Other than readability, what is the difference between the following linq queries and when and why would I use one over the other: IEnumerable<T> items = listOfItems.Where(d => d is T).Cast<T>(); and IEnumerable<T> items = listOfItems
I am working with a Backbone.js framework, where I am using dot net Web API (which is created by me only). I am call the API Controller from fetch method of backbone. If this api does not respond in 30 Second i want to show some error message. Where
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
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
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
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
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-
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
I'm told to write a code that get a string text and check if its encoding is equal the specific encoding that we want or not. I've searched a lot but I didn't seem to find anything. I found a method (getEncoding()) but it just works with files and th
Anyone able to set up Python with IIS? Been trying to figure it out, but it's not working and it's driving me crazy. I see plenty of examples but I can not get it to work. Here is my setup Windows 2008R2 IIS 7.5 (7.5.7600.16385) wfastcgi.py (2.2.0) F
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
This question already has an answer here: ArithmeticException: "Non-terminating decimal expansion; no exact representable decimal result" 7 answers I've used BigDecimals before but not very often and I was working on something this morning and I
I was following through on Alan Storm's tutorial on Magento's Model and ORM basics and I've run into a bit of a problem. When I get to the portion where I load from the Model for the first time I get this error "Fatal error: Call to a member function
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
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
I'm writing a project in C++ with SDL2 on 64-bit Windows 10 using Visual Studio 2015. I recently purchased a new Windows 10 laptop and cloned my project from github. My project compiles correctly, but I get the following error when I run it: The appl
I have a macro written in excel that has now stopped being able to run from the Macro window in the main excel window. It runs fine when I start it from the editor itself and I have another macro in the same file that also runs fine, and displays pro
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
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
I have this page: http://www.yasyf.com/services.html, 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
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
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
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
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 == '
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
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
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?
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
Edit: To simplify things here is the paradigm: I have an list of items that is constantly being updated by a continuous stream. Every now and then, I get a new data snapshot that re-initializes the stream. As a result if there are any updates happeni
I have a small website (using HTML, PHP and MySQL), and would like to display a specific banner image according to the country of the visitor. Each country has a different banner image. I have searched Google for solutions and found quite some API's