text
stringlengths
74
309k
{"title":"CSS3 Transparency + Gradient","tags":["css","css3","gradients"],"question_text":"RGBA is extremely fun, and so is\n`-webkit-gradient`\n,\n`-moz-gradient`\n, and uh...\n`progid:DXImageTransform.Microsoft.gradient`\n... yeah. :)\nIs there a way to combine the two, RGBA and gradients, so that there's gradient of...
{"title":"Reading entire file in Python","tags":["python","file-io","filehandle"],"question_text":"If you read an entire file with\n`content = open('Path\/to\/file', 'r').read()`\nis the file handle left open until the script exits? Is there a more concise method to read a whole file?","answer_text":"the answer to that...
{"title":"How to convert String to JSONObject in Java","tags":["java","arrays","json","parsing","jsonobject"],"question_text":"I have String variable called\n`jsonString`\n:\n`{\"phonetype\":\"N95\",\"cat\":\"WP\"}`\nNow I want to convert it into JSON Object. I searched more on Google but didn't get any expected answer...
{"title":"How to assign text size in sp value using java code","tags":["android","android-textview","text-size"],"question_text":"If I assign an integer value to change a certain text size of a TextView using java code, the value is interpreted as pixel (px). Now does anyone know how to assign it in sp?","answer_text":...
{"title":"jQuery If DIV Doesn't Have Class \"x\"","tags":["jquery"],"question_text":"In jQuery I need to do an if statement to see if $this doesn't contain the class '.selected'.\n`$(\".thumbs\").hover(function(){\n$(this).stop().fadeTo(\"normal\", 1.0);\n},function(){\n$(this).stop().fadeTo(\"slow\", 0.3);\n});`\nBasi...
{"title":"Convert between UIImage and Base64 string","tags":["ios","cocoa-touch","uiimage","base64","nsdata"],"question_text":"Does anyone know how to convert a\n`UIImage`\nto a Base64 string, and then reverse it?\nI have the below code; the original image before encoding is good, but I only get a blank image after I e...
{"title":"Media Queries: How to target desktop, tablet and mobile?","tags":["css","css3","mobile","media-queries","tablet"],"question_text":"I have been doing some research on media queries and I still don't quite understand how to target devices of certain sizes.\nI want to be able to target desktop, tablet and mobile...
{"title":"Remove CSS from a Div using JQuery","tags":["jquery","css"],"question_text":"I'm new to JQuery. In my App I have the following:\n`$(\"#displayPanel div\").live(\"click\", function(){\n $(this).css({'background-color' : 'pink', 'font-weight' : 'bolder'});\n});`\nWhen I click on a Div, the color of that Div is ...
{"title":"SQL Server SELECT INTO @variable?","tags":["sql","sql-server","tsql","sql-server-2008"],"question_text":"I have the following code in one of my Sql (2008) Stored Procs which executes perfectly fine:\n`CREATE PROCEDURE [dbo].[Item_AddItem]\n @CustomerId uniqueidentifier,\n @Description nvarchar(100),\n @Type i...
{"title":"Java - sending HTTP parameters via POST method easily","tags":["java","http","post","httpurlconnection"],"question_text":"I am successfully using this code to send\n`HTTP`\nrequests with some parameters via\n`GET`\nmethod\n`function void sendRequest(String request)\n{\n \/\/ i.e.: request = \"http:\/\/example...
{"title":"Is there a better Windows Console Window?","tags":["windows","command-line","console","terminal","command-line-interface"],"question_text":"I find working on the command line in Windows frustrating, primarily because the console window is wretched to use compared to terminal applications on linux and OS X suc...
{"title":"How can an SQL query return data from multiple tables","tags":["mysql","sql","select"],"question_text":"I would like to know the following:\nhow to get data from multiple tables in my database?\nwhat types of methods are there to do this?\nwhat are joins and unions and how are they different from one another?...
{"title":"Window.location.href and Window.open () methods in JavaScript","tags":["javascript","location","window","href","window-object"],"question_text":"What is the difference between\n`window.location.href`\nand\n`window.open ()`\nmethods in JavaScript?","answer_text":"`window.location.href`\nis\nnot\na method, it's...
{"title":"Loading\/Downloading image from URL on Swift","tags":["ios","swift","uiimage","nsurl"],"question_text":"I'd like to load an image from a URL in my application, so I first tried with Objective-C and it worked, however, with Swift, I've a compilation error:\n'imageWithData' is unavailable: use object constructi...
{"title":"Greedy vs. Reluctant vs. Possessive Quantifiers","tags":["regex","regex-greedy"],"question_text":"I found this\nexcellent tutorial\non regular expressions and while I intuitively understand what \"greedy\", \"reluctant\" and \"possessive\" quantifiers do, there seems to be a serious hole in my understanding.\...
{"title":"Material effect on button with background color","tags":["android","android-5.0-lollipop"],"question_text":"I am using Android v21 support library.\nI have created a button with custom background color. The Material design effects like ripple, reveal are gone (except the elevation on click) when I use the bac...
{"title":"What is the difference between 'typedef' and 'using' in C++11?","tags":["c++","c++11","typedef","using-declaration"],"question_text":"I know that in C++11 we can now use\n`using`\nto write type alias, like\n`typedef`\ns:\n`typedef int MyInt;`\nIs, from what I understand, equivalent to:\n`using MyInt = int;`\n...
{"title":"Do I need to explicitly call the base virtual destructor?","tags":["c++","destructor"],"question_text":"When overriding a class in C++ (with a virtual destructor) I am implementing the destructor again as virtual on the inheriting class, but do I need to call the base destructor?\nIf so I imagine it's somethi...
{"title":"Why are there no ++ and --\u00e2\u0080\u008b operators in Python?","tags":["python","operators"],"question_text":"Why are there no\n`++`\nand\n`--`\noperators in Python?","answer_text":"It's not because it doesn't make sense; it makes perfect sense to define \"x++\" as \"x += 1, evaluating to the previous bin...
{"title":"CentOS 64 bit bad ELF interpreter","tags":["linux","centos","64bit","32bit-64bit","centos6"],"question_text":"I have just installed CentOS 6 64bit version, I'm trying to install a 32-bit application on a 64-bit machine and got this error:\n\/lib\/ld-linux.so.2: bad ELF interpreter: No such file or directory\n...
{"title":"Changing the case of a string in Eclipse","tags":["eclipse","ide","keyboard-shortcuts"],"question_text":"How do I make a lowercase string uppercase using Eclipse? I want to select a string and either uppercase it or lowercase it. Is there a shortcut for doing this?","answer_text":"By default, the hotkeys:\nCT...
{"title":"What are important languages to learn to understand different approaches and concepts?","tags":["language-agnostic","programming-languages"],"question_text":"When all you have is a pair of bolt cutters and a bottle of vodka, everything looks like the lock on the door of Wolf Blitzer's boathouse. (Replace that...
{"title":"How to scroll the window using JQuery $.scrollTo() function","tags":["javascript","jquery","scroll","scrollto"],"question_text":"I'm trying to scroll down 100px every time the user gets near the top of the document.\nI have the function executing when the user gets close to the top of the document, but the .s...
{"title":"Getting name of the class from an instance in Objective-C","tags":["iphone","objective-c","class","instance","classname"],"question_text":"I have the following problem: I get an instance of a class passed and want to know the name of the class of this instance. Any guess how to get this?\nThank you very much!...
{"title":"How do I connect to a specific Wi-Fi network in Android programmatically?","tags":["android","android-wifi","wifimanager"],"question_text":"I want to design an app which shows a list of Wi-Fi networks available and connect to whichever network is selected by the user.\nI have implemented the part showing the ...
{"title":"Using Emacs to recursively find and replace in text files not already open","tags":["emacs","editor"],"question_text":"As a follow-up to\nthis question\n, it's trying to find out how to do something like this which should be easy, that especially stops me from getting more used to using Emacs and instead star...
{"title":"Why does git commit not save my changes?","tags":["git","version-control","git-commit"],"question_text":"I did a\n`git commit -m \"message\"`\nlike this\n`>git commit -m \"save arezzo files\"\n# On branch master\n# Changes not staged for commit:\n# (use \"git add <file>...\" to update what will be committed)\...
{"title":"iPhone Debugging: How to resolve 'failed to get the task for process'?","tags":["xcode","provisioning","adhoc"],"question_text":"I have just added a provisioning profile to XCode (needed to support notifications and in app purchase), setup as needed the build configuration for ad hoc distribution, and tried t...
{"title":"URL to load resources from the classpath in Java","tags":["java","url","classloader"],"question_text":"In Java, you can load all kinds of resources using the same API but with different URL protocols:\n`file:\/\/\/tmp.txt\nhttp:\/\/127.0.0.1:8080\/a.properties\njar:http:\/\/www.foo.com\/bar\/baz.jar!\/COM\/fo...
{"title":"Whats the main difference between int.Parse() and Convert.ToInt32","tags":["c#"],"question_text":"I am using C#,and wanted to know the main difference between the two and which one is preferred to use while coding.","answer_text":"If you've got a string, and you expect it to always be an integer (say, if some...
{"title":"Using cURL with a username and password?","tags":["curl"],"question_text":"I want to access a URL which requires a username\/password. I'd like to try accessing it with curl. Right now I'm doing something like:\n`curl http:\/\/api.somesite.com\/test\/blah?something=123`\nI get an error. I guess I need to spec...
{"title":"How to create a GUID\/UUID using the iPhone SDK","tags":["ios","iphone","guid","uuid"],"question_text":"I want to be able to create a GUID\/UUID on the iPhone and iPad.\nThe intention is to be able to create keys for distributed data that are all unique. Is there a way to do this with the iOS SDK?","answer_te...
{"title":"SELECT INTO a table variable in T-SQL","tags":["sql-server","tsql","insert","table-variable"],"question_text":"Got a complex SELECT query, from which I would like to insert all rows into a table variable, but T-SQL doesn't allow it.\nAlong the same lines, you cannot use a table variable with SELECT INTO or IN...
{"title":"Convert Collection to List","tags":["java","list","sorting","collections","apache-commons-collection"],"question_text":"I am using\n`TreeBidiMap`\nfrom the\n`Apache Collections`\nlibrary. I want to sort this on the values which are\n`doubles`\n.\nMy method is to retrieve a\n`Collection`\nof the values using:\...
{"title":"Reset push notification settings for app","tags":["iphone","push-notification"],"question_text":"I am developing an app with push notifications. To check all possible ways of user interaction, I'd like to test my app when a user declines to have push notifications enabled for my app during the first start.\nT...
{"title":"Max size of an iOS application","tags":["ios","app-store"],"question_text":"What is the maximum size of an iOS application? any constraints?","answer_text":"4GB's is the maximum size your iOS app can be.\nAs of February 12, 2015\n(iOS only) App Size\niOS App binary files can be as large as 4 GB, but each exec...
{"title":"How do you find the row count for all your tables in Postgres","tags":["database","postgresql","count","database-table"],"question_text":"I'm looking for a way to find the row count for all my tables in Postgres. I know I can do this one table at a time with a\n`select count(*) from table_name;`\nbut I'd like...
{"title":"Find text string using jQuery?","tags":["jquery","text"],"question_text":"Say a web page has a string such as \"I am a simple string\" that I want to find. How would I go about this using JQuery?","answer_text":"jQuery has the contains method. Here's a snippet for you:\n`<script type=\"text\/javascript\">\n$(...
{"title":"How can I create a copy of an Oracle table without copying the data?","tags":["sql","oracle","copy","database-table"],"question_text":"I know the statement:\n`create table xyz_new as select * from xyz;`\nWhich copies the structure and the data, but what if I just want the structure?","answer_text":"Just use a...
{"title":"Error: Unable to run mksdcard SDK tool","tags":["java","android","android-studio"],"question_text":"Keep getting an error in the set-up wizard while trying to install android studio on Ubuntu.\n`\"Unable to run mksdcard SDK tool.\"`\nAlso, in the terminal I get this:\n`[ 115528] ERROR - tRunWizard$SetupProgre...
{"title":"In android app Toolbar.setTitle method has no effect \u00e2\u0080\u0093 application name is shown as title","tags":["android","toolbar","android-support-library"],"question_text":"I'm trying to create simple application using android-support-v7:21 library.\nCode snippets:\nMainActivity.java\n`public class Mai...
{"title":"ActionBarActivity is deprecated (Android Studio)","tags":["android","android-actionbar","deprecated"],"question_text":"Actually there is no problem. Project compiles and runs. But I can't understand what is mean strikeout class name (Android Studio tells that there is deprecated code is used)\n. Can anybody e...
{"title":"git + LaTeX workflow","tags":["git","latex"],"question_text":"I'm writing a very long document in LaTeX. I have my work computer and my laptop, and I work on them both. I need to keep all the files synchronized between the two computers, and also would like to keep a revision history. I chose git as my DVCS, ...
{"title":"Bootstrap 3 with jQuery Validation Plugin","tags":["twitter-bootstrap","jquery-validate","twitter-bootstrap-3"],"question_text":"I am trying to add validation to my form with jQuery Validation Plugin, but I'm having a problem where the plugin puts the error messages when I'm using input groups.\n`$('form').va...
{"title":"Find and Replace text in the entire table using a MySQL query","tags":["mysql","phpmyadmin"],"question_text":"Usually I use manual find to replace text in a MySQL database using phpmyadmin. I'm tired of it now, how can I run a query to find and replace a text with new text in the entire table in phpmyadmin?\n...
{"title":"Reloading submodules in IPython","tags":["python","numpy","ipython"],"question_text":"Currently I am working on a python project that contains sub modules and uses numpy\/scipy. Ipython is used as interactive console. Unfortunately I am not very happy with workflow that I am using right now, I would appreciat...
{"title":"Function to Clear the Console in R","tags":["r"],"question_text":"I am wondering if there is a function to clear the console in R, and RStudio in particular. I am looking for a function that I can type into the console, and not a keyboard shortcut.\nSomeone has already provided such a function in\nthis StackE...
{"title":"Howto: Clean a mysql InnoDB storage engine?","tags":["mysql","windows","innodb"],"question_text":"Is it possible to clean a mysql innodb storage engine so it is not storing data from deleted tables?\nOr do I have to rebuild a fresh database every time?","answer_text":"Here is a more complete answer with regar...
{"title":"Why should we typedef a struct so often in C?","tags":["c","struct","typedef"],"question_text":"I have seen many programs consisting of structures like the one below\n`typedef struct \n{\n int i;\n char k;\n} elem;\nelem user;`\nWhy is it needed so often? Any specific reason or applicable area?","answer_text"...
{"title":"How to join NSArray elements into an NSString?","tags":["cocoa","string"],"question_text":"Given an NSArray of NSStrings, is there a quick way to join them together into a single NSString (with a Separator)?","answer_text":"`NSArray * stuff = \/* ... *\/;\nNSString * combinedStuff = [stuff componentsJoinedByS...
{"title":"rails 3 validation on uniqueness on multiple attributes","tags":["ruby-on-rails","validation"],"question_text":"I use Rails 3.0.0.beta4\nI want to add a validation on uniqueness on two attributes, that means that my model is valid if the couple of\n`'recorded_at'`\nand\n`'zipcode'`\nis unique.\nOn one attribu...
{"title":"How to store printStackTrace into a string","tags":["java","stack-trace"],"question_text":"How can I get the\n`e.printStackTrace()`\nand store it into a\n`String`\nvariable?\nI want to use the string generated by\n`e.printStackTrace()`\nlater in my program.\nI'm still new to Java so I'm not too familiar with\...
{"title":"get current URL of UIWebview","tags":["iphone","url","uiwebview","request"],"question_text":"I already tried getting the current URL of my\n`UIWebView`\nwith:\n`webview.request.URL`\n.\nUnfortunately the\n`NSURL`\nwas empty. Anything wrong here? I am working with Xcode 3.2.2 beta 5.\nThe code above should be ...
{"title":"Execute a command line binary with Node.js","tags":["javascript","ruby","node.js","command-line-interface"],"question_text":"I am in the process of porting a CLI library from Ruby over to Node.js. In my code I execute several third party binaries when necessary. I am not sure how best to accomplish this in No...
{"title":"What is the standard way to add N seconds to datetime.time in Python?","tags":["python","datetime","time","math"],"question_text":"Given a\n`datetime.time`\nvalue in Python, is there a standard way to add an integer number of seconds to it, so that\n`11:34:59`\n+ 3 =\n`11:35:02`\n, for example?\nThese obvious...
{"title":"biggest integer that can be stored in a double","tags":["types","floating-point","double","ieee-754"],"question_text":"What is the biggest \"no-floating\" integer that can be stored in an IEEE 754 double type without losing precision ?","answer_text":"The biggest\/largest integer that can be stored in a doubl...
{"title":"How to set layout_gravity programmatically?","tags":["android","android-layout"],"question_text":"My question is simple,\nHow to set my buttons layout_gravity programmatically?\nI found this on internet, but it simply throws me a Nullpointer exception:\n`Button MyButton = new Button(this);\n LinearLayout.Layo...
{"title":"Which HTML Parser is the best?","tags":["java","html","parsing","html-parsing","web-scraping"],"question_text":"I code a lot of parsers. Up until now, I was using HtmlUnit headless browser for parsing and browser automation.\nNow, I want to separate both the tasks.\nAs 80% of my work involves just parsing, I ...
{"title":"Is there a short contains function for lists?","tags":["python","list","search","collections","contains"],"question_text":"I see people are using\n`any`\nto gather another list to see if an item exists in a list, but is there a quick way to just do?:\n`if list.contains(myItem):\n # do something`","answer_text...
{"title":"Get boolean from database using Android and SQLite","tags":["java","android","sqlite","boolean"],"question_text":"How can I obtain the value of a boolean field in an\nSQLite\ndatabase on Android?\nI usually use\n`getString()`\n,\n`getInt()`\n, etc. to get the values of my fields, but there does not seem to be...
{"title":"How do I loop through a date range?","tags":["c#","asp.net","datetime","loops"],"question_text":"I'm not even sure how to do this without using some horrible for loop\/counter type solution. Here's the problem:\nI'm given two dates, a start date and an end date and on a specified interval I need to take some ...
{"title":"How to convert object array to string array in Java","tags":["java","arrays","string"],"question_text":"I use the following code to convert an Object array to a String array :\n`Object Object_Array[]=new Object[100];\n\/\/ ... get values in the Object_Array\nString String_Array[]=new String[Object_Array.lengt...
{"title":"iOS Simulator failed to install the application","tags":["ios-simulator","cordova","xcode4.5"],"question_text":"I have created a Cordova 2.1.0 app, It ran fine for the first 2-3 times. But now when I am trying to run it through terminal it is giving me the following error.I didn't change anything.\n`Ankurs-Ma...
{"title":"How to change background color in android app","tags":["android"],"question_text":"I want to be able to change the background color to white in my android app in the simplest way possible.","answer_text":"You need to use the android:background property , eg\n`android:background=\"@color\/white\"`\nAlso you ne...
{"title":"Not able to access adb in OS X through Terminal, \"command not found\"","tags":["android","osx","adb"],"question_text":"I have installed Android SDK and Eclipse on my\u00c2\u00a0Mac system. I am able to program using Eclipse and have created few sample applications. But I am still not able to access\n`adb`\nt...
{"title":"CSS two divs next to each other","tags":["html","css"],"question_text":"I want to put two\n`<div>`\ns next to each other. The right\n`<div>`\nis about 200px; and the left\n`<div>`\nmust fill up the rest of the screen width? How can I do this?","answer_text":"You can use\nflexbox\nto lay out your items:\n`#par...
{"title":"Call Angular JS from legacy code","tags":["javascript","actionscript-3","externalinterface","angularjs"],"question_text":"I'm using angular to build HTML controls that interact with a legacy Flex application. All callbacks from the Flex app must be attached to the DOM window.\nFor example (in AS3)\n`ExternalI...
{"title":"Adding hours to Javascript Date object?","tags":["javascript","datetime","prototype-programming"],"question_text":"It amazes me that Javascript's Date object does not implement an add function of any kind.\nI simply want a function that can do this:\n`var now = Date.now();\nvar fourHoursLater = now.addHours(4...
{"title":"Hibernate cannot simultaneously fetch multiple bags","tags":["java","hibernate","jpa","java-persistence-api"],"question_text":"Hibernate throws this exception during SessionFactory creation:\norg.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags\nThis is my test case:\nPare...
{"title":"Getting visitors country from their IP","tags":["php","geolocation","ip","country-codes"],"question_text":"I want to get visitors country via their IP... Right now I'm using this (\nhttp:\/\/api.hostip.info\/country.php?ip=\n...... )\nHere is my code:\n`<?php\nif (isset($_SERVER['HTTP_CLIENT_IP']))\n{\n $real...
{"title":"Convert a positive number to negative in C#","tags":["c#"],"question_text":"You can convert a negative number to positive like this:\n`int myInt = System.Math.Abs(-5);`\nIs there an equivalent method to make a positive number negative?","answer_text":"How about\n`myInt = myInt * -1`","question_code":["int myI...
{"title":"Fixed position but relative to container","tags":["css","position","css-position","fixed"],"question_text":"I am trying to fix a\n`div`\nso it always sticks to the top of the screen, using:\n`position: fixed;\ntop: 0px;\nright: 0px;`\nHowever, the\n`div`\nis inside a centered container. When I use\n`position:...
{"title":"Accessing clicked element in angularjs","tags":["jquery","angularjs"],"question_text":"I'm relatively new to AngularJS and suspect I'm not grasping a concept. I'm also using Twitter Bootstrap and I've got jQuery loaded.\nWorkflow: User clicks a link from a list, \"master\" section is updated and link user cli...
{"title":"Remove a JSON attribute","tags":["javascript","json"],"question_text":"if I have a JSON object say:\n`var myObj = {'test' : {'key1' : 'value', 'key2': 'value'}}`\ncan I remove 'key1' so it becomes:\n`{'test' : {'key2': 'value'}}`","answer_text":"Simple:\n`delete myObj.test.key1;`","question_code":["var myObj ...
{"title":"HTML5 Local storage vs. Session storage","tags":["javascript","html5","local-storage","session-storage"],"question_text":"Apart from being non persistent and scoped only to the current window, are there any benefits (performance, data access, etc) to Session Storage over Local Storage?","answer_text":"`localS...
{"title":"Calculate distance between two points in google maps V3","tags":["javascript","google-maps-api-3"],"question_text":"How do you calculate the distance between two markers in Google maps V3? (Similar to the\n`distanceFrom`\nfunction inV2.)\nThanks..","answer_text":"If you want to calculate it yourself, then you...
{"title":"Reset\/remove CSS styles for element only","tags":["css"],"question_text":"I'm sure this must have been mentioned\/asked before but have been searching for an age with no luck, my terminology must be wrong!\nI vaguely remember a tweet I saw a while ago that suggested there was a css rule available that would ...
{"title":"Load Testing with AB ... fake failed requests (length)","tags":["benchmarking","load-testing","apachebench"],"question_text":"To do some load testing, for my own curiosity, on my server I ran:\n`ab -kc 50 -t 200 http:\/\/localhost\/index.php`\nThis opens up 50 keep-alive connections for 200 seconds and just s...
{"title":"Inversion of Control vs Dependency Injection","tags":["dependency-injection","inversion-of-control"],"question_text":"According to the paper written by Martin Fowler:\nhttp:\/\/martinfowler.com\/bliki\/InversionOfControl.html\n, inversion of control is the principle where the control flow of a program is inve...
{"title":"iphone Core Data Unresolved error while saving","tags":["iphone","objective-c","ios","core-data"],"question_text":"I am getting a strange error message from the core data when trying to save\nbut the problem that the error is not reproducible ( it appears at different times when doing different tasks)\nthe er...
{"title":"Difference between dispatch_async and dispatch_sync on serial queue?","tags":["ios","multithreading","grand-central-dispatch"],"question_text":"I've created a serial queue like this:\n`dispatch_queue_t _serialQueue = dispatch_queue_create(\"com.example.name\", DISPATCH_QUEUE_SERIAL);`\nWhat's the difference b...
{"title":"How to concatenate strings of a string field in a PostgreSQL 'group by' query?","tags":["sql","postgresql","group-by","string-concatenation","concat"],"question_text":"I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table:\n`ID COMPANY_ID EMPLOYEE...
{"title":"What exactly do \"u\" and \"r\" string flags do in Python, and what are raw string literals?","tags":["python","unicode","rawstring"],"question_text":"While asking\nthis question\n, I realized I didn't know much about raw strings. For somebody claiming to be a Django trainer, this sucks.\nI know what an encod...
{"title":"Getting value of select (dropdown) before change","tags":["javascript","jquery","javascript-events"],"question_text":"The thing i want to achieve is whenever the\n`<select>`\ndropdown is changed i want the value of the dropdown before change. I am using 1.3.2 version of jquery and using on change event but th...
{"title":"How does @synchronized lock\/unlock in Objective-C?","tags":["objective-c","synchronization"],"question_text":"Does @synchronized not use \"lock\" and \"unlock\" to achieve mutual exclusion? How does it do lock\/unlock then?\nThe output of the following program is only \"Hello World\".\n`@interface MyLock: NS...
{"title":"Why is \"Set as Startup\" option stored in the suo file and not the sln file?","tags":["c#","projects-and-solutions"],"question_text":"It seems like this setting should be stored in the solution file so it's shared across all users and part of source code control. Since we don't check in the suo file, each us...
{"title":"Java compiler level does not match the version of the installed Java project facet","tags":["eclipse","maven","m2eclipse"],"question_text":"I have created a New Dynamic Project under Eclipse Helios Version, where my JRE Version is set to 1.6.\nI have added Maven capabilities to the Web Application by clicking...
{"title":"Why can't dead code detection be fully solved by a compiler?","tags":["compiler-theory"],"question_text":"The compilers I've been using in C or Java have dead code prevention (warning when a line won't ever be executed). My professor says that this problem can never be fully solved by compilers though. I was ...
{"title":"Delete empty lines using SED","tags":["linux","unix","sed"],"question_text":"I am trying to delete empty lines using sed\n`sed '\/^$\/d'`\nbut i have no luck with it.\nfor example I have this lines:\n`xxxxxx\nyyyyyy\nzzzzzz`\nand i want it to be like:\n`xxxxxx\nyyyyyy\nzzzzzz`\nwhat should be the code for thi...
{"title":"Should one use < or <= in a for loop","tags":["performance","conventions","readability"],"question_text":"If you had to iterate through a loop 7 times, would you use:\n`for (int i = 0; i < 7; i++)`\nor:\n`for (int i = 0; i <= 6; i++)`\nThere are two considerations:\nperformance\nreadability\nFor performance I...
{"title":"Heavy usage of Python at Google","tags":["python"],"question_text":"Google's heavy usage of Python, is it just a matter of taste or does it give them a competitive advantage?","answer_text":"I can't really give a definitive answer, because by the time I interviewed at Google in 2004 Python was already promine...
{"title":"How do I enlarge an EER Diagram in MySQL Workbench?","tags":["mysql","mysql-workbench","eer-model"],"question_text":"I am working on a moderately complex schema in MySQL Workbench, and the single page of the EER diagram is now full up. Does anyone know how to enlarge it to two or more pages?","answer_text":"O...
{"title":"The shortest possible output from git log containing author and date","tags":["git","formatting","logging"],"question_text":"How can I show a git log output with (at least) this information:\n`* author\n* commit date\n* change`\nI want it compressed to one line per log entry. What's the shortest possible form...
{"title":"Get the last 4 characters of a string","tags":["python","string"],"question_text":"I have the following string:\n`\"aaaabbbb\"`\nHow can I get the last four characters and store them in a string using Python?","answer_text":"Like this:\n`>>>mystr = \"abcdefghijkl\"\n>>>mystr[-4:]\n'ijkl'`\nThis slices the str...
{"title":"How do you force a makefile to rebuild a target","tags":["c++","linux","makefile"],"question_text":"I have a makefile that builds and then calls another makefile. Since this makefile calls more makefiles that does the work it doesnt really change. Thus it keeps thinking the project is built and upto date.\n`d...
{"title":"How do I find the caller of a method using stacktrace or reflection?","tags":["java","stack-trace"],"question_text":"I need to find the caller of a method. Is it possible using stacktrace or reflection?","answer_text":"`StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace()`\nAccordin...
{"title":"How do I group Windows Form radio buttons?","tags":["c#",".net","winforms","radio-button"],"question_text":"How can I group the radio buttons in Windows Form application (a lot like ASP.NET's radiobuttonlist!)?\nSo I can switch between each case chosen from the options.","answer_text":"Put all radio buttons f...
{"title":"Can my enums have friendly names?","tags":["c#","enums"],"question_text":"I have the following\n`enum`\n`public enum myEnum\n{\n ThisNameWorks, \n This Name doesn't work\n Neither.does.this;\n}`\nIs it not possible to have\n`enum`\ns with \"friendly names\"?","answer_text":"You could use the\n`Description`\na...
{"title":"How to make a transparent UIWebView","tags":["ios","iphone","cocoa-touch","uiwebview"],"question_text":"I have an app with a\n`UITableView`\nand a corresponding detail view for each row. In the detail view I have to display some text and a background image (text is different for each row, but the image remain...
{"title":"Django: When saving, how can you check if a field has changed?","tags":["django","image","caching","django-models"],"question_text":"In my model I have :\n`class Alias(MyBaseModel):\n remote_image = models.URLField(max_length=500, null=True, help_text=\"A URL that is downloaded and cached for the image. Only\...