Sorting dictionary values

I have a dictionary with tuples as keys (containing a string and an int) and floats as values. An example: first = {} first['monkey', 1] = 130.0 first['dog', 2] = 123.0- first['cat', 3] = 130.0 first['cat', 4] = 130.0 first['mouse', 6] = 100.0 Now, I

ReWriteRule htaccess to a new domain

Writing some regular expressions for an .htaccess file. Got the second half working but the first half is driving me nuts. Any regular expression gurus wanna lend a hand? <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteRule

Arrays Concat of grouped lines

I have the following array: [ ["String 0", [1, 2]], ["String 1", [1, 3]], ["String 2", []], ["String 3", [2]], ["String 1", [1, 2]], ["String 2", [0]] ] I need to transform it into an array with

Debugging with the command line

I'm writing a program with VBA, in order to manipulate Microsoft Project. However, I am running into some trouble. I want to be able to do some debugging work. How can I open a command line in order to see what is going on with some printfs, which ap

C ++ - boost :: any serialization

As far as I understand, there is no serialization (boost::serialization, actually) support for boost::any placeholder. Does someone know if there is a way to serialize a custom boost::any entity? The problem here is obvious: boost::any uses template-

Migration from TFS 2010 to TFS 2012

I have been searching the web for a clean solution on how to migrate our 2010 tfs collections to our new tfs 2012 server, but no luck. May someone please assist with the steps or a good blog I could look at to achieve this process. The reason we want

Event Calendar UI android

I can create an event like this: public void Mindencalendar(){ ContentResolver cr = getActivity().getContentResolver(); Calendar calendarEvent = Calendar.getInstance(); long idk[] = new long[szam]; idk[szam-1] = cu.addEventToCalender(cr,"a",&quo

url or content as a variable in the page header

I am designing a site where external links form various are being shown on my page. I am using $url=$_GET['url']; $website_data = file_get_contents($url); echo $website_data; so essentially a user would click on a hyperlink which is something like ww

Get the md5 / sha1 checksum from a file

I have found two functions to count md5 and sha 1 in Objective C. Here's the code: -(void)md5HexDigest:(NSString*)input { NSData *data = [input dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; uint8_t digest[CC_MD5_DIGEST_LENGTH]; C

Is it possible to select multiple markers on google map

If I have 100 markers on map and I want to do something with only 15 of them is there any way to implement this by using CTRL + click on marker or standard cursor drag selection?Ctrl+click is possible. Add a click event to the marker, and then in the

MVC2 extension methods throwing errors into my views

I have a project written in MVC2 and VB.NET. I use a lot of htmlhelper extension methods, and I have them all in a public module. They work just fine, and I can compile and run my project. I reference the namespace they are in with this: <%@ Import N

jQuery scrollto after time delay

I have this page:, in which a video autoplays. I would like to have it so that once the video finishes playing (a set amount of time), the page automatically scrolls down to the text, using a jQuery scrollto with ti

C ++ Help Function for Copy Builder

I haven't been able to find a good answer to this question. I'm working on a C++ program and I'm trying to implement a function named copy which takes a reference to another object as an argument. Then, it returns a deep copy of this object. Some bac

how to return $ from ui-router statechange

I would like to return the .state('name') when I change location in angular. From my run() it can return the $state object: .run(function($rootScope, Analytics, $location, $stateParams, $state) { console.log($state); but when I try to get$state.curre

Fill an array with the data in the list with one more element

By a question that I made, I figured out that tho copy elements from one list to an array I just need to use the method toArray() for this. But let's suppose I have a List with n objects. I want to copy then into a array sized n+1 and add into the fi

Add if otherwise function in Ajax Jquery function

Is it possible to add other else function in my JS like this: ? if response == success redirect to home if response == failed redirect to failed $.ajax({ type: "POST", url: action, data: form_data, success: function(response) { if (response == '

How to keep focus in css

I have this page with a header tag which include four buttons like Home About.. but using focus I managed to have some changes in properties like border after I click one of them, but I want that button to stay clicked after I click any other element

C equivalent to python pickle (object serialization)?

What would be the C equivalent to this python code? Thanks. data = gather_me_some_data() # where data = [ (metic, datapoints), ... ] # and datapoints = [ (timestamp, value), ... ] serialized_data = cPickle.dumps(data, protocol=-1) length_prefix = str

Query for string properties vs method calls

Is there any or noticeable performance decrease; when using linq queries on string properties vs method calls to get that string value; in an IEnumarable list? If not; is there any other queryable interface for linq that makes performance difference?

Exclude the first line of the macro

I have a macro that puts the current time into a cell upon editing any row. my problem is that this macro also executes for row 1 which are the titles. So it ends up changing the title of a column to a time. The macro works fine but still changes the