text
stringlengths
74
309k
{"title":"ExpandableListView - hide indicator for groups with no children","tags":["android","android-listview","expandablelistview"],"question_text":"In an\n`ExpandableListView`\n, is there a way to hide the group indicator for groups with no children?","answer_text":"The\n`android:groupIndicator`\nproperty takes a st...
{"title":"Default value to a parameter while passing by reference in C++","tags":["c++","pass-by-reference","default-value"],"question_text":"Is it possible to give a default value to a parameter of a function while we are passing the parameter by reference. in C++\nFor example, when I try to declare a function like:\n...
{"title":"Reporting Services permissions on SQL Server R2 SSRS","tags":["sql-server-2008","ssrs-2008","sql-server-2008-r2"],"question_text":"I'm getting the error below when I try and access SSRS on SQL Server 2008 R2\nI'm not sure how many others have started using SQL 2008 R2 SSRS, but I am having an issue with getti...
{"title":"img src SVG changing the fill color","tags":["css","image","css3","svg"],"question_text":"html\n`<img src=\"logo.svg\" alt=\"Logo\" class=\"logo-img\">`\ncss\n`.logo-img path {\n fill: #000;\n}`\nThe above svg loads and is natively\n`fill: #fff`\nbut when I use the above\n`css`\nto try change it to black it d...
{"title":"Refresh (reload) a page once using jQuery?","tags":["jquery","refresh","reload"],"question_text":"I'm wondering how to refresh\/reload a page (or even specific div) once(!) using jQuery?\nIdeally in a way right after the\n`DOM structure`\nis available (cf.\n`onload`\nevent) and not negatively affecting\n`back...
{"title":"CSV API for Java","tags":["java","csv"],"question_text":"Can anyone recommend a simple API that will allow me to use read a CSV input file, do some simple transformations, and then write it.\nA quick google has found\nhttp:\/\/flatpack.sourceforge.net\/\nwhich looks promising.\nI just wanted to check what oth...
{"title":"Why override operator()?","tags":["c++","boost","operator-overloading","functor","function-call-operator"],"question_text":"In the\nBoost Signals\nlibrary, they are overloading the () operator.\nIs this a convention in C++? For callbacks, etc.?\nI have seen this in code of a co-worker (who happens to be a big...
{"title":"Understanding the results of Execute Explain Plan in Oracle SQL Developer","tags":["oracle","oracle-sqldeveloper","explain-plan"],"question_text":"I'm trying to optimize a query but don't quite understand some of the information returned from\nExplain Plan\n. Can anyone tell me the significance of the OPTIONS...
{"title":"UIScrollView not scrolling in iOS7 with autolayout on","tags":["ios","objective-c","uiscrollview"],"question_text":"I have a UIScrollView with a 6 textfields in it and a button inside of it. There is not enough content in the scrollView to make it scroll.\nBut when the keyboard shows, I would like the scrollv...
{"title":"How do I get a UTC Timestamp in JavaScript?","tags":["javascript","timezone","utc"],"question_text":"While writing a web application, it makes sense to store (server side)\nall\ndatetimes in the DB as UTC timestamps.\nI was astonished when I noticed that you couldn't natively do much in terms of Timezone mani...
{"title":"How can I run a static constructor?","tags":["c#",".net","static-constructor"],"question_text":"I'd like to execute the static constructor of a class (i.e. I want to \"load\" the class) without creating an instance. How do I do that?\nBonus question: Are there any differences between .NET 4 and older versions...
{"title":"Calculate a running total in MySQL","tags":["mysql","sql"],"question_text":"I have this MySQL query:\n`SELECT DAYOFYEAR(`date`) AS d, COUNT(*) \nFROM `orders` \nWHERE `hasPaid` > 0\nGROUP BY d\nORDER BY d`\nWhich returns something like this:\n`d | COUNT(*) |\n20 | 5 |\n21 | 7 |\n22 | 12 |\n23 | 4 |`\nWhat I'd...
{"title":"Setting EditText imeOptions to actionNext has no effect","tags":["android","android-layout","focus","ime"],"question_text":"I have a fairly complex (not really) xml layout file. One of the views is a LinearLayout (\n`v1`\n) with two children: an EditText(\n`v2`\n) and another LinearLayout(\n`v3`\n). The child...
{"title":"EventMachine vs Node.js","tags":["ruby-on-rails","node.js","eventmachine","event-driven","commonjs"],"question_text":"I'm going to develop a collaborative site, and one of the features will be collaborative editing with realtime changes. i.e. when two or more users are editing the same doc, they can see each ...
{"title":"The VMware Authorization Service is not running","tags":["service","vmware"],"question_text":"windows could not start vmware authorise service on local computer.\nError 1075 : the dependency service does not exist or has been marked\n as deletion\nI have installed\nwindows7 home basic\nso i am not geeting any...
{"title":"List distinct values in a vector in R","tags":["r","vector","distinct-values"],"question_text":"How can I list the distinct values in a vector where the values are replicative? I mean, similarly to the following SQL statement:\n`SELECT DISTINCT product_code\nFROM data`","answer_text":"Do you mean\n`unique`\n:...
{"title":"jQuery .val() vs .attr(\"value\")","tags":["jquery","forms"],"question_text":"I had thought these two were the same, but they appear to not be. I've generally been using\n`$obj.attr(\"value\")`\nto work with form fields, but on the page I'm currently building,\n`$obj.attr(\"value\")`\ndoes not return the text...
{"title":"In angular, how to use cancel an $interval on user events, like page change?","tags":["angularjs"],"question_text":"Angular documentation\nabout\n`$interval`\nis saying :\nNote: Intervals created by this service must be explicitly destroyed when you are finished with them.\nbut it's not explaining how to dest...
{"title":"Efficient way to determine number of digits in an integer","tags":["c++","integer","digits"],"question_text":"What is a very\nefficient\nway of determining how many digits there are in an integer in C++?","answer_text":"Well, the most efficient way, presuming you know the size of the integer, would be a looku...
{"title":"What is the difference between char a[] = ?string?; and char *p = ?string?;?","tags":["c++","pointers","c++-faq"],"question_text":"As the heading says, What is the difference between\n`char a[] = ?string?; and \nchar *p = ?string?;`\nThis question was asked to me in interview.\nI even dont understand the stat...
{"title":"Does Index of Array Exist","tags":["c#","arrays","indexing"],"question_text":"I've inherited some code at work that has a really bad smell. I'm hoping to find the most painless solution possible.\nIs there a way to check if some arbitrary number is a valid element in an array?\nExample - I need to check if ar...
{"title":"Detect if time format is in 12hr or 24hr format","tags":["objective-c","ios","cocoa-touch","nstimezone"],"question_text":"Is there any way to detect if the current device of the app uses 12h our 24h format, so that I can use one NSDateFormatter for 12h and one for 24h depending on the users language\/loaction...
{"title":"What is \"X-Content-Type-Options=nosniff\"?","tags":["html","http-headers","meta","owasp","penetration-testing"],"question_text":"I am doing some penetration testing on my localhost with OWASP ZAP, and it keeps reporting this message:\nThe Anti-MIME-Sniffing header X-Content-Type-Options was not set to\n 'nos...
{"title":"E11000 duplicate key error index in mongodb mongoose","tags":["node.js","mongodb","express","mongoose","mean-stack"],"question_text":"Following is my\n`user`\nschema in\n`user.js`\nmodel -\n`var userSchema = new mongoose.Schema({\n local: {\n name: { type: String },\n email : { type: String, require: true, un...
{"title":"Remove UIWebView Shadow?","tags":["iphone","uiwebview","shadow"],"question_text":"Does anyone know if its possible to remove the shadow that is placed on the UIWebView window?\nExample:\nhttp:\/\/uploadingit.com\/files\/1173105_olub5\/shadow.png\nIf its possible how do you do it?\nThanks","answer_text":"This ...
{"title":"What tools to automatically inline CSS style to create email HTML code?","tags":["html","css","email","inline","html-email"],"question_text":"When you take a look at\nhttp:\/\/www.campaignmonitor.com\/css\/\nyou learn that you need to embed inline styles in your HTML, in order for your email to be read in any...
{"title":"How do I implement IEnumerable<T>","tags":["c#",".net","generics"],"question_text":"I know how to implement the non generic IEnumerable, like this:\n`using System;\nusing System.Collections;\nnamespace ConsoleApplication33\n{\n class Program\n {\n static void Main(string[] args)\n {\n MyObjects myObjects = ne...
{"title":"Can code that will never be executed invoke undefined behavior?","tags":["c"],"question_text":"The code that invokes undefined behavior (in this example, division by zero) will never get executed, is the program still undefined behavior?\n`int main(void)\n{\n int i;\n if(0)\n {\n i = 1\/0;\n }\n return 0;\n}`...
{"title":"the best way to make codeigniter website multi-language. calling from lang arrays depends on lang session?","tags":["arrays","session","codeigniter","multilanguage"],"question_text":"I'm researching hours and hours, but I could not find any clear, efficient way to make it :\/\nI have a codeigniter base websit...
{"title":"iterm vim colorscheme not working","tags":["osx","vim","iterm"],"question_text":"When I run vim from the commandline in iterm, syntax highlighting doesn't seem to work locally.\nIn vim for example I have installed a nice colour scheme that works quite well in MacVim but it would be great if in iterm it showed...
{"title":"Error: could not find function \"unit\"","tags":["r","ggplot2"],"question_text":"While trying to modify theme settings this simple code gives the following error:\n`library(ggplot2)\ntheme_nogrid <- theme_set(theme_update( \n plot.margin=unit(c(.25, .25, .25, .25), \"in\"),))\nError in do.call(theme, list(......
{"title":"What's the difference between Bitmap.Clone() and new Bitmap(Bitmap)?","tags":["c#","bitmap","clone"],"question_text":"As far as I can tell, there are two ways of copying a bitmap.\nBitmap.Clone()\n`Bitmap A = new Bitmap(\"somefile.png\");\nBitmap B = (Bitmap)A.Clone();`\nnew Bitmap()\n`Bitmap A = new Bitmap(\...
{"title":"Clear git repository on Bitbucket?","tags":["git","bitbucket"],"question_text":"I'm just getting started with git, and started messing about with Bitbucket. However, I now want to use the repository I created, but without its initial history.\nIs there any way I can clear out or purge my repository so that I ...
{"title":"What is the use of ByteBuffer in Java?","tags":["java","buffer","bytebuffer"],"question_text":"What are example applications for a\n`ByteBuffer`\nin Java? Please list any example scenarios where this is used. Thank you!","answer_text":"This\nis a good description of its uses and shortcomings. You essentially ...
{"title":"0xDBE \/ PHPStorm \/ IDEA fails to synchronize database's tables","tags":["intellij-idea","phpstorm","0xdbe"],"question_text":"I'm getting the following error when trying to sync the database tables in 0xDBE:\n`Method org.postgresql.jdbc4.Jdbc4Array.free() is not yet implemented.\nMethod org.postgresql.jdbc4....
{"title":"Why should a developer use web services instead of direct connections to a db?","tags":["wcf","web-services"],"question_text":"I'm looking for a \"top ten\" list of reasons why we should be connecting to remote databases via web service instead of directly connecting to the db. This is an internal debate righ...
{"title":"Representing Monetary Values in Java","tags":["java","currency","money","bigdecimal"],"question_text":"I understand that BigDecimal is recommended best practice for representing monetary values in Java. What do you use? Is there a better library that you prefer to use instead?","answer_text":"`BigDecimal`\nal...
{"title":"Where is the all Android broadcast Intent list","tags":["android","android-intent","broadcast"],"question_text":"I want to receive the Android broadcast messages. Is there a list of all intents?","answer_text":"I have found the broadcast intent list. It can be located under the sdks(or android-sdks)\/platform...
{"title":"Set maxlength in Html Textarea","tags":["html","input","textarea"],"question_text":"How can I set the\n`maxlength`\nin a\n`textarea`\n? And why\n`maxlength`\nis not working properly in\n`textarea`\n?","answer_text":"Before HTML5, we have an easy but workable way:\nFirstly set an maxlength attribute in the tex...
{"title":"DataGrid row content vertical alignment","tags":["c#","wpf","xaml","datagrid","vertical-alignment"],"question_text":"I have a regular DataGrid from WPF 4.0 RTM, where I put data from a database. In order to make clean & light style of DataGrid I use a tall\/high rows and by default DataGrid aligns row content...
{"title":"Mongoose: findOneAndUpdate doesn't return updated document","tags":["node.js","mongodb","mongoose"],"question_text":"Below is my code\n`var mongoose = require('mongoose');\nmongoose.connect('mongodb:\/\/localhost\/test');\nvar Cat = mongoose.model('Cat', {\n name: String,\n age: {type: Number, default: 20},\n...
{"title":"Javascript, how do you sort an array on multiple columns?","tags":["javascript","algorithm","sorting"],"question_text":"I have a multidimensional array. The primary array is an array of\n`[publicationID][publication_name][ownderID][owner_name]`\nWhat I am trying to do is sort the array by\n`owner_name`\nand t...
{"title":"Xcode 4.5 Storyboard 'Exit'","tags":["iphone","objective-c","xcode","ipad","storyboard"],"question_text":"I have just installed Xcode 4.5 for iOS6 support, and I have seen a new icon called 'Exit' in my Storyboard, listed under my view controllers along with 'First Responder' etc. A little green icon labeled ...
{"title":"Download binary file from OKHTTP","tags":["android","inputstream","bufferedinputstream","okhttp"],"question_text":"I am using OKHTTP client for networking in my android application.\nThis\nexample shows how to upload binary file. I would like to know how to get inputstream of binary file downloading with OKHT...
{"title":"Difference between .*? and .* for regex","tags":["regex","regex-greedy"],"question_text":"I'm trying to split up a string into two parts using regex. The string is formatted as follows:\n`text to extract<number>`\nI've been using\n`(.*?)<`\nand\n`<(.*?)>`\nwhich work fine but after reading into regex a little...
{"title":"Opening Chrome From Command Line","tags":["windows","google-chrome","batch-file","command-prompt"],"question_text":"I have the following batch file:\n`@echo off\nREM Starts a chrome browser with multiple tabbed sites\nC:\\Users\\UserName\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe \"site1.com\" \...
{"title":"Deleting to the beginning of line when line starts with whitespace characters","tags":["vim"],"question_text":"I usually use\nd\n^\nto delete to the beginning of line.\nBut if the line starts with space or tabulations, the deletion does not go all the way to start of line.\nExample:\nfoo foo\nThe line starts ...
{"title":"C++ STL containers: what's the difference between deque and list?","tags":["c++","list","stl","deque"],"question_text":"What is the difference between the two? I mean the methods are all the same. So, for a user, they work identically.\nIs that correct??","answer_text":"Let me list down the differences:\nDequ...
{"title":"SQL join on multiple columns in same tables","tags":["sql","join"],"question_text":"I have 2 subqueries, but I'm having trouble joining columns together from the same tables. I tried:\n`SELECT * FROM\n(SELECT userid, listid \nFROM user_views_table\nWHERE date='2013-05-15' AND view_type='lists') a\nJOIN\n(SELE...
{"title":"Django: Catching Integrity Error and showing a customized message using template","tags":["python","django","website"],"question_text":"In my django powered app there is only one obvious case where \"IntegrityError\" can arise.So,how can I catch that error and display a message using templates.","answer_text"...
{"title":"CSS Margin Collapsing","tags":["css","margin"],"question_text":"So essentially does margin collapsing occur when you don't set any margin or padding or border to a given div element?","answer_text":"No. When you have two adjacent vertical margins, the greater of the two is used and the other is ignored.\nSo, ...
{"title":"Cross-platform means of getting user's home directory in Ruby?","tags":["ruby","cross-platform"],"question_text":"Java has the convienient\n`System.getProperty(\"user.home\")`\nto get the user's \"home\" directory in a platform-independent way. What's the equivalent in Ruby? I don't have a Windows box to play...
{"title":"Razor syntax highlighting not working in VS 2012 with MVC 5","tags":["c#","razor","visual-studio-2012","visual-studio-2013","asp.net-mvc-5"],"question_text":"I'm playing around with MVC 5 RC 1 in Visual Studio 2013 RC. Works very well.\nNow I upgraded an existing MVC 4 project in VS 2012 to MVC 5 the same way...
{"title":"Similar to jQuery .closest() but traversing descendants?","tags":["jquery"],"question_text":"Is there a function similar to\n`jQuery`\n`.closest()`\nbut for traversing descendants and returning only closest ones?\nI know that there is\n`.find()`\nfunction, but it returns all possible matches, not closest.\nEd...
{"title":"Is there a Unicode glyph that looks like a \"key\" icon?","tags":["unicode","icons","key","glyph"],"question_text":"Unicode has a million icon-like glyphs, but they're not always easy to search by, since I don't always know what they look like.\nIs there a Unicode glyph that looks like a \"key\"? Or is there ...
{"title":"Matrix multiplication: Small difference in matrix size, large difference in timings","tags":["c","performance","algorithm","matrix-multiplication"],"question_text":"I have a matrix multiply code that looks like this:\n`for(i = 0; i < dimension; i++)\n for(j = 0; j < dimension; j++)\n for(k = 0; k < dimension;...
{"title":"Using HTML5 file uploads with AJAX and jQuery","tags":["javascript","jquery","ajax","html5","file-upload"],"question_text":"Admittedly, there are similar questions lying around on SO. But it seems none quite meet my requirements. Here is what I'm looking to do:\nUpload an entire form of data, one piece of whi...
{"title":"How to get existing fragments when using FragmentPagerAdapter","tags":["android","android-fragments","fragmentpageradapter"],"question_text":"I have problem making my fragments communicating with each other through the\n`Activity`\n, which is using the\n`FragmentPagerAdapter`\n, as a helper class that impleme...
{"title":"JavaScript Random Positive or Negative Number","tags":["javascript","random"],"question_text":"I need to create a random -1 or 1 to multiply an already existing number by. Issue is my current random function generates a -1, 0, or 1. What is the most efficient way of doing this?","answer_text":"Don't use your ...
{"title":"Proper REST response for empty table?","tags":["api","http","rest"],"question_text":"Let's say you want to get list of users by calling\n`get`\nto\n`api\/users`\nbut currently the table was truncated so there are no users. What is the proper response for this scenario\n`404`\nor\n`204`\n?","answer_text":"I sa...
{"title":"Is it possible to prevent stack allocation of an object and only allow it to be instantiated with 'new'?","tags":["c++","c++-faq"],"question_text":"Is it possible to prevent stack allocation of an object and only allow it to be instiated with 'new' on the heap?","answer_text":"One way you could do this would ...
{"title":"UITextView with Syntax Highlighting","tags":["iphone","objective-c","cocoa-touch","uitextview"],"question_text":"Possible Duplicate:\nUITextView w\/ Syntax Highlighting\nI've found a question on this already but it didn't have a complete answer to it.\nIs there a Framework or Library that can do Syntax Highli...
{"title":"Android gradle build Error:(9, 0) Gradle DSL method not found: 'compile()'.","tags":["android","build","gradle"],"question_text":"I am getting the following build error when I try and sync my project:\n`Error:(9, 0) Gradle DSL method not found: 'compile()'\nPossible causes:The project 'AlexTest' may be using ...
{"title":"How to add an action to a UIAlertView button using Swift iOS","tags":["ios","uialertview","swift"],"question_text":"I want to add another button other than the \"OK\" button which should just dismiss the alert.\nI want the other button to call a certain function.\n`var logInErrorAlert: UIAlertView = UIAlertVi...
{"title":"filteredArrayUsingPredicate does not exist in swift Array","tags":["swift","ios8","xcode6"],"question_text":"I have \"UserDetails\" struct objects in array..I want to filter the objects from array. But there is no option for \"filteredArrayUsingPredicate\" in Swift array.\nMy array creation\n`var arrayOfUsers...
{"title":"Change status bar text colour from white iOS 7 \/ Xcode 5","tags":["ios","objective-c","ios7"],"question_text":"I'm developing an application for a school that I work at. Currently I am having issues with changing the status bar text from it's default state of black to white so we can actually read it!\nI hav...
{"title":"How to redirect qDebug, qWarning, qCritical etc output?","tags":["c++","debugging","qt","mingw","qdebug"],"question_text":"I'm using a lot of\n`qDebug() <<`\nstatements for debug output. Is there any cross-platform way I can redirect that debug output to a file, without resorting to shell scripts? I'm guessin...
{"title":"How can I use an integer value as 'key' to set value in NSMutableDictionary?","tags":["iphone","objective-c","nsmutabledictionary"],"question_text":"How can I use an integer value as 'key' to set a float value in NSMutableDictionary ?","answer_text":"As NSDictionarys are only designed to deal with objects, a ...
{"title":"Mockito How to mock and assert a thrown exception?","tags":["java","exception-handling","junit","mockito"],"question_text":"I'm using mockito in a junit test. How do you make an exception happen and then assert that it has (generic pseudo-code)","answer_text":"To answer your second question first. If you're u...
{"title":"Programmatically get a Storyboard ID?","tags":["objective-c","xcode","storyboard","identity"],"question_text":"Trying to see if a UIViewController or UIView can identify it's Storyboard ID. So was hoping for:\n`UIViewController *aViewController;\n NSString *storyboardID = aViewController.storyboard.id; \/\/no...
{"title":"How can you dynamically create variables via a while loop?","tags":["python","variables"],"question_text":"I want to create variables dynamically via to a while loop in Python. Anyone have any creative means of doing this?","answer_text":"Unless there is an overwhelming need to create a mess of variable names...
{"title":"How do I render jinja2 output to a file in Python instead of a Browser","tags":["python","django","jinja2"],"question_text":"I have a jinja2 template (.html file) that I want to render (replace the tokens with values from my py file). Instead of sending the rendered result to a browser, however, I want to wri...
{"title":"Today button in jQuery Datepicker doesn't work","tags":["jquery-ui","datepicker"],"question_text":"I'm using jQueryUI Datepicker and show \"Today\" button.\nBut it doesn't work. It also doesn't work in demo:\nhttp:\/\/www.jqueryui.com\/demos\/datepicker\/#buttonbar\nI'w want to fill input with today when pres...
{"title":"Understanding SQL Server LOCKS on SELECT queries","tags":["sql-server","tsql","linq-to-sql"],"question_text":"I'm wondering what is the benefit to use\n`SELECT WITH (NOLOCK)`\non a table if the only other queries affecting that table are\n`SELECT`\nqueries.\nHow is that handled by SQL Server? Would a\n`SELECT...
{"title":"Cordova + Angularjs + Device Ready","tags":["angularjs","cordova","angularjs-service"],"question_text":"I am developing a mobile application using Cordova and AngularJS. How do I restrict bootstrapping of AngluarJS before Cordova device ready. Basically I don't want to use any of AngularJS controllers before ...
{"title":"UINavigationBar Text Color in Swift","tags":["text","colors","navigation","uinavigationbar","swift"],"question_text":"How would I go about changing the color of the\n`UINavigationBar`\nin Swift?\nMost things online say to do something like:\n`[self.navigationController.navigationBar setTitleTextAttributes:@{N...
{"title":"ASP.NET MVC: Html.EditorFor and multi-line text boxes","tags":["asp.net-mvc-3","razor"],"question_text":"This is my code:\n`<div class=\"editor-label\">\n @Html.LabelFor(model => model.Comments[0].Comment)\n <\/div>\n <div class=\"editor-field\">\n @Html.EditorFor(model => model.Comments[0].Comment)\n @Html.V...
{"title":"what's the use of Gemfile in rails?","tags":["ruby-on-rails","gemfile"],"question_text":"My question may seem a bit complicated but let me clarify, use of\n`Gemfile`\nin Rails. I am new to Rails its getting difficult for me to do the same. If anyone can provide me a link for its demo or can explain me how to ...
{"title":"Search and delete multiple lines","tags":["search","vim"],"question_text":"In vim\n:g\/George Bush\/d\ndeletes all lines with\nGeorge Bush.\nWhat if I wanted to delete\n5 lines below that start with George Bush\n?\nAnother realistic example would be to find all DEBUG in a log4net log and delete up to the end ...
{"title":"WebClient.DownloadString() returns string with peculiar characters","tags":["c#","asp.net",".net","character-encoding","special-characters"],"question_text":"I have an issue with some content that we are downloading from the web for a screen scraping tool that I am building.\nin the code below, the string ret...
{"title":"Is there a \"Find in Files\" shortcut in Eclipse?","tags":["eclipse","file","find","shortcut"],"question_text":"Is there a \"Find in Files\" shortcut in Eclipse, as there is in Visual Studio (\nCtrl\n+\nShift\n+\nF\n)?\nI have looked in these two lists:\nEclipse Shortcuts\n\"Show All Shortcuts\" shortcut:\nCt...
{"title":"Copy a file, creating directories as necessary in Ruby","tags":["ruby"],"question_text":"Let's say I have a file at\n`\/source.txt`\n, and I want to copy it to\n`\/a\/b\/c.txt`\n.\n`\/a`\nand\n`\/a\/b`\nmay or may not exist.\nIs there a way to copy the file and have it create the necessary parent directories ...
{"title":"Remove first element from $@ in bash","tags":["arrays","bash"],"question_text":"I'm writing a bash script that needs to loop over the arguments passed into the script. However, the first argument shouldn't be looped over, and instead needs to be checked before the loop.\nIf I didn't have to remove that first ...
{"title":"What is the meaning of \"... ...\" token? i.e. double ellipsis operator on parameter pack","tags":["c++","c++11","variadic-templates"],"question_text":"While browsing through gcc's current implementation of new C++11 headers, I stumbled upon \"......\" token. You can check, that the following code\ncompiles f...
{"title":"Most efficient way to make the first character of a String lower case?","tags":["java","string","performance","optimization"],"question_text":"What is the most efficient way to make the first character of a\n`String`\nlower case?\nI can think of a number of ways to do this:\nUsing\n`charAt()`\nwith\n`substrin...
{"title":"What is jQuery's ajax default timeout value?","tags":["jquery","timeout"],"question_text":"Does anyone know what the default jQuery ajax timeout value is?","answer_text":"The default is\n`0`\n(\ntechnically it's undefined\n, but behaves as 0). This means no timeout in jQuery itself...if the browser has some t...
{"title":"How does github figure out a project's language?","tags":["github"],"question_text":"I was recently working on a github project in both JavaScript and C++, and noticed that github tagged the project as C++. If you have to pick a single language, this is probably the correct designation since the C++ code is c...
{"title":"transform object to array with lodash","tags":["javascript","arrays","object","lodash"],"question_text":"How i can transform big object to array with lodash?\nexample:\n`var obj = {\n 22: {name:\"John\", id:22, friends:[5,31,55], works:{books:[], films:[],}\n 12: {name:\"Ivan\", id:12, friends:[2,44,12], work...
{"title":"Java - find the first cause of an exception","tags":["java","oracle","exception-handling","ora-00001"],"question_text":"I need to check if an exception is caused by some database problem. I receive an Exception and check if its cause contains the \"ORA\" string and return that (something like \"ORA-00001\"). ...
{"title":"Find tuple structure containing an unknown value inside a list","tags":["python","list","tuples"],"question_text":"Say I have list of tuples:\n`list = [(1,5), (1,7), (2,3)]`\nIs there a way in Python to write something like\n`if (1, *) in list: do things`\nwhere\n`*`\nmeans \"\nI don\u00e2\u0080\u0099t care a...
{"title":"How do I indicate long text into a smaller fixed column with CSS?","tags":["css","string","truncate"],"question_text":"How do I fit long text into a fixed width column where I have room for only one line of text? The text needs to be cut to a fixed width\n(lets say to 100px)\nand I would like to add dots \".....
{"title":"What is System, out, println in System.out.println() in Java","tags":["java","system.out"],"question_text":"Possible Duplicate:\nWhat's the meaning of System.out.println in Java?\nI was looking for the answer of what\n`System`\n,\n`out`\nand\n`println`\nare in\n`System.out.println()`\nin the Java. I searched ...
{"title":"What's the yield keyword in JavaScript?","tags":["javascript","yield","keyword"],"question_text":"I heard about a \"yield\" keyword in JavaScript, but I found very poor documentation about it. Can someone explain me (or recommend a site that explains) its usage and what it is used for?","answer_text":"The\nMD...
{"title":"Is shared readonly data copied to different processes for Python multiprocessing?","tags":["python","numpy","multiprocessing"],"question_text":"The piece of code that I have looks some what like this:\n`glbl_array = # a 3 Gb array\ndef my_func( args, def_param = glbl_array):\n #do stuff on args and def_param\...
{"title":"Removing empty space, if the section header is hidden in the UICollectionView","tags":["ios","iphone","ios7","uicollectionview","uicollectionreusableview"],"question_text":"I have two sections in\n`UICollectionView`\n. I want to show a section header in\n`UICollectionView`\nfor only 1st section. Not in 0th se...
{"title":"Adding attributes to customer entity","tags":["php","magento","custom-attributes"],"question_text":"my current goal is to add a new customer attribute (with\n`int`\ntype) which should appear as select with predefined options (loaded from a model with entries editable in backend, which is done).\nI'm strugglin...
{"title":"Regex to remove all special characters from string?","tags":["c#","regex","string"],"question_text":"I'm completely incapable of regular expressions, and so I need some help with a problem that I think would best be solved by using regular expressions.\nI have list of strings in C#:\n`List<string> lstNames = ...
{"title":"Explain the use of a bit vector for determining if all characters are unique","tags":["java","string","bit-manipulation","bitvector"],"question_text":"I am confused about how a bit vector would work to do this (not too familiar with bit vectors). Here is the code given. Could someone please walk me through th...
{"title":"UIPageViewController navigates to wrong page with Scroll transition style","tags":["ios6","uipageviewcontroller"],"question_text":"My UIPageViewController was working fine in iOS 5. But when iOS 6 came along, I wanted to use the new scroll transition style (UIPageViewControllerTransitionStyleScroll) instead o...
{"title":"What is the difference between casting and conversion?","tags":["c#","type-conversion","casting"],"question_text":"Eric Lippert's comments in\nthis question\nhave left me thoroughly confused. What is the difference between casting and conversion in C#?","answer_text":"Casting is a way of telling the compiler ...