text
stringlengths
74
309k
{"title":"What is the \"Upgrade-Insecure-Requests\" HTTP header?","tags":["google-chrome","http","http-headers","upgrade-insecure-requests"],"question_text":"I made a POST request to a HTTP (non-HTTPS) site, inspected the request in Chrome's Developer Tools, and found that it added its own header before sending it to t...
{"title":"When should I use Debug.Assert()?","tags":["language-agnostic","exception","testing","assertions","defensive-programming"],"question_text":"I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea ...
{"title":"\"You cannot install this app because another user has already installed an incompatible version on this device\"","tags":["android","android-5.0-lollipop"],"question_text":"Trying to install my own app from play store, it says \"You cannot install this app because another user has already installed an incomp...
{"title":"How do I space out the child elements of a StackPanel?","tags":["wpf","silverlight","xaml","stackpanel"],"question_text":"Given a StackPanel:\n`<StackPanel>\n <TextBox Height=\"30\">Apple<\/TextBox>\n <TextBox Height=\"80\">Banana<\/TextBox>\n <TextBox Height=\"120\">Cherry<\/TextBox>\n<\/StackPanel>`\nWhat's...
{"title":"Can vim highlight matching HTML tags like Notepad++?","tags":["html","notepad++","vim"],"question_text":"VIM has support for matching pairs of curly brackets, parentheses, and square brackets. This is great for editing C-style languages like PHP and Javascript. But what about matching HTML tags?\nNotepad++ ha...
{"title":"JavaScript module pattern with example","tags":["javascript","module"],"question_text":"I can't find any accessible examples showing how two (or more) different modules are connected to work together.\nSo, I'd like to ask whether anyone has time to write an example explaining how modules work together.","answ...
{"title":"How do I add FTP support to Eclipse?","tags":["eclipse","ftp","eclipse-pdt"],"question_text":"I'm using Eclipse PHP Development Tools. What would be the easiest way to access a file or maybe create a remote project trough FTP and maybe SSH and SFTP?.","answer_text":"Eclipse natively supports FTP and SSH. Apta...
{"title":"up to first N characters","tags":["java","string"],"question_text":"How do I get up to the first n characters of a string in java without doing a size check first(inline is acceptable) or risking an\n`IndexOutOfBoundsException`\n?","answer_text":"Here's a neat solution:\n`String upToNCharacters = s.substring(...
{"title":"Making the Android emulator run faster","tags":["android","performance","testing","android-emulator","emulator"],"question_text":"The Android emulator is a bit sluggish. For some devices, like the Motorola Droid and the Nexus One, the app runs faster in the actual device than the emulator. This is a problem w...
{"title":"How to convert a String to CharSequence?","tags":["java","string","charsequence"],"question_text":"How to convert a String to CharSequence in Java?","answer_text":"Since\n`String`\nIS-A\n`CharSequence`\n, you can pass a\n`String`\nwherever you need a\n`CharSequence`\n, or assign a\n`String`\nto a\n`CharSequen...
{"title":"Why should we use sp for font sizes in Android?","tags":["android","user-interface"],"question_text":"Possible Duplicate:\nDifference of px, dp, dip and sp in android\nI am new to Android and I was trying out\nthis tutorial\nIn that tutorial, they used the unit \"sp\" for textSize attribute and \"dp\" for oth...
{"title":"MongoDB Get names of all keys in collection","tags":["mongodb"],"question_text":"I'd like to get the names of all the keys in a MongoDB collection.\nFor example, from this:\n`db.things.insert( { type : ['dog', 'cat'] } );\ndb.things.insert( { egg : ['cat'] } );\ndb.things.insert( { type : [] } );\ndb.things.i...
{"title":"An object reference is required for the nonstatic field, method, or property on a Windows form","tags":["c#"],"question_text":"`namespace WindowsApplication1\n{ \n public partial class Form1 : Form\n { \n public Form1()\n {\n InitializeComponent(); \n } \n private void button1_Click(object sender, EventArgs e...
{"title":"How to check if a String contains another String in a case insensitive manner in Java?","tags":["java","string"],"question_text":"Say I have two strings,\n`String s1 = \"AbBaCca\";\nString s2 = \"bac\";`\nI want to perform a check returning that\n`s2`\nis contained within\n`s1`\n. I can do this with:\n`return...
{"title":"Java time-based map\/cache with expiring keys","tags":["java","caching","dictionary"],"question_text":"Do any of you know of a Java Map or similar standard data store that automatically purges entries after a given timeout? This means aging, where the old expired entries \u00e2\u0080\u009cage-out\u00e2\u0080\...
{"title":"How to crop an image using C#?","tags":["c#","image-processing"],"question_text":"How can I write an application that will crop images in C#?","answer_text":"Check out this link:\nhttp:\/\/www.switchonthecode.com\/tutorials\/csharp-tutorial-image-editing-saving-cropping-and-resizing\n`private static Image cro...
{"title":"Build app with Xcode 4 - it always show some error about PNG image","tags":["xcode","xcode4"],"question_text":"When I build my app with Xcode 4 it always show this error message:\n`CopyPNGFile \/Users\/michaelchen\/Library\/Developer\/Xcode\/DerivedData\/iMusicBox-boeawugacmhacbdtyymnprzfobyq\/ArchiveIntermed...
{"title":"how can you debug a CORS request with cURL?","tags":["curl","cors"],"question_text":"I'm wondering if it's possible to debug CORS requests using cURL. So far I couldn't find any way to \"simulate\" the preflight request .","answer_text":"Here's how you can debug CORS requests using curl.\nSending a regular CO...
{"title":"How can I run a SQL text file on a MySQL database?","tags":["mysql","command-line"],"question_text":"I am new to MySQL. I want to execute a text file containing SQL queries.\nI tried to run\n`source \/Desktop\/test.sql`\nand received the error,\n`mysql> . \\home\\sivakumar\\Desktop\\test.sql ERROR: Failed to ...
{"title":"How can I get the iOS 7 default blue color programmatically?","tags":["ios","colors","ios7","uicolor"],"question_text":"I'm creating custom elements in my app and want to match the look and feel of the new iOS. iOS 7 introduced to us a very common lighter blue color, the default color or tint for several elem...
{"title":"Python try...except comma vs 'as' in except","tags":["python","python-2.6"],"question_text":"What is the difference between ',' and 'as' in except statements, eg:\n`try:\n pass\nexcept Exception, exception:\n pass`\nand:\n`try:\n pass\nexcept Exception as exception:\n pass`\nIs the second syntax legal in 2.6?...
{"title":"Android: how to add a custom button state","tags":["android","button","state"],"question_text":"For instance, the default button has the following dependencies between its states and background images:\n`<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http:\/\/schemas.android.com\/apk\/r...
{"title":"why unaligned apk is needed?","tags":["android","apk","release"],"question_text":"Android gradle produces apk in two binaries: unaligned and aligned.\nThe\ndocument\nsaid...\nOnce you have signed the APK with your private key, run zipalign on the file. This tool ensures that all uncompressed data starts with ...
{"title":"receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm","tags":["node.js","ssl-certificate","npm"],"question_text":"I am using npm v1.0.104\/node 0.6.12 on ubuntu - I am receiving the error copied below while attempting to install any new modules via npm (I tested socket.io earlier usi...
{"title":"Failed to load c++ bson extension","tags":["node.js","express","dependencies","mongoose"],"question_text":"A total node noob here. I've been trying to set up a sample node app but the following error keeps popping up every time I try to run:\nnode app\n`Failed to load c++ bson extension, using pure JS version...
{"title":"Is it true that I can't use curly braces in Python?","tags":["python"],"question_text":"I was reading that Python does all it's \"code blocks\" by indentation, rather than with curly braces. Is that right? So functions, if's and stuff like that all appear without surrounding their block with curly braces?","a...
{"title":"How does \"?android:attr\/activatedBackgroundIndicator\" work?","tags":["android"],"question_text":"I was looking for how to highlight a selected item in a list when displaying a contextual action bar for the selection, and the solution I found was to set the\n`android:background`\nattribute of my row layout ...
{"title":"Which HTML elements can receive focus?","tags":["html","focus"],"question_text":"I'm looking for a definitive list of HTML elements which are allowed to take focus, i.e. which elements will be put into focus when\n`focus()`\nis called on them?","answer_text":"There isn't a definite list, it's up to the browse...
{"title":"How to send email attachments with Python","tags":["python","email"],"question_text":"I am having problems understanding how to email an attachment using Python. I have successfully emailed simple messages with the\n`smtplib`\n. Could someone please explain how to send an attachment in an email. I know there ...
{"title":"Xcode \/ iOS: How to determine whether code is running in DEBUG \/ RELEASE build?","tags":["ios","xcode","debugging","preprocessor","release"],"question_text":"I am making an app that processes sensitive credit card data.\nIf my code is running in debug mode I want to log this data to the console and make som...
{"title":"Apply CSS Style to child elements","tags":["css","css-selectors"],"question_text":"I want to apply styles only to the table inside the DIV with a particular class:\nNote: I'd rather use a css-selector for children elements.\nWhy does the #1 works and #2 doesnt?\n1:\n`div.test th, div.test td, div.test caption...
{"title":"Window vs Page vs UserControl for WPF navigation?","tags":["c#","wpf"],"question_text":"I wondered if someone could help me. I'm new to WPF and am currently writing a desktop application, but I cannot seem to get my head around what to use when redirecting someone to a new section of the application.\nMy opti...
{"title":"Can I add custom attribute to HTML tag?","tags":["html"],"question_text":"Can I add custom attribute to HTML tag like this:\n`<tag myAttri=\"myVal\" \/>`","answer_text":"You can add custom attributes to your elements at will. But that will make your document invalid.\nIn HTML 5 you will have the opportunity t...
{"title":"Programatically set height on LayoutParams as density-independent pixels","tags":["android","android-layout"],"question_text":"Is there any way to set the height\/width of a\nLayoutParams\nas density-independent pixels (dp)? It looks like the height\/width, when set programatically, are in pixels and not dp."...
{"title":"How to convert a Base64 string into a BitMap image to show it in a ImageView?","tags":["android","base64","imageview"],"question_text":"I have a Base64 String that represents a BitMap image.\nI need to transform that String into a BitMap image again to use it on a ImageView in my Android app\nHow to do it?\nT...
{"title":"Cross-platform way of getting temp directory in Python","tags":["python","cross-platform","temporary-directory"],"question_text":"Is there a cross-platform way of getting the path to the\n`temp`\ndirectory in Python 2.6?\nFor example, under Linux that would be\n`\/tmp`\n, while under XP\n`C:\\Documents and se...
{"title":"findViewByID returns null","tags":["android"],"question_text":"First of all: yes, I read all the other threads on this topic. And not only those from this site... (you see, I'm a little frustrated)\nMost of them come with the advice to use\n`android:id`\ninstead of just\n`id`\nin the XML file. I did.\nFrom ot...
{"title":"Proper MIME type for .woff2 fonts","tags":["fonts","mime-types","woff","woff2"],"question_text":"Today I updated\nFont Awesome\npackage to 4.3.0 and noticed that\nwoff2\nfont was added. That file is linked in CSS so I need to configure nginx to serve woff2 files properly.\nCurrently I have this block in nginx...
{"title":"How do I remove a MySQL database?","tags":["mysql"],"question_text":"You may notice from my last question that a problem caused some more problems,\nReading MySQL manuals in MySQL monitor?\nMy database is now unusable partly due to my interest to break things and my inability to look at error messages. I know...
{"title":"HTML Body says cz-shortcut-listen=\"true\" with Chrome's Developer Tools?","tags":["html","google-chrome","google-chrome-devtools"],"question_text":"I was testing some HTML code I'm making, and while using the Developer Tools on Google Chrome version 22.0.1229.94 m, I saw the\n`<body>`\ntag has the attribute\...
{"title":"How do I force git to use LF instead of CR+LF under windows?","tags":["git","msysgit"],"question_text":"I want to force git to checkout files under Windows using just\n`LF`\nnot\n`CR+LF`\n. I checked the two configuration options but I was not able to find the right combination of settings.\nI want it to conv...
{"title":"An invalid form control with name='' is not focusable","tags":["html","html5","validation"],"question_text":"I have an acute problem on my website.\nIn Google Chrome some customers are not able to proceed to my payment page.\nWhen trying to submit a form I get this error:\n`An invalid form control with name='...
{"title":"Unable to delete node_modules folder (Windows 7)","tags":["node.js","windows-7","npm"],"question_text":"Upon trying to remove the\nnode_modules\ndirectory created by\n`npm install`\n:\nThe source file name(s) are larger than is supported by the file\n system. Try moving to a location which has a shorter path ...
{"title":"Use didSelectRowAtIndexPath or prepareForSegue method for UITableView?","tags":["iphone","objective-c","uitableview","storyboard"],"question_text":"I'm using storyboards and I have a UITableView. I have a segue setup that pushes from my table to the detail VC. But which method should I use to handle this? I'l...
{"title":"Android Use Done button on Keyboard to click button","tags":["android","keyboard-events","android-softkeyboard"],"question_text":"Ok in my app I have a field for the user to input a number. I have the field set to only accept numbers. When the user clicks on the field it brings up the keyboard. On the keyboar...
{"title":"Why is this code vulnerable to buffer overflow attacks?","tags":["c","security","buffer-overflow"],"question_text":"`int func(char* str)\n{\n char buffer[100];\n unsigned short len = strlen(str);\n if(len >= 100)\n {\n return (-1);\n }\n strncpy(buffer,str,strlen(str));\n return 0;\n}`\nThis code is vulnerabl...
{"title":"Can Mockito stub a method without regard to the argument?","tags":["java","unit-testing","mocking","mockito"],"question_text":"I'm trying to test some legacy code, using Mockito.\nI want to stub a\n`FooDao`\nthat is used in production as follows:\n`foo = fooDao.getBar(new Bazoo());`\nI can write:\n`when(fooDa...
{"title":"Get MD5 hash of big files in Python","tags":["python","md5","hashlib"],"question_text":"I have used hashlib (which replaces md5 in Python 2.6\/3.0) and it worked fine if I opened a file and put its content in\n`hashlib.md5()`\nfunction.\nThe problem is with very big files that their sizes could exceed RAM siz...
{"title":"In Mongoose, how do I sort by date? (node.js)","tags":["node.js","mongodb","mongoose"],"question_text":"let's say I run this query in Mongoose:\n`Room.find({}, function(err,docs){\n}).sort({date:-1});`\nThis doesn't work!","answer_text":"Sorting\nin Mongoose has evolved over the releases such that some of the...
{"title":"use space as a delimiter with cut command","tags":["bash","unix","cut"],"question_text":"I want to use space as a delimiter with the\n`cut`\ncommand.\nWhat syntax can I use for this?","answer_text":"`cut -d ' ' -f 2`\nWhere 2 is the field number of the space-delimited field you want.","question_code":[],"answ...
{"title":"Retrieve only static fields declared in Java class","tags":["java","reflection","static","field"],"question_text":"I have the following class:\n`public class Test {\n public static int a = 0;\n public int b = 1;\n}`\nIs it possible to use reflection to get a list of the static fields only? I'm aware I can get...
{"title":"AutoMapper: \"Ignore the rest\"?","tags":[".net","automapper"],"question_text":"Is there a way to tell AutoMapper to ignore all of the properties except the ones which are mapped explicitly?\nI have external DTO classes which are likely to change from the outside and I want to avoid specifying each property t...
{"title":"How to change size of split screen emacs windows?","tags":["emacs","split","size","screen"],"question_text":"I have emacs split horizontally - on top I'm editing Perl code, the bottom is the shell. By default emacs makes the two windows equal in size, but I'd like the shell buffer smaller (maybe half the size...
{"title":"Why am I getting \"Unable to find manifest signing certificate in the certificate store\" in my Excel Addin?","tags":["visual-studio","vsto","excel-2007"],"question_text":"I've got an Excel add-in project that was created a couple years back in Visual Studio 2008. It's got some changes to be made so I've upgr...
{"title":"Use of \"global\" keyword in Python","tags":["python","global-variables"],"question_text":"What I understand from reading the documentation is that Python has a separate namespace for functions, and if I want to use a global variable in that function, I need to use\n`global`\n.\nI'm using Python 2.7 and I tri...
{"title":"Change status bar color with AppCompat ActionBarActivity","tags":["android","android-5.0-lollipop","android-toolbar"],"question_text":"in my one Activity I change the Toolbar color using\n`Palette`\nbut on 5.0 devices using\n`ActionBarActivity`\nthe\n`status bar`\ncolor is the color of my\n`colorPrimaryDark`\...
{"title":"Enum ToString with user friendly strings","tags":["c#","enums","tostring"],"question_text":"My enum consists of the following values:\n`private enum PublishStatusses{\n NotCompleted,\n Completed,\n Error\n};`\nI want to be able to output these values in a user friendly way though.\nI don't need to be able to ...
{"title":"Block commenting in Ruby","tags":["ruby","keyboard-shortcuts","comments","text-editor"],"question_text":"Does Ruby have block comments?\nIf not, is there an efficient way of inserting\n`#`\nin front of a block of highlighted code in TextMate?","answer_text":"You can do\n`=begin\n [Multi line comment]\n=end`\n...
{"title":"What is the lifecycle of an AngularJS Controller?","tags":["javascript","angularjs"],"question_text":"Can someone please clarify what the lifecycle of an AngularJS controller is?\nIs a controller a singleton, or created \/ destroyed on demand?\nIf the latter, what triggers the creation \/ destruction of the c...
{"title":"How are POST and GET variables handled in Python?","tags":["python","post","get"],"question_text":"In PHP you can just use\n`$_POST`\nfor POST and\n`$_GET`\nfor GET (Query string) variables. What's the equivalent in Python?","answer_text":"suppose you're posting a html form with this:\n`<input type=\"text\" n...
{"title":"Is it wrong to use Deprecated methods or classes in Java?","tags":["java","methods","deprecated"],"question_text":"I am using eclipse to develop a web application. Just today I have updated my struts version by changing the JAR file. I am getting warnings at some places that methods are deprecated, but the co...
{"title":"Loop through all the resources in a .resx file","tags":["c#",".net","embedded-resource"],"question_text":"Is there a way to loop through all the resources in a\n`.resx`\nfile in C#?","answer_text":"You should always use the resource manager and not read files directly to ensure globalization is taken into acc...
{"title":"Why doesn't os.path.join() work in this case?","tags":["python","path"],"question_text":"The below code will not join, when debugged the command does not store the whole path but just the last entry.\n`os.path.join('\/home\/build\/test\/sandboxes\/', todaystr, '\/new_sandbox\/')`\nWhen I test this it only sto...
{"title":"VSTS 2010 SGEN : error : Could not load file or assembly (Exception from HRESULT: 0x80131515)","tags":["msbuild",".net-4.0","sgen","vsts2010"],"question_text":"I am experiencing a strange issue with VS2010. We use TFS to build our API dlls and we used to reference them in our projects usign a mapped network d...
{"title":"When do you use the \"this\" keyword?","tags":["c#","coding-style"],"question_text":"I was curious about how other people use the\nthis\nkeyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples:\nIn a constructor:\n`public Light(Vector v)\n{\n this....
{"title":"Capture Signature using HTML5 and iPad","tags":["ipad","html5","canvas","svg"],"question_text":"Anyone know how this can be done? Would you use a canvas object, svg, jQuery, etc?","answer_text":"Here's another canvas based version with variable width (based on drawing velocity) curves: demo at\nhttp:\/\/szime...
{"title":"Where does PostgreSQL store the database?","tags":["postgresql"],"question_text":"Where are the files for a PostgreSQL database stored?","answer_text":"To see where the data directory is, use this query.\n`show data_directory;`\nTo see all the run-time parameters, use\n`show all;`\nYou can create tablespaces ...
{"title":"HttpServletRequest get JSON POST data","tags":["java","json","post","servlets"],"question_text":"Possible Duplicate:\nRetrieving JSON Object Literal from HttpServletRequest\nI am HTTP POST-ing to URL\nhttp:\/\/laptop:8080\/apollo\/services\/rpc?cmd=execute\nwith\nPOST data\n`{ \"jsondata\" : \"data\" }`\nHttp...
{"title":"Setting unique Constraint with fluent API?","tags":["c#","entity-framework","entity-framework-6","ef-fluent-api"],"question_text":"I'm trying to build an EF Entity with Code First, and an\n`EntityTypeConfiguration`\nusing fluent API. creating primary keys is easy but not so with a Unique Constraint. I was see...
{"title":"Log4net does not write the log file","tags":["c#",".net","asp.net","logging","log4net"],"question_text":"I created a simple scenario using Log4net, but it seems that my appenders do not work because the messages are not added to the logfile.\nI added the following to the web.config file:\n`<configSections>\n ...
{"title":"Update git commit author date when amending","tags":["git"],"question_text":"I found myself amending my commits quite often. I don't\n`stash`\nso much because I tend to forget I did so, especially when I want to save what I did before I leave or before a weekend, so I do a \"draft\" commit. Only thing is, whe...
{"title":"Importance of varchar length in MySQL table","tags":["sql","mysql","performance","types"],"question_text":"I have a MySQL table where rows are inserted dynamically. Because I can not be certain of the length of strings and do not want them cut off, I make them varchar(200) which is generally much bigger than ...
{"title":"Copy Notepad++ text with formatting?","tags":["notepad++"],"question_text":"I'm using Notepad++ to write code.\nHow do I copy code in Notepad++ along with its formatting to paste into Microsoft Word? (i.e. syntax highlights, etc)","answer_text":"Here is an image from notepad++ when you select text to copy as ...
{"title":"How to convert hashmap to JSON object in Java","tags":["java","json"],"question_text":"How to convert or cast hashmap to JSON object in Java, and again convert JSON object to JSON string?","answer_text":"You can use:\n`new JSONObject(map);`\nCaution:\nThis will only work for a\n`Map<String, String>!`\nOther f...
{"title":"jQuery: How to capture the TAB keypress within a Textbox","tags":["javascript","jquery"],"question_text":"I want to capture the TAB keypress, cancel the default action and call my own javascript function.","answer_text":"Edit:\nSince your element is dynamically inserted, you have to use\ndelegated\n`on()`\nas...
{"title":"Explanation of JSONB introduced by PostgreSQL","tags":["json","postgresql","nosql","postgresql-json","jsonb"],"question_text":"PostgreSQL just introduced\nJSONB\nand it's already trending on\nhacker news\n. It would be great if someone could explain how it's different from Hstore and JSON previously present i...
{"title":"Delete\/Reset all entries in Core Data?","tags":["iphone","cocoa","cocoa-touch","core-data"],"question_text":"Do you know of any way to delete all of the entries stored in Core Data? My schema should stay the same; I just want to reset it to blank.\nEdit\nI'm looking to do this programmatically so that a user...
{"title":"Passing a URL with brackets to curl","tags":["url","curl"],"question_text":"If I try to pass a URL to curl that contains brackets, it fails with an error:\n`$ curl 'http:\/\/www.google.com\/?TEST[]=1'\ncurl: (3) [globbing] illegal character in range specification at pos 29`\nHowever, if I escape both brackets...
{"title":"force Maven2 to copy dependencies into target\/lib","tags":["java","maven-2","copy","runtime","dependencies"],"question_text":"How do I get my project's runtime dependencies copied into the\n`target\/lib`\nfolder?\nAs it is right now, after\n`mvn clean install`\nthe\n`target`\nfolder contains only my project'...
{"title":"LINQ Group By into a Dictionary Object","tags":["linq","dictionary"],"question_text":"I am trying to use LINQ to create a\n`Dictionary<string, List<CustomObject>>`\nfrom a\n`List<CustomObject>`\n. I can get this to work using \"var\", but I don't want to use anonymous types. Here is what I have\n`var x = (fro...
{"title":"Error: Could not find or load main class","tags":["java","linux"],"question_text":"I am having trouble compiling and running my Java code, intended to allow me to interface Java with a shared object for Vensim, a simulation modeling package.\nThe following code compiles without error:\n`javac -d . -cp .\/apac...
{"title":"How to get last inserted id?","tags":["c#","sql","sql-server"],"question_text":"I have this code:\n`string insertSql = \n \"INSERT INTO aspnet_GameProfiles(UserId,GameId) VALUES(@UserId, @GameId)\";\nusing (SqlConnection myConnection = new SqlConnection(myConnectionString))\n{\n myConnection.Open();\n SqlComm...
{"title":"How to change the font size on a matplotlib plot","tags":["python","matplotlib","font-size"],"question_text":"How does one change the font size for all elements (ticks, labels, title) on a matplotlib plot?\nI know how to change the tick label sizes, this is done with:\n`import matplotlib \nmatplotlib.rc('xtic...
{"title":"What is the difference between Swing and AWT?","tags":["java","swing","awt"],"question_text":"Can someone please explain me what's the difference between Swing and AWT?\nAre there any cases where AWT is more useful\/advised to use than swing or vice-versa?","answer_text":"AWT is a Java interface to native sys...
{"title":"How can I make gdb save the command history?","tags":["debugging","gdb"],"question_text":"How can I set up\n`gdb`\nso that it saves the command history? When starting a new\n`gdb`\nsession I'd like to use the arrow up keys to access the commands of the previous sessions.","answer_text":"Command history is cov...
{"title":"Deep copying an NSArray","tags":["objective-c","cocoa-touch","cocoa","nsarray","deep-copy"],"question_text":"Is there any built-in function that allows me to deep copy an\n`NSMutableArray`\n?\nI looked around, some people say\n`[aMutableArray copyWithZone:nil]`\nworks as deep copy. But I tried and it seems to...
{"title":"Is it possible to print a variable's type in standard C++?","tags":["c++","variables","c++11","typeof"],"question_text":"For example:\n`int a = 12;\ncout << typeof(a) << endl;`\nExpected output:\n`int`","answer_text":"C++11 update to a very old question: Print variable type in C++.\nThe accepted (and good) an...
{"title":"Unable to fix signing identity issue on Xcode","tags":["ios","xcode","developer-tools","code-signing-certificate"],"question_text":"I am not new to this but I am unable to fix my signing identity from Xcode Version 6.2 (6C86e). When I click\nfix issue\non the following message:\nI get a pop up window saying:\...
{"title":"AngularJS access scope from outside js function","tags":["angularjs","angularjs-scope"],"question_text":"I'm trying to see if there's a simple way to access the internal scope of a controller through an external javascript function (completely irrelevant to the target controller)\nI've seen on a couple of oth...
{"title":"Android Facebook SDK 4 in Eclipse","tags":["android","facebook","facebook-sdk-4.0"],"question_text":"Are there some way to import the new Facebook SDK for Android to Eclipse without Gradle or Maven (something like the past way)? I've been watching some pages but i don't find a the way.\nThanks","answer_text":...
{"title":"likely()\/unlikely() macros in the Linux kernel - how do they work? What's their benefit?","tags":["gcc","optimization","compiler-construction","macros","likely-unlikely"],"question_text":"I've been digging through some parts of the Linux kernel, and found calls like this:\n`if (unlikely(fd < 0))\n{\n \/* Do ...
{"title":"NuGet upgrade issue","tags":["visual-studio-2010","visual-studio","nuget"],"question_text":"I have the version of NuGet that comes with MVC3 (1.0), but when I try to upgrade to the latest version (currently 1.4) it failes and I get this in the log file:\n6\/27\/2011 1:25:08 PM - VSIXInstaller.SignatureMismatc...
{"title":"Remove excess whitespace from within a string","tags":["php","string"],"question_text":"I receive a string from a database query, then I remove all HTML tags, carriage returns and newlines before I put it in a CSV file. Only thing is, I can't find a way to remove the\nexcess\nwhite space from\nbetween\nthe st...
{"title":"how does jquery's promise method really work?","tags":["ajax","jquery","jquery-deferred"],"question_text":"I don't really understand this delegate and promise thing. According to the docs, delegate would bind an selector and event to some sort of wrapping container that can be used again at a later time for c...
{"title":"What size do you use for varchar(MAX) in your parameter declaration?","tags":["c#","sql-server-2008","ado.net"],"question_text":"I normally set my column size when creating a parameter in ADO.NET\nBut what size do I use if the column is\n`VARCHAR(MAX)`\n?\n`cmd.Parameters.Add(\"@blah\", SqlDbType.VarChar, ???...
{"title":"SyntaxError: Non-ASCII character '\\xa3' in file when function returns '\u00c2\u00a3'","tags":["python","unicode","python-unicode"],"question_text":"Say I have a function:\n`def NewFunction():\n return '\u00c2\u00a3'`\nI want to print some stuff with a pound sign in front of it and it prints an error when I t...
{"title":"Factorial Algorithms in different languages","tags":["algorithm","language-agnostic"],"question_text":"I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language.\nIdeas:\nProcedura...
{"title":"What is the \"best\" way to set a global variable in JavaScript?","tags":["javascript","jquery","global-variables"],"question_text":"I'm wondering what the best way is to set a global variable with Jquery \/ Javascript that can be used and updated by multiple functions.\nI've a fairly over complex site that u...
{"title":"form_for with nested resources","tags":["ruby-on-rails","form-for","nested-resources"],"question_text":"I have a two-part question about form_for and nested resources. Let's say I'm writing a blog engine and I want to relate a comment to an article. I've defined a nested resource as follows:\n`map.resources :...
{"title":"Proper way to return JSON using node or Express","tags":["json","node.js","express","httpresponse"],"question_text":"So, one can attempt to fetch the following JSON object:\n`$ curl -i -X GET http:\/\/echo.jsontest.com\/key\/value\/anotherKey\/anotherValue\nHTTP\/1.1 200 OK\nAccess-Control-Allow-Origin: *\nCo...