Both radio buttons can be selected

I have form with 2 radio buttons but both of the radio buttons can be selected, <form class="descriptions" id="collection" method="post" action=""> <table width="200"> <tr> <td> <

Csv python reading header

Is there a way to inject the header array into the header vector in a more efficient way without using any packages such as csv, pandas, etc...? data = [] b = 1 with open(datafile, "rb") as f: for line in f: if b: header=line.strip('\n').split('

Multiply the series by distributing MultiIndex levels

This is a MultiIndex version of this question. Consider a DataFrame of sales figures: sales = pd.DataFrame({'year':[2008,2008,2008,2008,2009,2009,2009,2009], 'flavour':['strawberry','strawberry','banana','banana', 'strawberry','strawberry','banana','

How to find a location with the name of the company?

I am trying to build an iphone app that finds the location with business name. For example, I want to annotate a restaurant and I want to find it with the name of restaurant. I was trying to use CLGeocoder, but it seems like geocoder does not help in

CSS multimedia queries for Samsung s6

Help please. Can any body tell me about media queries in CSS for Samsung s6 to be more responsive? @media only screen and (min-device-width : 360px) and (max-device-width : 640px) and (-webkit-min-device-pixel-ratio : 3) { // code here } And from whe

How to delete and load separate dictionaries on the same file?

I have a process which runs and creates three dictionaries: 2 rather small, and 1 large. I know I can store one dictionary like: import cPickle as pickle with open(filename, 'wb') as fp: pickle.dump(self.fitResults, fp) What I'd like to do is store a

Invalid JSON with box-api

def get_item_url(itemid, itemtype): if itemtype=="folder" or itemtype=="FOLDER": url = ""+itemid headers = {'Authorization' : 'BoxAuth api_key='+apikey+'&auth_token='+auth_token,} payload =

Find the closest key in a dictionary with a string?

I am trying to find a way to find the closest key to a string within a dictonary. Example: data = {'1a': 'This is 1a', '1d': 'This is 1d', '1f': 'This is 1f', '1e': 'This is 1e'} find_nearest(data, '1b') #This would return key '1a' I have found other

Epoch in seconds for MJD conversion to C

I wanted to convert the given time in epoch format to MJD (Modified Julian Day). But not getting exact MJD equivalent. I think missing some offset value. #include <stdio.h> #include <time.h> #include <memory.h> int get_mjd (int Y, int M,

Google Search by Program

Does anyone know if and how it is possible to search Google programmatically without entering the query in a search box? I want to double click a word in a webpage and get the google search results.You could just link to the URL:

JQuery ajax calls updates on removing characters

I have a small jQuery function which collects data from the server depending on a zipcode input field: $(document).ready(function(){ $('#id_zipcode').keyup(function() { var selected = this.value; if (selected.length > 3) { $.getJSON(get_zip_factors_u

Mail attachment .NET encoding problem (.csv)

I use following code to send a attachment (.csv) with Chinese characters. However, MS excel fails to disply the characters properly, it displays something like "¨å¯¹æ–°ç". Is it because I didn't set some property when sending the mail? Thanks fo

Using echo and system to run C software

I am trying to run a biological program called BLASTP which takes in two strings (fasta_GWIDD and fasta_UNIPROT in the code) and compares them. The problem that I am encountering is the use of echo/system in the code. Can anyone suggest what am I mis

Changing the text debugging problem

I have a activity , in a activity one edit text having some hint text. when i start activity by default focus gone on edit text and hint invisible. please tell me how to make hint visible Thank youAdd in the page an empty view: <LinearLayout android:

Filtering characters from a string

This question already has an answer here: Remove specific characters from a string in python 18 answers I need to make a function that takes two strings as imnput and returns a copy of str 1 with all characters from str2 removed. First thing is to it

PHP - MySQL - Loading data from XML

I have a really strange problem. I want to load the MySQL connection attributes from an XML file, but I got this error when I try to process the connection: php_network_getaddresses: getaddrinfo failed (Error number: 2002) And why this is strange? Be

Remove "duplicates" from a pairing list

Title could be misleading, so an example: I have a class: class Pair { Book Book1; Book Book2; } I have a list of these: var list = new List<Pair>(); list.Add(new Pair() { Book1 = new Book() { Id = 123 }, Book2 = new Book() { Id = 456 } }); list.Add

Closing the Windows Phone application programmatically

I am using the following code to check for network access in the start of my application public async void CheckNetwork() { if (!NetworkAvailabilty.Instance.IsNetworkAvailable) { MessageDialog Message = new MessageDialog("Network access not available

Injecting code into an MFC application

I have a Win32 application that gets the HANDLE of a MFC application. My goal is to force the MFC program not to display ASSERT error message box. Basically, I have made a prototype that allows my Win32 application to force the MFC application to sho

Delete the JSON table data

I am trying to remove a piece of a data from a JSON array. For example, I have this array; var users = []; io.on('connection',function(socket){ socket.on('nickname', function(nick){ socket.nick = nick; users.push({ user:socket.nick,,

Simulate button click printing

This meteor client code tries to give the impression that a button is being clicked. It uses the onmousedown event to apply a class to a div but it is not applying the class when checking the browser element tab. What is wrong with it? Thanks Templat

Redirect to a page and send mail information to another

I would like to have a form on a page that after submitting sends the person to a thank you page, but I would like to send the data from the form to another .php file on a remote server. I've used the action to send the info as a post directly to the