text
stringlengths
74
309k
{"title":"Why does i|= j|= k|= (j+= i) - - (k+++k) - - (i =+j) == 11?","tags":["java","operators","operator-precedence"],"question_text":"I came across this code in a project I have started working on. The original developer is no longer available, and I can't make any sense of it.\n`k = (j = (i = 0) + 2) + 1;\nreturn ...
{"title":"Using .NET, how can you find the mime type of a file based on the file signature not the extension","tags":["c#","mime","mime-types"],"question_text":"I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to\nthis question\nonly in .Net.","answe...
{"title":"Specify pane percentage in tmuxinator project","tags":["tmux","tmuxinator"],"question_text":"How can I specify a pane percentage in tmuxinator ?\nEg:\n`project_name: ad_dev\n project_root: ~\/Programming\/WWW\/Rails\/projects\/ApparelDreamDev\n rvm: ruby-1.9.2-p290@apparel_dev\n pre: SQL\n tabs:\n - editor:\n...
{"title":"Convert an int to ASCII character","tags":["c++","c","ascii"],"question_text":"I have\n`int i = 6;`\nand I want\n`char c = '6'`\nby conversion. Any simple way to suggest?\nEDIT:\nalso i need to generate a random number, and convert to a char, then add a '.txt' and access it in an ifstream.","answer_text":"Str...
{"title":"What's so bad about Template Haskell?","tags":["haskell","template-haskell"],"question_text":"It seems that Template Haskell is often viewed by the Haskell community as an unfortunate convenience. It's hard to put into words exactly what I have observed in this regard, but consider these few examples\nTemplat...
{"title":"Undo part of unstaged changes in git","tags":["git"],"question_text":"How do I undo parts of my unstaged changes in git but keep the rest as unstaged? The way I figured out is:\n`git commit --interactive\n# Choose the parts I want to delete\n# Commit the changes\ngit stash\ngit rebase -i master # (I am an anc...
{"title":"How to create a custom exception type in Java?","tags":["java","exception"],"question_text":"Possible Duplicate:\nHow can I write an Exception by myself?\nI would like to create a custom exception in Java, how do I do it?\n`...\ntry{\n...\nString word=reader.readLine();\nif(word.contains(\" \"))\n \/*create c...
{"title":"How to display a dynamically allocated array in the Visual Studio debugger?","tags":["c++","c","visual-studio","debugging"],"question_text":"If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements. However, if you have an array allocated dynamically an...
{"title":"Changing 'ic_launcher.png' in Android Studio","tags":["icons","android-studio"],"question_text":"When one first creates a new project, that dialog lets you point\nto some external .PNG file, and then when that dialog completes,\nit generates 4 different pixel-sizes of images for use as\na launcher-icon.\nMy q...
{"title":"View all TODO items in Visual Studio using Ghostdoc","tags":["c#","visual-studio-2008","todo","ghostdoc"],"question_text":"I'm also using\nGhostDoc\nin Visual Studio 2008. How do I view all to-do items and if that's a function already in Visual Studio or in GhostDoc (documentation tool that I use)?","answer_t...
{"title":"Fastest way to check if string contains only digits","tags":["c#"],"question_text":"I know a few ways how to check this.\nregex,\n`int.parse`\n,\n`tryparse`\n,looping.\ncan anyone tell me what is the fastest way to check?\nthe need is to only\nCHECK\nno need to actually parse.\nthis is not the same question a...
{"title":"Intent.EXTRA_EMAIL not populating the To field","tags":["android","android-intent"],"question_text":"I am trying to use an\nintent\nto send an email from my application but the To field of the email will not populate. If I add code to fill in the subject or text, they work fine. Just the To field will not pop...
{"title":"Short form for Java If statement","tags":["java","if-statement","ternary-operator","short"],"question_text":"I know there is a way for writing java if statement in short form\n`if (city.getName() != null) {\n name = city.getName();\n} else {\n name=\"N\/A\";\n}`\ndoes anyone know how to write short form for a...
{"title":"How to hide uitabbarcontroller","tags":["iphone","ios","uitabbarcontroller"],"question_text":"I have a problem with\n`UITabBarController`\n. In my application, I want to hide it but without using\n`hidesBottomBarWhenPushed`\nbecause I want to hide it not when I pushed it. For Example, I want to hide it when I...
{"title":"CMake tutorial","tags":["cmake","fortran"],"question_text":"Can anyone provide link(s) to good CMake tutorial except very expensive and hard-to-get\nofficial one\n?\nEspecially interesting in using CMake for Fortran projects but will be grateful for any good tutorial.\nUpdate.\nWhat I already found is\nCMake ...
{"title":"PHP MYSQL UPDATE if Exist or INSERT if not?","tags":["php","mysql"],"question_text":"I have no idea if this is even remotely correct. I have a class where I would like to update the database if the fields currently exist or insert if they do not. The complication is that I am doing a joining 3 tables (set_col...
{"title":"Android studio: new project vs new module","tags":["android","android-studio"],"question_text":"Android Studio uses the concept of\n`modules`\n, whereas other IDEs like Eclipse use\n`projects`\n.\nHowever AS\n`File`\nmenu has the option to create a\n`New Module`\nas well as a\n`new Project`\n.\nWhat are the d...
{"title":"Python3 error: \"Import error: No module name urllib2\"","tags":["python","python-3.x","urllib2"],"question_text":"Here's my code:\n`import urllib2.request\nresponse = urllib2.urlopen(\"http:\/\/www.google.com\")\nhtml = response.read()\nprint(html)`\nAny help?","answer_text":"As stated in the urllib2 documen...
{"title":"How to format a phone number with jQuery","tags":["javascript","jquery"],"question_text":"I'm currently displaying phone numbers like\n`2124771000`\n. However, I need the number to be formatted in a more human-readable form, for example:\n`212-477-1000`\n. Here's my current\n`HTML`\n:\n`<p class=\"phone\">212...
{"title":"How does a UILabel's minimumScaleFactor work?","tags":["ios","objective-c","uilabel"],"question_text":"I have used\n`minimumFontSize`\nbefore but that function is now deprecated and i don't quite understand how\n`minimumScaleFactor`\nworks.\nI want the maximum font size to be 10 and the minimum to be 7.\nHow ...
{"title":"Remove xticks in a matplot lib plot?","tags":["python","matplotlib","plot"],"question_text":"I have a semilogx plot and I would like to remove the xticks. I tried :\n`plt.gca().set_xticks([])\nplt.xticks([])\nax.set_xticks([])`\nThe grid disappear (ok), but small ticks (at the place of the main ticks) remain....
{"title":"How to detect the physical connected state of a network cable\/connector?","tags":["linux","networking","connection","detection"],"question_text":"In a Linux environment, I need to detect the physical connected or disconnected state of an RJ45 connector to its socket. Preferably using BASH scripting only.\nTh...
{"title":"MySQL - Make an existing Field Unique","tags":["mysql","unique-constraint"],"question_text":"I have an already existing table with a field that should be unique but is not. I only know this because an entry was made into the table that had the same value as another, already existing, entry and this caused pro...
{"title":"Why is the amount of visibility on methods and attributes important?","tags":["php","oop","visibility","encapsulation"],"question_text":"Why shouldn't one leave all methods and attributes accessible from anywhere (i.e.\n`public`\n)?\nCan you\ngive me an example\nof a problem I can run into if I declared an at...
{"title":"creating private class method","tags":["ruby","access-specifier"],"question_text":"How come this approach of creating a private class method works:\n`class Person\n def self.get_name\n persons_name\n end\n class << self\n private\n def persons_name\n \"Sam\"\n end\n end\nend\nputs \"Hey, \" + Person.get_name\...
{"title":"Can't clone a github repo on Linux via HTTPS","tags":["linux","git","github"],"question_text":"I'm trying to do a simple\n`git clone https:\/\/github.com\/org\/project.git`\non a CentOS box but get:\nerror: The requested URL returned error: 401 while accessing\nhttps:\/\/github.com\/org\/project.git\/info\/re...
{"title":"PHP - add item to beginning of associative array","tags":["php"],"question_text":"How can I add an item to the beginning of an associative array? For example, say I have an array like this:\n`$arr = array('key1' => 'value1', 'key2' => 'value2');`\nWhen I add something to it as in\n`$arr['key0'] = 'value0';`\n...
{"title":"Valid email address regular expression?","tags":["ruby","regex","validation","email"],"question_text":"I have done some testing but I wanted to ask if anyone sees a problem with this ruby regular expression for email validation:\n`\/\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\Z\/i`\nLook good?\nThanks,\nTony...
{"title":"Chrome rendering issue. Fixed position anchor with UL in body","tags":["html","css","google-chrome","rendering"],"question_text":"There is a rendering issue with Google Chrome and Opera (why?=) with such code:\n`<html>\n<style>\n #content {\n width: 150px;\n background: gray;\n }\n #sidebar {\n position: fixe...
{"title":"Android: Vertical ViewPager","tags":["android","android-viewpager"],"question_text":"Is there a way to make a\n`ViewPager`\nthat does not scroll horizontally, but vertically?!","answer_text":"You can use a\nViewPager.PageTransformer\nto give the illusion of a vertical\n`ViewPager`\n. To achieve scrolling with...
{"title":"AngularJS - Trigger when radio button is selected","tags":["angularjs"],"question_text":"I searched and tried many ng-xxxx kind of options but couldn't find the one..\nI just want to call some function in the controller when radio button is selected.\nSo it might be similar to following..(Of course, below cod...
{"title":"ImportError: No module named BeautifulSoup","tags":["python","beautifulsoup"],"question_text":"I have installed BeautifulSoup using easy_install and trying to run following script\n`from BeautifulSoup import BeautifulSoup\nimport re\ndoc = ['<html><head><title>Page title<\/title><\/head>',\n '<body><p id=\"fi...
{"title":"Passing a String by Reference in Java?","tags":["java","c","string","pass-by-reference","pass-by-value"],"question_text":"I am used to doing the following in\n`C`\n:\n`void main() {\n String zText = \"\";\n fillString(zText);\n printf(zText);\n}\nvoid fillString(String zText) {\n zText += \"foo\";\n}`\nAnd th...
{"title":"Pure virtual destructor in C++","tags":["c++","polymorphism","destructor","pure-virtual"],"question_text":"Is it wrong to write:\n`class A {\npublic:\n virtual ~A() = 0;\n};`\nfor an abstract base class?\nAt least that compiles in MSVC... Will it crash at run time?","answer_text":"Yes. You also need to implem...
{"title":"How to use mongoimport to import csv","tags":["mongodb","csv","import","mongoimport"],"question_text":"Trying to import a CSV with contact information:\n`Name,Address,City,State,ZIP \nJane Doe,123 Main St,Whereverville,CA,90210 \nJohn Doe,555 Broadway Ave,New York,NY,10010`\nRunning this doesn't seem to add a...
{"title":"Is there an easy way to attach source in Eclipse?","tags":["java","eclipse"],"question_text":"I'm a big fan of the way Visual Studio will give you the comment documentation \/ parameter names when completing code that you have written and ALSO code that you are referencing (various libraries\/assemblies).\nIs...
{"title":"In Unix, how do you remove everything in the current directory and below it?","tags":["bash","unix","directory","subdirectory","delete-directory"],"question_text":"I know this will delete everything in a subdirectory and below it:\n`rm -rf <subdir-name>`\nBut how do you delete everything in the current direct...
{"title":"Visual Studio Post Build Event - Copy to Relative Directory Location","tags":["visual-studio","visual-studio-2008","post-build-event"],"question_text":"On a successful build, I wish to copy the contents of the output directory to a different location under the same\n\"base\"\nfolder. This parent folder is a r...
{"title":"Latest 'pip' fails with \"requires setuptools >= 0.8 for dist-info\"","tags":["python","pip","setuptools","python-wheel"],"question_text":"Using the recent (1.5) version of\n`pip`\n, I get an error when attempting to update several packages. For example,\n`sudo pip install -U pytz`\nresults in failure with:\n...
{"title":"Count how many files in directory php","tags":["php","file","count","directory"],"question_text":"I'm working on a slightly new project. I wanted to know how to make it so it counts how many files are in a certain directory.\n`<div id=\"header\">\n<?php \n $dir = opendir('uploads\/'); # This is the directory ...
{"title":"CSS - Border only inside the table","tags":["html","css","xhtml","table","border"],"question_text":"I am trying to figure out how to add border only inside the table. When I do:\n`table {\n border: 0;\n}\ntable td, table th {\n border: 1px solid black;\n}`\nThe border is around the whole table and also betwee...
{"title":"What is the difference between int, Int16, Int32 and Int64?","tags":["c#",".net"],"question_text":"What is the difference between\n`int`\n,\n`System.Int16`\n,\n`System.Int32`\nand\n`System.Int64`\nother than their sizes?","answer_text":"Each type of integer has a different range of storage capacity\n`Type Cap...
{"title":"Django: show\/log ORM sql calls from python shell","tags":["django","orm"],"question_text":"Using the excellent\nDjango-Devserver\nI'm finding all kinds of interesting and unexpected SQL calls in my code. I wanted to find where the calls are coming from, and so I'm looking for a way to get a log or print-out ...
{"title":"Linker errors when trying to install new Google Analytics 3.0 Beta","tags":["ios","google-analytics","google-analytics-api"],"question_text":"I believe just today Google released a new update to their iOS Analytics frame work (version 3.0). When I follow the instructions and try to run the code, I get:\nUndef...
{"title":"C# List<> Sort by x then y","tags":["c#",".net","sorting"],"question_text":"Similar to\nList<> OrderBy Alphabetical Order\n, we want to sort by one element, then another. we want to achieve the functional equivalent of\n`SELECT * from Table ORDER BY x, y`\nWe have a class that contains a number of sorting fun...
{"title":"What is so evil about a Flash based website?","tags":["html","flash","silverlight"],"question_text":"I have the feeling that\nFlash\n-based ( or\nSilverlight\n-based) websites are generally frowned upon, except when you are creating games or multimedia-content rich applications. Why this is so?","answer_text"...
{"title":"How do I convert a string to a double in Python?","tags":["python"],"question_text":"I would like to know how to convert a string containing digits to a double.","answer_text":"`>>> x = \"2342.34\"\n>>> float(x)\n2342.3400000000001`\nThere you go. Use float (which is almost always a C double).","question_code...
{"title":"How to define a function in ghci across multiple lines?","tags":["haskell","ghci"],"question_text":"I'm trying to define any simple function that spans multiple lines in ghci, take the following as an example:\n`let abs n | n >= 0 = n\n | otherwise = -n`\nSo far I've tried pressing Enter after the first line:...
{"title":"Rename an environment with virtualenvwrapper","tags":["python","virtualenv","virtualenvwrapper"],"question_text":"I have an environment called\n`doors`\nand I would like to rename it to\n`django`\nfor the\nvirtualenvwrapper\n.\nI've noticed that if I just rename the folder\n`~\/.virtualenvs\/doors`\nto\n`djan...
{"title":"How to change shape color dynamically?","tags":["android","android-layout","xamarin.android","shape"],"question_text":"I have\n`<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n android:shape=\"rectangle\">\n <solid\n android:color=\"#FFFF00...
{"title":"Javascript : Send JSON Object with Ajax?","tags":["javascript","ajax","json","header","request"],"question_text":"Is this possible?\n`xmlHttp.send({\n \"test\" : \"1\",\n \"test2\" : \"2\",\n});`\nMaybe with: a header with\n`content type`\n:\n`application\/json`\n?:\n`xmlHttp.setRequestHeader('Content-Type', ...
{"title":"How exactly to use Notification.Builder","tags":["android","api","android-studio","notifications","deprecated"],"question_text":"I found that I am using a deprecated method for noficitations (notification.setLatestEventInfo())\nIt says to use Notification.Builder.\nHow do I use it?\nWhen I try to create a new...
{"title":"Twitter Bootstrap 3 Sticky Footer","tags":["html","css","twitter-bootstrap","twitter-bootstrap-3"],"question_text":"Good morning, I have been using the twitter bootstrap framework for quite a while now and they recently updated to version 3!\nI'm having trouble getting the sticky footer to stick to the bottom...
{"title":"notifyDataSetChange not working from custom adapter","tags":["android","listview","baseadapter","notifydatasetchanged"],"question_text":"When I repopulate my\n`ListView`\n, I call a specific method from my\n`Adapter`\n.\nProblem\n:\nWhen I call\n`updateReceiptsList`\nfrom my\n`Adapter`\n, the data is refreshe...
{"title":"Get PHP class property by string","tags":["php","string"],"question_text":"How do I get a property in a PHP based on a string? I'll call it\n`magic`\n. So what is\n`magic`\n?\n`$obj->Name = 'something';\n$get = $obj->Name;`\nwould be like...\n`magic($obj, 'Name', 'something');\n$get = magic($obj, 'Name');`","...
{"title":"Rebuild IntelliJ project indexes","tags":["intellij-idea"],"question_text":"IntelliJ IDEA 10.5.1 is reporting zero usages for all method, classes etc.\nCan I force IntelliJ to rebuild the project indexes?","answer_text":"File -> Invalidate caches...\n(Force rebuild of all caches and indices on next startup)\n...
{"title":"Android: Proper Way to use onBackPressed()","tags":["android"],"question_text":"I wrote a piece of code that will give the user a prompt asking them to press back again if they would like to exit. I currently have my code working to an extent but I know it is written poorly and I assume there is a better way ...
{"title":"Eclipse returns error message \"Java was started but returned exit code = 1\"","tags":["java","eclipse","error-handling"],"question_text":"I just downloaded and dearchived android SDK for Windows. I`m currently using W8 64x.","answer_text":"The error message points to a problem with your java Version. Do you ...
{"title":"Replace duplicate spaces with a single space in T-SQL","tags":["sql-server","tsql"],"question_text":"I need to ensure that a given field does not have more than one space (I am not concerned about all white space, just space) between characters.\nSo\n`'single spaces only'`\nneeds to be turned into\n`'single s...
{"title":"How to take the first N items from a generator or list in Python?","tags":["python","list","generator"],"question_text":"With\nlinq\nI would\n`var top5 = array.Take(5);`\nHow to do this with Python?","answer_text":"Slicing a list\n`top5 = array[:5]`\nTo slice a list, there's a simple syntax:\n`array[start:sto...
{"title":"Python Requests throwing up SSLError","tags":["python","ssl","python-requests","urllib3"],"question_text":"I'm working on a simple script that involves CAS, jspring security check, redirection, etc. I would like to use Kenneth Reitz's python requests because it's a great piece of work! However, CAS requires g...
{"title":"Simple basic explanation of a Distributed Hash Table (DHT)","tags":["theory","p2p","dht"],"question_text":"Could any one give an explanation on how a DHT works?\nNothing too heavy, just the basics.","answer_text":"Ok, they're fundamentally a pretty simple idea. A DHT gives you a dictionary-like interface, but...
{"title":"Correct mime type for .mp4","tags":["video","html5-video","mime-types"],"question_text":"I have two applications as mentioned below:\nAdmin application through which I am able to upload a .mp4 file to the server.\nI am trying to download the .mp4 using mobile application in iPad.\nThe Admin application is mad...
{"title":"Why doesn't Console.Writeline, Console.Write work in Visual Studio Express?","tags":["c#","visual-studio-2010"],"question_text":"I just open a console application and I type\n`Console.WriteLine(\"Test\");`\nBut the output window doesn't show this. I go to the output window with Ctrl+W,O\nBut nothing shows up ...
{"title":"wget download with multiple simultaneous connections","tags":["download","wget"],"question_text":"I'm using wget to download website content, but wget downloads the files one by one.\nHow can I make wget download using 4 simultaneous connections?","answer_text":"use the aria2 :\n`aria2c -x 16 [url]\n# |\n# |\...
{"title":"How to delete object from array inside foreach loop?","tags":["php","foreach","unset","arrays"],"question_text":"I iterate through an array of objects and want to delete one of the objects based on it's 'id' property, but my code doesn't work.\n`foreach($array as $element) {\n foreach($element as $key => $val...
{"title":"Why does viewWillAppear not get called when an app comes back from the background?","tags":["iphone","objective-c","viewwillappear"],"question_text":"I'm writing an app and I need to change the view if the user is looking at the app while talking on the phone.\nI've implemented the following method:\n`- (void...
{"title":"Create a devise user from Ruby console","tags":["ruby-on-rails","ruby","devise"],"question_text":"Any idea on how to create and save a new User object with devise from the ruby console?\nWhen I tried to save it, I'm getting always false. I guess I'm missing something but I'm unable to find any related info.",...
{"title":"Remove carriage return in Unix","tags":["unix","carriage-return"],"question_text":"What is the simplest way to remove all the carriage returns\n`\\r`\nfrom a file in Unix?","answer_text":"I'm going to assume you mean carriage returns (\n`\"\\r\", 0x0d`\n) at the ends of lines rather than just blindly within a...
{"title":"How to change the floating label color of TextInputLayout","tags":["android","android-edittext","android-design-library"],"question_text":"With reference to the new TextInputLayout released by Google, how do I change the floating label text color?\nSetting colorControlNormal, colorControlActivated, colorContr...
{"title":"Hidden features of JSP\/Servlet","tags":["jsp","servlets"],"question_text":"I am interested in your tricks etc used when writing JSP\/Servlet. I will start:\nI somewhat recently found out how you can include the output of one JSP tag in an attribute of another tag:\n`<c:forEach items=\"${items}\">\n <jsp:attr...
{"title":"android:actionBarStyle requires API level 11","tags":["android","android-actionbar","actionbarsherlock"],"question_text":"While using the\n`ActionBarSherlock`\nin xml at:\n`<item name=\"android:actionBarStyle\">@style\/Widget.Styled.ActionBar<\/item>`\nI got this error:\n`android:actionBarStyle requires API l...
{"title":"MySQL: determine which database is selected?","tags":["mysql"],"question_text":"After calling\n`mysql_select_db`\nto grab a database, is there any way to later output the name of the database that is currently selected? This seems very basic but I couldn't find anything on php.net or stackoverflow (all result...
{"title":"Filtering fiddler to only capture requests for a certain domain","tags":["c#",".net","windows","fiddler"],"question_text":"I'm not sure how to modify the CustomRules.js file to only show requests for a certain domain.\nDoes anyone know how to accomplish this?","answer_text":"This is easy to do.\nOn the filter...
{"title":"design a stack such that getMinimum( ) should be O(1)","tags":["algorithm","language-agnostic","data-structures","stack"],"question_text":"This is one of an interview question. You need to design a stack which holds an integer value such that getMinimum() function should return the minimum element in the stac...
{"title":"Really PHP? \"Argument 1 passed to my_function() must be an instance of string, string given\"","tags":["php","types","type-hinting"],"question_text":"`function phpwtf(string $s) {\n echo \"$s\\n\";\n}\nphpwtf(\"Type hinting is da bomb\");`\nCatchable fatal error: Argument 1 passed to phpwtf() must be an inst...
{"title":"Configuring IntelliJ IDEA for unit testing with JUnit","tags":["unit-testing","junit","intellij-idea"],"question_text":"I decided to try out IntelliJ this morning via the trial version and installed the JUnit plugin. I made a new Java project and I want to write a test case for it.\nHow do I add the junit.jar...
{"title":"How to get a single column's values into an array","tags":["ruby-on-rails","ruby","ruby-on-rails-3"],"question_text":"Right now I'm doing something like this to select a single column of data:\n`points = Post.find_by_sql(\"select point from posts\")`\nThen passing them to a method, I'd like my method to remai...
{"title":"Stop Safari Mobile from giving input buttons rounded corners","tags":["ios","mobile-safari"],"question_text":"I guess the subject says it all. I have a web application when viewed on an Iphone, Ipod or Ipad, input submit buttons have rounded corners. Is there a way to stop this?","answer_text":"If you add...\...
{"title":"How to prevent moment.js from loading locales with webpack?","tags":["javascript","gulp","momentjs","webpack"],"question_text":"Hello is there anyway you can stop moment.js from loading all the locales(I just need english) when your using webpack? I'm looking at the source it seems that if hasModule is define...
{"title":"How to remove duplicate values from an array in PHP","tags":["php","arrays","duplicate-data"],"question_text":"How can I remove duplicate values from an array in PHP?","answer_text":"Use\narray_unique()\n.\nExample:\n`$array = array(1, 2, 2, 3);\n$array = array_unique($array); \/\/ Array is now (1, 2, 3)`","q...
{"title":"How can I convert an Integer to localized month name in Java?","tags":["java","date","locale"],"question_text":"I get an integer and I need to convert to a month names in various locales:\nExample for locale en-us:\n1 -> January\n2 -> February\nExample for locale es-mx:\n1 -> Enero\n2 -> Febrero","answer_text...
{"title":"Sleep\/Pause\/Wait in Javascript","tags":["javascript","sleep"],"question_text":"Possible Duplicate:\nJavascript sleep\nIs there a javascript function that simulates the operation of function 'sleep' in PHP?\nA function 'sleep' to pause code execution on x milliseconds, and then resume where it left off.\nThe...
{"title":"UISlider with increments of 5","tags":["iphone","ios","uislider"],"question_text":"How do I have my\n`UISlider`\ngo from\n`1-100`\nin increments of\n`5`\n?","answer_text":"Add a target like this:\n`slider.continuous = YES;\n[slider addTarget:self\n action:@selector(valueChanged:) \n forControlEvents:UIControl...
{"title":"Scaling node.js","tags":["node.js","scalability"],"question_text":"I'm fairly new to large-scale server-side development. I want to write a server using node.js, but before I forge ahead I'd like to know what the general principles are for scaling node up to, say, 20 queries per second.\nThe service I'm writi...
{"title":"Java: Why charset names are not constants?","tags":["java","character-encoding"],"question_text":"Charset issues are confusing and complicated by themselves, but on top of that you have to remember exact names of your charsets. Is it\n`\"utf8\"`\n? Or\n`\"utf-8\"`\n? Or maybe\n`\"UTF-8\"`\n? When searching in...
{"title":"Auto-wiring a List using util schema gives NoSuchBeanDefinitionException","tags":["java","spring"],"question_text":"I have a bean that i want to inject with a named list using Spring util namespace\n`<util:list id=\"myList\">`\nbut Spring is looking for a collection of beans of type String instead. My broken ...
{"title":"When should I use Arrow functions in ECMAScript 6?","tags":["javascript","lambda","ecmascript-6","ecmascript-harmony","arrow-functions"],"question_text":"The question is directed at people who have thought about code style in the context of the upcoming ECMAScript 6 (Harmony) and who have already worked with ...
{"title":"Appending NSDictionary to other NSDictionary","tags":["objective-c","ios","uitableview","nsdictionary"],"question_text":"I have one\n`NSDictionary`\nand it loads up\n`UITableView`\n. If a user scrolls more and more, I call API and pull new data. This data is again in the form of an\n`NSDictionary`\n. Is it po...
{"title":"In Vim\/Vi, how do you move the cursor to the end of the previous word?","tags":["vim","vi"],"question_text":"In Vim's normal mode:\ne\ngoes to the end of the next word\nw\ngoes to the beginning of the next word\nb\ngoes to the beginning of the previous word\nHow do you move the cursor to the\nend\nof the\npr...
{"title":"What effect(s) can the virtual keyword have in Entity Framework 4.1 POCO Code First?","tags":["entity-framework-4","ef-code-first","entity-framework-4.1"],"question_text":"The\n`virtual`\nkeyword has an effect when used on properties in EF Code First. Can someone describe all its ramifications in different si...
{"title":"How to only get file name with linux `find`?","tags":["linux","shell","find"],"question_text":"I'm using find to all files in directory, so I get a list of paths. However, I need only file names. i.e. I get\n`.\/dir1\/dir2\/file.txt`\nand I want to get\n`file.txt`","answer_text":"In GNU\n`find`\nyou can use\n...
{"title":"How to get execution time in rails console?","tags":["sql","ruby-on-rails","time","console"],"question_text":"I want compare time of execution\n`Post.all`\nand\n`SELECT * FROM posts`\n(or some other statements) How can i get execution time of\n`Post.all`\n?","answer_text":"`timing = Benchmark.measure { Post.a...
{"title":"log4j: Log output of a specific class to a specific appender","tags":["java","log4j","logging","appender"],"question_text":"I use log4j and would like to route the output of certain Loggers to specific files.\nI already have multiple appenders in place. Now, to make debugging easier, I want to tell log4j that...
{"title":"How can you list the matches of Vim's search?","tags":["search","vim"],"question_text":"I would like to list the matches, when I hit:\n`\/example`\nso that I see where all matches are at once.","answer_text":"`:g\/\/p`\nIn its longer form:\n`:global\/regular-expression\/print`\nYou can leave out the pattern\/...
{"title":"Maven check for updated dependencies in repository","tags":["maven-2","version","dependencies"],"question_text":"Is there a Maven plugin that allows you to check if there are newer versions of dependencies available in the repository?\nSay, you are using dependency X with version 1.2. Now a new version of X i...
{"title":"Unknown provider: $modalProvider <- $modal error with AngularJS","tags":["javascript","angularjs","modal-dialog"],"question_text":"I keep receiving this error as I'm trying to implement bootstrap Modal window. What could be the cause of it? I've copy\/pasted everything from\nhttp:\/\/angular-ui.github.io\/boo...
{"title":"How to escape a JSON string to have it in a URL?","tags":["javascript","jquery","json","url","escaping"],"question_text":"Using Javascript, I want to generate a link to a page. The parameters to the page are in a Javascript array that I serialize in JSON.\nSo I would like to generate a URL like that :\n`http:...
{"title":"How can I download all emails with attachments from Gmail?","tags":["java","python","perl","gmail"],"question_text":"How do I connect to Gmail and determine which messages have attachments? I then want to download each attachment, printing out the Subject: and From: for each message as I process it.","answer_...
{"title":"Is there an insertion order preserving Set that also implements List?","tags":["java","collections"],"question_text":"I'm trying to find an implementation of\n`java.util.List`\nand\n`java.util.Set`\nat the same time in Java. I want this class to allow only unique elements (as\n`Set`\n) and preserve their orde...