text stringlengths 74 309k |
|---|
Unzip the "stackoverflow.zip" and place stackoverflow.jsonl in this folder |
{"title":"How to undo 'git add' before commit?","tags":["git","version-control","git-stage"],"question_text":"I mistakenly added files using the command:\n`git add myfile.txt`\nI have not yet run\n`git commit`\n. Is there a way to undo this, so these files won't be included in the commit?","answer_text":"You can undo\n... |
{"title":"Regular expression to match line that doesn't contain a word?","tags":["regex","regex-negation"],"question_text":"I know it's possible to match a word and then reverse the matches using other tools (e.g.\n`grep -v`\n). However, I'd like to know if it's possible to match lines that\ndon't\ncontain a specific w... |
{"title":"How to check if a string contains a specific word in PHP?","tags":["php","string"],"question_text":"Consider:\n`$a = 'How are you?';\nif ($a contains 'are')\n echo 'true';`\nSuppose I have the code above, what is the correct way to write the statement\n`if ($a contains 'are')`\n?","answer_text":"You can use t... |
{"title":"Is Java \"pass-by-reference\" or \"pass-by-value\"?","tags":["java","methods","parameter-passing","pass-by-reference","pass-by-value"],"question_text":"I always thought Java was\npass-by-reference\n; however I've seen a couple of blog posts (for example,\nthis blog\n) that claim it's not. I don't think I unde... |
{"title":"How to find all files containing specific text on Linux?","tags":["linux","text","grep","directory","find"],"question_text":"I'm trying to find a way to scan my entire Linux system for all files containing a specific string of text. Just to clarify, I'm looking for text within the file, not in the file name.\... |
{"title":"Make an existing Git branch track a remote branch?","tags":["git","branch","git-branch"],"question_text":"I know how to make a new branch that tracks remote branches, but\nhow do I make an existing branch track a remote branch?\nI know I can just edit the\n`.git\/config`\nfile, but it seems there should be an... |
{"title":"What is your most productive shortcut with Vim?","tags":["vim","productivity","vi"],"question_text":"I've heard a lot about\nVim\n, both pros and cons.\nIt really seems you should be (as a developer) faster with Vim than with any other editor.\nI'm using Vim to do some basic stuff and I'm at best 10 times\nle... |
{"title":"Why does Google prepend while(1); to their JSON responses?","tags":["javascript","ajax","json"],"question_text":"Why does Google prepend\n`while(1);`\nto their (private) JSON responses?\nFor example, here's a response while turning a calendar on and off in\nGoogle Calendar\n:\n`while(1);[['u',[['smsSentFlag',... |
{"title":"How to get the current branch name in Git?","tags":["git"],"question_text":"I'm from a Subversion background and, when I had a branch, I knew what I was working on with \"These working files point to this branch\".\nBut with Git I'm not sure when I am editing a file in NetBeans or Notepad++, whether it's tied... |
{"title":"Set a default parameter value for a JavaScript function","tags":["javascript","function","arguments","default"],"question_text":"I would like a JavaScript function to have optional arguments which I set a default on, which gets used if the value isn't defined. In Ruby you can do it like this:\n`def read_file(... |
{"title":"Loop through an array in JavaScript","tags":["javascript","arrays","for-loop"],"question_text":"In Java you can use a\n`for`\nloop to traverse objects in an array as follows:\n`String[] myStringArray = {\"Hello\", \"World\"};\nfor (String s : myStringArray)\n{\n \/\/ Do something\n}`\nCan you do the same in J... |
{"title":"How can I determine the URL that a local Git repository was originally cloned from?","tags":["git","github","git-remote"],"question_text":"I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, and I neglected to note which one I took originally. How can I... |
{"title":"How do I empty an array in JavaScript?","tags":["javascript","arrays"],"question_text":"Is there a way to empty an array and if so possibly with\n`.remove()`\n?\nFor instance,\n`A = [1,2,3,4];`\nHow can I empty that?","answer_text":"Ways to clear an existing array\n`A`\n:\nMethod 1\n(this was my original answ... |
{"title":"Using java.net.URLConnection to fire and handle HTTP requests","tags":["java","http","httprequest","httpurlconnection","urlconnection"],"question_text":"Use of\n`java.net.URLConnection`\nis asked about pretty often here, and the\nOracle tutorial\nis\ntoo\nconcise about it.\nThat tutorial basically only shows ... |
{"title":"Checking if a key exists in a JavaScript object?","tags":["javascript","arrays","object"],"question_text":"How do I check if a particular key exists in a JavaScript object or array?\nIf a key doesn't exist, and I try to access it, will it return false? Or throw an error?","answer_text":"Checking for undefined... |
{"title":"Proper use of the IDisposable interface","tags":["c#",".net","garbage-collection","idisposable"],"question_text":"I know from reading\nthe MSDN documentation\nthat the \"primary\" use of the IDisposable interface is to clean up unmanaged resources.\nTo me, \"unmanaged\" means things like database connections,... |
{"title":"How do I give text or an image a transparent background using CSS?","tags":["html","css","opacity"],"question_text":"Is it possible, using CSS only, to make the\n`background`\nof an element semi-transparent but have the content (text & images) of the element opaque?\nI'd like to accomplish this without having... |
{"title":"When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?","tags":["c++","pointers","casting","c++-faq"],"question_text":"What are the proper uses of:\n`static_cast`\n`dynamic_cast`\n`const_cast`\n`reinterpret_cast`\nC-style cast\n`(type)value`\nFunction-style cast\n`type(value)`\nHow do... |
{"title":"Is there a standard function to check for null, undefined, or blank variables in JavaScript?","tags":["javascript",null,"undefined"],"question_text":"Is there a universal JavaScript function that checks that a variable has a value and ensures that it's not\n`undefined`\nor\n`null`\n? I've got this code, but I... |
{"title":"How do you disable browser Autocomplete on web form field \/ input tag?","tags":["html","autocomplete"],"question_text":"How do you disable\n`autocomplete`\nin the major browsers for a specific\n`input`\n(or\n`form field`\n)?","answer_text":"Firefox 30 ignores\n`autocomplete=\"off\"`\nfor passwords, opting to... |
{"title":"What is attr_accessor in Ruby?","tags":["ruby"],"question_text":"I am having a hard time understanding\n`attr_accessor`\nin Ruby. Can someone explain this to me? I have done tons of Google searches. I just can't understand it fully.","answer_text":"Let's say you have a class\n`Person`\n.\n`class Person\nend\n... |
{"title":"When are you supposed to use escape instead of encodeURI \/ encodeURIComponent?","tags":["javascript","encoding","query-string"],"question_text":"When encoding a query string to be sent to a web server - when do you use\n`escape()`\nand when do you use\n`encodeURI()`\nor\n`encodeURIComponent()`\n:\nUse escape... |
{"title":"How to replace master branch in git, entirely, from another branch?","tags":["git","merge","git-branch"],"question_text":"Possible Duplicate:\nChange the current branch to master in git\nI have two branches in my git repo:\nmaster\nseotweaks (created originally from master)\nI created\n`seotweaks`\nwith the i... |
{"title":"What are the nuances of scope prototypal \/ prototypical inheritance in AngularJS?","tags":["javascript","angularjs","inheritance","prototype","prototypal-inheritance"],"question_text":"The\nAPI Reference Scope page\nsays:\nA scope\ncan\ninherit from a parent scope.\nThe\nDeveloper Guide Scope page\nsays:\nA ... |
{"title":"How to count all the lines of code in a directory recursively?","tags":["bash","shell"],"question_text":"We've got a PHP application and want to count all the lines of code under a specific directory and its subdirectories. We don't need to ignore comments, as we're just trying to get a rough idea.\n`wc -l *.... |
{"title":"How to exit the VIM editor?","tags":["vim","vi"],"question_text":"I'm stuck and cannot escape. It says:\n`\"type :quit<Enter> to quit VIM\"`\nbut when I type that it simply appears in the object body.","answer_text":"Hit the\nEsc\nkey; that goes into command mode. Then you can type\n`:q`\nto quit (short for\n... |
{"title":"Vertically align text next to an image?","tags":["css","vertical-alignment"],"question_text":"Why won't\n`vertical-align: middle`\nwork? And yet,\n`vertical-align: top`\ndoes\nwork.\n`<div>\n <img style=\"width:30px;height:30px\">\n <span style=\"vertical-align:middle\">Doesn't work.<\/span>\n<\/div>`","answe... |
{"title":"How to determine whether my calculation of pi is accurate?","tags":["algorithm","math","language-agnostic","pi"],"question_text":"I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the\nTaylor series\nmethod, but it proved to converge extremely slowly (when I... |
{"title":"How do I randomly select an item from a list using Python?","tags":["python","list","random"],"question_text":"Assume I have the following list:\n`foo = ['a', 'b', 'c', 'd', 'e']`\nWhat is the simplest way to retrieve an item at random from this list?","answer_text":"Use\n`random.choice`\n:\n`import random\nf... |
{"title":"Check if a program exists from a Bash script","tags":["bash","shell"],"question_text":"How would I validate that a program exists?\nWhich would then either return an error and exit or continue with the script?\nIt seems like it should be easy, but it's been stumping me.","answer_text":"Yes; avoid\n`which`\n. ... |
{"title":"How does Trello access the user's clipboard?","tags":["javascript","coffeescript","clipboard","trello"],"question_text":"When you hover over a card in\nTrello\nand press\nCtrl\n+\nC\n, the URL of this card is copied to the clipboard. How do they do this?\nAs far as I can tell, there is no Flash movie involved... |
{"title":"How to efficiently count the number of keys\/properties of an object in JavaScript?","tags":["javascript","performance","properties","count","key"],"question_text":"What's the fastest way to count the number of keys\/properties of an object? It it possible to do this without iterating over the object? i.e. wi... |
{"title":"What are move semantics?","tags":["c++","c++-faq","c++11","move-semantics"],"question_text":"I just finished listening to the Software Engineering radio\npodcast interview with Scott Meyers\nregarding\nC++0x\n. Most of the new features made sense to me, and I am actually excited about C++0x now, with the exce... |
{"title":"Can you force Visual Studio to always run as an Administrator in Windows 8?","tags":["visual-studio","windows-8","uac"],"question_text":"In Windows 7, you could go into a programs compatibility settings and check off to always run as an Administrator. Is there a similar option in Windows 8?\nI've always disab... |
{"title":"How can I do an UPDATE statement with JOIN in SQL?","tags":["sql","sql-server","sql-server-2005","tsql"],"question_text":"I need to update this table in SQL Server 2005 with data from its 'parent' table, see below:\nsale\n`id (int)\nudid (int)\nassid (int)`\nud\n`id (int)\nassid (int)`\n`sale.assid`\ncontains... |
{"title":"How to fully delete a git repository created with init?","tags":["git","git-init"],"question_text":"I created a git repository with\n`git init`\n. I'd like to delete it entirely and init a new one.","answer_text":"Git keeps all of its files in the\n`.git`\ndirectory. Just remove that one and init again.\nIf y... |
{"title":"How can I select an element by name with jQuery?","tags":["javascript","jquery","html","dom","jquery-selectors"],"question_text":"Have a table column I'm trying to expand and hide:\njQuery seems to hide the td elements when I select it by\nclass\nbut not by element\nname\n.\nFor example, why does:\n`$(\".bold... |
{"title":"How to list the file names only that changed between two commits?","tags":["git","git-diff"],"question_text":"I have a bunch of commits in the repo. I want to see a list of files changed between two commits - from SHA1 to SHA2.\nWhat command should I use?","answer_text":"`git diff --name-only SHA1 SHA2`\nwher... |
{"title":"Squash my last X commits together using Git","tags":["git"],"question_text":"How can I squash my last X commits together into one commit using Git?","answer_text":"You can do this fairly easily without\n`git rebase`\nor\n`git merge --squash`\n. In this example, we'll squash the last 3 commits.\nIf you want to... |
{"title":"How to do case insensitive search in Vim","tags":["search","vim","case-insensitive"],"question_text":"I'd like to search for an upper case word, for example COPYRIGHT in a file. I tried performing a search like:\n`\/copyright\/i # Doesn't work`\nbut it doesn't work. I know that in Perl, if I give the\n`i`\nfl... |
{"title":"Check if checkbox is checked with jQuery","tags":["jquery","checkbox"],"question_text":"How can I check if a checkbox in a checkbox array is checked using the id of the checkbox array?\nI am using the following code, but it always returns the count of checked checkboxes regardless of id.\n`function isCheckedB... |
{"title":"How do I convert a string into an integer in JavaScript?","tags":["javascript","string","integer","parseint"],"question_text":"How do I convert a\n`string`\ninto an\n`integer`\nin JavaScript?","answer_text":"parseInt\nor\nunary plus\nor even\nparseFloat with floor\nor\nMath.round\nparseInt:\n`var x = parseInt... |
{"title":"How do I generate a random int number in C#?","tags":["c#","random"],"question_text":"How do I generate a random int number in C#?","answer_text":"The\n`Random`\nclass\nis used to create random numbers. (Pseudo-random that is of course.).\nExample:\n`Random rnd = new Random();\nint month = rnd.Next(1, 13); \/... |
{"title":"Is there a way to get the source code from an APK file?","tags":["android","android-resources","decompiling","apk"],"question_text":"The hard drive on my laptop just crashed and I lost all the source code for an app that I have been working on for the past two months.\nAll I have is the APK file that is store... |
{"title":"JSON serialization of enum as string","tags":["c#","asp.net","serialization","enums","javascriptserializer"],"question_text":"I have a class that contains an\n`enum`\nproperty, and upon serializing the object using\n`JavaScriptSerializer`\n, my json result contains the integer value of the enumeration rather ... |
{"title":"Proper MIME media type for PDF files","tags":["pdf","http-headers","content-type","mime"],"question_text":"When working with PDFs, I've run across the MIME types\n`application\/pdf`\nand\n`application\/x-pdf`\namong others.\nIs there a difference between these two types, and if so what is it? Is one preferred... |
{"title":"Find object by id in an array of JavaScript objects","tags":["javascript","jquery","arrays","object","javascript-objects"],"question_text":"I've got an array:\n`myArray = [{'id':'73','foo':'bar'},{'id':'45','foo':'bar'}, etc.]`\nI'm unable to change the structure of the array. I'm being passed an id of\n`45`\... |
{"title":"How to undo \"git commit --amend\" done instead of \"git commit\"","tags":["git","commit","undo","amend"],"question_text":"I accidentally amended my previous commit. The commit should have been separate to keep history of the changes I made to a particular file.\nIs there a way to undo that last commit? If I ... |
{"title":"What is the best algorithm for an overridden System.Object.GetHashCode?","tags":[".net","hashcode","gethashcode"],"question_text":"In .NET\n`System.Object.GetHashCode`\nmethod is used in a lot of places, throughout the .NET base class libraries. Especially when finding items in a collection fast or to determi... |
{"title":"jQuery document.createElement equivalent?","tags":["javascript","jquery","html","dom","dhtml"],"question_text":"I'm refactoring some old JavaScript code and there's a lot of DOM manipulation going on.\n`var d = document;\nvar odv = d.createElement(\"div\");\nodv.style.display = \"none\";\nthis.OuterDiv = odv;... |
{"title":"How can I reverse a NSArray in Objective-C?","tags":["objective-c","nsarray"],"question_text":"I need to reverse my\n`NSArray`\n.\nAs an example:\n`[1,2,3,4,5]`\nmust become:\n`[5,4,3,2,1]`\nWhat is the best way to achieve this?","answer_text":"There is a much easier solution, if you take advantage of the bui... |
{"title":"Is JavaScript a pass-by-reference or pass-by-value language?","tags":["javascript","pass-by-reference","pass-by-value"],"question_text":"The primitive types (Number, String, etc.) are passed by value, but Objects are unknown, because they can be both passed-by-value (in case we consider that a variable holdin... |
{"title":"Java optional parameters","tags":["java","optional-parameters"],"question_text":"How do I use optional parameters in Java? What specification supports optional parameters?","answer_text":"There are several ways to simulate optional parameters in Java:\nMethod overloading.\n`void foo(String a, Integer b) {\n \... |
{"title":"Type Checking: typeof, GetType, or is?","tags":["c#"],"question_text":"I've seen many people use the following code:\n`Type t = typeof(obj1);\nif (t == typeof(int))\n \/\/ Some code here`\nBut I know you could also do this:\n`if (obj1.GetType() == typeof(int))\n \/\/ Some code here`\nOr this:\n`if (obj1 is in... |
{"title":"Version vs build in XCode","tags":["ios","xcode"],"question_text":"I have an app that I developed with XCode 3 and recently started editing with XCode 4. In the target summary I have the iOS application target form with fields: identifier, version, build, devices, and deployment target. The version field is b... |
{"title":"How to restart Jenkins manually?","tags":["jenkins"],"question_text":"I've just started working with Jenkins and have run into a problem. After installing several plugins it said it needs to be restarted and went into a \"shutting down\" mode, but never restarts.\nHow do I do a manual restart?","answer_text":... |
{"title":"How much does it cost to develop an iPhone application?","tags":["iphone","objective-c","jobs"],"question_text":"How much can a developer charge for an iPhone app like\nTwitterrific\n?\nI want to know this because I need such an application with the same functionality for a new community website. I can do Rub... |
{"title":"Need a minimal Django file upload example","tags":["django","file","upload"],"question_text":"As a newbie to Django, I am having difficulty making an upload app in Django 1.3. I could not find any up-to-date example\/snippets. May someone post a minimal but complete (Model, View, Template) example code to do ... |
{"title":"Writing files in Node.js","tags":["node.js","file"],"question_text":"I've been trying to find a way to write to a file when using Node.js, but with no success. How can I do that?","answer_text":"There are a lot of details in the\nfilesystem API\n. The most common way (as far as I know) is:\n`var fs = require(... |
{"title":"Extracting extension from filename in Python","tags":["python","filenames","file-extension"],"question_text":"Is there a function to extract the extension from a filename?","answer_text":"Yes. Use\n`os.path.splitext`\n:\n`>>> import os\n>>> filename, file_extension = os.path.splitext('\/path\/to\/somefile.ext... |
{"title":"What is the difference between match_parent and fill_parent?","tags":["android","android-layout"],"question_text":"I'm a little confused about two XML properties:\n`match_parent`\nand\n`fill_parent`\n. It seems that both are the same. Is there any difference between them?","answer_text":"They're the same thin... |
{"title":"HTML-encoding in JavaScript\/jQuery","tags":["javascript","jquery","html-encode"],"question_text":"I\u00e2\u0080\u0099m using JavaScript to pull a value out from a hidden field and display it in a textbox. The value in the hidden field is encoded.\nFor example,\n`<input id='hiddenId' type='hidden' value='chal... |
{"title":"How do I create a Java string from the contents of a file?","tags":["java","file","file-io","io"],"question_text":"I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited.\nIs there a better\/different way to read a file into a string in J... |
{"title":"Generating random numbers in Objective-C","tags":["objective-c","random"],"question_text":"I'm a Java head mainly, and I want a way to generate a pseudo-random number between 0 and 74. In Java I would use the method:\n`Random.nextInt(74)`\nI'm not interested in a discussion about seeds or true randomness, jus... |
{"title":"How do you give a C# Auto-Property a default value?","tags":["c#","automatic-properties"],"question_text":"How do you give a C# Auto-Property a default value? I either use the constructor, or revert to the old syntax.\nUsing the Constructor:\n`class Person \n{\n public Person()\n {\n Name = \"Default Name\";\... |
{"title":"Make bash alias that takes parameter?","tags":["bash","alias"],"question_text":"I used to use CShell (\ncsh\n), which let you make an alias that takes a parameter. The notation was something like\n`alias junk=\"mv \\\\!* ~\/.Trash\"`\nIn Bash this does not seem to work. Given that Bash has a multitude of usef... |
{"title":"How do I correctly clone a JavaScript object?","tags":["javascript"],"question_text":"I have an object,\n`x`\n. I'd like to copy it as object\n`y`\n, such that changes to\n`y`\ndo not modify\n`x`\n. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted propert... |
{"title":"How to merge two arrays in Javascript and de-duplicate items","tags":["javascript","arrays","merge"],"question_text":"I have two JavaScript arrays:\n`var array1 = [\"Vijendra\",\"Singh\"];\nvar array2 = [\"Singh\", \"Shakya\"];`\nI want the output to be:\n`var array3 = [\"Vijendra\",\"Singh\",\"Shakya\"];`\nT... |
{"title":"how to push different local git branches to heroku\/master","tags":["git","heroku","git-push"],"question_text":"Heroku has a policy of ignoring all branches but 'master'.\nWhile I'm sure Heroku's designers have excellent reasons for for this policy (I'm guessing for storage and performance optimization), the ... |
{"title":"What's your most controversial programming opinion?","tags":["language-agnostic"],"question_text":"This is definitely subjective, but I'd like to try to avoid it becoming argumentative. I think it could be an interesting question if people treat it appropriately.\nThe idea for this question came from the comm... |
{"title":"window.onload vs $(document).ready()","tags":["javascript","jquery","javascript-events","unobtrusive-javascript"],"question_text":"What are the differences between JavaScript's\n`window.onload`\nand jQuery's\n`$(document).ready()`\nmethod?","answer_text":"The\n`ready`\nevent occurs after the HTML document has... |
{"title":"PHP array delete by value (not key)","tags":["php","arrays"],"question_text":"I have a PHP array as follows:\n`$messages = [312, 401, 1599, 3, ...];`\nI want to delete the element containing the value\n`$del_val`\n(for example,\n`$del_val=401`\n), but I don't know its key. This might help:\neach value can onl... |
{"title":"Xcode 4 - \"Archive\" is greyed out?","tags":["xcode4"],"question_text":"I would like to archive my application, but the Archive option is greyed out. What could cause this?","answer_text":"You have to select the device in the schemes menu in the top left where you used to select between simulator\/device. It... |
{"title":"How do I make links in a TextView clickable?","tags":["android","hyperlink","android-textview","clickable"],"question_text":"I have the following TextView defined:\n`<TextView android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\" android:text=\"@string\/txtCredits\"\n android:autoLink... |
{"title":"How do I get an apk file from an Android device?","tags":["android","adb","apk"],"question_text":"How do I get the apk file from an android device? Or how do I transfer the apk file from device to system?","answer_text":"None of these suggestions worked for me, because Android was appending a sequence number ... |
{"title":"git ignore files only locally","tags":["git","ignore","gitignore"],"question_text":"Can I ignore files locally without polluting the global git config for everyone else? I have untracked files that are spam in my git status but I don't want to commit git config changes for every single little random untracked... |
{"title":"What is the purpose of .PHONY in a makefile?","tags":["makefile"],"question_text":"What does\n`.PHONY`\nmean in a Makefile? I have gone through\nthis\n, but it is too complicated.\nCan somebody explain it to me in simple terms?","answer_text":"By default, Makefile targets are \"file targets\" - they are used ... |
{"title":"Fix a Git detached head?","tags":["git"],"question_text":"I was doing some work in my repository and noticed a file has local changes. I didn't want them anymore so I deleted the file, thinking I can just checkout a fresh copy. I wanted to do the git equivalent of\n`svn up .`\nUsing\n`git pull`\ndidn't seem t... |
{"title":"TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT maximum storage sizes","tags":["mysql","innodb"],"question_text":"Per\nthe docs\n, there are four TEXT types:\nTINYTEXT\nTEXT\nMEDIUMTEXT\nLONGTEXT\nWhat is the maximum length that I can store in a column of each data type assuming the character encoding is UTF-8?","an... |
{"title":"How does git handle symbolic links?","tags":["git","version-control","symlink"],"question_text":"If I have a file or directory that is a symbolic link and I commit it to a git repo what happens to it?\nI would assume that it leaves it as a symbolic link until the file is deleted and then if you pull the file ... |
{"title":"How to change the name of an iOS app?","tags":["ios"],"question_text":"I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished.\nBut I'm not sure how to do this with Xcode, trying the obvious of changing the applic... |
{"title":"Service vs IntentService","tags":["android","multithreading","android-service","android-intentservice"],"question_text":"Can someone please show me an example of something that can be done with an\n`IntentService`\nthat cannot be done with a\n`Service`\n(and vice-versa)?\nI also believe that an\n`IntentServic... |
{"title":"truncate foreign key constrained table","tags":["mysql","foreign-keys","constraints","truncate","dml"],"question_text":"Why doesn't a\nTRUNCATE\non\n`mygroup`\nwork?\nEven though I have\n`ON DELETE CASCADE SET`\nI get:\nERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint (\n`myt... |
{"title":"jQuery AJAX submit form","tags":["jquery","ajax","submit","form-submit","html-form"],"question_text":"I have a form with name orderproductForm and an undefined number of inputs.\nI want to do some kind of jQuery.get or ajax or anything like that that would call a page through Ajax, and send along all the inpu... |
{"title":"How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?","tags":["javascript","jquery","ajax","asynchronous"],"question_text":"I have a JavaScript widget which provides standard extension points. One of them is the\n`beforecreate`\nfunction. It should return\n`false`\nto prevent... |
{"title":"Is it possible to include one CSS file in another?","tags":["css"],"question_text":"Is it possible to include one CSS file in another?","answer_text":"Yes:\n`@import url(\"base.css\");`\nNote:\nThe\n`@import`\nrule must\nprecede\nall other rules (except the\n`@charset`\nrule); and\nAdditional\n`@import`\nstat... |
{"title":"Why is my program slow when looping over exactly 8192 elements?","tags":["c++","performance","memory-management","gcc"],"question_text":"Here is the extract from the program in question. The matrix\n`img[][]`\nhas the size SIZE\u00c3\u0097SIZE, and is initialized at:\n`img[j][i] = 2 * j + i`\nThen, you make a... |
{"title":"How to install lxml on Ubuntu","tags":["python","ubuntu","lxml","libxml2","easy-install"],"question_text":"I'm having difficulty installing lxml with easy_install on Ubuntu 11.\nWhen I type\n`$ easy_install lxml`\nI get:\n`Searching for lxml\nReading http:\/\/pypi.python.org\/simple\/lxml\/\nReading http:\/\/... |
{"title":"What is (functional) reactive programming?","tags":["functional-programming","terminology","reactive-programming","frp"],"question_text":"I've read the Wikipedia article on\nreactive programming\n. I've also read the small article on\nfunctional reactive programming\n. The descriptions are quite abstract.\nWh... |
{"title":"Manually raising (throwing) an exception in Python","tags":["python","exception","exception-handling"],"question_text":"How can I raise an exception in Python so that it can later be caught via an\n`except`\nblock?","answer_text":"How do I manually throw\/raise an exception in Python?\nUse the most specific E... |
{"title":"Sending email in .NET through Gmail","tags":["c#",".net","email","smtp","gmail"],"question_text":"Instead of relying on my host to send email, I was thinking of sending the messages though my Gmail account. The emails are personalized emails to the bands I play on my show. Is it possible to do?","answer_text"... |
{"title":"How to find all the tables in MySQL with specific column names in them?","tags":["mysql","information-schema"],"question_text":"I have 2-3 different column names that I want to look up in the entire DB and list out all tables which have those columns. Any easy script?","answer_text":"To get all tables with co... |
{"title":"Validation failed for one or more entities. See 'EntityValidationErrors' property for more details","tags":["c#","entity-framework","entity-framework-4","entity-framework-4.1"],"question_text":"I am having this error when seeding my database with code first approach.\nValidation failed for one or more entitie... |
{"title":"What is Node.js' Connect, Express and \"middleware\"?","tags":["node.js","middleware"],"question_text":"Despite knowing JavaScript quite well, I'm confused what\nexactly\nthese three projects in Node.js ecosystem do. Is it something like Rails' Rack? Can someone please explain?","answer_text":"[\nUpdate:\nAs ... |
{"title":"What is Redis and what do I use it for?","tags":["redis"],"question_text":"I saw mentions of Redis a few times and I looked it up and glanced at the\nfaq\n. From what I can tell it's a server (rather than in process library). I see it mentions storage and I am confused. What would redis be used for? I heard o... |
{"title":"How do I remove\/delete a folder that is not empty with Python?","tags":["python","file"],"question_text":"I am getting an 'access is denied' error when I attempt to delete a folder that is not empty. I used the following command in my attempt:\n`os.remove(\"\/folder_name\")`\n.\nWhat is the most effective wa... |
{"title":"Map two lists into a dictionary in Python","tags":["python","dictionary"],"question_text":"Imagine that you have:\n`keys = ('name', 'age', 'food')\nvalues = ('Monty', 42, 'spam')`\nWhat is the simplest way to produce the following dictionary ?\n`dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}`\nThis co... |
{"title":"Trim string in JavaScript?","tags":["javascript","string","trim"],"question_text":"How do I trim a string in JavaScript?","answer_text":"Since new Browsers (IE9+) have\n`trim()`\nalready implemented, you should only implement\n`trim()`\nif it is not already available on the Prototype-Object (overriding it is ... |
{"title":"Global Git ignore","tags":["git","global","gitignore"],"question_text":"I want to set up Git to globally ignore certain files.\nI have added a\n`.gitignore`\nfile to my user root directory (\n`Users\/me\/`\n) and I have added the following line to it:\n`*.tmproj`\nBut it is not ignoring this type of files, an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.