text
stringlengths
74
309k
{"title":"string.LastIndexOf() Bug?","tags":["c#","string","indexof"],"question_text":"does anyone know why:\n`\" <exception>\".LastIndexOf(\"<\",0) returns -1 (wrong)`\nwhile\n`\" <exception>\".LastIndexOf(\"<\") returns 2 (right)`\nand\n`\"<exception>\".LastIndexOf(\"<\",0) returns 0 (right)`\nIs this a bug or am I m...
{"title":"MongoDB: locale::facet::_S_create_c_locale name not valid","tags":["mongodb","ubuntu","locale"],"question_text":"I got this error message when trying to start\n`mongod`\n:\n`Tue Oct 29 21:33:23.589 [initandlisten] exception in initAndListen std::exception: locale::facet::_S_create_c_locale name not valid, ter...
{"title":"Curl and PHP - how can I pass a json through curl by PUT,POST,GET","tags":["php","post","curl","get","put"],"question_text":"I have been working on building an Rest API for the hell of it and I have been testing it out as I go along by using curl from the command line which is very easy for CRUD\nI can succes...
{"title":"With a browser, how do I know which decimal separator does the client use?","tags":["html","internationalization","locale"],"question_text":"I'm developing a web application.\nI need to display some decimal data correctly so that it can be copied and pasted into a certain\n`GUI`\napplication that is not under...
{"title":"What's the shortest way to count the number of items in a generator\/iterator?","tags":["python","iterator","generator","iterable"],"question_text":"If I want the number of items in an iterable without caring about the elements themselves, what would be the pythonic way to get that? Right now, I would define\...
{"title":"Application Loader Warning - Resulting API Analysis File is too large","tags":["ios","iphone","xcode","itunesconnect","application-loader"],"question_text":"I am getting a strange error when I submit my application via application loader tool.\nThe resulting API analysis file is too large. We were unable to\n...
{"title":"DbContext is very slow when adding and deleting","tags":["entity-framework","dbcontext"],"question_text":"When using DbContext in a database-first scenario I found out that adding and deleting entities is very slow compared to ObjectContext. If adding 2000 entities and saving the changes at the end, DbContext...
{"title":"What MIME type if JSON is being returned by a REST API?","tags":["json","api","http","rest","mime-types"],"question_text":"My REST API returns JSON.\nI'm currently returning text\/plain as the MIME type, but it feels funny.\nShould I be returning\n`application\/x-javascript`\nor some other type?\nThe second q...
{"title":"Error when install pylibmc using pip","tags":["python","memcached","osx-lion","libmemcached"],"question_text":"Hello when I attempt to install pylibmc on OSX Lion using pip I get the following error:\n`.\/_pylibmcmodule.h:42:10: fatal error: 'libmemcached\/memcached.h' file not found\n#include <libmemcached\/...
{"title":"How to install a windows service programmatically in C#?","tags":["c#",".net","windows-services","setup-project","visual-studio-setup-proje"],"question_text":"I have 3 projects in my VS solution. 1 is a web app, the other is a windows service and the last one a setup project for my web app.\nWhat i want is by...
{"title":"Is there any way to detect if a database table exists with Laravel","tags":["php","laravel"],"question_text":"I want to be able to create a table using\n`Schema::create('mytable',function($table)\n{\n $table->increments('id');\n $table->string('title');\n});`\nBut before that I would like to check if the tabl...
{"title":"Groovy write to file (newline)","tags":["file-io","groovy"],"question_text":"I created a small function that simply writes text to a file, but I am having issues making it write each piece of information to a new line. Can someone explain why it puts everything on the same line?\nHere is my function:\n`public...
{"title":"UserScripts & Greasemonkey: calling a website's JavaScript functions","tags":["javascript","google-chrome-extension","greasemonkey","userscripts"],"question_text":"I'm creating a UserScript extension for Firefox & Chrome and I'm trying to use some of the code in the website's JavaScript, e.g.:\n`function: myF...
{"title":"What is ECMAScript?","tags":["javascript"],"question_text":"In Visual Studio when I am setting my script type to JavaScript this comes up as an option in intellisense.\nA quick Google search came up with lame results, leading me to believe this isn't terribly popular to use.\nWhat is it?\nDoes anyone use it?\...
{"title":"Can I (re-) map commands in vim?","tags":["vim"],"question_text":"I love vim and the speed it gives me. But sometimes, my fingers are too speedy and I find myself typing \":WQ\" instead of \":wq\" (on a German keyboard, you have to press shift to get the colon). Vim will then complain that 'W' is not an edito...
{"title":"Why is there no implicit parallelism in Haskell?","tags":["haskell","concurrency","parallel-processing","compiler-optimization"],"question_text":"Haskell is functional and pure, so basically it has all the properties needed for a compiler to be able to tackle\nimplicit parallelism\n.\nConsider this trivial ex...
{"title":"Android - How to animate an activity transition when the default back button is pressed","tags":["android","animation","button","transition","back"],"question_text":"In my activity, I have a button with the following click listener that is working great:\n`final ImageButton startOverButton = (ImageButton) fin...
{"title":"Iterable objects and array type hinting?","tags":["php","iterator","type-hinting"],"question_text":"I have a lot of functions that either have type hinting for arrays or use\n`is_array()`\nto check the array-ness of a variable.\nNow I'm starting to use objects that are iterable. They implement\n`Iterator`\nor...
{"title":"django for loop counter break","tags":["python","django","for-loop"],"question_text":"This is hopefully a quick\/easy one. I know a way to work around this via a custom template tag, but I was curious if there were other methods I was over looking. I've created a gallery function of sorts for my blog, and I h...
{"title":"Multiple Functions as Arguments in CoffeeScript","tags":["jquery","syntax","coffeescript"],"question_text":"I can't for the life of me figure this out or find a solution online. I am trying to figure out how to write a script in CoffeeScript from jQuery based JavaScript.\nThe script is this:\n`jQuery('.post-t...
{"title":"How to display HTML <FORM> as inline element?","tags":["html","css"],"question_text":"This is probably a basic html\/css question...\nI have a simple one-button form that I would like to display inline inside paragraph text.\n`<p>Read this sentence \n <form style='display:inline;'>\n <input style='display:inl...
{"title":"How do I remove a directory subtree from the staging area?","tags":["git","gitignore","git-add"],"question_text":"I made a new repository, and ran\n`git add -A`\n. I then noticed that there was a folder containing about 100 files that shouldn't have been included, so I added it to\n`.gitignore`\n.\nHow do I n...
{"title":"curl.h no such file or directory","tags":["c++","curl"],"question_text":"I installed curl this command (i use Ubuntu):\n`sudo apt-get install curl`\nWhen I test simple program using\n`g++ test.cpp`\n`#include <stdio.h>\n#include <curl\/curl.h>\nint main(void)\n{\n CURL *curl;\n CURLcode res;\n curl = curl_eas...
{"title":"gmail smtp with rails 3","tags":["ruby-on-rails-3","actionmailer"],"question_text":"I am trying to get a confirmation email sending using a gmail account. I have looked around and there is nothing that is obvious. There is no errors or anything, it just dosn't send\nI have this as the initalizer:\n`ActionMail...
{"title":"Why aren't my ball (objects) shrinking\/disappearing?","tags":["javascript","html5"],"question_text":"http:\/\/jsfiddle.net\/goldrunt\/jGL84\/42\/\nthis is from line 84 in this JS fiddle. There are 3 different effects which can be applied to the balls by uncommenting lines 141-146. The 'bounce' effect works a...
{"title":"Entity Framework 6 Code first Default value","tags":["entity-framework","ef-code-first","default-value"],"question_text":"is there \"elegant\" way to give specific property a default value ?\nMaybe by DataAnnotations, something like :\n`[DefaultValue(\"true\")]\npublic bool Active { get; set; }`\nThank you.",...
{"title":"DateTime parsing of custom date format in .NET","tags":["c#","parsing","datetime"],"question_text":"I have a string of the form\n`\"ORDER20100322194007\"`\n, it\n`\"20100322194007\"`\nDate and time\n`2010-03-22 19:40:07.000`\n. How to parse a string and get the contained object\n`DateTime`\n?","answer_text":"...
{"title":"How to use Lambda in LINQ select statement","tags":["c#","asp.net-mvc","linq","lambda"],"question_text":"I am trying to select stores using a lambda function and converting the result to a SelectListItem so I can render it. However it is throwing a \"\nType of Expression in Select Clause is Incorrect\n\" erro...
{"title":"What's the difference between lapply and do.call in R?","tags":["r","functional-programming"],"question_text":"I'm learning R recently and confused by two function:\n`lapply`\nand\n`do.call`\n. It seems that they're just similar to\n`map`\nfunction in Lisp. But why are there two functions with such a differen...
{"title":"What are the benefits of Java's types erasure?","tags":["java","type-erasure"],"question_text":"I read a\ntweet\ntoday that said:\nIt's funny when Java users complain about type erasure, which is the only thing Java got right, while ignoring all the things it got wrong.\nThus my question is:\nAre there benefi...
{"title":"How to add a function to jQuery?","tags":["jquery"],"question_text":"What's the easiest way to define a new jQuery\nmember function\n?\nSo that I can call something like:\n`$('#id').applyMyOwnFunc()`","answer_text":"Please see\nDefining your own functions in jQuery\n:\nIn this post i want to present how\n eas...
{"title":"What's the difference between System.Type and System.RuntimeType in C#?","tags":["c#","reflection"],"question_text":"I was trying to do some convention tests today, and getting all the types in an assembly (by calling\n`Assembly.GetTypes()`\n), when I stumbled into something:\n`System.RuntimeType:[First.Names...
{"title":"Entity Framework 5 and Visual Studio 2012 POCO Classes in Different Project","tags":["entity-framework","visual-studio-2012"],"question_text":"In VS 2010 and EF 4.4, you were able to move and edit .tt files when using the DBContext generator in Entity Framework such that your POCO objects where in a different...
{"title":"How do I test database-related code with NUnit?","tags":["c#","database","unit-testing","tdd","nunit"],"question_text":"I want to write unit tests with NUnit that hit the database. I'd like to have the database in a consistent state for each test. I thought transactions would allow me to \"undo\" each test so...
{"title":"how to send through ServletOutputStream characters in UTF-8 encoding","tags":["java","servlets","utf-8","internationalization"],"question_text":"My servlet code looks like that:\n`response.setContentType(\"text\/html; charset=UTF-8\");\nresponse.setCharacterEncoding(\"UTF-8\");\nServletOutputStream out = resp...
{"title":"Best way to add a \"nothing selected\" option to a selectOneMenu in JSF","tags":["jsf","selectonemenu"],"question_text":"I was wondering what would be the best or easiest way to allow a user to select nothing in a selectOneMenu.\nMy example: I have a list of registered users and the administrator should be ab...
{"title":"Why should y.innerHTML = x.innerHTML; be avoided?","tags":["javascript","jquery","html","browser"],"question_text":"Let's say that we have a DIV\n`x`\non the page and we want to duplicate (\"copy-paste\") the contents of that DIV into another DIV\n`y`\n. We could do this like so:\n`y.innerHTML = x.innerHTML;`...
{"title":"CURL ERROR: Recv failure: Connection reset by peer - PHP Curl","tags":["php","curl","yii"],"question_text":"I'm having this strange error,\nCURL ERROR: Recv failure: Connection reset by peer\nThis is how it happens, if I did not connect to the server and all of a sudden trying to connect to the server via CUR...
{"title":"How to colorize git-status output?","tags":["git","git-config","git-status"],"question_text":"I want to colorize git-status output so that:\n`untracked files = magenta\nnew files = green\nmodified files = blue\ndeleted files = red`\nI am instead seeing staged files in green and unstaged files in blue:\nMy .gi...
{"title":"Google map comes partially, grey area comes instead of images from google server","tags":["javascript","google-maps","google-maps-api-2"],"question_text":"Sometimes google map comes partially with other area getting grayed out. There is one catch, if we start Firebug, images do come in that gray area. Dont kn...
{"title":"Map collection of objects","tags":["c#","entity-framework","automapper"],"question_text":"I am trying to introduce Automapper into an application for the first time, but I keep getting an error saying I have some invalid arguments.\nMy model:\n`namespace StoreGradesLib.Models\n{\n public class Store\n {\n [Ke...
{"title":"How to append rows to an R data frame","tags":["r","merge","append","dataframe","rows"],"question_text":"I have looked around StackOverflow, but I cannot find a solution specific to my problem, which involves appending rows to an R data frame.\nI am initializing an empty 2-column data frame, as follows.\n`df ...
{"title":"Determine if Type is a pointer in a template function","tags":["c++","templates"],"question_text":"If I have a template function, for example like this:\n`template<typename T>\nvoid func(const std::vector<T>& v)`\nIs there any way I can determine within the function whether T is a pointer, or would I have to ...
{"title":"polyline snap to road using google maps api v3","tags":["javascript","google-maps","google-maps-api-3"],"question_text":"In google maps api v2 it was easy,\n`var map = new GMap2(document.getElementById(\"map\"));\n map.setCenter(new GLatLng(53.7877, -2.9832),13)\n\/\/ map.addControl(new GLargeMapControl());\n...
{"title":"Best way of \"looping over a 2-D array\", using Repa","tags":["arrays","performance","haskell","profiling","repa"],"question_text":"I find the array library Repa for Haskell very interesting, and wanted to make a simple program, to try to understand how to use it. I also made a simple implementation using lis...
{"title":"Trigger click jquery not working","tags":["jquery","triggers","pageload"],"question_text":"I'm figuring out why this simple script is not working:\n`jQuery.noConflict();\njQuery(document).ready(function() {\n jQuery('.next_button a').trigger('click');\n});`\n`noConflict`\nis necessary because I also load prot...
{"title":"c# covariant return types utilizing generics","tags":["c#","generics","covariance"],"question_text":"Is the code below the only way to implement covariant return types?\n`public abstract class BaseApplication<T> {\n public T Employee{ get; set; }\n}\npublic class Application : BaseApplication<ExistingEmployee...
{"title":"Mocking vs. Spying in mocking frameworks","tags":["unit-testing","mocking","tdd"],"question_text":"In mocking frameworks, you can mock an object or spy on it. What's the difference between the two and when would\/should I use one over the other? Looking at mockito, for example, I see similar things being done...
{"title":"How to find X11\/extensions\/XTest.h","tags":["ubuntu","x11"],"question_text":"I am using ubuntu 10.10, and when i compile chromium, it said\n`remoting\/host\/event_executor_linux.cc:9: fatal error: X11\/extensions\/XTest.h: No such file or directory`\nBut i have already installed libx11-dev:\n`$ sudo apt-get...
{"title":"Alter MySQL table to add comments on columns","tags":["mysql","alter-table"],"question_text":"I have been checking the\nMySQL Documentation for ALTER TABLE\nand it does not seem to include a way to add or modify a comment to a column. How can I do this?\n`\/\/ for table\nALTER TABLE myTable COMMENT 'Hello Wor...
{"title":"Get list of photo galleries on Android","tags":["android","image","gallery","mediastore"],"question_text":"I'm looking for:\nA list of the existing photo gallery names (hopefully their top thumbnail as well)\nThe contents of the gallery (I can then load thumbnails and full size as needed)\nHow would I go abou...
{"title":"Enable and disable a Broadcast Receiver","tags":["android","broadcastreceiver"],"question_text":"I try to enable and disable a broadcast receiver by using this PackageManager method:\n`setComponentEnabledSetting(componentName,\n PackageManager.COMPONENT_ENABLED_STATE_DISABLED,\n PackageManager.DONT_KILL_APP);...
{"title":"iOS MKMapView zoom to show all markers","tags":["iphone","mkmapview"],"question_text":"I'm working with\n`MKMapView`\nand have plotted several points on the map. I have used the\n`MKCoordinateRegion`\nand\n`MKCoordinateSpan`\nto enable zooming etc around one of the points - but that's not what I want...\nI'm ...
{"title":"How do I calculate the elapsed time of an event in java?","tags":["java","timer","clock"],"question_text":"What's a simple\/easy way to access the system clock using Java, so that I can calculate the elapsed time of an event?","answer_text":"I would avoid using System.currentTimeMillis() for measuring elapsed...
{"title":"Remove IntelliJ Project Version Control","tags":["intellij-idea"],"question_text":"I am managing svn with a third party application.\nHow do I remove all version control associated with a project in IntelliJ?","answer_text":"Go to\n`Settings`\n|\n`Version Control`\n, select the mapping(s), click\n`[-]`\nicon ...
{"title":"How to connect with host PostgreSQL from vagrant virtualbox machine","tags":["postgresql","networking","ubuntu-12.04","virtualbox","vagrant"],"question_text":"I have a VirtualBox machine running Ubuntu 12.04 in a Mac OS X host machine. In my host machine (Mac OS X), I have PostgreSQL installed. I would like t...
{"title":"ALTER table - adding AUTOINCREMENT in MySQL","tags":["mysql","sql","alter-table"],"question_text":"I created a table in MySQL with on column\n`itemID`\n. After creating the table, now I want to change this column to\n`AUTOINCREMENT`\n. How can this be done using ALTER statements?\nTable definition:\n`ALLITEMS...
{"title":"Spring cannot find bean xml configuration file when it does exist","tags":["xml","spring","configuration","javabeans","applicationcontext"],"question_text":"I am trying to make my first bean in Spring but got a problem with loading a context.\nI have a configuration XML file of the bean in src\/main\/resource...
{"title":"Is there a PHP function for swapping the values of two variables?","tags":["php","function","swap"],"question_text":"Say for instance I have ...\n`$var1 = \"ABC\"\n$var2 = 123`\nand under certain conditions I want to swap the two around like so...\n`$var1 = 123\n$var2 = \"ABC\"`\nIs there a PHP function for d...
{"title":"xpath expression to remove whitespace","tags":["xpath"],"question_text":"I have this HTML:\n`<tr class=\"even expanded first>\n <td class=\"score-time status\">\n <a href=\"\/matches\/2012\/08\/02\/europe\/uefa-cup\/\">\n 16 : 00\n <\/a>\n <\/td> \n <\/tr>`\nI want to extract the (16 : 00) string without the ...
{"title":"Android ViewPager - Show preview of page on left and right","tags":["android","android-viewpager"],"question_text":"I'm using Android's\n`ViewPager`\n. What I want to do is to show a preview of the page on both the left and the right. I've seen where I can use a negative\n`pageMargin`\nto show a preview of th...
{"title":"iOS Chrome detection","tags":["javascript","ios","google-chrome","mobile"],"question_text":"I use Javascript code\n`if( (Android|webOS|iPhone|iPad|iPod|BlackBerry).test(navigator.userAgent) ) {}`\nfor mobile device detection, but Chrome at iOS is not detected. Is there a way to detect it?\nThanks.","answer_te...
{"title":"How to get indices of a sorted array in Python","tags":["python","indexing","sorted"],"question_text":"I have a numerical list:\n`myList = [1, 2, 3, 100, 5]`\nNow if I sort this list to obtain\n`[1, 2, 3, 5, 100]`\n. \nWhat I want is the indices of the elements from the \noriginal list in the sorted order i.e...
{"title":"Sinon JS \"Attempted to wrap ajax which is already wrapped\"","tags":["testing","backbone.js","jasmine","sinon"],"question_text":"I got the above error message when I ran my test. Below is my code (I'm using Backbone JS and Jasmine for testing). Does anyone know why this happens?\n`$(function() {\n describe(\...
{"title":"Any way to clear python's IDLE window?","tags":["python","python-idle"],"question_text":"I know there's a similar topic about python console, but I do not know if they are the same. I tried system(\"clear\") and it didn't work here.\nHow do I clear python's IDLE window?","answer_text":"The \"cls\" and \"clear...
{"title":"PHP: Loop through all months in a date range?","tags":["php","date","loops","php4"],"question_text":"If I have a start date (say\n`2009-02-01`\n) and an end date (say\n`2010-01-01`\n), how can I create a loop to go through all the dates (months) in the range?","answer_text":"Try\n`$start = $month = strtotime(...
{"title":"Best Redis library for Java","tags":["java","redis"],"question_text":"The official Redis homepage lists JDBC-Redis and JRedis. What are the advantages \/ disadvantages of each ? Are there any other options ?","answer_text":"You can use also\nJedis\n, which is also in the\nofficial Redis clients page\n. It is ...
{"title":"Using Ember.js, how do I run some JS after a view is rendered?","tags":["ember.js"],"question_text":"How do I run a function after an Ember View is inserted into the DOM?\nHere's my use-case: I'd like to use jQuery UI sortable to allow sorting.","answer_text":"You need to override\n`didInsertElement`\nas it's...
{"title":"RecyclerView crashes when \"scrapped or attached views may not be recycled\"","tags":["android","recyclerview"],"question_text":"I'm using a simple implementation of RecyclerView taken from the Android website using a StaggeredGridLayoutManager and I keep getting this error that crashes my app:\n`java.lang.Il...
{"title":"Are nested try\/except blocks in python a good programming practice?","tags":["python"],"question_text":"I'm writing my own container, which needs to give access to a dictionary inside by attribute calls. The typical use of the container would be like this:\n`temp_container = DictContainer()\ndict_container['...
{"title":"PHP file listing multiple file extensions","tags":["php"],"question_text":"Here is my current code:\n`$files = glob(\"*.jpg\");`\nThis works fine. However, I am wanting to list other image types, such as .png, gif etc.\nCan I please have some help to modify this above code to get it working. I have tried the ...
{"title":"Is Graphics.DrawImage too slow for bigger images?","tags":["c#","image","c#-4.0","gdi+"],"question_text":"I'm currently working on a game and I wish to have a main menu with background image.\nHowever, I find the method\n`Graphics.DrawImage()`\nreally slow. I have made some measurement. Let's assume that Menu...
{"title":"NumPy array initialization (fill with identical values)","tags":["python","arrays","numpy"],"question_text":"I need to create a NumPy array of length\n`n`\n, each element of which is\n`v`\n.\nIs there anything better than:\n`a = empty(n)\nfor i in range(n):\n a[i] = v`\nI know\n`zeros`\nand\n`ones`\nwould wor...
{"title":"@Scope(\"prototype\") bean scope not creating new bean","tags":["spring","spring-mvc"],"question_text":"I want to use a annotated prototype bean in my controller. But spring is creating a singleton bean instead. Here is the code for that:\n`@Component\n@Scope(\"prototype\")\npublic class LoginAction {\n priva...
{"title":"Why do we need break after case statements?","tags":["java","switch-statement","case","language-design","break"],"question_text":"Why doesn't the compiler automatically put break statements after each code block in the switch? Is it for historical reasons? When would you want multiple code blocks to execute?"...
{"title":"Remove a value from an array in CoffeeScript","tags":["javascript","node.js","coffeescript"],"question_text":"I have a an array\n`array = [..., \"Hello\", \"World\", \"Again\", ...]`\nHow could I check if \"World\" is in the array?\nThen remove it if it exists?\nAnd have a reference to \"World\"?\nSometimes m...
{"title":"IOS: stop a NSTimer","tags":["ios","xcode","nstimer"],"question_text":"Possible Duplicate:\nNSTimer doesn't stop\nI have this code:\n`[NSTimer scheduledTimerWithTimeInterval:110.0\n target:self\n selector:@selector(targetMethod:)\n userInfo:nil\n repeats:YES];\n- (void) targetMethod:(NSTimer) timer{\nNSLog(@\...
{"title":"How do I format a double to currency rounded to the nearst dollar?","tags":["c#","formatting","rounding","money"],"question_text":"Right now I have\n`double numba = 5212.6312\nString.Format(\"{0:C}\", Convert.ToInt32(numba) )`\nThis will give me\n`$5,213.00`\nbut I don't want the \".00\".\nI know I can just d...
{"title":"What does \"throw;\" by itself do?","tags":["c#",".net","exception"],"question_text":"Possible Duplicate:\ndifference between throw and throw new Exception()\nWhat would be the point of just having\n`catch (Exception)\n{\n throw;\n}`\nWhat does this do?","answer_text":"By itself, the\n`throw`\nkeyword simply ...
{"title":"On the static final keywords in Java","tags":["java","static","constants","final"],"question_text":"According to\nthe tutorial\n:\nThe\n`static`\nmodifier, in combination with the\n`final`\nmodifier, is also used to define constants. The\n`final`\nmodifier indicates that the value of this field cannot change....
{"title":"a basic question about \"while true\"","tags":["python","syntax"],"question_text":"level: beginner\n`def play_game(word_list):\n hand = deal_hand(HAND_SIZE) # random init\n while True:\n cmd = raw_input('Enter n to deal a new hand, r to replay the last hand, or e to end game: ')\n if cmd == 'n':\n hand = deal...
{"title":"nginx .\/configure error ubuntu 12.04","tags":["nginx"],"question_text":"after downloading and trying to configure nginx when um executing the command .\/configure\num getting this error\n`.\/configure: error: the HTTP rewrite module requires the PCRE library.\nYou can either disable the module by using --wit...
{"title":"How do I fix twitter-bootstrap on IE?","tags":["twitter","internet-explorer-9","twitter-bootstrap"],"question_text":"The navbar doesn't seem to be working properly in IE. Here's a screenshot of it in IE.\nI've been looking through many bootstrap-topics on stackoverflow.com, but the \"help\" they give people d...
{"title":"Dynamically create bootstrap alerts box through javascript","tags":["javascript","twitter-bootstrap"],"question_text":"I'm using bootstrap 2.0 for my project and I would like to dynamically add bootstrap alert box in my page (http:\/\/twitter.github.com\/bootstrap\/javascript.html#alerts). I want to do someth...
{"title":"How to use TabHost.OnTabChangeListener in android?","tags":["android"],"question_text":"How to use TabHost.OnTabChangeListener in android?\ngive me some example code... :(\nthanks","answer_text":"why it would be my pleasure to help you good sir:\n`myTabHost.setOnTabChangedListener(new OnTabChangeListener(){\n...
{"title":"I've caught an exception!! Now what?","tags":["sql","vb.net","exception-handling"],"question_text":"I've started using try catch blocks (a bit late, I know!), but now I'm not sure what to do with the exception once I've caught it. What should I do?\n`Try\n connection.Open()\n Dim sqlCmd As New SqlCommand(\"do...
{"title":"Is 'epoll' the essential reason that Tornadoweb(or Nginx) is so fast?","tags":["apache","nginx","tornado","epoll"],"question_text":"Tornadoweb\nand\nNginx\nare popular web servers for the moment and many benchmarkings show that they have a better performance than Apache under certain circumstances. So my ques...
{"title":"Why are Fibonacci numbers significant in computer science?","tags":["algorithm","math","data-structures","fibonacci"],"question_text":"Fibonacci numbers\nhave become a popular introduction to recursion for Computer Science students and there's a strong argument that they persist within nature. For these reaso...
{"title":"How to group by week in MySQL?","tags":["mysql","data-migration","group-by"],"question_text":"Oracle's table server offers a built-in function,\n`TRUNC(timestamp,'DY')`\n. This function converts any timestamp to midnight on the previous Sunday. What's the best way to do this in MySQL?\nOracle also offers\n`TR...
{"title":"Ruby on Rails - Validate a Cost","tags":["ruby-on-rails","validation"],"question_text":"What is the best way to validate a cost\/price input by a user, validation rules below:\nExamples of formats allowed .23, .2, 1.23, 0.25, 5, 6.3 (maximum of two digits after decimal point)\nMinimum value of 0.01\nMaximum v...
{"title":"C# - Show Dialog box at center of its parent","tags":["c#","winforms",".net-4.0","positioning","center"],"question_text":"It's been a mess to show a DialogBox at the center of its parent form. Here is a method to show a dialog. I am positioning its parent to center but not able to center the DialogBox\n`priva...
{"title":"Math opposite sign function?","tags":["math","function"],"question_text":"Does such function exist? I created my own but would like to use an official one:\n`private function opposite(number:Number):Number\n{\n if (number < 0)\n {\n number = Math.abs(number);\n }\n else\n {\n number = -(number);\n }\n return ...
{"title":"Is it possible to add an array or object to SharedPreferences on Android","tags":["android","android-preferences","sharedpreferences"],"question_text":"If not, is there any workaround? I have an array list of objects that have a name and an icon pointer. I do not want to use a database.","answer_text":"Regard...
{"title":"PHP - Failed to open stream : No such file or directory","tags":["php","fopen","require","include-path","php-include"],"question_text":"In PHP scripts, whether calling\n`include()`\n,\n`require()`\n,\n`fopen()`\n, or their derivatives such as\n`include_once`\n,\n`require_once`\n, or even,\n`move_uploaded_file...
{"title":"How to debug a maven goal with intellij idea?","tags":["intellij-idea"],"question_text":"Can you debug a maven goal with Intellij IDEA? I know that I can right-click and run\nDebug\n. However, the maven plugin does not appear in by\nExternal Libraries\nlist and I can thus not go in the code and set a breakpoi...
{"title":"jQuery form submit() is not working in IE6?","tags":["javascript","jquery","html","internet-explorer-6"],"question_text":"I want to submit a with using jquery as below;\n`$(\"#formid\").submit();`\nIts working perfect in all browsers except IE6.\nHow to make it work in IE6 ??","answer_text":"You probably have...
{"title":"What is the point of the class Option[T]?","tags":["java","scala",null,"functional-programming","monads"],"question_text":"I am not able to understand the point of\n`Option[T]`\nclass in Scala. I mean, I am not able to see any advanages of\n`None`\nover\n`null`\n.\nFor example, consider the code:\n`object Mai...
{"title":"What does \"Hot Swap error\" with IntelliJ (in Java) mean?","tags":["java","intellij-idea","hotswap"],"question_text":"I have no idea what a hot swap is and for the life of me cannot construct a google search that will find what it means in the context of my program. I was editing my class, the same way I do ...
{"title":"Regular expression for 10 digit number without any special characters ","tags":["c#",".net","regex"],"question_text":"What is the regular expression for a 10 digit numeric number (no special characters and no decimal).","answer_text":"Use this regular expression to match ten digits only:\n`@\"^\\d{10}$\"`\nT...
{"title":"Convert String to KeyEvents","tags":["java","awtrobot"],"question_text":"I've discovered the Robot class today and wanted to use it to do some funny scripts...\nI want to convert a String into KeyEvent to do something like this :\n`writeKeyboard(myBot,\"abcd\");\npublic void writeKeyboard(Robot bot, String st...