text
stringlengths
74
309k
{"title":"How do I find duplicates across multiple columns?","tags":["sql","sql-server-2008"],"question_text":"So I want to do something like this sql code below:\n`select s.id, s.name,s.city \nfrom stuff s\ngroup by s.name having count(where city and name are identical) > 1`\nTo produce the following, (but ignore wher...
{"title":"How can an anonymous class use \"extends\" or \"implements\"?","tags":["java","anonymous-class"],"question_text":"How can an anonymous class extend a superclass or implement an interface?","answer_text":"Anonymous classes\nmust\nextend or implement something, like any other Java class, even if it's just\n`jav...
{"title":"Dagger 2 subcomponents vs component dependencies","tags":["dagger","dagger-2"],"question_text":"Dagger 1's\n`plus()`\nmethod is something I used quite often in previous applications, so I understand situations where you might want to have a subcomponent with full access to the parent graphs bindings.\nIn what...
{"title":"GetManifestResourceStream returns NULL","tags":["c#","embedded-resource"],"question_text":"This is a C# .NET 4.0 application:\nI'm embedding a text file as a resource and then trying to display it in a dialog box:\n`var assembly = Assembly.GetExecutingAssembly();\n var resourceName = \"MyProj.Help.txt\";\n us...
{"title":"How to convert CString and ::std::string ::std::wstring to each other?","tags":["c++","mfc","cstring","stdstring"],"question_text":"`CString`\nis quite handy, while\n`std::string`\nis more compatible with STL container.\nI am using\n`hash_map`\n. However,\n`hash_map`\ndoes not support\n`CString`\nas key, so ...
{"title":"Word frequency algorithm for natural language processing","tags":["algorithm","nlp","word-frequency"],"question_text":"Without getting a degree in information retrieval, I'd like to know if there exists any algorithms for counting the frequency that words occur in a given body of text. The goal is to get a \"...
{"title":"CSS display:table-row does not expand when width is set to 100%","tags":["css","css3"],"question_text":"I'm having a bit of a problem. I'm using FireFox 3.6 and have the following DOM structure:\n`<div class=\"view-row\">\n <div class=\"view-type\">Type<\/div>\n <div class=\"view-name\">Name<\/div> \n<\/div>`...
{"title":"I am confused about SOAP namespaces","tags":["soap"],"question_text":"I am learning about SOAP implementation and have become somewhat confused regarding the appropriate namespace URI for a SOAP 1.2 Envelope.\nThe\nw3c specification for SOAP\nrefers to the\n`\"http:\/\/www.w3.org\/2003\/05\/soap-envelope\"`\n...
{"title":"reorder list elements - jQuery?","tags":["javascript","jquery"],"question_text":"Is it possible to reorder\n`<li>`\nelements with JavaScript or pure jQuery. So if I have a silly list like the following:\n`<ul>\n <li>Foo<\/li>\n <li>Bar<\/li>\n <li>Cheese<\/li>\n<\/ul>`\nHow would I move the list elements arou...
{"title":"AsyncTask onPostExecute never gets called","tags":["android","android-asynctask"],"question_text":"I am not sure what I am doing wrong but onPostExecute never gets called.\nCreated a base class called BaseActivity.java\nFrom my original Activity I extended this class.\nPlaced PostToOpenFeint class inside Base...
{"title":"How should I log while using multiprocessing in Python?","tags":["python","logging","multiprocessing"],"question_text":"Right now I have a central module in a framework that spawns multiple processes using the Python 2.6\n`multiprocessing`\nmodule\n. Because it uses\n`multiprocessing`\n, there is module-level...
{"title":"Get Visual Studio to run a T4 Template on every build","tags":["visual-studio","templates","tfs","t4"],"question_text":"How do I get a T4 template to generate its output on every build? As it is now, it only regenerates it when I make a change to the template.\nI have found other questions similar to this:\nh...
{"title":"Why JavaScript functions always return a value?","tags":["javascript"],"question_text":"I'm taking a course in JavaScript programming, and the instructor said that a typical JavaScript function always returns a value. Even when we don't provide any explicit return value, the engines return\n`undefined`\n.\nIs...
{"title":"Contact us functionality in Rails 3","tags":["ruby-on-rails","forms","email","contact","mail-form"],"question_text":"I want to make a contact us form in Rails 3 with the following fields:\nName\nEmail\nMessage title\nMessage body\nThe posted messages are intended to go to my email address so I don't neccessar...
{"title":"If I'm already using Modernizr, will I then even need HTML5 Shiv?","tags":["javascript","html5","css3","cross-browser","modernizr"],"question_text":"1) If I'm already using Modernizr, will I then even need HTML5 Shiv to enable HTML5 tag support for IE?\n2) Is HTML5 Shiv only for IE, or for all browser who don...
{"title":"Multivariate time series modelling in R","tags":["r","statistics","time-series"],"question_text":"I want do fit some sort of multi-variate time series model using R.\nHere is a sample of my data:\n`u cci bci cpi gdp dum1 dum2 dum3 dx \n 16.50 14.00 53.00 45.70 80.63 0 0 1 6.39 \n 17.45 16.00 64.00 46.30 80.90...
{"title":"What does <> (angle brackets) mean in Java?","tags":["java","generics"],"question_text":"I am currently studying Java and have recently been stumped by what does <> means?\n`public class Pool<T>{\n public interface PoolFactory<T>{\n public T createObject();\n}\nthis.freeObjects= new ArrayList<T>(maxsize)`\nWh...
{"title":"Unsigned keyword in C++","tags":["c++","unsigned"],"question_text":"Does the unsigned keyword default to a data type in C++? I am trying to write a function for a class for the prototype:\n`unsigned Rotate(unsigned object, int count)`\nBut I don't really get what unsigned means. I thought it would be like uns...
{"title":"What should I choose: GTK+ or Qt?","tags":["linux","qt","gtk"],"question_text":"Can someone suggest what's the best uses for those libraries today? Is it just GUI, or do they have database, XML, networking, threading, etc support too?\nI was reading about them, and considered starting to learning\/using one o...
{"title":"SQL Inner join more than two tables","tags":["sql","table","inner-join"],"question_text":"I can currently query the join of two tables on the equality of a foreign\/primary key in the following way.\n`$result = mysql_query(\"SELECT * FROM `table1` \n INNER JOIN \n `table2` ON table1.primaryKey=table2.table1Id...
{"title":"Reliable method to get machine's MAC address in C#","tags":["c#","mac-address"],"question_text":"I need a way to get a machine's MAC address regardless of the OS it is running using C#. Application will need to work on XP\/Vista\/Win7 32 and 64 bit as well as on those OSs but with a foreign language default. ...
{"title":"How to consume a webApi from asp.net Web API to store result in database?","tags":["c#","asp.net","asp.net-web-api"],"question_text":"How to consume a WEBAPI from another ASP.Net Web API to store the response in a database.\nI know how to consume a WEBAPI from clients like javascript,console application etc.\...
{"title":"Benefit of Polymorphism","tags":["java","oop","java-ee","polymorphism"],"question_text":"When I started to look for the benefits of polymorphism, I found with\nthis\nquestion here. But here I was unable to find my answer. Let me tell what I want to find. Here I have some classes:\n`class CoolingMachines{\n pu...
{"title":"What is the difference between `before()` and `beforeEach()`?","tags":["javascript","unit-testing","mocha"],"question_text":"What specifically is the difference between\nMocha\n's\n`before()`\nand\n`beforeEach()`\n? (Same question for\n`after()`\nand\n`afterEach()`\n.)\nI assume\n`before()`\nruns once per\n`d...
{"title":"RMagick warning while running server","tags":["ruby-on-rails","rmagick"],"question_text":"I am using gem 1.3.7, rails 2.3.5 and ruby 1.8.7 (2008-08-11 patchlevel 72). While starting server i get below warnings.\n`Loading development environment (Rails 2.3.5)\n\/Users\/me\/.rvm\/gems\/ruby-1.8.7-p72@mbm\/gems\...
{"title":"PHP + PDO + MySQL: how do I return integer and numeric columns from MySQL as integers and numerics in PHP?","tags":["php","mysql","osx","ubuntu","pdo"],"question_text":"I've seen this question repeated a few times on Stack Overflow but none sufficiently explore the problem (or at least in a way that is helpfu...
{"title":"301 or 302 Redirection With PHP","tags":["php"],"question_text":"I'm considering using the following code during a website launch phase to show users a\ndown for maintenance\npage while showing me the rest of the site.\nIs there a way to show the correct 302 re-direction status to search engines or should I l...
{"title":"Can I detect IE6 with PHP?","tags":["php","internet-explorer-6","cross-browser"],"question_text":"Is there a way to use PHP to detect if the page is being loaded using IE6?","answer_text":"Try checking their user agent for\n`'MSIE 6.'`\n.\n`$using_ie6 = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== FALS...
{"title":"Good algorithm and data structure for looking up words with missing letters?","tags":["algorithm","data-structures"],"question_text":"so I need to write an efficient algorithm for looking up words with missing letters in a dictionary and I want the set of possible words.\nFor example, if I have th??e, I might...
{"title":"Increment Letters like numbers","tags":["php"],"question_text":"I would like to write a function that takes in 3 characters and increments it and returns the newly incremented characters as a string.\nI know how to increase a single letter to the next one but how would I know when to increase the second lette...
{"title":"how to 'load data infile' on amazon RDS?","tags":["mysql","amazon-web-services","amazon-rds","mysql-error-1045"],"question_text":"not sure if this is a question better suited for serverfault but I've been messing with amazon RDS lately and was having trouble getting 'file' privileges to my web host mysql user...
{"title":"PHP: exceptions vs errors?","tags":["php","exception","exception-handling","error-handling"],"question_text":"Maybe I'm missing it somewhere in the PHP manual, but what exactly is the difference between an error and an exception? The only difference that I can see is that errors and exceptions are handled dif...
{"title":"pandoc markdown page break","tags":["latex","markdown","pandoc"],"question_text":"Recently I started using pandoc markdown which seems a good alternative to LaTeX, as my document does not have many mathematical formulas, and I do not have ANY experience with LaTeX, which combined with less than 2 week submiss...
{"title":"How can I alter a primary key constraint using SQL syntax?","tags":["sql-server"],"question_text":"I have a table that is missing a column in its primary key constraint. Instead of editing it through SQL Server, I want to put this in a script to add it as part of our update scripts.\nWhat syntax can I use to ...
{"title":"How do I disable the Performance Explorer from opening every time?","tags":["visual-studio-2012"],"question_text":"On a project that you've ran a Performance Analysis, the Performance Explorer tab always opens when VS is started, even if it was closed just before VS was exited.\nHow do I disable it and keep i...
{"title":"YouTube Video not playing in WebView - Android","tags":["android","video","youtube","android-webview"],"question_text":"I am tying to play YouTube video in WebView, WebView showing first look of video with play button, But after click on play button start progress bar and after 2-3 seconds stop progress bar a...
{"title":"Maven dependency spring-web vs spring-webmvc","tags":["spring","maven","spring-mvc"],"question_text":"What is the difference between the following dependencies?\n`<dependency>\n <groupId>org.springframework<\/groupId>\n <artifactId>spring-webmvc<\/artifactId>\n <version>3.1.2.RELEASE<\/version>\n <\/dependenc...
{"title":"How can I calculate divide and modulo for integers","tags":["c#"],"question_text":"How can I calculate division and modulo for integer numbers in c#?","answer_text":"Before asking questions of this kind, please check\nMSDN documentation\n.\nWhen you divide two integers, the result is always an integer. For ex...
{"title":"Summarize grouping by year and month","tags":["google-spreadsheet"],"question_text":"I have a worksheet\nMovements\nwith two fields:\n`mydate | amount\n2009-01-01 | 10.00\n2009-01-02 | 13.00\n2009-02-01 | 11.00\n2009-02-05 | 12.00\n2009-02-08 | 52.00`\nI want to have in another worksheet\nMonthSum\nthat displ...
{"title":"Destructors of builtin types (int, char etc..)","tags":["c++","constructor","destructor","typedef"],"question_text":"In C++ the following code gives a compiler error:\n`void destruct1 (int * item)\n{\n item->~int();\n}`\nThis code is nearly the same, I just typedef the int to another type and something magic ...
{"title":"ASP.NET vNext is host agnostic, what does it deeply mean?","tags":["asp.net","host","asp.net-core"],"question_text":"According to\nASP.NET vNext tutorial\n:\n`vNext is host agnostic . You can host your app in IIS, or self-host in a custom process`\nCould anyone help me to understand this in deepth with showin...
{"title":"Check whether the string is a unix timestamp","tags":["php","datetime","time","unix-timestamp"],"question_text":"I have a string and I need to find out whether it is a unix timestamp or not, how can I do that effectively?\nI found\nthis thread\nvia Google, but it doesn't come up with a very solid answer, I'm ...
{"title":"how to identify a given string is hex color format","tags":["regex","colors"],"question_text":"I'm looking for a regular expression to validate hex colors in\nasp.net C#\n.\nAnd also looking code for validation on server side.\nFor instance:\n`#CCCCCC`","answer_text":"`^#(?:[0-9a-fA-F]{3}){1,2}$`\nDissection:...
{"title":"jQuery Validation Plugin - adding rules that apply to multiple fields","tags":["jquery","jquery-validate"],"question_text":"I'm using the\njQuery Validation\nplugin:\nI have several fields in a large form that I want to apply the same rules to. I've simplified the code for this example. This code doesn't work...
{"title":"get list of pandas dataframe columns based on data type","tags":["python","pandas"],"question_text":"If I have a dataframe with the following columns:\n`1. NAME object\n2. On_Time object\n3. On_Budget object\n4. %actual_hr float64\n5. Baseline Start Date datetime64[ns]\n6. Forecast Start Date datetime64[ns]`\...
{"title":"WCF: How do I get the list of endpoints from ServiceHost?","tags":[".net","wcf",".net-3.0"],"question_text":"I can add endpoints using\n`ServiceHost.AddServiceEndpoint`\n. How do I get that list of endpoints back out?","answer_text":"host.Description.Endpoints","question_code":[],"answer_code":[],"retrieval_t...
{"title":"Private module methods in Ruby","tags":["ruby","private-methods","access-specifier"],"question_text":"I have a two part question\nBest-Practice\nI have an algorithm that performs some operation on a data structure using the public interface\nIt is currently a module with numerous static methods, all private e...
{"title":"git: how to move some commits to new branch","tags":["git"],"question_text":"I have been working in straight line:\n`A---B---C---D---E---F (master:HEAD)`\nNow I want to move backward:\n`git checkout C`\nand move few last commits to a new branch:\nOption 1:\n`D---E---F (new:HEAD)\n \/\nA---B---C (master)`\nOpt...
{"title":"Storing DateTime (UTC) vs. storing DateTimeOffset","tags":["sql","sql-server","tsql","sql-server-2008","datetimeoffset"],"question_text":"I usually have an \"interceptor\" that right before reading\/writing from\/to the database does datetime conversion (from UTC to localtime, and from localtime to utc), so I...
{"title":"Writing backwards compatible Android code","tags":["android","api","compatibility"],"question_text":"I'm writing an app that uses some functions and classes only available in the latest API level - 16, but I want it to run with no errors on devices with API level 15.\nLet's use a couple of examples. A new cla...
{"title":"Vim helptag generation","tags":["vim"],"question_text":"I use pathogen and have an update script that downloads the latest versions of all the vim plugins I use from vim.org, github, or wherever else they may be. However, this script does not currently update the vim helptags. In order to do so, I have to go ...
{"title":"Grails domain class: unique constraint for multiple columns","tags":["grails","orm","unique-constraint","grails-domain-class","grails-validation"],"question_text":"Suppose a simple Grails domain class:\n`class Account {\n String countryId;\n String userName;\n String password;\n static constraints = {\n ...??...
{"title":"Align HTML input fields by :","tags":["html","css","html5","user-interface","alignment"],"question_text":"I have a HTML form like:\n`<html>\n Name:<input type=\"text\"\/><\/br>\n Email Address:<input type=\"text\"\/><\/br>\n Description of the input value:<input type=\"text\"\/><\/br>\n <\/html>`\nNow the lab...
{"title":"NSURL URLWithString: is null with non-english accented characters","tags":["cocoa","special-characters","nsurl"],"question_text":"I have the following string...\n`NSString *googleSearchString = @\"http:\/\/www.google.com\/search?q=lyrics+%22T\u00c3\u00a6nder+P\u00c3\u00a5+Dig%22+%22Jakob+Sveistrup%22\";`\nNot...
{"title":"what is the size of an enum type data in C++?","tags":["c++","enums","sizeof"],"question_text":"This is a C++ interview test question not homework.\n`#include <iostream>\nusing namespace std;\nenum months_t { january, february, march, april, may, june, july, august, september, \n october, november, december} ...
{"title":"\"The Id field is required\" validation message on Create; Id not set to [Required]","tags":["asp.net-mvc","asp.net-mvc-2","data-annotations"],"question_text":"This is happening when I try to create the entity using a Create style action in Asp.Net MVC 2.\nThe POCO has the following properties:\n`public int I...
{"title":"Using object types with Jasmine's toHaveBeenCalledWith method","tags":["javascript","tdd","bdd","jasmine"],"question_text":"I've just started using Jasmine so please forgive the newbie question but is it possible to test for object types when using\n`toHaveBeenCalledWith`\n?\n`expect(object.method).toHaveBeen...
{"title":"Notify url of Paypal","tags":["paypal","payment-gateway"],"question_text":"Paypal returns me successfully to the return url that i specify while creating buy now button. But, now I am confused.\nHow do I retrieve details about the transaction that happened on Paypal?\nAnd I also want to set some database valu...
{"title":"casting Object array to Integer array error","tags":["java","casting"],"question_text":"What's wrong with the following code?\n`Object[] a = new Object[1];\nInteger b=1;\na[0]=b;\nInteger[] c = (Integer[]) a;`\nThe code has the following error at the last line :\nException in thread \"main\" java.lang.ClassCa...
{"title":"Web deploy in Visual Studio 2010 - web management service is missing","tags":["c#","visual-studio-2010","web-deployment-project","web-platform-installer"],"question_text":"I'm setting up a new server on Windows 2008 (x64) with IIS 7.5. I have installed Web Deploy 2.1 from the Web Platform Installer.\nBut the ...
{"title":"Make an image responsive - simplest way","tags":["html","css","image","mobile"],"question_text":"I have been searching for a solution to this for a while now, with no luck.\nI notice that my code is responsive, in the fact that if I scale it down to the size of a phone or tablet - all of the text, links, and ...
{"title":"Converting JSONarray to ArrayList","tags":["android","android-listview"],"question_text":"I am downloading a JSON string and converting it to JSONArray. Im putting it into a listview and need to be able to delete from that listview later, and since JSONArray has no .remove method (Thanks Obama), I am trying t...
{"title":"Customize\/remove Django select box blank option","tags":["python","django","django-models","django-forms"],"question_text":"I'm using Django 1.0.2. I've written a ModelForm backed by a Model. This model has a ForeignKey where blank=False. When Django generates HTML for this form it creates a select box with ...
{"title":"How to pass a single object[] to a params object[]","tags":["c#","arrays"],"question_text":"I have a method which takes params object[] such as:\n`void Foo(params object[] items)\n{\n Console.WriteLine(items[0]);\n}`\nWhen I pass two object arrays to this method, it works fine:\n`Foo(new object[]{ (object)\"1...
{"title":"How to check command line parameter in \".bat\" file?","tags":["file","batch-file","dos"],"question_text":"My OS is Windows Vista. I need to have a \".bat\" file where I need to check if user enters any command-line parameter or not. If does then if the parameter equals to \"-b\" then I will do something othe...
{"title":"How to convert Joda-Time to Date of java.util.Date and vice versa?","tags":["java","date","jodatime"],"question_text":"Is it possible to do that ? If yes, then how do i do the conversion from\nJoda-Time\nto\nDate\nand vice versa.","answer_text":"To convert\nJava\n`Date`\nto\nJoda\n`DateTime`\n:-\n`Date date =...
{"title":"WordPress path url in js script file","tags":["javascript","wordpress","wordpress-theming"],"question_text":"I added custom script:\n`wp_enqueue_script('functions', get_bloginfo('template_url') . '\/js\/functions.js', 'search', null, false);`\nIt works great, except in the\n`functions.js`\nI have:\n`Reset.sty...
{"title":"Android: fast bitmap blur?","tags":["android","image-processing","blur","convolution"],"question_text":"I've been searching the past three days for a built-in, hardware-accelerated way of bluring a bitmap with android. I stumbled upon certain work-arounds like shrinking the bitmap and scaling it up again, but...
{"title":"Lua check if a file exists","tags":["file-io","lua"],"question_text":"How can i check if a file exists using lua?","answer_text":"Try\n`function file_exists(name)\n local f=io.open(name,\"r\")\n if f~=nil then io.close(f) return true else return false end\nend`\nbut note that this code only tests whether the ...
{"title":"Python 3, let json object accept bytes or let urlopen output strings","tags":["json","encoding","python-3.x","urlopen"],"question_text":"With Python3 I am requesting from some url a json document.\n`response = urllib.request.urlopen(request)`\nThe\n`response`\nobject is a file like object with read, readline ...
{"title":"Machine Learning in Game AI","tags":["machine-learning","artificial-intelligence","game-ai"],"question_text":"In the old days of gaming, I'm sure simple switch\/case statements (in a sense) would have done just fine for most of the game \"AI.\" However, as games have become increasing complex, especially at t...
{"title":"Getting back old copy paste behaviour in tmux, with mouse","tags":["terminal","gnu-screen","tmux"],"question_text":"This is what I used to do in tmux to copy-paste (using the mouse, the keyboard works differently and it is not what I am interested about):\nSelect text with mouse, left-button pressed\nPaste te...
{"title":"Under what circumstances are __rmul__ called?","tags":["python","operators"],"question_text":"In Python, say I have a list\n`l`\n.\nUnder what circumstance is\n`l.__rmul__(self, other)`\ncalled?","answer_text":"When Python attempts to multiply two objects, it first tries to call the left object's\n`__mul__()`...
{"title":"android.content.res.Resources$NotFoundException: String resource ID #0x1 Error","tags":["android","exception"],"question_text":"I am using Listview to dynamically add checkboxes in android. I am using a contextAdapter class to add inflate the ListView. \nMy error log is as follows:\n`09-23 13:44:45.000: E\/An...
{"title":"Convert String to Integer\/Float in Haskell?","tags":["haskell","floating-point","int","monads"],"question_text":"`data GroceryItem = CartItem ItemName Price Quantity | StockItem ItemName Price Quantity\nmakeGroceryItem :: String -> Float -> Int -> GroceryItem\nmakeGroceryItem name price quantity = CartItem n...
{"title":"What is a stream?","tags":["stream","terminology"],"question_text":"What is a stream in the programming world ? \nWhy do we need it ? \nKindly explain with the help of an analogy, if possible.","answer_text":"A stream represents a sequence of objects (usually bytes, but not necessarily so), which can be acces...
{"title":"In a .csproj file, what is <None Include=\"...\"> for?","tags":["c#","csproj"],"question_text":"How is\n`<None Include=\"C:\\foo.bar\" \/>`\ndifferent from\n`<Content Include=\"C:\\foo.bar\" \/>`\n?","answer_text":"The MSDN article on the\nbuild action\nproperty explains the differences.\nNone\n- The file is ...
{"title":"Have I reached the limits of the size of objects JavaScript in my browser can handle?","tags":["javascript","arrays","memory"],"question_text":"I'm embedding a large array in\n`<script>`\ntags in my HTML, like this (nothing surprising):\n`<script>\n var largeArray = [\/* lots of stuff in here *\/];\n<\/script...
{"title":"Sort file according to the second column?","tags":["shell"],"question_text":"i have a file like this::\n`FirstName, FamilyName, Address, PhoneNumber`\ni need to sort this file according to the family name ??","answer_text":"If this is UNIX:\n`sort -k 2 file.txt`\nYou can use multiple\n`-k`\nflags to sort on m...
{"title":"WPF ListView ScrollBar visible to false","tags":["wpf","listview","scrollbar"],"question_text":"Is it possible to force the horizontal (or vertical) scroll to NOT display even when needed?\nThe thing is that I need to display colors that are different depending of the item. That works fine but you can clearly...
{"title":"What is the pythonic way to detect the last element in a python 'for' loop?","tags":["for-loop","python","idioms","fencepost"],"question_text":"I'd like to know the best way (more compact and \"pythonic\" way) to do a special treatment for the last element in a for loop. There is a piece of code that should b...
{"title":"Git: show more context when using git add -i or git add -e?","tags":["git"],"question_text":"I'm selectively committing parts of a large file and I'd like to see more context around each hunk. Is this possible?","answer_text":"Short answer: no.\n`git diff`\nhas the\n`-U<n>`\noption which allows you to customi...
{"title":"bash: Accessing last x characters of string","tags":["string","bash","extract"],"question_text":"I found out that with\n`${string:0:3}`\none can access the first 3 characters of a string. Is there a equivalently easy method to access e.g. the last three characters?","answer_text":"Last three characters of\n`s...
{"title":"Node.js \"require\" function and parameters","tags":["javascript","node.js","require"],"question_text":"When I do:\n`lib = require('lib.js')(app)`\nis\n`app`\nactually geting passed in?\nin lib.js:\n`exports = module.exports = function(app){}`\nSeems like no, since when I try to do more than just\n`(app)`\nan...
{"title":"What's the exact semantics of a deleted function in C++11?","tags":["c++","c++11","overloading","semantics","language-lawyer"],"question_text":"`struct A\n{\n A();\n A(const A&);\n A& operator =(const A&);\n A(A&&) = delete;\n A& operator =(A&&) = delete;\n};\nstruct B\n{\n B();\n B(const B&);\n B& operator =...
{"title":"Crop MP3 to first 30 seconds","tags":["mp3","ffmpeg"],"question_text":"Original Question\nI want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first\nn\nseconds of the track.\nNow, I know ...
{"title":"How to set date.timezone for code igniter to work with php5.3","tags":["codeigniter","datetime","php"],"question_text":"When date.timezone in php.ini is commented out, it gives me:\nA PHP Error was encountered\nSeverity: Warning\nMessage: main(): It is not safe to\n rely on the system's timezone\n settings. Y...
{"title":"Tips for using Vim as a Java IDE?","tags":["java","vim","ide"],"question_text":"I'm addicted to Vim, it's now my de facto way of editing text files.\nBeing that it's mainly a text editor and not an IDE, has anyone got tricks for me to make it easier when developing Java apps?\nSome questions I have:\nHow do I...
{"title":"jQuery Sparklines and Twitter Bootstrap 3 - tooltip style overrides?","tags":["jquery","css","twitter-bootstrap","canvas","sparklines"],"question_text":"Here it goes: I am trying to use jQuery Sparklines with Twitter Bootstrap 3. In the process, the tooltip of Sparklines loose styling, and it is clearly that ...
{"title":"Execute PHP function with onClick","tags":["php","onclick"],"question_text":"I am searching for a simple solution to call a\nPHP function\nonly when\na-tag\nis clicked.\nPHP:\n`function removeday() { ... }`\nHTML:\n`<a href=\"\" onclick=\"removeday()\" class=\"deletebtn\">Delete<\/a>`\nUPDATE:\nthe html and P...
{"title":"Variables in jsp pages with \"included\" pages","tags":["java","jsp","java-ee"],"question_text":"What are the scoping rules for variables in a jsp page with pages added to them using tags?\nMy understanding is that an included page is essentially copied verbatum into the page, which would lead me to assume th...
{"title":"How do I duplicate item when using jquery sortable?","tags":["jquery","list","drag-and-drop","duplicates","jquery-sortable"],"question_text":"I am using this method\nhttp:\/\/jqueryui.com\/demos\/sortable\/#connect-lists\nto connect two lists that i have. I want to be able to drag from list A to list B but wh...
{"title":"Shell: redirect stdout to \/dev\/null and stderr to stdout","tags":["linux","bash","shell","sh"],"question_text":"I saw this interesting question at a comment on\ncyberciti.biz\n.\nThat I found I even can't find a flexible way to do this in one-line command with sh.\nAs far my thought for the solution is:\n`t...
{"title":"Auto Layout error","tags":["ios","objective-c","uibutton","autolayout"],"question_text":"I had a similar problem to\nthis poster\n. And I used jrturton's suggestion to move the code for customizing the buttons into\n`viewDidLayoutSubviews`\n. It was working well until I received this error:\n'NSInternalIncons...
{"title":"Purpose of returning by const value?","tags":["c++","const"],"question_text":"What is the purpose of the const in this?\n`const Object myFunc(){\n return myObject;\n}`\nI've just started reading Effective C++ and Item 3 advocates this and a Google search picks up similar suggestions but also counterexamples. ...
{"title":"Retrieving the calling method name from within a method","tags":["c#","reflection","methods","calling-convention"],"question_text":"Possible Duplicate:\nHow can I find the method that called the current method?\nI have a method in an object that is called from a number of places within the object. Is there a ...
{"title":"What is digest authentication?","tags":["digest-authentication"],"question_text":"How does Digest Authentication differ from Basic Authentication other than sending credentials as plain text?","answer_text":"The only difference, as far as I know, is that it doesn't require sending the username and password ac...
{"title":"Cepstral Analysis for pitch detection","tags":["signal-processing","fft","detection","pitch","accelerate-framework"],"question_text":"I'm looking to extract pitches from a sound signal.\nSomeone on IRC just explained to me how taking a double FFT achieves this. Specifically:\ntake FFT\ntake log of square of a...
{"title":"Get 2 levels up from dirname( __FILE__)","tags":["php","return","parent","filepath"],"question_text":"How can I return the pathname from the current file, only 2 directories up?\nSo if I my current file URL is returning\n`theme\/includes\/functions.php`\nHow can I return \"theme\/\"\nCurrently I am using\n`re...
{"title":"Using a Glyphicon as an LI bullet point (Bootstrap 3)","tags":["twitter-bootstrap","twitter-bootstrap-3","glyphicons","bulletedlist"],"question_text":"How can I change the bullet points in an HTML list and use the glyphicons that come with Bootstrap 3?\nSo that:\n`<ul>\n <li>...<\/li>\n <li>...<\/li>\n<\/ul>`...