text stringlengths 74 309k |
|---|
{"title":"Difference between $(this) and this in jquery","tags":["jquery","this"],"question_text":"What is the fundamental difference between using $(this) vs this\n`$('.viewComments').click(function(ev){\n \/\/returns the desired value\n alert(this.getAttribute('id'));\n \/\/Gives an error sayin function is not define... |
{"title":"Are private methods really safe?","tags":["java","reflection","private","access-modifiers"],"question_text":"In Java the\n`private`\naccess modifier consider as safe since it is not visible outside of the class. Then outside world doesn't know about that method either.\nBut I thought Java reflection can use t... |
{"title":"An AVPlayerItem cannot be associated with more than one instance of AVPlayer'","tags":["iphone","ios","video","avplayer"],"question_text":"`-(IBAction)play:(id)sender\n{\n thumbImageView.alpha=0.0;\n NSString *stringvideo=[NSString stringWithFormat:@\"http:\/\/streaming-service\",[[NSUserDefaults standardUser... |
{"title":"Calling a javascript function recursively","tags":["javascript","function","recursion","function-expression"],"question_text":"I can create a recursive function in a variable like so:\n`\/* Count down to 0 recursively.\n *\/\nvar functionHolder = function (counter) {\n output(counter);\n if (counter > 0) {\n ... |
{"title":"How to iterate through all git branches using bash script","tags":["git","bash","git-bash"],"question_text":"How can I iterate through all the local branches in my repository using bash script.\nI need to iterate and check is there any difference between the branch and some remote branches.\nEx\n`for branch i... |
{"title":"Recursive search and replace in text files on Mac and Linux","tags":["linux","osx","shell"],"question_text":"In the linux shell, the following command will recursively search and replace all instances of 'this' with 'that' (I don't have a Linux shell in front of me, but it should do).\n`find . -name \"*.txt\"... |
{"title":"How can I have an opaque UIView as a subview of a semi-transparent UIView?","tags":["iphone","ios","ipad"],"question_text":"I have a UIView with an alpha of 0.5 which I add as a subview to my primary view in order to gray-out everything else. I want to add an additional UIView to this gray UIView as a subview... |
{"title":"Code First - Are Data Annotations or the Fluent API better?","tags":["entity-framework","poco","entity-framework-4.1"],"question_text":"Just wondering what is a better way to configure my model?\nI like the Fluent API, because then my POCO's are not full of EF specific attributes.\nIs there anything you can't... |
{"title":"Entityframework Join using join method and lambdas","tags":["entity-framework","join","lambda"],"question_text":"It seems there are different ways to do joins using linq. One is more straightforward and involves just joining tables like this:\n`var found = from c in s.categories\n join cm in s.categorymaps on... |
{"title":"What do (lambda) function closures capture in Python?","tags":["python","lambda","closures"],"question_text":"Recently I started playing around with Python and I came around something peculiar in the way closures work. Consider the following code:\n`adders= [0,1,2,3]\nfor i in [0,1,2,3]:\n adders[i]=lambda a:... |
{"title":"How can I programmatically determine if my workstation is locked?","tags":["c#","windows"],"question_text":"I'm writing up some productivity\/metrics tools for myself to help monitor my focus throughout the day. Recently, I've noticed that I tend to get off track more than usual and feel the need to get up an... |
{"title":"Get timezone from DateTime","tags":["c#",".net","datetime","timezone"],"question_text":"Does the .Net DateTime contain information about time zone where it was created?\nI have a library parsing DateTime from a format that has \"+zz\" at the end, and while it parses correctly and adjusts a local time, I need ... |
{"title":"Submitting a file with jQuery.ajax gives TypeError","tags":["javascript","jquery","api","form-data"],"question_text":"I am trying to submit a file from a form using jQuery's\n`ajax`\nmethod:\n`var ofile=document.getElementById('image').files[0];\nvar formdata = new FormData();\nformdata.append(\"image\",ofile... |
{"title":"mySQL select one column DISTINCT, with corresponding other columns","tags":["mysql"],"question_text":"`ID FirstName LastName\n1 John Doe\n2 Bugs Bunny\n3 John Johnson`\nI want to select\n`DISTINCT`\nresults from the\n`FirstName`\ncolumn, but I need the corresponding\n`ID`\nand\n`LastName`\n.\nThe result set n... |
{"title":"making URL lowercase. Any easy or builtin way?","tags":["asp.net-mvc-3"],"question_text":"Is there any easy\/builtin way to make URL in lowercase for MVC3.\nI have code that could do it but looking something simple to implement.\n`routes.MapRouteLowercase(\n \"Default\", \/\/ Route name\n \"{controller}\/{act... |
{"title":"How to align the absolute position to center?","tags":["css","html5-canvas"],"question_text":"I am trying to stack two canvas together and make it a double layers canvas.\nI've saw an example here:\n`<div style=\"position: relative;\">\n <canvas id=\"layer1\" width=\"100\" height=\"100\" \n style=\"position: ... |
{"title":"How to escape a single quote ( ' ) in JavaScript?","tags":["javascript","html","escaping"],"question_text":"Okay, I am basically doing this\n`document.getElementById(\"something\").innerHTML = \"<img src='something' onmouseover='change(\\'ex1\\')' \/>\";`\nI don't want double quotes (\") where I put the \\'. ... |
{"title":"FragmentPagerAdapter getItem is not being triggered","tags":["android","android-fragments","android-viewpager","fragmentpageradapter"],"question_text":"Currently, with a\n`FragmentActivity`\n, I toggle among 2 type of Fragments using the following code.\n`private void toggle() {\n Fragment oldFragment = getSu... |
{"title":"How do I create a new branch using TortoiseSVN?","tags":["svn","tortoisesvn","branch"],"question_text":"How do I create a new branch with my working copy using TortoiseSVN?\nI see the branch option, but I don't see a way to name it somehow.","answer_text":"Right click and open SVN Repo-browser:\nRight click o... |
{"title":"Python: Lambda function in List Comprehensions","tags":["python"],"question_text":"Why is the output of the following two list comprehensions different, even though f and the lambda function are the same ?\n`f = lambda x: x*x\n[f(x) for x in range(10)]`\nand\n`[lambda x: x*x for x in range(10)]`\nMind you, bo... |
{"title":"Referencing system.management.automation.dll in Visual Studio","tags":["visual-studio","powershell"],"question_text":"I am beginning to look into the PowerShell model and snap-in development. The first thing I notice is to reference System.management.automation.dll. However in Visual Studio, the .NET tab does... |
{"title":"CSS background-size: cover replacement for Mobile Safari","tags":["html","css","mobile-safari"],"question_text":"Hi I have several divs on my page which have background images that I want to expand to cover the entire div which in turn can expand to fill the width of the viewport.\nObviously\n`background-size... |
{"title":"Integrate existing ASP.NET MVC application with Orchard CMS","tags":[".net","asp.net","asp.net-mvc","orchardcms"],"question_text":"I have Orchard CMS and I want to integrate my MVC site with it. Can anybody tell me how to do this?","answer_text":"It depends on how complex your MVC app is, but in most cases it... |
{"title":"XCode History (back\/forward) Keyboard Shortcut?","tags":["xcode","keyboard-shortcuts"],"question_text":"Back Arrow Broken In XCode?\nIs there keyboard command to go back\/forward one\nfile\nat a time.\nXCode 3.2\nchanged the behavior\nof Cmd-Opt <-- and -->. As noted in another question, they do not operate ... |
{"title":"How to style a div to be a responsive square?","tags":["css","css3","layout","responsive-design","aspect-ratio"],"question_text":"I want my div to adapt its height to always equal its width. The width is percental. When the parent's width decreases, the box should decrease by keeping its aspect ratio.\nHow to... |
{"title":"MySql Join three tables","tags":["mysql"],"question_text":"Hi I have three tables named\n`**Student Table** \n-------------\nid name\n-------------\n1 ali\n2 ahmed\n3 john\n4 king\n**Course Table**\n-------------\nid name\n-------------\n1 physic\n2 maths\n3 computer\n4 chemistry\n**Bridge**\n-------------\ns... |
{"title":"How to open the keyboard automatically on UITextField?","tags":["iphone","objective-c","interface","uitextfield","builder"],"question_text":"I have a very simple table and when tocuh a cell it opens a new view with one UITextfield. All I want is that the keyboard will automatically opens, without the user hav... |
{"title":"Anonymous code blocks in Java","tags":["java"],"question_text":"Are there any practical uses of anonymous code blocks in Java?\n`public static void main(String[] args) {\n \/\/ in\n {\n \/\/ out\n }\n}`\nPlease note that this is not about\nnamed\nblocks, i.e.\n`name: { \n if ( \/* something *\/ ) \n break nam... |
{"title":"Why does JDK sourcecode take a `final` copy of `volatile` instances","tags":["java"],"question_text":"I read the JDK's source code about ConcurrentHashMap.\nBut the following code confused me:\n`public boolean isEmpty() {\n final Segment<K,V>[] segments = this.segments;\n ...\n}`\nMy question is:\n\"this.segm... |
{"title":"What is a View in Oracle?","tags":["database","oracle","views"],"question_text":"What is a view in Oracle?","answer_text":"A\nView in Oracle\nand in other database systems is simply the representation of a SQL statement that is stored in memory so that it can easily be re-used. For example, if we frequently i... |
{"title":"Using Bootstrap Tooltip with AngularJS","tags":["angularjs","twitter-bootstrap","twitter-bootstrap-tooltip"],"question_text":"I am trying to use the Bootstrap tooltip in an app of mine. My app is using AngularJS Currently, I have the following:\n`<button type=\"button\" class=\"btn btn-default\" \n data-toggl... |
{"title":"Create aar file in Android Studio","tags":["android","jar","aar"],"question_text":"I'd like to create an aar file for my library in Android Studio, i would've gone with a jar option but my library has resources.\nAny idea how to create an aar file from a library?","answer_text":"If your library is set up as a... |
{"title":"Does IE9 have a file size limit for CSS?","tags":["css","internet-explorer","internet-explorer-9","stylesheet"],"question_text":"I'm using Drupal and I notice that if I have my CSS files aggregated that the CSS doesn't always work correctly. I know there is a\nproblem in IE7\nbut is there a limit to a CSS fil... |
{"title":"where can I find the php.ini for php-cli","tags":["php","php-ini"],"question_text":"It appears that the php command line is using a different php.ini from the main php interpreter. I am using Ubuntu 10.4. My problem is that in the main php.ini I have included an extra path for an external library, but in the ... |
{"title":"What are the differences between Mustache.js and Handlebars.js?","tags":["handlebars.js","mustache","client-side-templating","templating-engine"],"question_text":"Major differences I've seen are:\nHandlebars templates are compiled\nHandlebars adds #if, #unless, #with, and #each\nHandlebars adds helpers\nHandl... |
{"title":"How do I maximize the browser window in Selenium WebDriver (Selenium 2) using C#?","tags":["c#","selenium","selenium-webdriver"],"question_text":"Is there any way to maximize the browser window using WebDriver (Selenium 2) with C#?","answer_text":"`driver.Manage().Window.Maximize();`\nThis works for IE and Fi... |
{"title":"Naming of ID columns in database tables","tags":["sql","naming-conventions"],"question_text":"I was wondering peoples opinions on the naming of ID columns in database tables.\nIf I have a table called Invoices with a primary key of an identity column I would call that column InvoiceID so that I would not conf... |
{"title":"JavaScript moving element in the DOM","tags":["javascript","jquery","dom"],"question_text":"Let's say I have three\n`<div>`\nelements on a page. How can I swap positions of the first and third\n`<div>`\n? jQuery is fine.","answer_text":"There's no need to use a library for such a trivial task:\n`var divs = do... |
{"title":"In Perl, how do I create a hash whose keys come from a given array?","tags":["arrays","perl","hash"],"question_text":"Let's say I have an array, and I know I'm going to be doing a lot of \"Does the array contain X?\" checks. The efficient way to do this is to turn that array into a hash, where the keys are th... |
{"title":"How can I return camelCase JSON serialized by JSON.NET from ASP.NET MVC controller methods?","tags":["asp.net-mvc","json","json.net","camelcasing"],"question_text":"My problem is that I wish to return camelCased (as opposed to the standard PascalCase) JSON data via\nActionResult\ns from ASP.NET MVC controller... |
{"title":"CSS selector with period in ID","tags":["html","css","css-selectors"],"question_text":"The HTML spec allows for periods (.) in an id:\n`<img id=\"some.id\" \/>`\nHowever, using a CSS ID selector rule will\nnot\nmatch correctly:\n`#some.id { color: #f00; }`\nThe CSS spec for\nID Selectors\ndoes not mention thi... |
{"title":"String.replaceAll without RegEx","tags":["java"],"question_text":"I'd like to replace all instances of a substring in a string but\n`String.replaceAll()`\nonly accepts a pattern. The string that I have came from a previous match. Is it possible to add escapes to the pattern that I have or is there a version o... |
{"title":"Xcode doesn't show recent projects in recent projects list","tags":["xcode"],"question_text":"Every time I start Xcode it gives me a window where my recent projects supposedly should be. It would come in handy but unfortunately it's always empty.\nDoes it have anything to do with the location where I store my... |
{"title":"Getting result of dynamic SQL into a variable for sql-server","tags":["sql","sql-server","sql-server-2005","tsql","dynamic-sql"],"question_text":"Executing dynamic SQL as follows in Stored Procedure:\n`DECLARE @sqlCommand nvarchar(1000)\nDECLARE @city varchar(75)\nSET @city = 'London'\nSET @sqlCommand = 'SELE... |
{"title":"Javascript communication between browser tabs\/windows","tags":["javascript","browser"],"question_text":"What's the most reliable way to have Javascript communicate between tabs\/windows of the same browser? For example, when Tab 2 starts audio playback, Tab 1 somehow knows about this and can pause it's playe... |
{"title":"Service not Available - Geocoder Android","tags":["android","google-geocoder"],"question_text":"I have a little problem with the geocoder to get latitude and lontitude from an address :\nThis is my code:\n`for (Garage g : XMLGarage) {\nList<Address> address;\naddress = coder.getFromLocationName(\ng.getAddress... |
{"title":"Get name of property as a string","tags":["c#","reflection","properties"],"question_text":"(See below solution I created using the answer I accepted)\nI'm trying to improve the maintainability of some code involving reflection. The app has a .NET Remoting interface exposing (among other things) a method calle... |
{"title":"How to get the name of the running application in iOS","tags":["ios","xcode","uiapplication"],"question_text":"If the application name under the icon on the home screen is \"My Awesome App\" how do you get that string within the application at runtime?","answer_text":"I\u00e2\u0080\u0099d try\n`[[NSBundle mai... |
{"title":"Angular ui-router - how to access parameters in nested, named view, passed from the parent template?","tags":["javascript","angularjs","nested","angular-ui-router"],"question_text":"Hi I am trying to access a parameter in the controller \"ViewWorklogCrtl\" while using ui-router and running into difficulty.\nB... |
{"title":"What's the advantage of persist() vs save() in Hibernate?","tags":["java","hibernate"],"question_text":"Can anyone tell me what's the advantage of\n`persist()`\nvs\n`save()`\nin Hibernate?","answer_text":"From\nthis forum post\n`persist()`\nis well defined. It makes a\n transient instance persistent.\n Howeve... |
{"title":"NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder","tags":["java","android","eclipse","appcompat"],"question_text":"There is an issue with the Android appcompat v7 library on Samsung devices running Android 4.2. I keep getting crashes with the following stack trace in my Developer Consol... |
{"title":"When should I use malloc in C and when don't I?","tags":["c","memory","memory-management"],"question_text":"I understand how malloc() works. My question is, I'll see things like this:\n`#define A_MEGABYTE (1024 * 1024)\nchar *some_memory;\nsize_t size_to_allocate = A_MEGABYTE;\nsome_memory = (char *)malloc(si... |
{"title":"Android - NullPointerException on SearchView in Action Bar","tags":["android","nullpointerexception","android-actionbar","searchview"],"question_text":"I've got a problem trying to add a SearchView widget to the ActionBar in my activity - I get a null value when calling getActionView to get my SearchView obje... |
{"title":"How to transform array to comma separated words string?","tags":["php","arrays","string"],"question_text":"Possible Duplicate:\nHow to create comma separated list from array in PHP?\nMy array looks like this:\n`Array\n(\n [0] => lorem\n [1] => ipsum\n [2] => dolor\n [3] => sit\n [4] => amet\n)`\nHow to transf... |
{"title":"Oracle PL\/SQL - Raise User-Defined Exception With Custom SQLERRM","tags":["oracle","exception","plsql","custom-exceptions"],"question_text":"Is it possible to create user-defined exceptions and be able to change the SQLERRM?\nFor example:\n`DECLARE\n ex_custom EXCEPTION;\nBEGIN\n RAISE ex_custom;\nEXCEPTION\... |
{"title":"Get the name of a class as a string in C#","tags":["c#","entity-framework"],"question_text":"Is there a way to take a class name and convert it to a string in C#?\nAs part of the Entity Framework, the .Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class... |
{"title":"What Makes a Good Unit Test?","tags":["unit-testing","language-agnostic","tdd","integration-testing","testing-strategies"],"question_text":"I'm sure most of you are writing lots of automated tests and that you also have run into some common pitfalls when unit testing.\nMy question is do you follow any rules o... |
{"title":"Is $(document).ready necessary?","tags":["jquery","document-ready"],"question_text":"I saw this question in stackoverflow but do not feel that it was answered at all.\nIs $(document).ready necessary?\nI link all my javascripts at the bottom of the page so in theory they are all running after the document is r... |
{"title":"Reading file content to string in .Net Compact Framework","tags":["c#",".net","compact-framework"],"question_text":"I am developing an application for mobile devices with the .net compact framework 2.0. I am trying to load a file's content to a string object, but somehow I can't get it done. There is no\n`Rea... |
{"title":"In JavaScript, is returning out of a switch statement considered a better practice than using break?","tags":["javascript","return","switch-statement","break"],"question_text":"Option 1 - switch using return:\n`function myFunction(opt) \n{\n switch (opt) \n {\n case 1: return \"One\";\n case 2: return \"Two\"... |
{"title":"How to use NSEnumerator with NSMutableDictionary?","tags":["iphone","nsenumerator"],"question_text":"How do I use NSEnumerator with NSMutableDictionary, to print out all the keys and values?\nThanks!","answer_text":"Unless you need to use NSEnumerator, you can use fast enumeration (which is faster) and concis... |
{"title":"HighCharts Hide Series Name from the Legend","tags":["javascript","hide","highcharts","legend","series"],"question_text":"I try to solve this problem several times and give up. Now, when I have met him again, I decided to ask for some help.\nI have this code for my Legend:\n`legend:\n{\n layout: 'vertical',\n... |
{"title":"Cannot start MongoDB as a service","tags":["mongodb","windows-services"],"question_text":"I have been developing for MongoDB for some months now and would like to install it as a service on my Windows 7 Enterprise machine. The following is the command that I have executed to create the service:\n`\"D:\\Milvia... |
{"title":"error: default argument given for parameter 1","tags":["c++","function","default-value"],"question_text":"I'm getting this error message with the code below:\n`class Money {\npublic:\n Money(float amount, int moneyType);\n string asString(bool shortVersion=true);\nprivate:\n float amount;\n int moneyType;\n};... |
{"title":"Can I create view with parameter in MySQL?","tags":["mysql","stored-procedures","view","parameters"],"question_text":"I have a view like this:\n`CREATE VIEW MyView AS\n SELECT Column FROM Table WHERE Value = 2;`\nI'd like to make it more generic, it means to change 2 into a variable. I tried this:\n`CREATE VI... |
{"title":"Is it possible to deserialize XML into List<T>?","tags":["c#","serialization","xml-serialization","xml-deserialization"],"question_text":"Given the following XML:\n`<?xml version=\"1.0\"?>\n<user_list>\n <user>\n <id>1<\/id>\n <name>Joe<\/name>\n <\/user>\n <user>\n <id>2<\/id>\n <name>John<\/name>\n <\/user>... |
{"title":"What are the differences between LinearLayout, RelativeLayout, and AbsoluteLayout?","tags":["android","android-layout","android-linearlayout","relativelayout","absolutelayout"],"question_text":"I am confused about the difference between LinearLayout, RelativeLayout, and AbsoluteLayout. \nCould someone please ... |
{"title":"Is there a way to do repetitive tasks at intervals in Golang?","tags":["go"],"question_text":"Is there a way to do repetitive background tasks in Go? I'm thinking of something like\n`Timer.schedule(task, delay, period)`\nin Java. I know I can do this with a goroutine and\n`Time.sleep()`\n, but I'd like someth... |
{"title":"Java Arrays how to add elements at the beginning","tags":["java","arrays","arraylist","stack"],"question_text":"I need to add elements to an\n`ArrayList`\nqueue whatever, but when I call the function to add an element, I want it to add the element at the beginning of the array (so it has the lowest index) and... |
{"title":"Custom method names in ASP.NET Web API","tags":["c#","asp.net-web-api","asp.net-web-api-routing"],"question_text":"I'm converting from the WCF Web API to the new ASP.NET MVC 4 Web API. I have a UsersController, and I want to have a method named Authenticate. I see examples of how to do GetAll, GetOne, Post, a... |
{"title":"WPF: Create a dialog \/ prompt","tags":["wpf","dialog","prompt"],"question_text":"I need to create a Dialog \/ Prompt including TextBox for user input. My problem is, how to get the text after having confirmed the dialog? Usually I would make a class for this which would save the text in a property. However I... |
{"title":"How to add one month to an NSDate?","tags":["ios","iphone","objective-c","nsdate"],"question_text":"How To Add Month To NSDate Object?\n`NSDate *someDate = [NSDate Date] + 30Days.....;`","answer_text":"You need to use\nNSDateComponents\n:\n`NSDateComponents *dateComponents = [[NSDateComponents alloc] init];\n... |
{"title":"Integer division: How do you produce a double?","tags":["java","casting","integer-division"],"question_text":"For this code block:\n`int num = 5;\nint denom = 7;\ndouble d = num \/ denom;`\nthe value of\n`d`\nis\n`0.0`\n. It can be forced to work by casting:\n`double d = ((double) num) \/ denom;`\nBut is ther... |
{"title":"When debugging autolayout what is the meaning of the autoresizing mask strings such as h=--& v=-&-?","tags":["cocoa","autolayout"],"question_text":"I guess they must refer to the struts and springs model but I can't find any mention of them. When you\n`NSLog`\nconstraint they sometimes appear as the descripti... |
{"title":"Python Inverse of a Matrix","tags":["python","algorithm","matrix","linear-algebra","matrix-inverse"],"question_text":"How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.","answer_text":"You should have a l... |
{"title":"Sublime editor split screen, put same file on both windows?","tags":["sublimetext2","sublimetext","sublimetext3"],"question_text":"I can only put two different files on the two split windows. Can I put the same file on both window?","answer_text":"Yes, you can. When a file is open, click on\n`File -> New View... |
{"title":"mysql error 1364 Field doesn't have a default values","tags":["mysql"],"question_text":"My table looks like\n`create table try ( name varchar(8), CREATED_BY varchar(40) not null);`\nand then I have a trigger to auto populate the CREATED_BY field\n`create trigger autoPopulateAtInsert BEFORE INSERT on try for e... |
{"title":"Multiple input in JOptionPane.showInputDialog","tags":["java","swing","joptionpane"],"question_text":"Is there a way to create multiple input in\n`JOptionPane.showInputDialog`\ninstead of just one input?","answer_text":"Yes. You know that you can put any\n`Object`\ninto the\n`Object`\nparameter of most\n`JOpt... |
{"title":"HttpClient.GetAsync with network credentials","tags":["c#","async-await",".net-4.5"],"question_text":"I'm currently using\n`HttpWebRequest`\nto get a website. I'd like to use the await pattern, which is not given for\n`HttpWebRequests`\n. I found the class\n`HttpClient`\n, which seems to be the new Http worke... |
{"title":"Jump to function definition in vim","tags":["function","vim"],"question_text":"How can i jump to to a function definition using VIM? For example with Visual Assist i can type\nAlt\n+\ng\nunder a function and it opens a context menu listing the files with definitions.\nHow can i do something like this in vim?"... |
{"title":"Cast to int vs floor","tags":["c++","c","floating-point"],"question_text":"Is there any difference between these:\n`float foo1 = (int)(bar \/ 3.0);\nfloat foo2 = floor(bar \/ 3.0);`\nAs I understand both cases have the same result. Is there any difference in the compiled code?","answer_text":"Casting to an in... |
{"title":"Approximate cost to access various caches and main memory?","tags":["memory","latency","cpu-cache","low-latency"],"question_text":"Can anyone give me the approximate time (in nanoseconds) to access L1, L2 and L3 caches, as well as main memory on Intel i7 processors?\nWhile this isn't specifically a programmin... |
{"title":"Singleton release method produces warning?","tags":["objective-c","warnings"],"question_text":"In my singleton release method, I have it doing nothing:\n`-(void) release {\n \/\/A whole lot of nothing.\n}`\nBut it produces this warning:\nWarning: Conflicting distributed object modifiers on return type in impl... |
{"title":"Uncaught RangeError: Maximum call stack size exceeded Google maps when I try to set bounds","tags":["google-maps"],"question_text":"I created a working google map that I am now trying to have auto zoom out so all the points fit.\nWhen I added:\n`var bounds = new google.maps.LatLngBounds();`\nand\n`bounds.exte... |
{"title":"How do I replace the entire HTML node using jQuery","tags":["javascript","jquery"],"question_text":"I have a string which looks like:\n`<html><head><title>example<\/title><\/head><body>some example text<\/body><\/html>`\nI get this string returned as a result to an AJAX request.\nI would like the browser to r... |
{"title":"Why is semicolon allowed in this python snippet?","tags":["python"],"question_text":"Python does not warrant the use of semicolons to end statements.\nSo why is this (below) allowed?\n`import pdb; pdb.set_trace()`","answer_text":"Python does not\nrequire\nsemi-colons to terminate statements. Semi colons\ncan\... |
{"title":"mvc: does the favicon.ico also look for a controller?","tags":["asp.net","asp.net-mvc","asp.net-mvc-2"],"question_text":"I get an error:\n\"The controller for path '\/favicon.ico' was not found or does not implement IController\"\nThen I thought: how does the framework know for which files it has to instantia... |
{"title":"PHP - Get key name of array value","tags":["php","arrays","array-key"],"question_text":"I have an array as the following:\n`function example() {\n \/* some stuff here that pushes items with\n dynamically created key strings into an array *\/\n return array( \/\/ now lets pretend it returns the created array\n... |
{"title":"How can I access the backing variable of an auto-implemented property?","tags":["c#","properties"],"question_text":"In the past we declared properties like this:\n`public class MyClass\n{\n private int _age;\n public int Age\n {\n get{ return _age; }\n set{ _age = value; }\n }\n}`\nNow we can do:\n`public cla... |
{"title":"Not a PNG filCommand copypng emitted errors but did not return a nonzero exit code to indicate failure","tags":["iphone","ios","ipad","ios6","default.png"],"question_text":"I am getting following error while adding images the running the project on iPad.\nIt worked fine on simulator with all images but on iPa... |
{"title":"Why implement interface explicitly?","tags":["c#","interface"],"question_text":"So, what exactly is a good use case for implementing an interface explicitly?\nIs it only so that people using the class don't have to look at all those methods\/properties in intellisense?","answer_text":"If you implement two int... |
{"title":"Can Angular.js auto-update a view if a persistent model (server database) is changed by an external app?","tags":["javascript","model-view-controller","comet","angularjs"],"question_text":"I'm just starting to familiarize with Angular.js, but I would like to build a web app that has a view that gets auto-upat... |
{"title":"JQuery multiselect - Set a value as selected in the multiselect dropdown","tags":["jquery","jquery-multiselect"],"question_text":"I am having a multiselect dropdown as below\n`<select id=\"data\" name=\"data\" class=\"data\" multiple=\"multiple\">\n <option value=\"100\">foo<\/option>\n <option value=\"101\">... |
{"title":"How can I determine the element type of a matched element in jQuery?","tags":["asp.net","javascript","jquery","html"],"question_text":"I'm matching ASP.Net generated elements by ID name, but I have some elements which may render as text boxes or labels depending on the page context. I need to figure out wheth... |
{"title":"How to create a temporary table in SSIS control flow task and then use it in data flow task?","tags":["ssis"],"question_text":"I have a control flow where I create a temp database and table in a with a T-SQL Command. When I add a dataflow I would like to query the table but I can't because the table doesn't e... |
{"title":"Is declaration of variables expensive?","tags":["c"],"question_text":"While coding in C, I came across the below situation.\n`int function ()\n{\n if (!somecondition) return false;\n internalStructure *str1;\n internalStructure *str2;\n char *dataPointer;\n float xyz;\n \/* do something here with the above lo... |
{"title":"Multiple maven repositories in one gradle file","tags":["maven","gradle","multiple-repositories"],"question_text":"So my problem is how to add multiple maven repositories to one gradle file.\nThis DOESN\u00e2\u0080\u0099T work:\n`repositories {\n mavenCentral()\n maven {\n url \"http:\/\/maven.springframework... |
{"title":"Android and XMPP: Currently available solutions","tags":["android","xmpp","smack","asmack"],"question_text":"I'd like to pose a question as to which XMPP library would be the best choice nowadays, for Android development.\nI've been using the patched Smack\nlibrary from\nhere\nas is\nsuggested in many other q... |
{"title":"Nullable<int> vs. int? - Is there any difference?","tags":["c#",".net"],"question_text":"Apparently\n`Nullable<int>`\nand\n`int?`\nare equivalent in value. Are there any reasons to choose one over the other?\n`Nullable<int> a = null;\nint? b = null;\na == b; \/\/ this is true`","answer_text":"No difference.\n... |
{"title":"Zend Framework 1 vs Zend Framework 2 performance","tags":["php","zend-framework","zend-framework2"],"question_text":"Zend Framework 2 was just released and Zend offers support for ZF1 for only 18 months from now. I know they were working for new features in ZF2 and then they were going to do some major speed ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.