text
stringlengths
74
309k
{"title":"jQuery: Clearing Form Inputs","tags":["jquery","forms","console"],"question_text":"I have tried to different ways to clear a form:\n`<form action=\"service.php\" id=\"addRunner\" name=\"addRunner\" method=\"post\">\nFirst Name: <input type=\"text\" name=\"txtFirstName\" id=\"txtFirstName\" \/><br \/>\nLast Na...
{"title":"change the name of android project","tags":["android","eclipse","project"],"question_text":"Is there any posibility that I could change the\n`name of my project`\nas it appears in\n`Package Explorer`\n.I'm using Eclipse IDE.I tried to edit the\n`string.xml`\nin\n`res\/value`\nfolder but that won't change it i...
{"title":"ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)","tags":["mysql","mysql-error-2003"],"question_text":"I use the following command:\n`mysql -u root -h 127.0.0.1 -p`\nand the error message is :\n`ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)`\nWho can help me to f...
{"title":"Python TypeError: not enough arguments for format string","tags":["python","string","format","typeerror"],"question_text":"Here's the output. These are utf-8 strings I believe... some of these can be NoneType but it fails immediately, before ones like that...\n`instr = \"'%s', '%s', '%d', '%s', '%s', '%s', '%...
{"title":"Google Maps API v3: How do I dynamically change the marker icon?","tags":["javascript","google-maps","google-maps-api-3"],"question_text":"Using Google Maps API v3, how do I pro grammatically change the marker icon?\nWhat I would like to do is, when someone hovers over a link - to have the corresponding marke...
{"title":"Android: how to check if a View inside of ScrollView is visible?","tags":["android","scrollview","visible"],"question_text":"I have a ScrollView which holds a series of Views. I would like to be able to determine if a view is currently visible (if any part of it is currently displayed by the ScrollView). I wo...
{"title":"Sum of items in a collection","tags":["linq","sum"],"question_text":"Using LINQ to SQL, I have an Order class with a collection of OrderDetails. The Order Details has a property called LineTotal which gets Qnty x ItemPrice.\nI know how to do a new LINQ query of the database to find the order total, but as I a...
{"title":"How do I keep a label centered in WinForms?","tags":["c#",".net","winforms","centering"],"question_text":"In\n`WinForms`\nI am using a\n`Label`\nto display different messages like success, failure, etc.\nI'd like to center that label in the center form. I want a solution that will keep it centered whether the...
{"title":"Delegates: Predicate Action Func","tags":["c#","delegates"],"question_text":"Can someone provide a good explanation (hopefully with examples) of these 3 most important delegates:\nPredicate\nAction\nFunc\nWhat other delegates should a C# developer be aware of?\nHow often do you use them in production code?","...
{"title":"Is a Python dictionary an example of a hash table?","tags":["python","hash","dictionary","hashmap","hashtable"],"question_text":"One of the basic data structures in Python is the dictionary, which allows one to record \"keys\" for looking up \"values\" of any type. Is this implemented internally as a hash tab...
{"title":"How to add a line break in an Android TextView?","tags":["android","textview","line","line-breaks"],"question_text":"I am trying to add a line break in the TextView.\nI tried suggested \\n but that does nothing. Here is how I set my texts.\n`TextView txtSubTitle = (TextView)findViewById(r.id.txtSubTitle);\ntx...
{"title":"Exit command mode in sublime text 2","tags":["text-editor","sublimetext2"],"question_text":"I just started using sublime text 2 and when I go into command mode I can't get out.\nHow do I exit out?","answer_text":"Escape\nputs you into command mode;\n`i`\ntakes you back out.","question_code":[],"answer_code":[...
{"title":"Convert pixels to sp","tags":["android","textview"],"question_text":"I need the current\n`TextSize`\nof the\n`TextView`\nin\n`sp`\nunits.\nBut\n`getTextSize()`\nreturns the size in\n`pixels`\n. So is there a way to\n`convert pixels to sp`\n?","answer_text":"Use this\n`public static float pixelsToSp(Context co...
{"title":"How to count lines of code including sub-directories","tags":["linux","bash","unix","wc"],"question_text":"Suppose I want to count the lines of code in a project. If all of the files are in the same directory I can execute:\n`cat * | wc -l`\nHowever, if there are sub-directories, this doesn't work. For this t...
{"title":"Should I use a data.frame or a matrix?","tags":["r","matrix","dataframe","r-faq"],"question_text":"When should one use a\n`data.frame`\n, and when is it better to use a\n`matrix`\n?\nBoth keep data in a rectangular format, so sometimes it's unclear.\nAre there any general rules of thumb for when to use which ...
{"title":"Center message in android dialog box","tags":["java","android"],"question_text":"I want the message text within my dialog box to be center aligned.","answer_text":"Of course, you can always set the gravity of the original text view. This allows you to not have to worry about formatting and padding.\nFor examp...
{"title":"ActiveRecord: List columns in table from console","tags":["sql","ruby-on-rails","ruby-on-rails-3","activerecord"],"question_text":"I know that you can ask ActiveRecord to list tables in console using:\n`ActiveRecord::Base.connection.tables`\nIs there a command that would list the columns in a given table?","a...
{"title":"How to manually install an artifact in Maven 2?","tags":["maven-2","install"],"question_text":"I've encountered some errors when I tried to install an artifact manually with Maven 2. I wanted to install a jar from a local directory with the command\n`mvn install:install-file -Dfile=jta-1.0.1B.jar`\nBut Maven ...
{"title":"Iterate over values in Flags Enum?","tags":["c#","enums"],"question_text":"If I have a variable holding a flags enum, can I somehow iterate over the bit values in that specific variable? Or do I have to use Enum.GetValues to iterate over the entire enum and check which ones are set?","answer_text":"`static IE...
{"title":"Globally catch exceptions in a WPF application?","tags":["c#","wpf","exception","exception-handling"],"question_text":"We are having a WPF application where parts of it may throw exceptions at runtime. I'd like to globally catch any unhandled exception and log them, but otherwise continue program execution as...
{"title":"Convert string to integer type in Go?","tags":["go","type-conversion"],"question_text":"I'm trying to convert a string returned from\n`flag.Arg(n)`\nto an\n`int`\n. What is the idiomatic way to do this in Go?","answer_text":"For example,\n`package main\nimport (\n \"flag\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\...
{"title":"What is the point of STL Character Traits?","tags":["c++","string","stl","stdstring","char-traits"],"question_text":"I notice that in my copy of the SGI STL reference, there is a page about Character Traits but I can't see how these are used? Do they replace the string.h functions? They don't seem to be used ...
{"title":"iOS 6 Facebook posting procedure ends up with \"remote_app_id does not match stored id\"","tags":["ios","iphone","objective-c","facebook"],"question_text":"This is my third question about posting on Facebook.\nAlthough this may be a duplicate of\nMac OS X Facebook login failed - no stored remote_app_id for ap...
{"title":"Maven Unable to locate the Javac Compiler in:","tags":["java","maven","javac"],"question_text":"When i try to generate a war file, it is showing some error like\n`[ERROR] Unable to locate the Javac Compiler in:\n[ERROR] C:\\Program Files\\Java\\jre7\\..\\lib\\tools.jar`\nWhen i do\n`echo %path%`\nit shows\n`C...
{"title":"Error when trying vagrant up","tags":["vagrant"],"question_text":"I'm using Vagrant for my environment and I've got a little issue:\n`$vagrant up\nBringing machine 'default' up with 'virtualbox' provider...\n==> default: Box 'base' could not be found. Attempting to find and install...\n default: Box Provider:...
{"title":"Why do you specify the size when using malloc in C?","tags":["c","memory-management","malloc"],"question_text":"Take the following code :\n`int *p = malloc(2 * sizeof *p);\np[0] = 10; \/\/Using the two spaces I\np[1] = 20; \/\/allocated with malloc before.\np[2] = 30; \/\/Using another space that I didn't all...
{"title":"Text Editor which shows \\r\\n?","tags":["text","text-editor","newline","carriage-return"],"question_text":"I'm looking for a text editor that can show me the actual carriage returns and newlines.\nE.g. if I save this string:\n`\"This\\rIs\\r\\nA\\nString\"`\nInstead of showing\n`This\nIs\nA\nString`\nI'm loo...
{"title":"What's the best way to do \"application settings\" in Android?","tags":["android"],"question_text":"I'd like to store some application settings (like the URL of an API, and some settings for testing) for an Android application.\nI mostly work as a\n.NET\ndeveloper, so I'm used to using the file\n`app.config`\...
{"title":"Grep not as a regular expression","tags":["linux","grep"],"question_text":"I need to search for a PHP variable\n`$someVar`\n. However, Grep thinks that I am trying to run a regex and is complaining:\n`$ grep -ir \"Something Here\" * | grep $someVar\nUsage: grep [OPTION]... PATTERN [FILE]...\nTry `grep --help'...
{"title":"Cannot create a managed object context on iOS","tags":["ios","core-data"],"question_text":"I created a non core data project. I now want to use core data. In the build phases, I linked my binary with CoreData.framework. In my application delegate method, I want to manually create a managed object context like...
{"title":"Swift Equatable Protocol","tags":["ios","swift","xcode6"],"question_text":"I was folling this tutorial for Swift:\nhttp:\/\/www.raywenderlich.com\/75270\/make-game-like-candy-crush-with-swift-tutorial-part-1\nand came across this code:\n`func == (lhs: Cookie, rhs: Cookie) -> Bool {\n return lhs.column == rhs....
{"title":"gem install pg --with-pg-config works, bundle fails","tags":["postgresql","rubygems","bundler","pg"],"question_text":"WhenI run (as root)\n`gem install pg -v '0.12.0' -- --with-pg-config=\/usr\/pgsql-9.1\/bin\/pg_config`\nI get the following output:\n`#-> gem instal pg -v '0.12.0' -- --with-pg-config=\/usr\/p...
{"title":"Good Domain Driven Design samples","tags":["domain-driven-design"],"question_text":"I'm learning about Domain Driven Design and enjoying every minute of it. However, there are some practical issues that are confusing to me that I think seeing some good samples might clear up.\nSo being at peace with those iss...
{"title":"When I load ADT why do I receive the error \"The Android SDK requires Android Developer Toolkit version XX.X.X or above?\"","tags":["android","eclipse","adt","android-sdk-tools"],"question_text":"I just updated my Android SDK Tools to version 21.1. Unfortunately this is causing an error when I load the Androi...
{"title":"Internet Explorer Console","tags":["javascript","internet-explorer","internet-explorer-8","console","firebug"],"question_text":"Is there a console logger for IE? I'm trying to log a bunch of tests\/assertions to the console but I can't do this in IE.","answer_text":"You can access IE8 script console by launch...
{"title":"Is micro-optimization worth the time?","tags":["php","performance","design","optimization"],"question_text":"I am a PHP developer and I have always thought that micro-optimizations are not worth the time. If you really need that extra performance, you would either write your software so that it's architectura...
{"title":"GridView must be placed inside a form tag with runat=\"server\" even after the GridView is within a form tag","tags":["c#",".net","asp.net"],"question_text":"`<form runat=\"server\" id=\"f1\">\n <div runat=\"server\" id=\"d\">\n grid view:\n <asp:GridView runat=\"server\" ID=\"g\">\n <\/asp:GridView>\n <\/div...
{"title":"Difference between screen.availHeight and window.height()","tags":["javascript","jquery","window","document"],"question_text":"I am executing the following Javascript on my browser (Firefox).\nconsole.debug(\"Screen height = \"+\nscreen.availHeight\n); \/\/outputs\n770\nconsole.debug(\"Window Height =\"+\n$(w...
{"title":"How do sessions work in Express.js with Node.js?","tags":["javascript","node.js","session","cookies","express"],"question_text":"Using\nExpress.js\n, sessions are dead simple. I'm curious how they actually work though.\nDoes it store some cookie on the client? If so, where can I find that cookie? If required,...
{"title":"How to properly handle a gzipped page when using curl?","tags":["bash","curl","gzip"],"question_text":"I wrote a bash script that gets output from a website using curl and does a bunch of string manipulation on the html output. The problem is when I run it against a site that is returning its output gzipped. ...
{"title":"Where can I learn more about the Google search \"did you mean\" algorithm?","tags":["algorithm","nlp","spell-checking"],"question_text":"Possible Duplicate:\nHow do you implement a \u201cDid you mean\u201d?\nI am writing an application where I require functionality similar to Google's \"did you mean?\" featur...
{"title":"capybara assert attributes of an element","tags":["ruby-on-rails","rspec","capybara"],"question_text":"I'm using RSpec2 and Capybara for acceptance testing.\nI would like to assert that link is disabled or not in Capybara. How can I do this?","answer_text":"Another simple solution is to access the HTML attrib...
{"title":"iPad Safari scrolling causes HTML elements to disappear and reappear with a delay","tags":["css","ios","ipad","html5","mobile-safari"],"question_text":"I'm currently developing a web app using html5 and jQuery for iPad Safari. I'm running into a problem wherein large scroll areas cause the elements that are o...
{"title":"Android Emulator: Failed to pull selection","tags":["android","eclipse","android-emulator"],"question_text":"Android 2.2 emulator. When I'm trying to pull a file from DDMS-file explorer, it says:\n`[2012-02-08 02:52:52] Failed to pull selection\n[2012-02-08 02:52:52] (null)`\nWhy and what to do with it?","ans...
{"title":"move_uploaded_file gives \"failed to open stream: Permission denied \" error after all configurations i did","tags":["php","linux","apache","upload"],"question_text":"I keep getting this error when trying to configure the upload directory with Apache 2.2 and PHP 5.3 on CentOS.\nIn php.ini:\n`upload_tmp_dir = ...
{"title":"How to clone ArrayList and also clone its contents?","tags":["java","collections","clone","deep-copy"],"question_text":"How can I clone an\n`ArrayList`\nand also clone its items in Java?\nFor example I have:\n`ArrayList<Dog> dogs = getDogs();\nArrayList<Dog> clonedList = ....something to do with dogs....`\nAn...
{"title":"jQuery.proxy() usage","tags":["javascript","jquery"],"question_text":"I was reading the api about\n`jQuery.proxy()`\n. It looks promising but I was wondering in what situation is this best use. Can anyone enlighten me?","answer_text":"When you want a function that has the\n`this`\nvalue bound to a specific ob...
{"title":"How do I call setattr() on the current module?","tags":["python","module","global-variables","getattr","setattr"],"question_text":"What do I pass as the first parameter \"\n`object`\n\" to the function\n`setattr(object, name, value)`\n, to set variables on the current module?\nFor example:\n`setattr(object, \...
{"title":"Bash : iterate over list of files with spaces","tags":["linux","bash","shell"],"question_text":"I want to iterate over a list of files. This list is the result of a\n`find`\ncommand, so I came up with:\n`getlist() {\n for f in $(find . -iname \"foo*\")\n do\n echo \"File found: $f\"\n # do something useful\n ...
{"title":"Comment shortcut Android Studio","tags":["android","android-studio","keyboard-shortcuts"],"question_text":"I'm searching for useful Android Studio keyboard shortcut for commenting code, as in Sublime Text or Eclipse.\nWhen I press either\n`cmd + \/`\nor\n`cmd + maj + \/`\nnothing happens...","answer_text":"Ma...
{"title":"How many threads is too many?","tags":["multithreading","performance","threadpool"],"question_text":"I am writing a server, and I branch each action of into a thread when the request is incoming. I do this because almost every request makes database query. I am using a threadpool library to cut down on constr...
{"title":"Chrome debugging - break on next click event","tags":["javascript","debugging","google-chrome","google-chrome-devtools"],"question_text":"We have a button. Click events are handled by a 3rd party framework, however, the framework is buggy somehow.\nWe want to debug the framework, however, we don't know where ...
{"title":"Can I use the range operator with if statement in Swift?","tags":["if-statement","swift","range"],"question_text":"Is it possible to use the range operator\n`...`\nand\n`..<`\nwith if statement. Maye something like this:\n`let statusCode = 204\nif statusCode in 200 ..< 299 {\n NSLog(\"Success\")\n}`","answer_...
{"title":"What makes JNI calls slow?","tags":["java","performance","jni"],"question_text":"I know that 'crossing boundaries' when making a JNI call in Java is slow.\nHowever I want to know\nwhat\nis it that makes it slow?\nWhat does the underlying jvm implementation do when making a JNI call that makes it so slow?","an...
{"title":"Two way binding not working in directive with transcluded scope","tags":["javascript","angularjs"],"question_text":"I've a textbox in a controller which is bound to model\n`name`\n. There's a directive inside the controller and there's another textbox inside the directive which is bound to the same model\n`na...
{"title":"How to add a new row to datagridview programmatically","tags":["c#","winforms","datagridview","row"],"question_text":"if add row to\n`DataTable`\n`DataRow row = datatable1.NewRow();\nrow[\"column2\"]=\"column2\";\nrow[\"column6\"]=\"column6\";\ndatatable1.Rows.Add(row);`\nHow about\n`DataGridView`\n??","answe...
{"title":"java: Class.isInstance vs Class.isAssignableFrom","tags":["java"],"question_text":"Let\n`clazz`\nbe some\n`Class`\nand\n`obj`\nbe some\n`Object`\n.\nIs\n`clazz.isAssignableFrom(obj.getClass())`\nalways the same as\n`clazz.isInstance(obj)`\n?\nIf not, what are the differences?","answer_text":"Both answers are ...
{"title":"Can I convert a C# string value to an escaped string literal","tags":["c#","string","escaping"],"question_text":"In C#, can I convert a string value to a string literal, the way I would see it in code? I would like to replace tabs, newlines, etc. with their escape sequences.\nIf this code:\n`Console.WriteLine...
{"title":"Is there a way to access an iteration-counter in Java's for-each loop?","tags":["java","loops","for-loop","foreach"],"question_text":"Is there a way in Java's for-each loop\n`for(String s : stringArray) {\n doSomethingWith(s);\n}`\nto find out how often the loop has already been processed?\nAside from using u...
{"title":"Value of i for (i == -i && i != 0) to return true in Java","tags":["java"],"question_text":"I have the following\n`if`\ncondition.\n`if (i == -i && i != 0)`\nWhat value of\n`i`\nwill return\n`true`\nfor this condition in Java?\nI am unable to think of any such value of\n`i`\nconsidering\ntwo's complement\nnot...
{"title":"How can I have linked dependencies in a git repo?","tags":["git","github","dependencies","git-submodules","githooks"],"question_text":"In my scripts, I often use libraries (mine or others') that have their own repos. I don't want to duplicate those in my repo and get stuck with updating them every time a new ...
{"title":"How do I get the time difference between two DateTime objects using C#?","tags":["c#","datetime"],"question_text":"How do I get the time difference between two\n`DateTime`\nobjects using C#?","answer_text":"The following example demonstrates how to do this:\n`DateTime a = new DateTime(2010, 05, 12, 13, 15, 00...
{"title":"How to stop unwanted UIButton animation on title change?","tags":["objective-c","swift","ios7","uibutton","uikit"],"question_text":"In iOS7 my UIButton titles are animating in and out at the wrong time - late. This problem does not appear on iOS6. I'm just using:\n`[self setTitle:text forState:UIControlStateN...
{"title":"Why does gulp.src not like being passed an array of complete paths to files?","tags":["arrays","node.js","globbing","gulp"],"question_text":"I'm attempting to pass gulp.src an array of files that I want it to deal with. This is the array as it stands.\n`['bower_components\/jquery\/jquery.js',\n 'bower_compone...
{"title":"Why is using onClick() in HTML a bad practice?","tags":["javascript","html"],"question_text":"I have heard many times that using JavaScript events, such as\n`onClick()`\n, in HTML is a bad practice, because it's not good for semantics. I would like to know what the downsides are and how to fix the following c...
{"title":"How to get hex color value rather than RGB value?","tags":["javascript","jquery","colors","hex","rgb"],"question_text":"Using the following jQuery will get the RGB value of an element's background color:\n`$('#selector').css('backgroundColor');`\nIs there a way to get the hex value rather than the RGB?","answ...
{"title":"NoClassDefFoundError for code in an Java library on Android","tags":["android","noclassdeffounderror"],"question_text":"I am experiencing an error quite often among my users. The app crashes during startup. When the MainActivity is supposed to be loaded the VM apparently cannot find the class. I cannot figure...
{"title":"How to open existing project in Eclipse","tags":["android","eclipse"],"question_text":"I kind of feel stupid, but I just can't get it to work....\nI have an existing Android project copied from my other pc, in the folder\n`c:\\projects\\trunk\\android\\emergency`\n(I created that project on the other pc, copi...
{"title":"Force to open \"Save As...\" popup open at text link click for pdf in HTML","tags":["html","pdf","download","meta-tags","content-disposition"],"question_text":"I have some big size pdf catalogs at my website, and I need to link these as download. When I googled, I found such a thing noted below. It should ope...
{"title":"What is opinionated software?","tags":["design","architecture","language-agnostic","terminology"],"question_text":"I often see people saying that certain software is \"very opinionated\" or that Microsoft tends to write \"un-opinionated\" frameworks. What does this actually mean?","answer_text":"If a framewor...
{"title":"Access the css \":after\" selector with jQuery","tags":["jquery","css","jquery-selectors"],"question_text":"I have the following css:\n`.pageMenu .active::after {\n content: '';\n margin-top: -6px;\n display: inline-block;\n width: 0px;\n height: 0px;\n border-top: 14px solid white;\n border-left: 14px solid ...
{"title":"How to Concatenate Numbers and Strings to Format Numbers in T-SQL?","tags":["sql","tsql"],"question_text":"I have the following function\n`ALTER FUNCTION [dbo].[ActualWeightDIMS]\n(\n -- Add the parameters for the function here\n @ActualWeight int,\n @Actual_Dims_Lenght int,\n @Actual_Dims_Width int,\n @Actua...
{"title":"Google Map API V3: How to add Custom data to markers","tags":["google-maps","google-maps-api-3","google-maps-markers"],"question_text":"Is there a way I can add some custom information to my markers for later use. There are ways to have an info-window and a title, but what If I want to associate the marker wi...
{"title":"Using i and j as variables in Matlab","tags":["matlab","variables","naming-conventions"],"question_text":"`i`\nand\n`j`\nare very popular variable names (see e.g.,\nthis question\nand\nthis one\n).\nFor example, in loops:\n`for i=1:10,\n % do something...\nend`\nAs indices into matrix:\n`mat( i, j ) = 4;`\nWh...
{"title":"GIT: Checkout to a specific folder","tags":["git"],"question_text":"I want to use something similar to:\n`git checkout -- <path>\/<file>`\nbut I want to checkout the file to some folder I choose, rather than the overwriting the local \/.\nAny idea?","answer_text":"Another solution which is a bit cleaner - jus...
{"title":"Must JDBC Resultsets and Statements be closed separately although the Connection is closed afterwards?","tags":["java","jdbc"],"question_text":"It is said to be a good habit to close all JDBC resources after usage. But if I have the following code, is it necessary to close the Resultset and the Statement?\n`C...
{"title":"How can I check ModelState.IsValid from inside my Razor view","tags":["asp.net-mvc","asp.net-mvc-3","razor"],"question_text":"I have the following in my action method:\n`if (!ModelState.IsValid)\n return View(vm);`\nIn the view I want to not present a submit key to allow deletion if the model state is not val...
{"title":"Swift - Read plist","tags":["ios","swift"],"question_text":"I am playing around with Apple's new\nSwift\nprogramming language and have some problems...\nCurrently I'm trying to read a plist file, in Objective-C I would do the following to get the content as a NSDictionary:\n`NSString *filePath = [[NSBundle ma...
{"title":"Create empty C# event handlers automatically","tags":["c#","events","delegates","clr"],"question_text":"It is not possible to fire an event in C# that has no handlers attached to it. So before each call it is necessary to check if the event is null.\n`if ( MyEvent != null ) {\n MyEvent( param1, param2 );\n}`\...
{"title":"Using bash history to get a previous command, copy it and then 'run' it but with the command commented","tags":["linux","bash","command-line"],"question_text":"Just a question to improve my\n`bash`\nskills. I always do this:\n`$ history | grep some_long_command\n...\n...\n123 some_long_command1.........\n124 ...
{"title":"How can I import load a .sql or .csv file into sqlite?","tags":["database","sqlite","import"],"question_text":"I need to dump a\n.sql\nor\n.csv\nfile into sqlite (I'm using sqlite3 API). I've only found documentation for importing\/loading tables, not entire databases. Right now, when I type:\n`sqlite3prompt>...
{"title":"How do you return a JSON object from a Java Servlet","tags":["java","json","servlets"],"question_text":"How do you return a JSON object form a Java servlet.\nPreviously when doing AJAX with a servlet I have returned a string. Is there a JSON object type that needs to be used, or do you just return a String th...
{"title":"How can I get the current network interface throughput statistics on Linux\/UNIX?","tags":["linux","networking","bandwidth"],"question_text":"Tools such as MRTG provide network throughput \/ bandwidth graphs for the current network utilisation on specific interfaces, such as eth0. How can I return that inform...
{"title":"What is duck typing?","tags":["programming-languages","duck-typing"],"question_text":"I came across the term\nduck typing\nwhile reading random topics on software online and did not completely understand it.\nWhat is \u00e2\u0080\u009cduck typing\u00e2\u0080\u009d?","answer_text":"It is a term used in\ndynami...
{"title":"Is it possible to use javascript to change the meta-tags of the page?","tags":["javascript","jquery","meta-tags"],"question_text":"if I put a div in the head and display:none, than use javascript to display it, will this work?\nEdit:\nI have stuff loaded in ajax. And as my ajax changes the \"main\" portion of...
{"title":"How to execute PHP code from the command line?","tags":["php","linux","function","shell","command-line"],"question_text":"I would like to execute a single php statement like\n`if(function_exists(\"my_func\")) echo 'function exists';`\ndirectly with the command line without having to use a seperate php file.\n...
{"title":"HTML5 Canvas Resize (Downscale) Image High Quality?","tags":["javascript","css","html5","canvas","html5-canvas"],"question_text":"I use html5 canvas elements to resize images im my browser. It turns out that the quality is very low. I found this:\nDisable Interpolation when Scaling a <canvas>\nbut it does not...
{"title":"Why is there not a register that contains the higher bytes of EAX?","tags":["x86","assembly"],"question_text":"`%AX = (%AH + %AL)`\nSo why not\n`%EAX = (%SOME_RESTIER + %AX)`\nfor some register\n`%SOME_REGISTER`\n?","answer_text":"Just for some clarification. In the early microprocessor days of the 1970's, CP...
{"title":"Viewing contents of a .jar file","tags":["java","jar","viewer"],"question_text":"What would be the easiest way to view classes, methods, properties, etc. inside a jar file?\nI'm looking for something equivalent to the very useful\nLutz Roeder .NET Reflector\n- for Java","answer_text":"Using the JDK,\n`jar tf`...
{"title":"IllegalArgumentException: the bind value at index 1 is null","tags":["android","database","sqlite","android-contentprovider"],"question_text":"Does anybody know what this means?\n`12-31 20:55:45.861: ERROR\/AndroidRuntime(12478): Caused by: java.lang.IllegalArgumentException: the bind value at index 1 is null...
{"title":"Enabling error display in php via htaccess only","tags":["php",".htaccess","error-handling"],"question_text":"I am testing a website online.\nRight now, the errors are not being displayed (But I know they exist).\nI have access to only the\n`.htaccess`\nfile.\nHow do i make all errors to display using my\n`.h...
{"title":"UIRefreshControl - Pull To Refresh in iOS 7","tags":["ios","objective-c","uitableview"],"question_text":"I'm trying to get the pull to refresh feature on iOS 7 in my Table View. In my\n`viewDidLoad`\n, I have:\n`refreshControl = [[UIRefreshControl alloc] init];\n[self.mytableView setContentOffset:CGPointMake(...
{"title":"Is there a DesignMode property in WPF?","tags":["wpf",".net-3.5"],"question_text":"In Winforms you can say\n`if ( DesignMode )\n{\n \/\/ Do something that only happens on Design mode\n}`\nis there something like this in WPF?","answer_text":"Indeed there is\n:\nSystem.ComponentModel.DesignerProperties.GetIsInD...
{"title":"How to get \"GET\" request parameters in JavaScript?","tags":["javascript"],"question_text":"How to get \"GET\" variables from request in JavaScript?\nDoes jQuery or YUI! have this feature built-in?","answer_text":"All data is available under\n`window.location.search`\nyou have to parse the string, eg.\n`func...
{"title":"Differences and Similarities Between Lumen and Laravel","tags":["php","laravel","lumen"],"question_text":"I read the documentation and it seems Lumen is Laravel with less features. I must be missing something.\nI am looking for a comparison table of the components and features of both Laravel and Lumen. Does ...
{"title":"Inner Shadow in UILabel","tags":["iphone","objective-c","uilabel"],"question_text":"is it possible to create such a UILabel with inner and outer shadow?\ni only know\n`shadowColor`\nand\n`shadowOffset`\nzoomed:\nthanks!","answer_text":"The answer by dmaclach is only suitable for shapes that can easily be inve...
{"title":"How can I find all subclasses of a class given its name?","tags":["python"],"question_text":"I need a working approach of getting all classes that are inherited from the base class in Python.","answer_text":"New-style classes (i.e. subclassed from\n`object`\n, which is the default in Python 3) have a\n`__subc...
{"title":"What are best practices for multi-language database design?","tags":["sql","database","database-design"],"question_text":"What is the best way to create multi-language database? To create localized table for every table is making design and querying complex, in other case to add column for each language is si...
{"title":"MySQL convert datetime to Unix timestamp","tags":["mysql"],"question_text":"How do I convert the following format to unix timestamp?\n`Apr 15 2012 12:00AM`\nThe format I get from DB seems to have\n`AM`\nat the end. \nI've tried using the following but it did not work:\n`CONVERT(DATETIME, Sales.SalesDate, 103)...
{"title":"Sort points in clockwise order?","tags":["algorithm","math","lua","geometry","computational-geometry"],"question_text":"Given an array of x,y points, how do I sort the points of this array in clockwise order (around their overall average center point)? My goal is to pass the points to a line-creation function...