text
stringlengths
74
309k
{"title":"How do I enable perfect forward secrecy by default on Apache?","tags":["apache","ssl","cryptography"],"question_text":"In the wake of recent events, I have been reconsidering my Apache setup. Currently, my apache site config looks something like this:\n`<IfModule mod_ssl.c>\n <VirtualHost *:80>\n ServerName m...
{"title":"How to use VideoToolbox to decompress H.264 video stream","tags":["objective-c","ios8","h.264","video-toolbox"],"question_text":"I had a lot of trouble figuring out how to use Apple's Hardware accelerated video framework to decompress an H.264 video stream. After a few weeks I figured it out and wanted to sha...
{"title":"How to properly retain a DialogFragment through rotation?","tags":["android","android-fragments","android-fragmentactivity","android-dialogfragment"],"question_text":"I have a FragmentActivity that hosts a DialogFragment.\nThe DialogFragment perform network requests and handles Facebook authentication, so I n...
{"title":"Jquery Mobile size is too small","tags":["html","css","mobile","jquery-mobile","cordova"],"question_text":"I'm making an app on PhoneGap using Jquery Mobile. The app runs fine on the PC browser and on the simulator, but when I install it on my phone everything is very small.\nOn my home page I have a listView...
{"title":"Git hook to send email notification on repo changes","tags":["git","githooks"],"question_text":"How do I configure the appropriate Git hook to send a summary email whenever a set of changes is pushed to the upstream repository?","answer_text":"Another, more modern way to do this is with\ngit-multimail\n, as s...
{"title":"I've Heard Global Variables Are Bad, What Alternative Solution Should I Use?","tags":["javascript","global-variables"],"question_text":"I've read all over the place that\nglobal variables are bad\nand alternatives should be used. In Javascript specifically, what solution should I choose.\nI'm thinking of a fu...
{"title":"Given a Unix timestamp, how to get beginning and end of that day?","tags":["php","timestamp","strtotime","unix-timestamp"],"question_text":"I have a Unix timestamp like this:\n`$timestamp=1330581600`\nHow do I get the beginning of the day and the end of the day for that timestamp?\n`e.g.\n$beginOfDay = Start ...
{"title":"IsolateApps causes Decryption key specified has invalid hex characters","tags":["asp.net-mvc","encryption","machinekey"],"question_text":"I working on a MVC 4 site which has uses Authentication. The site requires that I specify the Machine Key values. I did this via the IIS interface having deselected the \"a...
{"title":"Is it possible to write data to file using only JavaScript?","tags":["javascript","jquery","html","html5"],"question_text":"I want to Write Data to existing file using JavaScript.\nI don't want to print it on console.\nI want to Actually Write data to\n`abc.txt`\n.\nI Read many answered question but every whe...
{"title":"Why is a git 'pull request' not called a 'push request'?","tags":["git","github"],"question_text":"The terminology used to merge a branch with an official repository is a 'pull request'. This is confusing, as it appears that I am requesting to push my changes to the official repository.\nWhy is it called a pu...
{"title":"What are the advantages of using the C++ Boost libraries?","tags":["c++","boost"],"question_text":"So, I've been reading through and it appears that the Boost libraries get used a lot in practice (not at my shop, though). Why is this? and what makes it so wonderful?","answer_text":"Boost\nis used so extensive...
{"title":"Is there a dictionary implementation in JavaScript?","tags":["javascript",".net","arrays","dictionary"],"question_text":"How can I implement an array with an indexer in JavaScript? Is there something like a dictionary in .Net?","answer_text":"Technically not, but you can use a regular JavaScript object like a...
{"title":"Difference between jQTouch and jQuery mobile","tags":["jquery","mobile","jqtouch","jquery-mobile"],"question_text":"What is the difference between\njQTouch\n&\njQuery Mobile Framework\n?\nAre they related (other than being both based on jQuery) ?\nDo they have the same goal ?\nEdit:\njQTouch is now jQT","answ...
{"title":"How can I time a code segment for testing performance with Pythons timeit?","tags":["python","testing","timeit","database-tuning"],"question_text":"I've a python script which works just as it should but I need to write the time for the execution. I've googled that I should use\n`timeit`\nbut I can't seem to g...
{"title":"Xcode 4 archive warning to skip copy phase","tags":["xcode4","archive"],"question_text":"I have an app for the Mac that I am trying to archive. I have done this in the past with an earlier version of Xcode however when I archive with Xcode 4, I get the following warning:\n`warning: skipping copy phase strip, ...
{"title":"How do you automatically resize columns in a DataGridView control AND allow the user to resize the columns on that same grid?","tags":["c#","winforms","datagridview"],"question_text":"I am populating a DataGridView control on a Windows Form (C# 2.0 not WPF).\nMy goal is to display a grid that neatly fills all...
{"title":"How to replace text between quotes in vi","tags":["vim","vi"],"question_text":"Say I have this line of code:\n`$query = \"SELECT * FROM table\";`\nIs there a command in vi\/vim which can instantly delete everything between quotes and position the cursor between them so I can start typing?","answer_text":"Use\...
{"title":"Making sure PHP substr finishes on a word not a character","tags":["php","substring"],"question_text":"I know how to use the substr function but this will happy end a string halfway through a word. I want the string to end at the end of a word how would I go about doing this? Would it involve regular expressi...
{"title":"eclipse magic: ... Syntax error, varargs are only available if source level is 1.5 or greater","tags":["java","eclipse"],"question_text":"Yesterday I made a project in eclipse, and it was working, compiling. I used Eclipse Galileo for Java EE. Today I open eclipse and see lots of errors saying that stuff is n...
{"title":"Atom - Change indentation mode","tags":["github","atom-editor"],"question_text":"I haven't been able to figure this out yet. Atom seems to use spaces as the default indentation mode. I prefer to have tabs instead though. Sublime Text has built in functionality for switching and converting indentation.\nAnyone...
{"title":"Fast check for NaN in NumPy","tags":["python","numpy",null],"question_text":"I'm looking for the fastest way to check for the occurrence of NaN (\n`np.nan`\n) in a NumPy array\n`X`\n.\n`np.isnan(X)`\nis out of the question, since it builds a boolean array of shape\n`X.shape`\n, which is potentially gigantic.\...
{"title":"Line up labels and read only text in Twitter Bootstrap","tags":["twitter-bootstrap"],"question_text":"I have a form with a mixture of editable and read-only fields which I want to style using Bootstrap. The editable fields are aligned correctly, but the read-only fields are not, as shown in this screenshot:\n...
{"title":"git turn off \"LF will be replaced by CRLF\" warning","tags":["git"],"question_text":"I understand what the warning is for and how to turn off the function, but what I need is to turn off the warning itself. Help please?","answer_text":"You can turn off the warning with\n`git config --global core.safecrlf fal...
{"title":"What are some common uses for Python decorators?","tags":["python","decorator"],"question_text":"While I like to think of myself as a reasonably competent Python coder, one aspect of the language I've never been able to grok is decorators.\nI know what they are (superficially), I've read tutorials, examples, ...
{"title":"Custom color my UIActivityIndicatorView","tags":["ios","objective-c","uiactivityindicatorview"],"question_text":"I would like to have my\n`UIActivityIndicatorView`\nbe colored a custom color. Is there any way to set this property?","answer_text":"In iOS 5.0 and up you can use setColor: on the UIActivityIndica...
{"title":"False positive \"undefined variable\" error when compiling SCSS","tags":["sass"],"question_text":"Getting an error message when compiling my SCSS using the ruby compass gem.\n`run: \/var\/lib\/gems\/1.8\/gems\/compass-0.12.2\/bin\/compass compile\nout: unchanged sass\/partial\/grid.scss\nout: error sass\/part...
{"title":"How to access object attribute given string corresponding to name of that attribute","tags":["python","object","attributes"],"question_text":"How do you set\/get the values of attributes of\n`t`\ngiven by\n`x`\n.\n`class test():\n attr1 = int\n attr2 = int\nt = test()\nx = \"attr1\"`","answer_text":"There is ...
{"title":"Skip a submodule during a maven build","tags":["maven","continuous-integration","jenkins"],"question_text":"We have a need to be able to skip a submodule in certain environments.\nThe module in question contains integration tests and takes half an hour to run. So we want to include it when building on the CI ...
{"title":"How do I round a float up to the nearest int in C#?","tags":["c#",".net","rounding"],"question_text":"In C#, how do I round a float to the nearest int?\nI see Math.Ceiling and Math.Round, but these returns a decimal. Do I use one of these then cast to an Int?","answer_text":"If you want to round to the\nneare...
{"title":"Github Windows 'Failed to sync this branch'","tags":["git","github","github-for-windows"],"question_text":"I am using Github Windows 1.0.38.1 and when I click the 'Sync' button after committing, I get the error\nHow do I debug this problem? If in the shell, what should I do?\nThe sync works fine if i do a\n`g...
{"title":"How to implement a bitmask in php?","tags":["php","bitmask"],"question_text":"I'm not sure if bitmask is the correct term. Let me explain:\nIn php, the\n`error_reporting`\nfunction can be called multiple ways:\n`\/\/ Report simple running errors\nerror_reporting(E_ERROR | E_WARNING | E_PARSE);\n\/\/ Reporting...
{"title":"const string vs. static readonly string in c#","tags":["c#"],"question_text":"In C#, what's the difference between\n`static readonly string MyStr;`\nand\n`const string MyStr;`","answer_text":"When you use a\n`const`\nstring, the compiler embeds the string's value\nat compile-time\n.\nTherefore, if you use a\n...
{"title":"What does sizeof(&array) return?","tags":["c","string","pointers","sizeof"],"question_text":"Following the question:\nHow come an array's address is equal to its value in C?\n`#include <stdio.h>\n#define N 10 \nchar str2[N]={\"Hello\"};\nint main(){\n printf(\"sizeof(str2): %d bytes\\n\", sizeof(str2));\n pri...
{"title":"How do I check an array for duplicates?","tags":["ruby","arrays"],"question_text":"I've got an array A. I'd like to check if it contains duplicate values. How would I do so?","answer_text":"Just call\n`uniq`\non it (which returns a new array without duplicates) and see whether the\n`uniq`\ned array has less e...
{"title":"Java Logging vs Log4J","tags":["java","logging","log4j","java.util.logging"],"question_text":"Is it still worth to add the log4j library to a Java 5 project just to log\nlet's say some exceptions to a file with some nice rollover settings.\nOr will the standard util.logging facility do the job as well?\nWhat ...
{"title":"What is the git equivalent of of hg outgoing (hg out) or hg incoming (hg in)?","tags":["git","mercurial"],"question_text":"Possible Duplicate:\nHow can I see incoming commits in git?\nWhat is the git equivalent of of \"hg outgoing\" or \"hg incoming\"?\nIn Mercurial,\n`hg outgoing`\nlists the changesets that ...
{"title":"Getting Google+ profile picture url with user_id","tags":["google-api","google-plus"],"question_text":"I know that lots of social network APIs provide a way to construct a url to the profile picture of a user, using their user_id or username. For Facebook it looks like this:\n`http:\/\/graph.facebook.com\/use...
{"title":"Java Convert Long to Date?","tags":["java","date","long-integer"],"question_text":"I have list with long values (for example: 1220227200, 1220832000, 1221436800...) which I downloaded from web service. I must convert it to Dates. Unfortunately this way, for example:\n`Date d = new Date(1220227200);`\nreturns ...
{"title":"How to open or launch PDF Files in C#.Net?","tags":["c#","filestream",".net"],"question_text":"How do I launch a PDF Programmatically from a C# application in it's own process?\nOriginally: I want to open PDF file when i click button in C#.Net?","answer_text":"I assume you just want to open the file. Try the ...
{"title":"Open-sided Android stroke?","tags":["android"],"question_text":"Is it possible to create an Android shape object with stroke on only certain sides?\nEg I have:\n`<stroke \n android:width=\"3dip\" \n android:color=\"#000000\"\n android:dashWidth=\"10dip\" \n android:dashGap=\"6dip\" \/>`\nWhich is similar to t...
{"title":"Unhandled exceptions in BackgroundWorker","tags":["c#","exception","backgroundworker","unhandled-exception"],"question_text":"I have a small WinForms app that utilizes a BackgroundWorker object to perform a long-running operation.\nThe background operation throws occasional exceptions, typically when somebody...
{"title":"xcode 6 pch.file not found","tags":["objective-c","xcode","xcode6"],"question_text":"I load my project from xcode 5 to xcode 6 and see error myProject-prefix.pch is not found in myProjectTests, I add this file and see new error\n`Ld \/Users\/willrock\/Library\/Developer\/Xcode\/DerivedData\/\u00d0\u009c\u00d0...
{"title":"Laravel Eloquent ORM Transactions","tags":["php","laravel"],"question_text":"The Eloquent ORM is quite nice, though I'm wondering if there is an easy way to setup MySQL transactions using innoDB in the same fashion as PDO, or if I would have to extend the ORM to make this possible?","answer_text":"You can do ...
{"title":"Decode HTML entities in android","tags":["html","android","decode"],"question_text":"I need to decode HTML entities, e.g. from &#246; to \u00f6, and &amp; to &.\n`URLEncoder.decode(str)`\ndoes not do the job (convert from % notations). TextUtils has a HTMLencode, but not a HTMLdecode.\nAre there any function ...
{"title":"Markdown and image alignment","tags":["html","css","markdown"],"question_text":"I'm helping out a friend with a non-profit site that publishes articles in issues each month. They are mostly straightforward, and I think using a markdown editor (like the wmd one here in SO) would be perfect. However, they do ne...
{"title":"Difference between database and schema","tags":["sql-server","database","sql-server-2005","database-schema"],"question_text":"What's the difference between a Database and a Schema in SQL Server? Both are the containers of tables and data.\nIf a Schema is deleted, then are all the tables contained in that sche...
{"title":"How to select first 10 words of a sentence?","tags":["php","string","substring","trim"],"question_text":"How do I, from an output, only select the first 10 words?","answer_text":"`implode(' ', array_slice(explode(' ', $sentence), 0, 10));`\nTo add support for other word breaks like commas and dashes,\n`preg_m...
{"title":"Ckeditor update textarea","tags":["textarea","ckeditor"],"question_text":"I am trying to get the ckeditor working. Obviously it doesn't make use of the textarea so on submit the form doesn't submit the text in the editor. Beceause I make use of polymorphic associations etc. I can't make a onsubmit function to...
{"title":"How do exceptions work (behind the scenes) in c++","tags":["c++","performance","exception","throw","try-catch"],"question_text":"I keep seeing people say that exceptions are slow but I never see any proof. So instead of asking if they are I will ask how do exceptions work behind the scene so I can make a deci...
{"title":"Swift equivalent of Array.componentsJoinedByString?","tags":["swift","xcode6"],"question_text":"In Objective-C we can call\n`componentsJoinedByString`\nto produce a string with each element of the array separated by the supplied string. While Swift has a\n`componentsSeparatedByString`\nmethod on String, there...
{"title":"Benefit of using Parcelable instead of serializing object","tags":["android","serialization","bundle","parcelable"],"question_text":"As I understand,\n`Bundle`\nand\n`Parcelable`\nbelongs to the way Android performs serialization in. It is used for example in passing data between activities. But I wonder, if ...
{"title":"Similarity String Comparison in Java","tags":["java","string-comparison"],"question_text":"I want to compare several strings to each other, and find the ones that are the most similar. I was wondering if there is any library, method or best practice that would return me which strings are more similar to other...
{"title":"What is the equivalent of @autoreleasepool in Swift?","tags":["automatic-ref-counting","swift","nsautoreleasepool"],"question_text":"In Swift, I notice there is no\n`@autoreleasepool{}`\nconstruct, although Swift does use ARC. What is the proper way to manage an autoreleasepool in Swift, or has it been remove...
{"title":"How to Get Pixel Colour in Android?","tags":["android","pixel"],"question_text":"I'm using Intent to call and show an image from Gallery, and now I made it enable to get me the coordinates of the image in a TextView using these:\n`final TextView textView = (TextView)findViewById(R.id.textView); \nfinal TextVi...
{"title":"How can I initialize a module's instance variables in Ruby?","tags":["ruby","module","instance-variables"],"question_text":"I have some modules where I would like to use instance variables in. I'm currently initializing them like this:\n`module MyModule\n def self.method_a(param)\n @var ||= 0\n # other logic ...
{"title":"Check free disk space for current partition in bash","tags":["linux","bash"],"question_text":"I am writing an installer in bash. The user will go to the target directory and runs the install script, so the first action should be to check that there is enough space. I know that df will report all file systems,...
{"title":"The difference between \"#! \/usr\/bin\/env bash\" and \"#! \/usr\/bin\/bash\"?","tags":["linux","bash","shell","unix","shebang"],"question_text":"In the header of a\n`bash`\nscript, what's the difference between those two statements ?\n`#!\/usr\/bin\/env bash`\n`#!\/usr\/bin\/bash`\nWhen I tried to see the\n...
{"title":"UIBarButtonItem in navigation bar programmatically?","tags":["ios","swift","uibarbuttonitem","navigationbar"],"question_text":"I've been looking around for this solution for a while but haven't got any. \ne.g one solution is\n`self.navigationItem.setRightBarButtonItem(UIBarButtonItem(barButtonSystemItem: .Sto...
{"title":"Restart conflict resolution in a single file","tags":["git","git-merge"],"question_text":"In a larger git merge with several conflicting files, I incorrectly marked a file as resolved (using\n`git add FILE`\nafter some editing)\nNow I'd like to undo my conflict resolution attempt and start over resolving that...
{"title":"Reload content in modal (twitter bootstrap)","tags":["javascript","twitter-bootstrap"],"question_text":"I'm using twitter bootstrap's modal popup.\n`<div id=\"myModal\" class=\"modal hide fade in\">\n <div class=\"modal-header\">\n <a class=\"close\" data-dismiss=\"modal\">\u00c3\u0097<\/a>\n <h3>Header<\/h3>...
{"title":"How to close a spring ApplicationContext?","tags":["java","spring"],"question_text":"After my application finishes I want to close the spring context.\nThe relevant code has an\n`ApplicationContext`\nreference but I couldn't find a\n`close`\nmethod.","answer_text":"Downcast your\n`ApplicationContext`\nto\n`Co...
{"title":"WebView and HTML5 <video>","tags":["android","html5","video","webview","android-webview"],"question_text":"I'm piecing together a cheapo app that amongst other things \"frames\" some of our websites... Pretty simple with the WebViewClient... until I hit the video.\nThe video is done as HTML5 elements, and the...
{"title":"The matching wildcard is strict, but no declaration can be found for element 'context:component-scan","tags":["java","spring"],"question_text":"I am getting the following errors while trying my first spring project:\n`Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is s...
{"title":"Checking that a List is not empty in Hamcrest","tags":["java","collections","junit","hamcrest"],"question_text":"I was wondering if anyone knew of a way to check if a List is empty using\n`assertThat()`\nand\n`Matchers`\n?\nBest way I could see just use JUnit:\n`assertFalse(list.isEmpty());`\nBut I was hoping...
{"title":"How to use an output parameter in Java?","tags":["java","android","parameters"],"question_text":"Could someone please give me some sample code that uses an output parameter in function? I've tried to Google it but just found it just in functions. I'd like to use this output value in another function.\nThe cod...
{"title":"How to run single test from rails test suite?","tags":["ruby-on-rails","unit-testing","rake"],"question_text":"`rake test ANYTHING`\nseems to not help\nP.S.\nThe question is about rails itself, not rails app.","answer_text":"NOTE:\nThis doesn't run the test via\n`rake`\n. So any code you have in\n`Rakefile`\n...
{"title":"iPhone Safari Web App opens links in new window","tags":["iphone","safari","iphone-standalone-web-app"],"question_text":"I have problem with web after adding icon to Home Screen. If the web is launched from Home Screen, all links will open in new window in Safari (and lose full screen functionality). How can ...
{"title":"REST API Login Pattern","tags":["api","rest","design-patterns"],"question_text":"I am creating a REST api, closely following apigee suggestions, using nouns not verbs, api version baked into the url, two api paths per collection, GET POST PUT DELETE usage, etc.\nI am working on the login system, but unsure of...
{"title":"C# method naming conventions: ToSomething vs. AsSomething","tags":["c#","naming-conventions"],"question_text":"As I was writing some extension methods for my business logic objects, I came to the question of renaming the conversion methods.\n`someObject.ToAnotherObject()`\nwould go fine with the widely used\n...
{"title":"Where to stop\/destroy threads in Android Service class?","tags":["java","android","multithreading","service"],"question_text":"I have created a threaded service the following way:\n`public class TCPClientService extends Service{ \n...\n@Override\npublic void onCreate() {\n ...\n Measurements = new LinkedList...
{"title":"Get data attribute","tags":["javascript","jquery","html","custom-data-attribute"],"question_text":"In my html I have a\n`span`\nelement:\n`<span class=\"field\" data-fullText=\"This is a span element\">This is a<\/span>`\nAnd I want to get the\n`data-fullText`\nattribute. I tried these two ways, but they didn...
{"title":"Is there a vr (vertical rule) in html?","tags":["html"],"question_text":"I know there is a hr (horizontal rule) in html, but I don't believe there is a vr (vertical rule). Am I wrong and if not, why isn't there a vertical rule?","answer_text":"No, there is no vertical rule.\nIt does not make logical sense to ...
{"title":"vertical-align image in div","tags":["css","image","vertical-alignment"],"question_text":"i have problem with image vertical-align in div\n`.img_thumb {\n float: left;\n height: 120px;\n margin-bottom: 5px;\n margin-left: 9px;\n position: relative;\n width: 147px;\n background-color: rgba(0, 0, 0, 0.5);\n bor...
{"title":"process.waitFor() never returns","tags":["java","runtime.exec"],"question_text":"`Process process = Runtime.getRuntime().exec(\"tasklist\");\nBufferedReader reader = \n new BufferedReader(new InputStreamReader(process.getInputStream()));\nprocess.waitFor();`","answer_text":"There are many reasons that\n`waitF...
{"title":"How do I immediately execute an anonymous function in PHP?","tags":["php","javascript","function"],"question_text":"In JavaScript, you can define anonymous functions that are executed immediately:\n`(function () { \/* do something *\/ })()`\nCan you do something like that in PHP?","answer_text":"The only way ...
{"title":"Fresh installation of sphinx-quickstart fails","tags":["python-sphinx"],"question_text":"Trying to get it going with Sphinx for the first time, with a clean Sphinx 1.1.3 installation, and shinx-quickstart fails. Should there be any dependencies installed? I tried to\n`pip --force-reinstall sphinx`\nbut the re...
{"title":"flow 2 columns of text automatically with CSS","tags":["javascript","html","css","css3","two-columns"],"question_text":"I have the code similar to the following:\n`<p>This is paragraph 1. Lorem ipsum ... <\/p>\n<p>This is paragraph 2. Lorem ipsum ... <\/p>\n<p>This is paragraph 3. Lorem ipsum ... <\/p>\n<p>Th...
{"title":"Bootstrap 3 with remote Modal","tags":["twitter-bootstrap","modal-dialog"],"question_text":"I just started a new project with the new Twitter Bootstrap release : bootstrap 3. \nI can't make the Modal work in the remote mode. I just want that when I click on a link it shows the modal with the content of the re...
{"title":"Reordering arrays","tags":["javascript"],"question_text":"Say, I have an array that looks like this:\n`var playlist = [\n {artist:\"Herbie Hancock\", title:\"Thrust\"},\n {artist:\"Lalo Schifrin\", title:\"Shifting Gears\"},\n {artist:\"Faze-O\", title:\"Riding High\"}\n];`\nHow can move an element to another...
{"title":"Is there a performance difference between CTE , Sub-Query, Temporary Table or Table Variable?","tags":["sql","sql-server","tsql"],"question_text":"In this excellent\nSO question\n, differences between CTE and sub-queries were discussed.\nI would like to specifically ask: in what circumstance is each of the fo...
{"title":"How can I use jQuery validation with the \"chosen\" plugin?","tags":["jquery","jquery-validate","jquery-chosen"],"question_text":"I have some\n`<select>`\ninputs using the\nchosen plugin\nthat I want to validate as \"required\" on the client side. Since \"chosen\" hides the actual select element and creates a...
{"title":"Failed to install \"iOS 6.1 Simulator\" XCode 5","tags":["ios-simulator","ios6.1","xcode5"],"question_text":"I want to run my app on both simulators ios6 and ios7. I'm trying to install ios 6 simulator but I am getting this error:\n`Failed to install \"iOS 6.1 Simulator\"\nAn unknown error occured. Please try...
{"title":"Html attributes for EditorFor() in ASP.NET MVC","tags":["html","asp.net-mvc","editorfor"],"question_text":"Why can't I pass in html attributes to\n`EditorFor()`\n? eg;\n`<%= Html.EditorFor(model => model.Control.PeriodType, \n new { disabled = \"disabled\", readonly = \"readonly\" }) %>`\nI don't want to use ...
{"title":"how do I subtract one week from this date in jquery?","tags":["javascript","jquery"],"question_text":"this is my code\n`var myDate = new Date();\ntodaysDate = ((myDate.getDate()) + '\/' + (myDate.getMonth()) + '\/' + (myDate.getFullYear()));\n$('#txtEndDate').val(todaysDate);`\nI need txtEndDate's value = tod...
{"title":"Javascript curry - what are the practical applications?","tags":["javascript","function","currying","partial-application"],"question_text":"I don't think I've grokked currying yet. I understand what it does, and how to do it. I just can't think of a situation I would use it.\nWhere are you using currying in j...
{"title":"fork() and output","tags":["c++","linux","unix","fork"],"question_text":"I have a simple program:\n`int main()\n{\n std::cout << \" Hello World\";\n fork();\n}`\nAfter the program executes my output is:\n`Hello World Hello World`\n. Why does this happen instead of a single\n`Hello world`\n? I'm guessing that ...
{"title":"How to check for palindrome using Python logic","tags":["python","palindrome"],"question_text":"I'm trying to check for a palindrome with Python. The code I have is very\n`for`\n-loop intensive.\nAnd it seems to me the biggest mistake people do when going from C to Python is trying to implement C logic using ...
{"title":"Wait cursor over entire html page","tags":["javascript","html","css","dynamic-css"],"question_text":"Is it possible to set the cursor to 'wait' on the entire html page in a simple way? The idea is to show the user that something is going on while an ajax call is being completed. The code below shows a simplif...
{"title":"PHP removing a character in a string","tags":["php","string"],"question_text":"My php is weak and I'm trying to change this string:\nhttp:\/\/www.site.com\/backend.php?\/c=crud&m=index&t=care\nto be:\nhttp:\/\/www.site.com\/backend.php?c=crud&m=index&t=care\nremoving the \/ after the ? on backend.php. Any ide...
{"title":"How to remove unreferenced blobs from my git repo","tags":["git"],"question_text":"I have a GitHub repo that had two branches - master & release.\nThe release branch contained binary distribution files that were contributing to a very large repo size (> 250MB), so I decided to clean things up.\nFirst I delete...
{"title":"What is C# 5 and where does it come from?","tags":["c#",".net","visual-studio"],"question_text":"I know C# 3.5 is used with VS2008 and .NET 3.5.\nAlso C# 4 is part of VS2010 and .Net 4.0 .\nBut what is C# 5? What IDE?","answer_text":"At the recent PDC, Anders announced:\nWe plan to release a \"C# 5\" product ...
{"title":"How do I create and access the global variables in Groovy?","tags":["groovy"],"question_text":"I need to store a value in a variable in one method and then I need to use that value from that variable in another method or closure. How can I share this value?","answer_text":"In a Groovy script the scoping can b...
{"title":"iOS: How to use MPMoviePlayerController","tags":["objective-c","ios","video","mpmovieplayercontroller","avfoundation"],"question_text":"I've created a blank project (iOS) and put this in my viewDidLoad:\n`NSString *moviePath = [[NSBundle mainBundle] pathForResource:@\"Movie\" ofType:@\"m4v\"];\nMPMoviePlayerV...
{"title":"Rename a git submodule","tags":["git","git-submodules"],"question_text":"Is there some easy way to rename a git submodule directory (other than going through the entire motion of\ndeleting\nit and re-adding it with a new destination name).\nAnd while we are at it, why is it that I simply cannot do the followi...
{"title":"$.ajax - dataType","tags":["jquery"],"question_text":"what is the difference between\n`contentType: \"application\/json; charset=utf-8\",\ndataType: \"json\",`\nvs.\n`contentType: \"application\/json\",\ndataType: \"text\",`","answer_text":"`contentType`\nis the header sent to the server, specifying a particu...
{"title":"Linq query list contains a list","tags":["c#","linq"],"question_text":"I have 2 a class's:\n`public class ObjectA\n{\n public int Id;\n public string Name;\n}\npublic class ObjectB\n{\n public int Id;\n public string Name;\n public List<ObjectA> ListOfObjectA;\n}`\nSo I have two lists: One of ObjectB (ListObj...
{"title":"Why aren't my breakpoints working?","tags":["xcode","breakpoints"],"question_text":"I have breakpoints set but Xcode appears to ignore them.","answer_text":"First of all, I agree 100% with the earlier folks that said turn\nOFF\n`Load Symbols Lazily`\n.\nI have two more things to add.\n(My first suggestion sou...
{"title":"Conditional operator in Python?","tags":["python","syntax"],"question_text":"do you know if Python supports some keyword or expression like in C++ to return values based on\n`if`\ncondition, all in the same line (The C++\n`if`\nexpressed with the question mark\n`?`\n)\n`\/\/ C++\nvalue = ( a > 10 ? b : c )`",...
{"title":"WPF: How to display an image at its original size?","tags":["wpf","image","resize","size"],"question_text":"I have a problem with displaying images in WPF.\nHere's my code:\n`<Button HorizontalAlignment=\"Left\" Grid.Column=\"1\" Grid.Row=\"5\" Margin=\"0,5\">\n <Button.Content>\n <StackPanel Orientation=\"Ho...
{"title":"Serialize multiple forms together?","tags":["jquery","serialization","jsonobject"],"question_text":"Can you serialize multiple forms into one so that only one post or ajax request is made? I have searched around and it is all for submiting each form separently via post\/ajax.","answer_text":"If you run\n`$('f...