text
stringlengths
74
309k
{"title":"Why does a C\/C++ compiler need know the size of an array at compile time?","tags":["c++","c"],"question_text":"I know C standards preceding C99 (as well as C++) says that the size of an array on stack must be known at compile time. But why is that? The array on stack is allocated at run-time. So why does the...
{"title":"Change values while iterating in golang","tags":["arrays","for-loop","go"],"question_text":"Let's suppose I have these types :\n`type Attribute struct {\n Key, Val string\n}\ntype Node struct {\n Attr []Attribute\n}`\nand that I want to iterate on my node's attributes to change them.\nI would have loved to be...
{"title":"facet label font size","tags":["r","ggplot2"],"question_text":"is there a way to change to font size of facet labels in ggplot? I google a bit and found that that issue was yet on Hadley's to do list. I wonder if there's a workaround or any news on this issue.\nThx for sharing any news\u00e2\u0080\u00a6","ans...
{"title":"dyld: Library not loaded different behavior for 6.0 simulator\/6.0 device","tags":["xcode","cocoa-touch","ios6","dyld","ios-frameworks"],"question_text":"My app runs fine on the iPhone 6.0 Simulator in Xcode, but when I try to run it on my 6.0 device, I get the following fatal error:\ndyld: Library not loaded...
{"title":"Colon (:) in Python list index","tags":["python"],"question_text":"I'm new to Python. I see\n`:`\nused in list indices especially when it's associated with function calls.\nPython 2.7 documentation suggests that\n`lists.append`\ntranslates to\n`a[len(a):] = [x]`\n. Why does one need to suffix\n`len(a)`\nwith ...
{"title":"What does \"final\" do if you place it before a variable?","tags":["java"],"question_text":"Very basic question, but, what does \"final\" do if you place it before a variable such as below...\n`final EditText myTextField = (EditText) findViewById(R.id.myTextField);`\nWhat does\n`final`\ndo?","answer_text":"Sh...
{"title":"css absolute position won't work with margin-left:auto margin-right: auto","tags":["html","css","html5","css3","position"],"question_text":"Say you have the following css applied to a div tag\n`.divtagABS {\n position: absolute;\n margin-left: auto; \n margin-right:auto;\n }`\nthe margin-left and margin-right...
{"title":"what is the most reasonable way to find out if entity is attached to dbContext or not?","tags":["c#","entity-framework-4","ef-code-first"],"question_text":"when i try to attach entity to context i get an exception\nAn object with the same key already\n exists in the ObjectStateManager. The\n ObjectStateManage...
{"title":"How to remove whitespace in a string?","tags":["iphone","objective-c"],"question_text":"I have a string say\n`\"Allentown, pa\"`\nHow to remove the white space in between\n`,`\nand\n`pa`\nusing objective c?","answer_text":"This will remove all space from\n`myString`\n.\n`NSString *newString = [myString string...
{"title":"How to specify \"Space or end of string\" and \"space or start of string\"?","tags":["regex","preg-match"],"question_text":"Imaging you are trying to pattern match \"stackoverflow\".\nYou want the following:\n`this is stackoverflow and it rocks [MATCH]\n stackoverflow is the best [MATCH]\n i love stackoverflo...
{"title":"One-liner if statements, how to convert this if-else-statement","tags":["c#","if-statement"],"question_text":"Total noob here so be gentle. I've looked everywhere and can't seem to find the answer to this. How do I condense the following?\n`if (expression)\n{\n return true;\n}\nelse\n{\n return false;\n}`\nI ...
{"title":"RxJava Fetching Observables In Parallel","tags":["java","asynchronous","reactive-programming","observable","rx-java"],"question_text":"I need some help in implementing parallel asynchronous calls in RxJava. I have picked up a simple use case wherein the FIRST call fetches (rather searches) a list of products ...
{"title":"Is it still valid to use IE=edge,chrome=1?","tags":["html","internet-explorer","meta-tags","google-chrome-frame","x-ua-compatible"],"question_text":"I read Chrome Frame closed last month, I thus tried to understand what it'd mean for the X-UA tag and after 3 hours of research I still didn't find the answer I'...
{"title":"How to ng-translate inside select box option in angularjs","tags":["angularjs","ng-options","angular-translate"],"question_text":"How do I apply ng-translate to translate options inside a select box.\nFor example:\nTemplate:\n`<select class=\"form-control\" ng-model=\"me.gender\" ng-options=\"gender.name for ...
{"title":"socket.io - how to broadcast messages on a namespace?","tags":["node.js","broadcast","socket.io"],"question_text":"According to socket.io examples:\nTo broadcast, simply add a\n`broadcast`\nflag to\n`emit`\nand\n`send`\nmethod calls. Broadcasting means sending a message to everyone else except for the socket ...
{"title":"How come a non-const reference cannot bind to a temporary object?","tags":["c++","reference","const","temporary","c++-faq"],"question_text":"Why is it not allowed to get non-const reference to a temporary object, \nwhich function\n`getx()`\nreturns? Clearly, this is prohibited by C++ Standard \nbut I am inter...
{"title":"How does mockito when() invocation work?","tags":["unit-testing","mocking","mockito"],"question_text":"Given the following Mockito statement:\n`when(mock.method()).thenReturn(someValue);`\nHow does Mockito go about creating a proxying something for a mock, given that the mock.method() statement will pass the ...
{"title":"How to make Google Fonts work in IE?","tags":["css","internet-explorer","webfonts","google-webfonts"],"question_text":"I've been developing a site that uses the\nGoogle Fonts API\n. It's great, and supposedly has been tested in IE, but when testing in IE 8 the fonts simply don't get styled.\nI included the fo...
{"title":"Initializing a Generic.List in C#","tags":["c#",".net","generics","constructor"],"question_text":"In C#, I can initialize a list using the following syntax.\n`List<int> intList= new List<int>() { 1, 2, 3 };`\nI would like to know how that\n`{}`\nsyntax works, and if it has a name. There is a constructor that ...
{"title":"In a Visual Studio setup project, How do I generate an uninstall script?","tags":["visual-studio","visual-studio-2008","installation","setup-project"],"question_text":"I have a Visual Studio setup project. \nUpon installation, it creates an uninstall batch file in the application folder. IF the user wants to ...
{"title":"How can I mock dependencies for unit testing in RequireJS?","tags":["javascript","unit-testing","mocking","requirejs"],"question_text":"I have an AMD module I want to test, but I want to mock out its dependencies instead of loading the actual dependencies. I am using requirejs, and the code for my module look...
{"title":"How can I get Android Wifi Scan Results into a list?","tags":["java","android","listview","android-wifi"],"question_text":"I know how to get a of Android Wifi Scans but I can not figure out the best way to make a list adapter out of them. I would like to just bind SSID and BSSID from a of scans to text1 and t...
{"title":"What code analysis tools do you use for your Java projects?","tags":["java","code-coverage","static-analysis"],"question_text":"What code analysis tools do you use on your Java projects?\nI am interested in all kinds\nstatic code analysis tools (FindBugs, PMD, and any others)\ncode coverage tools (Cobertura, ...
{"title":"iPhone - Smooth animation for UITableViewCell height change including content update","tags":["iphone","uitableview","animation","resize"],"question_text":"Possible Duplicate:\nCan you animate a height change on a UITableViewCell when selected?\nI have a table view into which where you click on a swich into a...
{"title":"jquery clear input default value","tags":["jquery"],"question_text":"How can I clear the default value of an input form onfocus with jquery and clear it again when tha submit button is pressed?\n`<html>\n <form method=\"\" action=\"\">\n <input type=\"text\" name=\"email\" value=\"Email address\" class=\"inpu...
{"title":"How To Show Only Integer Values On yAxis Of HighChart","tags":["javascript","highcharts"],"question_text":"We have a set of a data that contains counts of instances of events. These can only be integers. When we display data that has a high enough yValue the yAxis labels are integers. However, when we zoom in...
{"title":"How can I detect which layout is selected by Android in my application?","tags":["android","android-layout","resources"],"question_text":"Assume I have an activity with three different layouts in different resource folders. For example:\n`layout-land\/my_act.xml`\n`layout-xlarge\/my_act.xml`\n`layout-xlarge-l...
{"title":"Can nullptr be emulated in gcc?","tags":["c++","gcc","c++11","nullptr"],"question_text":"I saw that\n`nullptr`\nwas implemented in Visual Studio 2010. I like the concept and want to start using it as soon as possible; however GCC does not support it yet. My code needs to run on both (but doesn't have to compi...
{"title":"Media Player called in state 0, error (-38,0)","tags":["android","android-mediaplayer"],"question_text":"I am currently trying to design a simple app that streams an internet radio station. I have the URL for the station and am setting up the Media Player like\n`MediaPlayer mediaPlayer = new MediaPlayer();\n ...
{"title":"Bash- how to read the second-to-last line in a file?","tags":["linux","bash","shell"],"question_text":"I have a file that has the following as the last three lines. I want to retrieve the penultimate line, i.e.\n`100.000;8438; 06:46:12`\n.\n`.\n.\n.\n99.900; 8423; 06:44:41\n100.000;8438; 06:46:12\nNumber of p...
{"title":"VS 2013 giving The operation could not be completed. Invalid pointer on Razor views","tags":["visual-studio","razor","visual-studio-2015"],"question_text":"I installed VS 2015 version on my system. I already had Visual studio 2013 update 4 installed on my machine. But now, whenever I try to open any cshtml ( ...
{"title":"Use Ant for running program with command line arguments","tags":["java","ant"],"question_text":"My program getting command line arguments. How can I pass it when I use Ant?","answer_text":"Extending\nRichard Cook\n's answer.\nHere's the\n`ant`\ntask to run any program (including, but not limited to Java progr...
{"title":"is there any way to disable compiler optimisation for a specific line of code?","tags":["c++","visual-studio","optimization","compiler-construction"],"question_text":"is there any way to disable compiler optimisation for a specific line of code in Visual studio?","answer_text":"No.\nOnly on a function-by-func...
{"title":"What is your favorite Visual Studio add-in\/setting?","tags":[".net","visual-studio"],"question_text":"What add-in\/setting in Visual Studio can you not live without? Which one improves your productivity or fixes something you can't stand in Visual Studio? Why is it your favorite?\nMy favorite is\naspx edit h...
{"title":"Java generics: Collections.max() signature and Comparator","tags":["java","generics","comparator"],"question_text":"I understand the\nget and put principle\nfor collections: if a method takes in a collection that it will write a type T to, the parameter has to be\n`Collection<? super T>`\n, whereas if it will...
{"title":"In Rails, how do you render JSON using a view?","tags":["ruby-on-rails","ruby","json","templates","rendering"],"question_text":"Suppose you're in your users controller and you want to get a json response for a show request, it'd be nice if you could create a file in your views\/users\/ dir, named show.json an...
{"title":"What is the simplest jQuery way to have a 'position:fixed' (always at top) div?","tags":["jquery","css","positioning"],"question_text":"I'm relatively new to jQuery, but so far what I've seen I like. What I want is for a div (or any element) to be across the top of the page as if \"position: fixed\" worked in...
{"title":"SQL Server: Extract Table Meta-Data (description, fields and their data types)","tags":["sql","sql-server","metadata"],"question_text":"I am trying to find a way to extract information about my tables in SQL Server (2008).\nThe data I need needs to include the\ndescription of the table\n(filled from the Descr...
{"title":"In bash, how to set a return code?","tags":["bash","scripting","error-handling","return-value"],"question_text":"I want to set a return value once so it goes into the while loop:\n`#!\/bin\/bash\nwhile [ $? -eq 1 ]\ndo\n#do something until it returns 0 \ndone`\nIn order to get this working I need to set\n`$? ...
{"title":"Google maps URL. I want to create a URL to google maps. I want to show search near specific coordonates","tags":["url","google-maps"],"question_text":"I have the longitude,latitude and the name of the place i want to look for, how do i edit the google maps URL sow i obtain all the places(name of the place) ne...
{"title":"Can I use the code in a GitHub project which does not have a license specified?","tags":["licensing","github"],"question_text":"Say that a public GitHub project does not have a license specified. Can I use that code in my own code? If I can, under what licenses can I distribute my code? Can I use any open sou...
{"title":"jquery abort() ajax request before sending another","tags":["javascript","jquery","ajax"],"question_text":"Based on:\nhttp:\/\/stackoverflow.com\/questions\/446594\/kill-ajax-requests-using-javascript-using-jquery\n... In inventory_search() - before the ajax request is made, how can I check for any current re...
{"title":"Converting &amp; to & etc","tags":["c#","html-encode","string-conversion"],"question_text":"I want to convert\n`&amp;`\nto &,\n`&quot;`\nto \" ect.\nIs there a function in c# that could do that without writing all the options manualy?","answer_text":"`System.Web.HttpUtility.HtmlDecode()`","question_code":[],"...
{"title":"Error: Failed to generate a user instance of SQL Server","tags":["visual-studio","sql-server-express","sql-server-2008-r2","user-instance"],"question_text":"I'm trying to connect to an MDF. I've even gone to the lengths of re-installing sql server express entirely (it is now the only flavor of SQL installed o...
{"title":"How to get the current date and time of your timezone in Java?","tags":["java","timezone","jodatime"],"question_text":"I have my app hosted in a London Server. I am in Madrid, Spain. So the timezone is -2 hours.\nHow can I obtain the current date \/ time with my time zone.\n`Date curr_date = new Date(System.c...
{"title":"Mailto links do nothing in Chrome but work in Firefox?","tags":["html","html5","google-chrome"],"question_text":"It seems like the\n`mailto`\nlinks we're embedding in our website fail to do anything in Chrome, though they work in Firefox.\nSimple example here:\nhttp:\/\/jsfiddle.net\/wAPNH\/\n`<a href='mailto...
{"title":"How does Ruby return two values?","tags":["ruby"],"question_text":"Whenever I swap values in an array, I make sure I stored one of the values in a reference variable. But I found that Ruby can return two values as well as automatically swap two values. For example,\n`array = [1, 3, 5 , 6 ,7]\narray[0], array[...
{"title":"CSS display: inline-block does not accept margin-top?","tags":["css","position","label","margin"],"question_text":"I have an element with display: inline-block, but it doesn't seem to accept margin-top. Is this because the element is still treated as an inline element?\nIf yes, does anyone have a workaround?\...
{"title":"How to return the index of child in Layout?","tags":["android","get","indexing","android-linearlayout"],"question_text":"I have the following situation - HorizontalScrollView (HSV), inside HSV - LinearLayout and inside it number of buttons - the code is here:\n`<HorizontalScrollView\n android:id=\"@+id\/Foote...
{"title":"Mongodb Explain for Aggregation framework","tags":["mongodb","aggregation-framework"],"question_text":"Is there an explain function for the Aggregation framework in MongoDB? I can't see it in the documentation.\nIf not is there some other way to check, how a query performs within the aggregation framework?\nI...
{"title":"Genymotion: how to load apk every time?","tags":["android","genymotion"],"question_text":"I'm getting started with Android development and with Genymotion. It's difficult to get Genymotion to install a .apk and run it more than once. Here's what I'm doing:\nBegin with Genymotion running.\nPress Genymotion ico...
{"title":"Get current user id in ASP.NET Identity 2.0","tags":["c#","asp.net","asp.net-identity"],"question_text":"I just switched over to using the new 2.0 version of the Identity Framework. In 1.0 I could get a user object by using\n`manager.FindByIdAsync(User.Identity.GetUserId())`\n. The\n`GetUserId()`\nmethod does...
{"title":"How to create Temp table with SELECT * INTO tempTable FROM CTE Query","tags":["sql","sql-server","common-table-expression"],"question_text":"I have a MS SQL CTE query from which I want to create a temporary table. I am not sure how to do it as it gives an\n`Invalid Object name`\nerror.\nBelow is the whole que...
{"title":"Convert existing project to library project in Android Studio","tags":["android","android-studio","android-library"],"question_text":"How can I convert an existing Android project into an Android library project in Android Studio?\nIn Eclipse, that is possible.\nActually, I want to convert an old Android proj...
{"title":"Accessing functions bound to event handlers with jQuery","tags":["jquery","events","event-handling","storage","internal"],"question_text":"With jQuery you can bind functions to an event triggered on a DOM object using\n`.bind()`\nor one of the event handler helper functions.\njQuery have to store this interna...
{"title":"iPad keyboard dimensions","tags":["objective-c","ipad","uikeyboard"],"question_text":"I have found the iPhone's keyboard bounds in the apple documentation, but I can't find the iPad's keyboard bounds. Could you please help me?","answer_text":"The entire answer in code looks like this. First you need to regist...
{"title":"How to select distinct field values using Solr?","tags":["select","solr"],"question_text":"I would like to do the equivalent of this SQL but with Solr as my data store.\n`SELECT\n DISTINCT txt\nFROM\n my_table;`\nWhat syntax would force Solr to only give me distinct values?\n`http:\/\/localhost:8983\/solr\/se...
{"title":"Devise password reset from Rails console","tags":["ruby-on-rails","ruby","ruby-on-rails-3","devise","rails-console"],"question_text":"While running an app how do you select a user by email address and then set the password manually within\n`rails console`\nfor Devise?\nAlso, where would I go to review documen...
{"title":"sematic zooming of force directed graph in d3","tags":["svg","d3.js","zoom","force-layout"],"question_text":"Many\ncases\nhave been shown for force directed graph geometric zooming by\nSVG Geometric Zooming\n.\nIn geometric zooming, I only need to add a transform attribute in zoom function. However, in semati...
{"title":"What does \\d+ mean in regular expression terms?","tags":["php","regex"],"question_text":"I'm new to regular expressions and came accros the following \\d+ . I do not exactly know what this means, please point me in the right direction.","answer_text":"`\\d`\nis a digit (a character in the range 0-9), and\n`+...
{"title":"How, exactly, does the double-stringize trick work?","tags":["c","c-preprocessor","stringification"],"question_text":"At least some\nC\npreprocessors let you stringize the value of a macro, rather than its name, by passing it through one function-like macro to another that stringizes it:\n`#define STR1(x) #x\...
{"title":"Google Map icons with VisualRefresh","tags":["google-maps","google-maps-api-3","visual-refresh"],"question_text":"How can I use the \"new\" default icons for Google maps when using VisualRefresh setting?\nThe default icon is:\nhttp:\/\/mt.googleapis.com\/vt\/icon\/name=icons\/spotlight\/spotlight-poi.png&scal...
{"title":"PHP: Possible to automatically get all POSTed data?","tags":["php","forms","post"],"question_text":"Simple question: Is it possible to get all the data POSTed to a page, even if you don't know all the fields?\nFor example, I want to write a simple script that collects any POSTed data and emails it. I can fore...
{"title":"Find maximum of three number in C without using conditional statement and ternary operator","tags":["c","algorithm","conditional-statements"],"question_text":"I have to find maximum of three number provided by user but with some restrictions. Its not allowed to use any conditional statement. I tried using ter...
{"title":"How can I auto increment the C# assembly version via our CI platform (Hudson)?","tags":[".net","msbuild","continuous-integration","hudson","versioning"],"question_text":"Myself and my group are horrendous at incrementing assembly version numbers and we frequently ship assemblies with 1.0.0.0 versions. Obvious...
{"title":"Difference between Arrays.asList(array) vs new ArrayList<Integer>(Arrays.asList(ia)) in java","tags":["java","list","collections"],"question_text":"what is the difference between\n`1.List<Integer> list1 = new ArrayList<Integer>(Arrays.asList(ia)); \/\/copy\n2.List<Integer> list2 = Arrays.asList(ia);`\nwhere\n...
{"title":"Closure in Java 7","tags":["java","closures"],"question_text":"What is closure? It is supposed to be included in Java 7.\n(Closures were discussed for inclusion in Java 7, but in the end were not included. -ed)\nCan anyone please provide me with some reliable references from where I can learn stuff about clos...
{"title":"Checking for empty arrays: count vs empty","tags":["php","arrays","performance","standards","semantics"],"question_text":"This question on '\nHow to tell if a PHP array is empty\n' had me thinking of this question\nIs there a reason that\n`count`\nshould be used instead of\n`empty`\nwhen determining if an arr...
{"title":"foreach on Request.Files","tags":["c#","asp.net","file-upload"],"question_text":"I'm attempting upload multiple files in ASP.NET MVC and I have this simple foreach loop in my controller\n`foreach (HttpPostedFileBase f in Request.Files)\n{\n if (f.ContentLength > 0)\n FileUpload(f);\n}`\nThe previous code gene...
{"title":"How to disable cache in InternetExplorer 8","tags":["javascript","internet-explorer","caching"],"question_text":"How can I disable cache in IE8 ?\nWe are doing Javascript development and testing it in IE8, but we have to clear the cache every time we make changes to the Javascript files.","answer_text":"Go to...
{"title":"Eclipse IDE: How to zoom in on text?","tags":["eclipse","eclipse-plugin"],"question_text":"I want the same behaviour Firefox has, when you use the scroll button in the mouse to zoom in and out on the current view. \nIs there something like it for eclipse?","answer_text":"There is a project from a guy called '...
{"title":"Where I can find example of SQLite database file or dump of it?","tags":["sqlite"],"question_text":"I really need a sqlite database file for studies.\nI'm creating an application in C# and I need a database with many tables, field, views, indexes, constraints and so on. And I don't want to create it myself us...
{"title":"How to get the fields in an Object via reflection?","tags":["java","reflection"],"question_text":"I have an object (basically a VO) in Java and I don't know its type.\nI need to get values which are not null in that object.\nHow can this be done?","answer_text":"You can use\n`Class#getDeclaredFields()`\nto ge...
{"title":"Django template can't loop defaultdict","tags":["python","django","loops"],"question_text":"`import collections\ndata = [\n {'firstname': 'John', 'lastname': 'Smith'}, \n {'firstname': 'Samantha', 'lastname': 'Smith'}, \n {'firstname': 'shawn', 'lastname': 'Spencer'}, \n]\nnew_data = collections.defaultdict(l...
{"title":"How can I disable model compatibility checking in Entity Framework 4.3?","tags":["c#",".net","entity-framework","entity-framework-4.3"],"question_text":"I'm working with EF 4.3 and have a context which needs to talk to a database which was generated by another library using EF Code First 4.3. The context is t...
{"title":"How to assign a C struct inline?","tags":["c++","c","struct"],"question_text":"`typedef struct {\n int hour;\n int min;\n int sec;\n} counter_t;`\nAnd in the code, I'd like to initialize instances of this struct without explicitly initializing each member variable. That is, I'd like to do something like:\n`co...
{"title":"InvalidKeyException Illegal key size","tags":["java","aes","jce"],"question_text":"I have a test which runs great on my development MacBook Pro, but fails to run in continuous integration TeamCity server.\nThe error is following:\n`java.security.InvalidKeyException: Illegal key size\n at javax.crypto.Cipher.a...
{"title":"Collections.sort with multiple fields","tags":["java","sorting","collections"],"question_text":"I have a list of \"Report\" objects with three fields (All String type)-\n`ReportKey\nStudentNumber\nSchool`\nI have a sort code goes like-\n`Collections.sort(reportList, new Comparator<Report>() {\n@Override\npubl...
{"title":"What is Grunt for?","tags":["javascript","automation","gruntjs"],"question_text":"I'm trying to get into Grunt, which I am new to, but I do not understand its utility.\nI understand that it is a taskrunner. I understand that it can be used to do things like bundle, uglify, jshint, minify, etc etc etc, anythin...
{"title":"svn over HTTP proxy","tags":["linux","svn","ubuntu","proxy"],"question_text":"I'm on laptop (Ubuntu) with a network that use HTTP proxy (only http connections allowed).\nWhen I use svn up for url like 'http:\/\/.....' everything is cool (google chrome repository works perfect), but right now I need to svn up ...
{"title":"Multiple Firefox Versions on Same PC","tags":["firefox","installation"],"question_text":"I develop various web apps, use CSS and JavaScript extensively, and need to be able to test them on both FF 3 as well as FF 3.5.\nBut, installing 3.5 overwrites 3.0, so I was wondering if its possible (and if so, how) to ...
{"title":"How can I create an editable dropdownlist in HTML?","tags":["html","combobox","html-select"],"question_text":"I'd like to create a text field with a dropdown list that lets the user choose some predefined values. The user should also be able to type a new value or select a predefined one from a dropdown list....
{"title":"How to position the form in the center screen?","tags":["java","swing","netbeans","layout-manager"],"question_text":"I'm a .Net developer but somehow I was task to create a simple application in java for some extra reason. I was able to create that application but my problem is how can i center the form in th...
{"title":"Radius of \"viewable\" region in google maps v3","tags":["google-maps","google-maps-api-3"],"question_text":"I need to know how to retrieve the radius of the viewable zoom level in google maps API v3.\nFor example, if I am at zoom level 3, and depending on the users screen size (lets just say 400x400 viewable...
{"title":"How to correctly sort a string with a number inside?","tags":["python","regex","sorting","string"],"question_text":"Possible Duplicate:\nDoes Python have a built in function for string natural sort?\nI have a list of strings containing numbers and I cannot find a good way to sort them.\nFor example I get some...
{"title":"Should interfaces be placed in a separate package?","tags":["java","interface","packages"],"question_text":"I'm new to a team working on a rather large project, with lots of components and dependencies. For every component, there's an\n`interfaces`\npackage where the exposed interfaces for that component are ...
{"title":"Check if key exists in JSON array using JQuery","tags":["jquery","ajax","json","zend-framework","zend-form-element"],"question_text":"I have done AJAX validation and validated message is returned as a JSON array. Therefore I need to check whether the keys, like\n`name`\nand\n`email`\n, are in that JSON array....
{"title":"Difference between global and device functions","tags":["cuda"],"question_text":"Can anyone describe me the difference between\n`__global__`\nand\n`__device__`\n?\nWhen should I use from\n`__device__`\n?, and when use\n`__global__`\n?.","answer_text":"Global functions are also called \"kernels\". It's the fun...
{"title":"Function declaration in CoffeeScript","tags":["javascript","coffeescript","jslint","function-declaration"],"question_text":"I notice that in CoffeeScript, if I define a function using:\n`a = (c) -> c=1`\nI can only get the\nfunction expression\n:\n`var a;\na = function(c) {\n return c = 1;\n};`\nBut, personal...
{"title":"Why does my C# gzip produce a larger file than Fiddler or PHP?","tags":["c#","gzip","fiddler","gzipstream"],"question_text":"If I GZip this text:\nHello World\nthrough C# using this code:\n`Stream stream = new MemoryStream(Encoding.Default.GetBytes(\"Hello World\"));\nvar compressedMemoryStream = new MemorySt...
{"title":"Using MemoryStore in production","tags":["node.js"],"question_text":"Today I ran my Node.js application in \"production\" mode for the first time and got this warning:\n`Warning: connection.session() MemoryStore is not\ndesigned for a production environment, as it will leak\nmemory, and obviously only work wi...
{"title":"How do I save Eclipse launch profiles across workspaces?","tags":["java","eclipse"],"question_text":"When I copy an Eclipse project directory, it contains the .classpath and .project files so that when I take that same directory to another Eclipse instance, I don't have to setup my build path and such (assumi...
{"title":"Memory Leak Detectors Working Principle","tags":["c++","c","memory-leaks"],"question_text":"How do memory leak detectors actually work? What are the underlying concepts in general? Can take C++ as the language to explain this.","answer_text":"There are a couple of different ways that leak detectors work. You ...
{"title":"How to set Hex color code in xib in iOS","tags":["ios","xcode","xib"],"question_text":"I am not finding an option for Hex color code in xib color picker in xcode.\nBut I have seen in stack over flow answer,\nhttp:\/\/stackoverflow.com\/a\/27283783\/4391112\n.\nIn this, image is having Hex color code option in...
{"title":"What svn command would list all the files modified on a branch?","tags":["svn"],"question_text":"In svn, I have a branch which was created, say at revision 22334. Commits were then made on the branch.\nHow do I get a list of all files that were changed on the branch compared to what's on the trunk? I do not w...
{"title":"UISearchDisplayController and UITableView prototype cell crash","tags":["iphone","ios","objective-c","uitableview","uisearchdisplaycontroller"],"question_text":"I have a UIViewController setup in a storyboard with a tableview and UISearchDisplayController.\nI am trying to use a custom prototype cell from self...
{"title":"Rails console can't connect to database","tags":["ruby-on-rails","osx"],"question_text":"In last days i update my OS X to Maverics. Today when i try to create new project like this:\n`rails new abc`\nthere were many problems but i install xcode and now it's work. Right now i open rails console like this:\n`ra...
{"title":"How to Alter Mulitple Columns datatype in SQL Server","tags":["sql","sql-server"],"question_text":"I have 10 columns in a table and i need to alter the datatypes of that columns.\nSo how should i go with it?\nI had tried for this:\n`ALTER TABLE tblcommodityOHLC alter column \n CC_CommodityContractID NUMERIC(1...
{"title":"two different DLL with same namespace","tags":["c#","visual-studio-2010",".net-2.0"],"question_text":"I have two DLL file that they both have a same namespace but they have different functions and types.\nhow can I references both DLLs in my Project and use their functions and types?\nby the way. these two DL...
{"title":"Two-dimensional array in Swift","tags":["arrays","swift"],"question_text":"I get so confused about 2D arrays in Swift. Let me describe step by step. And would you please correct me if i am wrong.\nFirst of all; declaration of an empty array:\n`class test{\n var my2Darr = Int[][]()\n}`\nSecondly fill the array...