text
stringlengths
74
309k
{"title":"java.lang.VerifyError: Expecting a stackmap frame at branch target JDK 1.7","tags":["java","jaxb","java-7"],"question_text":"After upgrading to JDK 1.7 I am getting below exception:\n`java.lang.VerifyError: Expecting a stackmap frame at branch target 71 in method com.abc.domain.myPackage.MyClass$JaxbAccessorM...
{"title":"How to execute raw SQL in SQLAlchemy-flask app","tags":["python","sql","sqlalchemy","flask","flask-sqlalchemy"],"question_text":"How do you execute raw SQL in SQLAlchemy?\nI have a python web app that runs on flask and interfaces to the database through SQLAlchemy.\nI need a way to run the raw SQL. The query ...
{"title":"Javascript closures vs PHP closures, what's the difference?","tags":["php","javascript","closures"],"question_text":"What are the differences between closures in JS and closures in PHP? Do they pretty much work the same way? Are there any caveats to be aware of when writing closures in PHP?","answer_text":"On...
{"title":"Differences between detach(), hide() and remove() - jQuery","tags":["javascript","jquery"],"question_text":"What is the functional difference between these three\n`jQuery`\nmethods:\ndetach()\nhide()\nremove()","answer_text":"`hide()`\nsets the matched elements' CSS\n`display`\nproperty to\n`none`\n.\n`remove...
{"title":"@ character before a function call","tags":["php"],"question_text":"What is the difference between these two function calls in PHP?\n`init_get($somevariable);\n@init_get($somevariable);`","answer_text":"the \"@\" will silence any php errors your function could raise.","question_code":["init_get($somevariable)...
{"title":"How to define an array \/ hash in Factory Girl?","tags":["ruby-on-rails-3","rspec","factory-girl"],"question_text":"I am trying to write a test that simulates some return values from Dropbox's REST service that gives me back data in an Array, with a nested hash.\nI am having trouble figuring out how to code m...
{"title":"openMP, atomic vs critical?","tags":["openmp"],"question_text":"What is the difference between atomic and critical in openMP?\nI can do this\n`#pragma omp atomic\ng_qCount++;`\nbut isn't this same as\n`#pragma omp critical\ng_qCount++;`\nThanks in advance","answer_text":"The effect on g_qCount is the same, bu...
{"title":"Defining a percentage width for a LinearLayout?","tags":["android","android-layout"],"question_text":"I want to define a percentage width (70%) for a LinearLayout that contains some buttons, so that I can center it and so that the child buttons can fill_parent. Here's a picture showing what I mean:\nMy curren...
{"title":"How do I backup a database file to the SD card on Android?","tags":["database","android","backup","sd-card"],"question_text":"I'd like to add a feature to my Android app that automatically backs up the\nSQLite\ndatabase to the\nSD card\n.\nWhat's the best way to go about this? Are any examples or tutorials av...
{"title":"C# or Java: Prepend strings with StringBuilder?","tags":["c#","java","stringbuilder"],"question_text":"I know we can append strings using\n`StringBuilder`\n. Is there a way we can prepend strings (i.e. add strings in front of a string) using\n`StringBuilder`\nso we can keep the performance benefits that\n`Str...
{"title":"how to compare the Java Byte[] array?","tags":["java"],"question_text":"`public class ByteArr {\n public static void main(String[] args){\n Byte[] a = {(byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00};\n Byte[] b = {(byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00};\n byte[] aa = {(byte)0x03, (byte)0x00, (byte)0...
{"title":"How to save an image to localStorage and display it on the next page?","tags":["javascript","jquery","html","html5","local-storage"],"question_text":"So basically, I need to do as the title states; Upload a single image, save it to localStorage, then display it on the next page.\nCurrently, I have my HTML fil...
{"title":"How to change navigation bar color in iOS 7 or 6?","tags":["ios","ios6","interface-builder","ios7"],"question_text":"I want to change the color of the navigation bar color, but I'm not sure whether or not I should change the tint or the background. I know iOS 7 is going for a more flat design (even\nrecommend...
{"title":"Validating file types by regular expression","tags":["c#",".net","regex"],"question_text":"I have a .NET webform that has a file upload control that is tied to a regular expression validator. This validator needs to validate that only certain filetypes should be allowed for upload (jpg,gif,doc,pdf)\nThe curre...
{"title":"How to ajax-submit a form textarea input from CKEditor?","tags":["javascript","jquery","ckeditor","html-form","jquery-forms-plugin"],"question_text":"I am using CKEditor, jQuery and\njQuery form plugin\nand I would like to submit contents of the CkEditor form via an Ajax query. Here is my code:\n`<form id=\"a...
{"title":"Default visibility of class methods in PHP","tags":["php","oop","visibility"],"question_text":"I look at the\nmanual\nbut can't seem to find the answer.\nWhat is the default visibility in PHP for functions without a visibility declaration. Does PHP have a package visibility like in Java? Example:\n`class test...
{"title":"Marathon vs Kubernetes vs Docker Swarm on DC\/OS with Docker containers","tags":["docker","kubernetes","marathon","docker-swarm","dcos"],"question_text":"I'm looking for some pros and cons of whether to go with Marathon and Chronos, Docker Swarm or Kubernetes when running Docker containers on DC\/OS.\nFor exa...
{"title":"How to remove elements from xml using xslt with stylesheet and xsltproc?","tags":["xml","xslt"],"question_text":"I have a lot of XML files which have something of the form:\n&lt Element \n fruit=\"apple\" \n animal=\"cat\" \n\/&gt\nWhich I want to be removed from the file.\nUsing an XSLT stylesheet and the Li...
{"title":"What's the most efficient test of whether a PHP string ends with another string?","tags":["php","string","performance"],"question_text":"The standard PHP way to test whether a string\n`$str`\nends with a substring\n`$test`\nis:\n`$endsWith = substr( $str, -strlen( $test ) ) == $test`\nIs this the fastest way?...
{"title":"PHP create array where key and value is same","tags":["php","arrays","range"],"question_text":"I am using the\n`range()`\nfunction to create an array. However, I want the\n`keys`\nto be the same as the\n`value`\n. This is ok when i do\n`range(0, 10)`\nas the index starts from\n`0`\n, however if i do\n`range(1...
{"title":"In Vim, what is the simplest way to join all lines in a file into a single line?","tags":["windows","vim"],"question_text":"I want to join all lines in a file into a single line. What is the simplest way of doing this? I've had poor luck trying to use substitution (\n`\\r\\n`\nor\n`\\n`\ndoesn't seem to get p...
{"title":"Fully backup a git repo?","tags":["git","backup"],"question_text":"Is there a simple way to backup an entire git repo including all branches and tags?","answer_text":"`git bundle`\nI like that method, as it results in only\none\nfile, easier to copy around.\nSee\nProGit: little bundle of joy\n.\nSee also \"\n...
{"title":"Disable XML validation in Eclipse","tags":["xml","eclipse"],"question_text":"My Eclipse validates XML files every time I save a file and it takes a while to validate them.\nThe project is created using gwt-maven-plugin.\nThe XML files are not under any Source folder build path in Eclipse, they are auto genera...
{"title":".net ensuring json keys are lowercase","tags":[".net","json"],"question_text":"Hi all is there simple way using json in .Net to ensure that the keys are sent as lower case.\nAt the moment I'm using the newtonsoft.json library and simply using\n`string loginRequest = JsonConvert.SerializeObject(auth);`\nIn thi...
{"title":"how to call a method of multiple arguments with delay","tags":["ios","methods","selector"],"question_text":"I'm trying to call a method after some delay.\nI know there is a solution for that:\n`[self performSelector:@selector(myMethod) withObject:nil afterDelay:delay];`\nI saw\nthis question\nand\nDocumentati...
{"title":"How do I reset a sequence in Oracle?","tags":["sql","database","oracle","sequence","reset"],"question_text":"In\nPostgreSQL\n, I can do something like this:\n`ALTER SEQUENCE serial RESTART WITH 0;`\nIs there an Oracle equivalent?","answer_text":"Here is a good procedure for resetting any sequence to 0 from Or...
{"title":"Convert a Bitmap to GrayScale in Android","tags":["android","image-processing","bitmap","grayscale"],"question_text":"I am new to this site, and I come with a question about Android.\nIs there any way to convert a Bitmap to grayscale? I know how to draw a grayscale bitmap (using canvas operations:\nhttp:\/\/w...
{"title":"How to use permission_required decorators on django class-based views","tags":["django","django-views","django-authentication","django-class-based-views","class-based-views"],"question_text":"I'm having a bit of trouble understanding how the new CBVs work. My question is this, I need to require login in all t...
{"title":"How to make a window always stay on top in .Net?","tags":["c#",".net","winforms"],"question_text":"I have a C# winforms app that runs a macro in another program. The other program will continually pop up windows and generally make things look, for lack of a better word, crazy. I want to implement a cancel but...
{"title":"Git push failed, \"Non-fast forward updates were rejected\"","tags":["git","github","push"],"question_text":"I've edited my GIT repositories via Git Online. After I tried to push my local code changes, I got an error:\n`Git push failed, To prevent from losing history, non-fast forward updates were rejected.`\...
{"title":"Google Analytics SDK 3.0 _sqlite3 linker errors in iOS","tags":["ios","objective-c","sqlite3","google-analytics"],"question_text":"I'm integrating\nGoogle Analytics SDK 3.0\nin my project. But I am getting\nlinker errors\nwhen try to build my project.\nAs mentioned in the\ndocumentation\n, I have linked follo...
{"title":"Java Preprocessor","tags":["java","optimization","preprocessor"],"question_text":"If I have a boolean field like:\n`private static final boolean DEBUG = false;`\nand within my code I have statements like:\n`if(DEBUG) System.err.println(\"err1\");`\ndoes the Java preprocessor just get rid of the if statement a...
{"title":"how do I preserve newlines in a quoted string in bash?","tags":["bash"],"question_text":"I'm creating a script to automate the creation of apache virtual hosts. Part of my script goes like this:\n`MYSTRING=\"<VirtualHost *:80>\nServerName $NEWVHOST\nDocumentRoot \/var\/www\/hosts\/$NEWVHOST\n...\n\"\necho $MY...
{"title":"How do I prevent a button's background image from stretching?","tags":["ios","cocoa-touch","uiimageview","uibutton","uikit"],"question_text":"I'm allocating a UIButtonTypeCustom UIButton to a UIView with a background image that is smaller than the button's frame. Reason why the image is smaller is because I'm...
{"title":"SQLiteOpenHelper onUpgrade() Confusion Android","tags":["android","database","sqlite"],"question_text":"I am doing my first app with a database and I am having a little trouble understanding the onUpgrade function. My database has a table with an items and a favorite column so that the user can favorite an it...
{"title":"Html List tag not working in android textview. what can i do?","tags":["android"],"question_text":"Html List tag not working in android TextView. This is my string content:\n`String str=\"A dressy take on classic gingham in a soft, textured weave of stripes that resembles twill. Take a closer look at this one...
{"title":"How to find FQDN of local machine in C#\/.NET ?","tags":["c#","localhost","fqdn"],"question_text":"How can you get the FQDN of a local machine in C#?","answer_text":"NOTE: This solution only works when targeting the .NET 2.0 (and newer) frameworks.\n`using System;\nusing System.Net;\nusing System.Net.NetworkI...
{"title":"How to drop all tables in a database?","tags":["sql-server","sql-server-2008","ssms"],"question_text":"I'm trying to write a script that will completely empty a SQL Server database. This is what I have so far:\n`USE [dbname]\nGO\nEXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'\nEXEC sp_msforeach...
{"title":"Best way to change the background color for an NSView","tags":["objective-c","osx","background-color","nsview"],"question_text":"I'm looking for the best way to change the\n`backgroundColor`\nof an\n`NSView`\n. I'd also like to be able to set the appropriate\n`alpha`\nmask for the\n`NSView`\n. Something like:...
{"title":"Facebook Graph API : get larger pictures in one request","tags":["facebook","facebook-graph-api"],"question_text":"I'm currently using\nthe Graph API Explorer\nto make some tests. That's a good tool.\nI want to get the user's friend list, with friends' names, ids and pictures. So I type :\n`https:\/\/graph.fa...
{"title":"Stateless and Stateful Enterprise Java Beans","tags":["java","java-ee","ejb","ejb-3.1","stateful-session-bean"],"question_text":"I am going through the Java EE 6 tutorial and I am trying to understand the difference between stateless and stateful session beans. If stateless session beans do not retain their s...
{"title":"$watch inside a service?","tags":["angularjs","angularjs-service"],"question_text":"Is it possible to set up a\n`$watch`\non an array of objects inside a service (I'd like the\n`$watch`\ndeclaration itself to be inside the service)?","answer_text":"You can add any expression to the set of watches by injecting...
{"title":"How to register Spring @Configuration annotated class instead of applicationContext.xml file in web.xml?","tags":["java","spring","spring-3","spring-annotations"],"question_text":"I am using jsf and spring together in web application. I have configured datasource and session factory in one configuration class...
{"title":"How to set a timeout with AFNetworking","tags":["objective-c","ios","xcode","networking","afnetworking"],"question_text":"My project is using AFNetworking.\nhttps:\/\/github.com\/AFNetworking\/AFNetworking\nHow do I dial down the timeout? Atm with no internet connection the fail block isn't triggered for what...
{"title":"How to wait till the response comes from the $http request, in angularjs?","tags":["angularjs","wait","angularjs-service"],"question_text":"I am using some data which is from a RESTful service in multiple pages.\nSo I am using angular factories for that. So, I required to get the data once from the server, an...
{"title":"NoClassDefFoundError JsonAutoDetect while parsing JSON object","tags":["java","eclipse","json","web-applications","noclassdeffounderror"],"question_text":"I am developing a webapp using Amazon's cloud services and I need to make use of JSON objects. How my project is set up is, I have an HTML form where the u...
{"title":"What is the difference between != and =! in Java?","tags":["java","syntax"],"question_text":"I was looking over some mock\nOCJP\nquestions. I came across a really baffling syntax. Here it is:\n`class OddStuff {\n public static void main(String[] args) {\n boolean b = false;\n System.out.println((b != b));\/\/...
{"title":"IOS: copy a file in documents folder","tags":["ios","xcode","bundle"],"question_text":"In my project I have two file .txt (in Resources folder), how can I copy them inside documents folder?","answer_text":"Copies\n`txtFile`\nfrom resource to document if not already present.\n`NSFileManager *fileManager = [NSF...
{"title":"How to start anonymous thread class","tags":["java","multithreading","anonymous-class"],"question_text":"I have the following code snippet:\n`public class A {\n public static void main(String[] arg)\n {\n new Thread()\n {\n public void run() {\n System.out.println(\"blah\");\n }\n };\n }\n}`\nHere, how do I c...
{"title":"How to subtract date\/time in javascript?","tags":["javascript"],"question_text":"I have a field at a grid containing date\/time and I need to know the difference between that and current date\/time. What could be the best way of doing so?","answer_text":"This will give you the difference between two dates, i...
{"title":"Is there a way to detect if an image is blurry?","tags":["image-processing","opencv"],"question_text":"I was wondering if there is a way to determine if an image is blurry or not by analyzing the image data.","answer_text":"Another very simple way to estimate the sharpness of an image is to use a Laplace (or ...
{"title":"Is there a combination of \"LIKE\" and \"IN\" in SQL?","tags":["sql","sql-server","oracle","tsql","plsql"],"question_text":"In SQL I (sadly) often have to use \"\n`LIKE`\n\" conditions due to databases that violate nearly every rule of normalization. I can't change that right now. But that's irrelevant to the...
{"title":"How can I make a multipart\/form-data POST request using Java?","tags":["java","http","multipart"],"question_text":"In the days of version 3.x of Apache Commons HttpClient, making a multipart\/form-data POST request was possible (\nan example from 2004\n). Unfortunately this is no longer possible in\nversion ...
{"title":"Does switch case order affect speed?","tags":["java","switch-statement"],"question_text":"I've tried to google this, but had no luck.\nI have a very big switch, and some cases are\nobviously more common\nthan others.\nSo I would like to know if the order is really held as it is and the \"upper\" cases get tes...
{"title":"submit a form in a new tab","tags":["php","jquery","html-form","html-form-post"],"question_text":"I'd like (just to test some functions, after I'll avoid this behaviour) to load the page called by submit on a new tab : is it possible?","answer_text":"`<form target=\"_blank\" [....]`\nwill submit the form in a...
{"title":"Set Response Status Code","tags":["php","cakephp","cakephp-1.3","http-status-codes"],"question_text":"I have an API call for which I need to be able to run some checks and potentially return various status codes. I don't need custom views or anything, I just need to return the proper code. If the user hasn't ...
{"title":"How to use EditTextPreference as a masked Password text field?","tags":["android","textview","android-preferences"],"question_text":"I have a very simple question:\nI have a\n`EditTextPreference`\ndialog which I want to use for getting the user's password and I want it to be masked.\nHow can I do that?","answ...
{"title":"Why does a function call require the parameter name in Swift?","tags":["methods","swift","named-parameters"],"question_text":"I have this Function in a class:\n`func multiply(factor1:Int, factor2:Int) -> Int{\n return factor1 * factor2\n}`\nI try to call the function using this:\n`var multResult = calculator....
{"title":"What happens to a github student account's repositories at the end of 2 years?","tags":["github"],"question_text":"I just got upgraded to a free github micro plan using my university email address. I'm planning to use the private repositories for some class projects this semester, but I'm wondering what will ...
{"title":"Is pass-by-value a reasonable default in C++11?","tags":["c++","coding-style","c++11"],"question_text":"In traditional C++, passing by value into functions and methods is slow for large objects, and is generally frowned upon. Instead, C++ programmers tend to pass references around, which is faster, but which ...
{"title":"using a html entity in xslt (e.g. &nbsp;)","tags":["xslt"],"question_text":"What is the best way to include an html entity in XSLT?\n`<xsl:template match=\"\/a\/node\">\n <xsl:value-of select=\".\"\/>\n <xsl:text>&nbsp;<\/xsl:text>\n<\/xsl:template>`\nthis one returns a\nXsltParseError","answer_text":"You can...
{"title":"How do you manage your own small project?","tags":["project-management"],"question_text":"Since I have a job, and I want to write some of my own software at my spare time, I want to know how you you guys organize, plan and develop such small project. Since it is not a job, you may be interrupted by many other...
{"title":"Create an assoc array with equal keys and values from a regular array","tags":["php","arrays"],"question_text":"I have an array that looks like\n`$numbers = array('first', 'second', 'third');`\nI want to have a function that will take this array as input and return an that would look like:\n`array(\n'first' =...
{"title":"jQuery append text","tags":["jquery","html","css","append"],"question_text":"I want to append some simple data in a div like:\n`$('#msg').append('Some text');`\nIn the body, i think i will need to place the the html like.\n`<div id=\"test\"> \n<div id=\"msg\"><\/div> \/\/show text inside it.\n<\/div>`\nHoweve...
{"title":"How to install a specific version of a package with pip?","tags":["python","virtualenv","pip","django-modeltranslation"],"question_text":"Possible Duplicate:\nInstalling specific package versions with Pip\nI am a bit new to\n`pip install`\nand\n`virtualenv`\nin general.\nI have setup an virtualenv on my serve...
{"title":"How to create a new (and empty!) \"root\" branch?","tags":["git"],"question_text":"I would like to define a new \"root\" branch in this git repository. By \"root\" branch I mean a branch that is entirely independent of all the other branches in the repository\n1\n.\nUnfortunately, even the commit (let's call ...
{"title":"Collapsing Sidebar with Bootstrap 3","tags":["twitter-bootstrap-3","sidebar","collapse"],"question_text":"I just visited this page\nhttp:\/\/www.elmastudio.de\/\nand wondered if it is possible to build the left sidebar collapse with Bootstrap 3.\nCode to collapse the sidebar from the top (phone only):\n`<butt...
{"title":"Why when I transfer a file through SFTP, it takes longer than FTP?","tags":["performance","file","ftp","sftp","transfer"],"question_text":"I manually copy a file to a server, and the same one to an SFTP server.\nThe file is 140MB.\nFTP: I have a rate arround 11MB\/s\nSFTP: I have a rate arround 4.5MB\/s\nI un...
{"title":"ClearCase advantages\/disadvantages","tags":["version-control","clearcase"],"question_text":"Because I'm currently struggling to learn IBM Rational ClearCase, I'd like to hear your professional opinion.\nI'm particularly interested in advantages\/disadvantages compared to other version-control-systems like Su...
{"title":"Asp.net MVC ModelState.Clear","tags":["asp.net-mvc","modelstate","post-redirect-get"],"question_text":"Can anyone give me a succinct definition of the role of ModelState in Asp.net MVC (or a link to one). In particular I need to know in what situations it is necessary or desirable to call\n`ModelState.Clear()...
{"title":"Base constructor in C# - Which gets called first?","tags":["c#",".net","asp.net"],"question_text":"Which gets called first - the base constructor or \"other stuff here\"?\n`public class MyExceptionClass : Exception\n{\n public MyExceptionClass(string message, string extrainfo) : base(message)\n {\n \/\/other ...
{"title":"Conditional Compilation and Framework Targets","tags":["c#",".net-3.5","msbuild",".net-4.0"],"question_text":"There are a few minor places where code for my project may be able to be drastically improved if the target framework were a newer version. I'd like to be able to better leverage conditional compilati...
{"title":"const char* and char const* - are they the same?","tags":["c++","pointers","const"],"question_text":"From my understanding,\n`const`\nmodifiers should be read from right to left. From that, I get that:\n`const char*`\nis a pointer whose char elements can't be modified, but the pointer itself can, and\n`char c...
{"title":"How do you log all events fired by an element in jQuery?","tags":["javascript","events","javascript-events","jquery"],"question_text":"I'd like to see all the events fired by an\ninput field\nas a user interacts with it. This includes stuff like:\nClicking on it.\nClicking off it.\nTabbing into it.\nTabbing a...
{"title":"How To Get Selected Value From UIPickerView","tags":["ios","objective-c","cocoa-touch"],"question_text":"I know that with a UIDatePicker, you can use something like:\n`NSDate *myDate = picker.date;`\nBut I am using a UIPickerView in my view. How can i similarly get the value selected? Or do I have to setup di...
{"title":"Why Clojure over other JVM Lisps: Kawa, Armed Bear or SISC?","tags":["clojure","jvm","lisp","kawa"],"question_text":"The JVM already had three Lisps before Clojure arrived on the scene:\nKawa\n,\nArmed Bear\nand\nSISC\n.\nWhat gap does\nClojure\nfill that was left by those Lisps?","answer_text":"Kawa, ABCL, a...
{"title":"How to update attributes without validation","tags":["ruby-on-rails","validation"],"question_text":"I've got a model with its validations, and I found out that I can't update an attribute without validating the object before.\nI already tried to add\n`on => :create`\nsyntax at the end of each validation line,...
{"title":"Get records with max value for each group of grouped SQL results","tags":["mysql","sql"],"question_text":"How do you get the rows that contain the max value for each grouped set?\nI've seen some overly-complicated variations on this question, and none with a good answer. I've tried to put together the simples...
{"title":"jQuery select option elements by value","tags":["javascript","jquery"],"question_text":"I have a select element wrapped by a span element. I am not allowed to use the select id but I am allowed to use the span id.\nI am trying to write a javascript\/jquery function in which the input is a number i, which is o...
{"title":"C++ equivalent of java.toString?","tags":["c++"],"question_text":"I'd like to control what is written to a stream, i.e.\n`cout`\n, for an object of a custom class. Is that possible in C++? In Java you could override the\n`toString()`\nmethod for similar purpose.","answer_text":"In C++ you can overload\n`opera...
{"title":"`if __name__ == '__main__'` equivalent in Ruby","tags":["python","ruby","main"],"question_text":"I am new to Ruby. I'm looking to import functions from a module that contains a tool I want to continue using separately. In Python I would simply do this:\n`def a():\n ...\ndef b():\n ...\nif __name__ == '__main_...
{"title":"How to enable CORS in AngularJs","tags":["javascript","angularjs","cors","angularjs-http"],"question_text":"I have created a demo using JavaScript for Flickr photo search API. \nNow I am converting it to the AngularJs.\nI have searched on internet and found below configuration.\nConfiguration:\n`myApp.config(...
{"title":".toInt() removed in Swift 2?","tags":["swift","swift2"],"question_text":"I was working on an application that used a text field and translated it into an integer. Previously my code\n`textField.text.toInt()`\nworked. Now Swift declares this as an error and is telling me to do\n`textField.text!.toInt()`\nand i...
{"title":"Remove all child nodes from a parent?","tags":["jquery"],"question_text":"I have a list, I just want to remove all child nodes from it. What's the most efficient way using jquery? This is what I have:\n`<ul id='foo'>\n <li>a<\/li>\n <li>b<\/li>\n<\/ul>\nvar thelist = document.getElementById(\"foo\"); \nwhile ...
{"title":"Open the start page in Visual Studio after closing a project?","tags":["visual-studio"],"question_text":"When you start Visual Studio you get a start page with all the latest projects in a list.\nBut when you've opened and closed a project, how do you open that start page again?\n(Without restarting VS)","ans...
{"title":"Is it possible to view the contents of files in the iOS Application sandbox while debugging?","tags":["ios","xcode","xcode4"],"question_text":"Title more or less says it all.\nI'd like to check the contents of an XML file at a specific point of execution while debugging in XCode. Is it possible to view the co...
{"title":"javascript: recursive anonymous function?","tags":["javascript","recursion","scope","anonymous-function"],"question_text":"Lets say I have a basic recursive function:\n`function recur(data) {\n data = data+1;\n var nothing = function() {\n recur(data);\n }\n nothing();\n}`\nHow could I do this if I have an an...
{"title":"Can someone explain what the C# \"Func<T,T>\" does?","tags":["c#","func"],"question_text":"I'm reading the Pro MVC 2 book, and there is an example of creating an extension method for the HtmlHelper class.\nHere the code example:\n`public static MvcHtmlString PageLinks(this HtmlHelper html, PagingInfo pagingIn...
{"title":"Serialize form not working in jQuery","tags":["jquery"],"question_text":"Can you please take a look and help me realize where am I going wrong with this? Here is the jsfiddle link:\nhttp:\/\/jsfiddle.net\/Hitman666\/QcEkj\/1\/\nbut also here is that code\nHTML:\n`<form action=\"#\" id=\"gamesForm\">\n <p> \n ...
{"title":"setResult does not work when BACK button pressed","tags":["android"],"question_text":"I am trying to setResult after the BACK button was pressed. I call in onDestroy\n`Intent data = new Intent();\nsetResult(RESULT_OK, data)`\nBut when it comes to\n`onActivityResult(int requestCode, int resultCode, Intent data...
{"title":"When should <script> tags be visible and why can they?","tags":["html","css","script-tag"],"question_text":"A\n`script`\nelement that got styled as\n`display:block`\nappears visible. Why is it possible and is there any real use case where it is desired?\n`td > * {\r\n display: block;\r\n}`\n`<table>\r\n <tr>\...
{"title":"How can I get the corresponding table header (th) from a table cell (td)?","tags":["jquery","jquery-selectors"],"question_text":"Given the following table, how would I get the corresponding table header for each td element?\n`<table>\n <thead> \n <tr>\n <th id=\"name\">Name<\/th>\n <th id=\"address\">Address<...
{"title":"razor syntax - foreach loop","tags":["razor"],"question_text":"`@foreach (string s in \"1,2,3\".Split(',')) {\n s is equal to @s<br\/>\n}`\nI want to spit out:\ns is equal to 1\ns is equal to 2\ns is equal to 3\nBut I'm getting all sorts of errors because Visual Studio thinks that what is between the {}'s is ...
{"title":"Android Word-Wrap EditText text","tags":["android","xml","word","wrap","android-edittext"],"question_text":"I have been trying to get my EditText box to word wrap, but can't seem to do it.\nI have dealt with much more complicated issues while developing Android applications, and this seems like it should be a...
{"title":"3 column layout HTML\/CSS","tags":["html","css"],"question_text":"I have the following HTML layout:\n`<div class=\"container\">\n <div class=\"column-center\">Column center<\/div>\n <div class=\"column-left\">Column left<\/div>\n <div class=\"column-right\">Column right<\/div>\n<\/div>`\nAny chance to arrange...
{"title":"Ruby get object keys as array","tags":["ruby"],"question_text":"I am new to Ruby, if I have an object like this\n`{\"apple\" => \"fruit\", \"carrot\" => \"vegetable\"}`\nHow can I return an array of just the keys?\n`[\"apple\", \"carrot\"]`","answer_text":"`hash = {\"apple\" => \"fruit\", \"carrot\" => \"vege...
{"title":"Sell me on const correctness","tags":["c++","const-correctness"],"question_text":"So why exactly is it that it's always recommended to use const as often as possible? It seems to me that using const can be more of a pain than a help in C++. But then again, I'm coming at this from the python perspective: if yo...
{"title":"Is using eval in Python a bad practice?","tags":["python","eval"],"question_text":"I am using the following class to easily store data of my songs.\n`class Song:\n \"\"\"The class to store the details of each song\"\"\"\n attsToStore=('Name', 'Artist', 'Album', 'Genre', 'Location')\n def __init__(self):\n for...
{"title":"How to use git with gnome-keyring integration","tags":["git","gnome"],"question_text":"Git 1.8.0 supports integration with gnome-keyring.\nhttp:\/\/www.h-online.com\/open\/news\/item\/Git-1-8-0-can-access-Windows-and-GNOME-keyrings-1733879.html\nAfter reading the docs about the git credentials helpers:\nhttp:...
{"title":"C++ mark as deprecated","tags":["c++"],"question_text":"I have a method in an interface that I want to deprecate with portable C++.\nWhen I Googled for this all I got was a Microsoft specific solution;\n#pragma deprecated\nand\n__declspec(deprecated)\n.\nA second prize solution would be to ifdef a MSVC and a ...