text stringlengths 74 309k |
|---|
{"title":"How to replace all occurrences of a character in string?","tags":["c++","algorithm","str-replace","stdstring"],"question_text":"What is the effective way to replace all occurrences of a character with another character in\n`std::string`\n?","answer_text":"`std::string`\ndoesn't contain such function but you c... |
{"title":"Can I use jQuery with Node.js?","tags":["javascript","jquery","node.js"],"question_text":"Is it possible to use jQuery selectors\/DOM manipulation on the server-side using Node.js?","answer_text":"Update\n: (late 2013) The official jQuery team finally took over the management of the\n`jquery`\npackage on npm:... |
{"title":"How to get the type of T from a generic List<T>?","tags":["c#",".net","generics","list"],"question_text":"Let say I have a\n`List<T> abc = new List<T>;`\ninside a class\n`public class MyClass<T>\/\/...`\n.\nLater, when I initialize the class, the\n`T`\nbecomes\n`MyTypeObject1`\n. So I have a generic list,\n`L... |
{"title":"Get element type with jQuery","tags":["jquery","element"],"question_text":"Is it possible, using jQuery, to find out the type of an element with jQuery? For example, is the element a div, span, select, or input?\nFor example, if I am trying to load values into a drop-down list with jQuery, but the same script... |
{"title":"How to check if a file exists from inside a batch file","tags":["windows","batch-file"],"question_text":"I need to run a utility only if a certain file exists. How do I do this in Windows batch?","answer_text":"`if exist <insert file name here> (\n rem file exists\n) else (\n rem file doesn't exist\n)`\nOr on... |
{"title":"Can code that is valid in both C and C++ produce different behavior when compiled in each language?","tags":["c++","c"],"question_text":"C and C++ have many differences, and not all valid C code is valid C++ code.\n(By \"valid\" I mean standard code with defined behavior, i.e. not implementation-specific\/und... |
{"title":"When to use CouchDB over MongoDB and vice versa","tags":["mongodb","performance","nosql","comparison","couchdb"],"question_text":"I am stuck between these two NoSQL databases.\nIn my project I will be creating a database within a database. For example, I need a solution to create dynamic tables.\nSo users can... |
{"title":"How to convert a char to a string in Java?","tags":["java","string","char","type-conversion"],"question_text":"I have a\n`char`\nand I need a\n`String`\n. How do I convert from one to the other?","answer_text":"You can use\n`Character.toString(char)`\n. Note that this method simply returns a call to\n`String.... |
{"title":"How do search engines deal with AngularJS applications?","tags":["html5","angularjs","seo","search-engine","google-search"],"question_text":"I see two issues with AngularJS application regarding search engines and SEO:\n1) What happens with custom tags? Do search engines ignore the whole content within those ... |
{"title":"How to get an absolute file path in Python","tags":["python","path","relative-path","absolute-path"],"question_text":"Given a path such as\n`\"mydir\/myfile.txt\"`\n, how do I find the absolute filepath relative to the current working directory in Python? E.g. on Windows, I might end up with:\n`\"C:\/example\... |
{"title":"Ternary operation in CoffeeScript","tags":["javascript","coffeescript"],"question_text":"I need to set value to\n`a`\nthat depends on a condition.\nWhat is the shortest way to do this with CoffeeScript?\nE.g. this is how I'd do it in JavaScript:\n`a = true ? 5 : 10 # => a = 5\na = false ? 5 : 10 # => a = 10`"... |
{"title":"When should I use Cross Apply over Inner Join?","tags":["sql","sql-server","performance","tsql","cross-apply"],"question_text":"What is the main purpose of using\nCROSS APPLY\n?\nI have read (vaguely, through posts on the Internet) that\n`cross apply`\ncan be more efficient when selecting over large data sets... |
{"title":"Cannot use object of type stdClass as array?","tags":["php","json"],"question_text":"I get a strange error using\n`json_decode()`\n. It decode correctly the data (I saw it using\n`print_r`\n), but when i try to access to info inside the array i get:\n`Fatal error: Cannot use object of type stdClass as array i... |
{"title":"\"cannot resolve symbol R\" in Android Studio","tags":["android","android-studio","r.java-file"],"question_text":"In every instance in all of my classes where I reference\n`R.id.something`\n, the\n`R`\nis in red and it says \"cannot resolve symbol R\". Also every time there is R.layout.something it is underli... |
{"title":"How should I choose an authentication library for CodeIgniter?","tags":["php","codeigniter","authentication"],"question_text":"I see there are\na few\n. Which ones are maintained and easy to use? What are their pros and cons?","answer_text":"Update (May 14, 2010):\nIt turns out, the russian developer Ilya Kon... |
{"title":"What XML parser should I use in C++?","tags":["c++","xml-parsing","c++-faq"],"question_text":"I have XML documents that I need to parse and\/or I need to build XML documents and write them to text (either files or memory). Since the C++ standard library does not have a library for this, what should I use?\nNo... |
{"title":"What are the differences between Perl, Python, AWK and sed?","tags":["python","perl","sed","awk","language-comparisons"],"question_text":"just want to know what are the main differences among them? and the power of each language (where it's better to use it).\nEdit:\nit's not \"vs.\" like topic, just informat... |
{"title":"How to create a DialogFragment without title?","tags":["android","android-dialogfragment"],"question_text":"I'm creating a DialogFragment to show some help messages regarding my app. Everything works fine besides one thing: There is a black stripe at the top of the window that shows the DialogFragment, that I... |
{"title":"How to discover number of *logical* cores on Mac OS X?","tags":["osx","makefile"],"question_text":"How can you tell, from the command line, how many cores are on the machine when you're running Mac OS X? On Linux, I use:\n`x=$(awk '\/^processor\/ {++n} END {print n+1}' \/proc\/cpuinfo)`\nIt's not perfect, but... |
{"title":"Programatically set left drawable in a TextView","tags":["android","android-textview","android-drawable"],"question_text":"I have a textView in xml here.\n`<TextView\n android:id=\"@+id\/bookTitle\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\... |
{"title":"Make an HTTP request with android","tags":["android","httpwebrequest","androidhttpclient"],"question_text":"I have searched everywhere but I couldn't find my answer, is there a way to make an simple HTTP request? I want to request an PHP page \/ script on one of my website but I don't want to show the webpage... |
{"title":"Is there a difference between \"throw\" and \"throw ex\"?","tags":["c#",".net","exception","exception-handling"],"question_text":"There are some posts that asks what the difference between those two are already.\n(why do I have to even mention this...)\nBut my question is different in a way that I am calling ... |
{"title":"Hard reset of a single file","tags":["git"],"question_text":"I currently have three modified files in my working directory. However I want one of them to be reset to the HEAD status.\nIn SVN I'd use\n`svn revert <filename>`\n(followed by\n`svn update <filename>`\nif needed) but in git I should use\n`git reset... |
{"title":"Gradle build without tests","tags":["gradle"],"question_text":"I want to execute\n`gradle build`\nwithout executing the unit tests. I tried:\n`$ gradle -Dskip.tests build`\nThat doesn't seem to do anything. Is there some other command I could use?","answer_text":"You should use the\n`-x`\ncommand line argumen... |
{"title":"Exporting APK from eclipse (ADT) silently crashes","tags":["android","eclipse","osx","adt"],"question_text":"Every time I try to export an APK from Eclipse (tried Juno and Indigo) on Mac, eclipse crashes after a few seconds\nThis used to work fine on my current setup.\nRunning the app straight (debug mode) on... |
{"title":"How to navigate to a directory in C:\\ with cygwin?","tags":["cygwin"],"question_text":"I'm trying to install\nPyQt4\nso I can mess around with it. The installation guide said I had to install\nsip\n. The last step to\ninstalling sip\nis to use the\n`make install`\ncommand. Windows doesn't have that, so I loo... |
{"title":"Deleting all files from a folder using PHP?","tags":["php","file","directory","folders"],"question_text":"For example I had a folder called `Temp' and I wanted to delete or flush all files from this folder using PHP. Could I do this?","answer_text":"`$files = glob('path\/to\/temp\/*'); \/\/ get all file names... |
{"title":"How to refresh Android listview?","tags":["android","android-listview","refresh"],"question_text":"How to refresh an Android\n`ListView`\nafter adding\/deleting dynamic data?","answer_text":"Call\n`notifyDataSetChanged()`\non your\n`Adapter`\nobject once you've modified the data in that adapter.\nSome additio... |
{"title":"How do I check if an integer is even or odd?","tags":["c","integer"],"question_text":"How can I check if a given number is even or odd in C?","answer_text":"Use the modulo (%) operator to check if there's a remainder when dividing by 2:\n`if (x % 2) { \/* x is odd *\/ }`\nA few people have criticized my answe... |
{"title":"Remove CSS \"top\" and \"left\" attributes with jQuery","tags":["jquery"],"question_text":"Im building a draggable map that when the map is dragged the element is given a 'left' and 'top' attribute with values for each as so...\n`<div class=\"map\" style=\"top:200px; left:100px;\">Map<\/div>`\nI have a button... |
{"title":"Create a custom callback in JavaScript","tags":["javascript"],"question_text":"All I need to do is to execute a callback function when my current function execution ends.\n`function LoadData() \n{\n alert('The data has been loaded');\n \/\/Call my callback with parameters. For example,\n \/\/callback(loadedDa... |
{"title":"How to enable NSZombie in Xcode?","tags":["xcode","nszombie"],"question_text":"I have an app that is crashing with no error tracing. I can see part of what is going on if I debug, but can't figure out which object is \"zombie-ing\".\nDoes anybody know how to enable NSZombie in Xcode 4?","answer_text":"Environ... |
{"title":"Rails update_attributes without save?","tags":["ruby-on-rails","ruby","ruby-on-rails-3","ruby-on-rails-4","activerecord"],"question_text":"Is there an alternative to update_attributes that does not save the record?\nSo I could do something like:\n`@car = Car.new(:make => 'GMC')\n#other processing\n@car.update... |
{"title":"git recover deleted file where no commit was made after the delete","tags":["git"],"question_text":"I deleted some files.\nI did NOT commit yet.\nI want to reset my workspace to recover the files.\nI did a\n`git checkout .`\n.\nBut the deleted files are still missing.\nAnd\n`git status`\nshows:\n`# On branch ... |
{"title":"Convert to absolute value in Objective-C","tags":["objective-c"],"question_text":"How do I convert a negative number to an absolute value in Objective-C?\ni.e.\n-10\nbecomes\n10?","answer_text":"Depending on the type of your variable, one of\n`abs(int)`\n,\n`labs(long)`\n,\n`llabs(long long)`\n,\n`imaxabs(int... |
{"title":"Find out which remote branch a local branch is tracking","tags":["git"],"question_text":"See also:\nhow do I get git to show me which branches are tracking what?\nHow can I find out which remote branch a local branch is tracking?\nDo I need to parse git config output, or is there a command that would do this ... |
{"title":"Showing all errors and warnings","tags":["php","debugging","warnings"],"question_text":"UPDATE 2:\nI have now removed the following from the .php file:\n`<?php error_reporting( E_ALL ); ?>`\nI have set display_erros in php.ini as follows:\ndisplay_errors = On\nerror reporting is set to the following in php.in... |
{"title":"How to check for NaN in python?","tags":["python","math"],"question_text":"`float('nan')`\nresults in a thingy simply called nan. But how do I check for it? Should be very easy, but i cannot find it.","answer_text":"math.isnan()\nChecks if the float x is a NaN (not a number). NaNs are part of the IEEE 754 sta... |
{"title":"What's the correct way to communicate between controllers in AngularJS?","tags":["scope","angularjs"],"question_text":"What's the correct way to communicate between controllers?\nI'm currently using a horrible fudge involving\n`window`\n:\n`function StockSubgroupCtrl($scope, $http) {\n $scope.subgroups = [];\... |
{"title":"Cannot resolve the collation conflict between \"SQL_Latin1_General_CP1_CI_AS\" and \"Latin1_General_CI_AS\" in the equal to operation","tags":["sql-server"],"question_text":"I have the following code\n`SELECT tA.FieldName As [Field Name],\nCOALESCE(tO_A.[desc], tO_B.[desc], tO_C.Name, tA.OldVAlue) AS [Old Val... |
{"title":"Responsively change div size keeping aspect ratio","tags":["html","css","responsive-design"],"question_text":"When I give an image a percent width or height only it will grow\/shrink keeping its aspect ratio, but if I want the same effect with another element, is it possible at all to tie the width and the he... |
{"title":"How do I measure time elapsed in Java?","tags":["java"],"question_text":"Possible Duplicate:\nHow do I calculate the elapsed time of an event in java?\nI want to have something like this:\n`public class Stream\n {\n public startTime;\n public endTime;\n public getDuration()\n {\n return startTime - endTime;\n... |
{"title":"Why can't I push to this bare repository?","tags":["git"],"question_text":"Can you explain what is wrong with this workflow?\n`$ git init --bare bare\nInitialized empty Git repository in \/work\/fun\/git_experiments\/bare\/\n$ git clone bare alice\nCloning into alice...\ndone.\nwarning: You appear to have clo... |
{"title":"What does \"coalgebra\" mean in the context of programming?","tags":["scala","haskell","functional-programming","programming-languages","category-theory"],"question_text":"I have heard the term \"coalgebras\" several times in functional programming and PLT circles, especially when the discussion is about obje... |
{"title":"Invoking JavaScript code in an iframe from the parent page","tags":["javascript","html","iframe"],"question_text":"Basically, I have an iframe embedded in a page and the iframe has some\nJavaScript\nroutines I need to invoke from the parent page.\nNow the opposite is quite simple as you only need to call\n`pa... |
{"title":"HTTP redirect: 301 (permanent) vs. 302 (temporary)","tags":["http","redirect","http-status-code-301","http-status-code-302"],"question_text":"Is the client supposed to behave differently? How?","answer_text":"Status 301 means that the resource (page) is moved permanently to a new location. The client\/browser... |
{"title":"Convert from enum ordinal to enum type","tags":["java","enums"],"question_text":"I've the enum type\n`ReportTypeEnum`\nthat get passed between methods in all my classes but I then need to pass this on the URL so I use the ordinal method to get the int value. After I get it in my other JSP page, I need to conv... |
{"title":"Is it possible to pass a flag to Gulp to have it run tasks in different ways?","tags":["javascript","node.js","gulp"],"question_text":"Normally in Gulp tasks look like this:\n`gulp.task('my-task', function() {\n return gulp.src(options.SCSS_SOURCE)\n .pipe(sass({style:'nested'}))\n .pipe(autoprefixer('last 10... |
{"title":"How do I specify the exit code of a console application in .NET?","tags":["c#",".net","exit-code"],"question_text":"I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the \"exit code\" of my console application. How do I do this?","answer_text":"Yo... |
{"title":"NSNotificationCenter addObserver in Swift","tags":["ios","nsnotificationcenter","swift","xcode6"],"question_text":"How do you add an observer in Swift to the default notification center? I'm trying to port this line of code that sends a notification when the battery level changes.\n`[[NSNotificationCenter def... |
{"title":"Finding Number of Cores in Java","tags":["java"],"question_text":"How can I find the number of cores available to my application from within Java code?","answer_text":"`int cores = Runtime.getRuntime().availableProcessors();`\nIf\n`cores`\nis less than one, either your processor is about to die, or your JVM h... |
{"title":"Apache not starting on MAMP Pro","tags":["mysql","apache","mamp","diagnostics","mamp-pro"],"question_text":"Apache wont start and it throws an error:\nOR\nApache couldn't be started. Please check the log file for more information.\ndyld: Symbol not found: _iconv\n Referenced from: \/usr\/lib\/libmecabra.dylib... |
{"title":"How to delete a module in Android Studio","tags":["android","ide","android-studio"],"question_text":"Is there a way to delete a module within Android Studio?\nWhen I right click on a module I can't find an option for deletion, is it elsewhere?","answer_text":"The \"Mark as Excluded\" option isn't there anymor... |
{"title":"Global variables in AngularJS","tags":["angularjs","global-variables"],"question_text":"I have a problem where i'm initialising a variable on the scope in a controller. Then it gets changed in another controller when a user logs in. This variable is used to control things such as the navigation bar and restri... |
{"title":"Is Mono ready for prime time?","tags":[".net","open-source","mono"],"question_text":"Has anyone used Mono, the open source .NET implementation on a large or medium sized project? I'm wondering if it's ready for real world, production environments. Is it stable, fast, compatible, ... enough to use? Does it tak... |
{"title":"What's the best way to iterate an Android Cursor?","tags":["android","cursor"],"question_text":"I frequently see code which involves iterating over the result of a database query, doing something with each row, and then moving on to the next row. Typical examples are as follows.\n`Cursor cursor = db.rawQuery(... |
{"title":"Fatal error: Maximum execution time of 30 seconds exceeded","tags":["php","json"],"question_text":"I am downloading a JSON file from an online source and and when it runs through the loop I am getting this error:\nFatal error: Maximum execution time of 30 seconds exceeded in C:\\wamp\\www\\temp\\fetch.php on ... |
{"title":"Get checkbox value in jQuery","tags":["jquery","html","forms","checkbox"],"question_text":"How can I get a checkbox's value in jQuery?","answer_text":"To get the value of the Value attribute you can do something like this:\n`$(\"input[type='checkbox']\").val();`\nOr if you have set a\n`class`\nor\n`id`\nfor i... |
{"title":"How to enable curl, installed Ubuntu LAMP stack?","tags":["php","ubuntu","curl","lamp"],"question_text":"I have installed ubuntu Lamp stack. But the curl is not enabled, neither can I can find the extension listed in the INI file. I added manually but it didn't work either.\nHow should I enable Curl then?","a... |
{"title":"Is this technically an O(1) algorithm for \"Hello World\"?","tags":["c#",".net","algorithm","big-o"],"question_text":"Would this be classified as an O(1) algorithm for \"Hello, World!\" ??\n`public class Hello1\n{\n public static void Main()\n {\n DateTime TwentyYearsLater = new DateTime(2035,01,01);\n while ... |
{"title":"How to delete an item in a list if it exists?","tags":["python","list"],"question_text":"I am getting\n`new_tag`\nfrom a form text field with\n`self.response.get(\"new_tag\")`\nand\n`selected_tags`\nfrom checkbox fields with\n`self.response.get_all(\"selected_tags\")`\nI combine them like this:\n`tag_string =... |
{"title":"How do you write multiline strings in Go?","tags":["go"],"question_text":"Does Go have anything similar to the python's multiline strings:\n`\"\"\"line 1\nline 2\nline 3\"\"\"`\nIf not, what is the preferred way of writing strings spanning multiple lines?","answer_text":"According to the\nlanguage specificati... |
{"title":"How to find index of list item in Swift?","tags":["arrays","swift"],"question_text":"I am trying to find an item index by searching a list. Does anybody know how to do that?\nI see there is list.StartIndex and list.EndIndex bu I want something like python's list.index(\"text\")","answer_text":"As swift is in ... |
{"title":"How to do SQL Like % in Linq?","tags":[".net","linq","tsql","linq-to-entities","sql-like"],"question_text":"I have a procedure in SQL that I am trying to turn into Linq:\n`SELECT O.Id, O.Name as Organization\nFROM Organizations O\nJOIN OrganizationsHierarchy OH ON O.Id=OH.OrganizationsId\nwhere OH.Hierarchy l... |
{"title":"Retrieving python module path","tags":["python","module","inotify"],"question_text":"I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.\nHow do I retrieve a module's path in python?","answer_text":"`import a_module... |
{"title":"How do I insert text at beginning of a multi-line selection in vi\/Vim?","tags":["vim","editing","viemu"],"question_text":"In\nVim\n, how would I go about inserting characters at the beginning of each line in a selection?\nFor instance, let's say I want to comment out a block of code by prepending '\/\/' at t... |
{"title":"SQL Server Profiler - How to filter trace to only display events from one database?","tags":["sql-server","profiler","sqlprofiler"],"question_text":"How do I limit a SQL Server Profiler trace to a specific database? I can't see how to filter the trace to not see events for all databases on the instance I conn... |
{"title":"How do I call controller\/view methods from the console in Rails?","tags":["ruby-on-rails","console"],"question_text":"When I load\n`script\/console`\n, some times I want play with the output of a controller or a view helper method.\nAre there ways to:\nsimulate a request?\ncall methods from a controller inst... |
{"title":"What is the size of ActionBar in pixels?","tags":["android","android-actionbar"],"question_text":"I need to know the exact size of ActionBar in pixels so to apply correct background image.","answer_text":"To retrieve the height of the ActionBar in XML, just use\n`?android:attr\/actionBarSize`\nor if you're an... |
{"title":"Best way to strip punctuation from a string in Python","tags":["python","string","punctuation"],"question_text":"It seems like there should be a simpler way than:\n`import string\ns = \"string. With. Punctuation?\" # Sample string \nout = s.translate(string.maketrans(\"\",\"\"), string.punctuation)`\nIs there... |
{"title":"What is the naming convention in Python for variable and function names?","tags":["python","variables","function","naming-conventions"],"question_text":"Coming from a C# background the naming convention for variables and method names are usually either CamelCase or Pascal Case:\n`\/\/ C# example\nstring thisI... |
{"title":"How to get index in Handlebars each helper?","tags":["javascript","handlebars.js"],"question_text":"I'm using Handlebars for templating in my project. Is there a way to get the index of the current iteration of an \"each\" helper in Handlebars?\n`<tbody>\n {{#each item}}\n <tr>\n <td><!--HOW TO GET ARRAY INDE... |
{"title":"Multiprocessing vs Threading Python","tags":["python","multithreading","multiprocessing"],"question_text":"I am trying to understand the advantages of\nmultiprocessing\nover\nthreading\n. I know that\nmultiprocessing\ngets around the Global Interpreter Lock, but what other advantages are there, and can\nthrea... |
{"title":"Add new attribute (element) to JSON object using JavaScript","tags":["javascript","json"],"question_text":"How do I add new attribute (element) to JSON object using JavaScript?","answer_text":"JSON stands for JavaScript Object Notation. A JSON object is really a string that has yet to be turned into the objec... |
{"title":"How to position one element relative to another with jQuery?","tags":["jquery"],"question_text":"I have a hidden DIV which contains a toolbar-like menu.\nI have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them.\nIs there a built-in function which will move the menu DIV t... |
{"title":"RESTful Authentication","tags":["rest","authentication","restful-authentication","rest-security"],"question_text":"What does RESTful Authentication mean and how does it work? I can't find a good overview on Google. My only understanding is that you pass the session key (remeberal) in the URL, but this could b... |
{"title":"Can I write a CSS selector selecting elements NOT having a certain class?","tags":["html","css","css-selectors"],"question_text":"I would like to write a CSS selector rule that selects all elements that\ndon't\nhave a certain class. For example, given the following HTML:\n`<html class=\"printable\">\n <body c... |
{"title":"Android Split string","tags":["java","android","string"],"question_text":"I have a string called\n`CurrentString`\nand is in the form of something like this\n`\"Fruit: they taste good\"`\n.\nI would like to split up the\n`CurrentString`\nusing the\n`:`\nas the delimiter.\nSo that way the word\n`\"Fruit\"`\nwi... |
{"title":"How to increase the vertical split window size in Vim","tags":["vim","window","viewport"],"question_text":"`:vsplit`\n(short form:\n`:vs`\n) split the Vim viewport vertically.\n`:30vs`\nsplits the viewport, making the new window 30 characters wide. Once this 30 char window is created, how would one change it'... |
{"title":"Is there a way to follow redirects with command line cURL","tags":["curl"],"question_text":"I know that in a php script:\n`curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);`\nwill follow redirects. Is there a way to follow redirects with command line cURL?","answer_text":"Use the location header flag:\n`curl -L... |
{"title":"Use of 'prototype' vs. 'this' in JavaScript?","tags":["javascript","prototype","this"],"question_text":"What's the difference between\n`var A = function () {\n this.x = function () {\n \/\/do something\n };\n};`\nand\n`var A = function () { };\nA.prototype.x = function () {\n \/\/do something\n};`","answer_te... |
{"title":"Difference between string and text in rails?","tags":["ruby-on-rails"],"question_text":"I'm making a new web app using Rails, and was wondering, what's the difference between\n`string`\nand\n`text`\n? And when should each be used?","answer_text":"The difference relies in how the symbol is converted into its r... |
{"title":"Generating all permutations of a given string","tags":["java","algorithm"],"question_text":"What is an elegant way to find all the permutations of a string. E.g.\n`ba`\n, would be\n`ba`\nand\n`ab`\n, but what about\n`abcdefgh`\n? Is there any example Java implementation?","answer_text":"`public static void pe... |
{"title":"How do I move a file (or folder) from one folder to another in TortoiseSVN?","tags":["svn","tortoisesvn"],"question_text":"I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add\/delete op... |
{"title":"How to ignore certain files in git?","tags":["git","gitignore"],"question_text":"I have a repository with a file\n`Hello.java`\n. When I compile it an additional\n`Hello.class`\nfile is generated.\nI created an entry for\n`Hello.class`\nin a\n`.gitignore`\nfile. However the file still appears to be tracked.\n... |
{"title":"Ruby: Calling class method from instance","tags":["ruby","class-method"],"question_text":"In Ruby, how do you call a class method from one of that class's instances? Say I have\n`class Truck\n def self.default_make\n # Class method.\n \"mac\"\n end\n def initialize\n # Instance method.\n Truck.default_make # ... |
{"title":"What is the strict aliasing rule?","tags":["c","undefined-behavior","c++-faq","strict-aliasing","type-punning"],"question_text":"When asking about\ncommon undefined behavior in C\n, souls more enlightened than I referred to the strict aliasing rule.\nWhat are they talking about?","answer_text":"A typical situ... |
{"title":"Processing $http response in service","tags":["javascript","angularjs","angular-http"],"question_text":"I recently posted a detailed description of the issue I am facing\nhere\nat SO. As I couldn't send an actual\n`$http`\nrequest, I used timeout to simulate asynchronous behavior. Data binding from my model t... |
{"title":"How to get rid of `deprecated conversion from string constant to \u00e2\u0080\u0098char*\u00e2\u0080\u0099` warnings in GCC?","tags":["c++","string","gcc"],"question_text":"So I'm working on an exceedingly large codebase, and recently upgraded to gcc 4.3, which now triggers this warning:\nwarning: deprecated ... |
{"title":"In what situations would AJAX long\/short polling be preferred over HTML5 WebSockets?","tags":["javascript","ajax","html5","websocket","network-protocols"],"question_text":"I am building a small chat application for friends, but unsure about how to get information in a timely manner that is not as manual or a... |
{"title":"How to retrieve the dimensions of a view?","tags":["android","layout","android-widget","lifecycle","measure"],"question_text":"I have a view made up of tablelayout, tablerows and textviews. I want it to look like a grid. I need to get the height and width of this grid. The methods getheight() and getwidth() a... |
{"title":"How to install a private NPM module without my own registry?","tags":["node.js","npm","package","npm-private-modules"],"question_text":"I've taken some shared code and put it in an NPM module, one I don't want to upload to the central registry. The question is, how do I install it from other projects?\nThe ob... |
{"title":"What is Daemon thread in Java?","tags":["java","multithreading"],"question_text":"Can anybody tell me what daemon threads are in Java?","answer_text":"A daemon thread is a thread that does not prevent the JVM from exiting when the program finishes but the thread is still running. An example for a daemon threa... |
{"title":"HTTP response code for POST when resource already exists","tags":["http","rest"],"question_text":"I'm building a server that allows clients to store objects. Those objects are fully constructed at client side, complete with object IDs that are permanent for the whole lifetime of the object.\nI have defined th... |
{"title":"How to enable PHP short tags?","tags":["php","tags","php-shorttags"],"question_text":"I have a web application on a Linux server which starts with\n`<?`\nI needed to copy this application to a windows environment and everything is working fine except that an SQL statement is being rendered differently. I don'... |
{"title":"Converting NSString to NSDate (and back again)","tags":["ios","objective-c","swift","nsstring","nsdate"],"question_text":"How would I convert an\n`NSString`\nlike \"01\/02\/10\" (meaning 1st February 2010) into an\n`NSDate`\n? And how could I turn the\n`NSDate`\nback into a string?","answer_text":"Objective-C... |
{"title":"How to use if statements in underscore.js templates?","tags":["javascript","templates","backbone.js","underscore.js"],"question_text":"I'm using the underscore.js templating function and have done a template like this:\n`<script type=\"text\/template\" id=\"gridItem\">\n <div class=\"griditem <%= gridType %> ... |
{"title":"Android: How to put an Enum in a Bundle?","tags":["android","enums","android-bundle"],"question_text":"How do you add an Enum object to an Android Bundle?","answer_text":"Enums are Serializable so there is no issue.\nGiven the following enum:\n`enum YourEnum {\n TYPE1,\n TYPE2\n}`\nBundle:\n`\/\/ put\nbundle.... |
{"title":"JQuery: detect change in input field","tags":["jquery","keypress"],"question_text":"Possible Duplicate:\nJquery: how to detect a textbox's content has changed\nI want to detect when a user's keyboard actions alter the value of a text field. It should work consistently across modern browsers.\nThe JQuery page ... |
{"title":"How can I assign an ID to a view programmatically?","tags":["android","android-view","android-resources","findviewbyid","android-identifiers"],"question_text":"In an XML file, we can assign an ID to a view like\n`android:id=\"@+id\/something\"`\nand then call\n`findViewById()`\n, but when creating a view prog... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.