text
stringlengths
74
309k
{"title":"Delphi 2006-2010 error: \"Cannot create file C:\\Users\\Admin\\AppData\\Local\\Temp\\EditorLineEnds.ttr\"","tags":["delphi","delphi-2010","delphi-2009","delphi-2007","delphi-2006"],"question_text":"I am getting an error after installing Delphi 2007 (Edit: This problem occurs in all Delphi versions from 2006 t...
{"title":"Auto append\/complete from text file to an edit box delphi","tags":["delphi","autocomplete"],"question_text":"I'm trying to create an edit box and I want it to be able to auto-append the text entered while typing. Text would be appended with \"suggestions\" from a text file.\nLet's say I have these in my sugg...
{"title":"Dozens of \"profiling:invalid arc tag\" when running code coverage in Xcode 5","tags":["ios","objective-c","xcode","code-coverage"],"question_text":"When running my Test target with code coverage enabled in Xcode 5, I get dozens of the following message in the build output:\n`profiling:invalid arc tag (0x...)...
{"title":"Fading out text on overflow with css if the text is bigger than allowed","tags":["html","css","html5","css3"],"question_text":"I am trying to create a text fade-out effect when the amount of text is bigger than the row can handle. I am achieving this with the mixture of\n`max-height`\n,\n`overflow`\nand\n`lin...
{"title":"Proper way to check if many-to-many relation exists - Symfony2\/Doctrine","tags":["symfony2","doctrine"],"question_text":"Let's suppose I have two entities User and Product related by a Many-to-Many relationship with Doctrine.\nI would like to know the best way to handle a $user->hasProduct($product) method f...
{"title":"Is it worth encrypting email addresses in the database?","tags":["security","email","encryption"],"question_text":"I'm already using\nsalted hashing\nto store passwords in my database, which means that I should be immune to\nrainbow table\nattacks.\nI had a thought, though: what if someone does get hold of my...
{"title":"Why does $($) crash my page?","tags":["javascript","jquery"],"question_text":"Disclaimer:\nDo not try this at home\nWhy, if I am using jQuery, does\n`$($)`\nfreeze the page?","answer_text":"`$($)`\nis a shortcut for\n`$(document).ready($)`\n. So, it will run the function (when the DOM is ready or directly whe...
{"title":"How to get Quarter from a date in TSQL","tags":["sql","sql-server","tsql","sql-server-2005"],"question_text":"I have a different dates in a column .For example 20080102,20070821\nI want to convert this date in Year and quarter .\n`Below is the output: \nYear Quarter\n2008 2008-Q1\n2007 2007-Q3`\n`select left(...
{"title":"So what IS the right direction of the path's slash (\/ or \\) under Windows?","tags":["path","uri","backslash"],"question_text":"It seems Windows insists on writing a backslash\n`\\`\nin file paths, whereas .NET's URI class writes them with a slash\n`\/`\n. Is there any right way, that is accepted even in the...
{"title":"Navigation Drawer rendering error in ADT Layout Editor","tags":["android","adt","navigation-drawer"],"question_text":"`<FrameLayout\n android:id=\"@+id\/content_frame\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\" \/>\n<ListView\n android:id=\"@+id\/left_drawer\"\n android:...
{"title":"How can I render html in validation message in ASP.NET MVC?","tags":["c#","asp.net-mvc","razor"],"question_text":"I am currently developing a registration page. When user already exists I want to provide login and reset password links for user in error message for email field. In controller I have:\n`[HttpPos...
{"title":"Getting the name of a method parameter","tags":["java","reflection","runtime"],"question_text":"In Java6, imagine I have the following method signature:\n`public void makeSandwich(Bread slice1, Bread slice2, List<Filling> fillings, boolean mustard)`\nI would like to know, at runtime, the value that was passed...
{"title":"How to I import 3rd party frameworks into Xcode Playground?","tags":["ios","xcode","osx","swift","xcode6"],"question_text":"How do I import 3rd part frameworks into Xcode Playground?\nSwift Playground obviously has a framework import mechanism because we can import\n`Cocoa`\n,\n`SpriteKit`\n, and in an OSX Pl...
{"title":"Locking pattern for proper use of .NET MemoryCache","tags":["c#",".net","multithreading","memorycache"],"question_text":"I assume this code has concurrency issues:\n`const string CacheKey = \"CacheKey\";\nstatic string GetCachedData()\n{\n string expensiveString =null;\n if (MemoryCache.Default.Contains(Cache...
{"title":"how to have quotation marks in html input values","tags":["html","escaping"],"question_text":"i have following problem - from the server side i get a string like 'hoschi\"brother'\ni want to put this string into a\n`<input value\"MYSTRING\" \/>`\n. this results in something like\n`<input value\"hoschi\" broth...
{"title":"TableViewController doesn't flash scroll indicators even if the table is bigger that the view","tags":["iphone","sdk","scrollbar","tableview","indicator"],"question_text":"I've got a weird problem with a TableViewController.\nIn the doc it says that a tableViewController deals also with the method\n -flashScr...
{"title":"How to create a KeyEventArgs object in WPF ( related to a SO answer )","tags":["c#","wpf"],"question_text":"I've found this answer which look like what I need:\nHow can I programmatically generate keypress events in C#?\nExcept for the fact I can't create an instance of\n`KeyEventArgs`\n( I don't know how )\n...
{"title":"Does Javadoc have an equivalent to <![CDATA[ ... ]]>?","tags":["java","html","xml","javadoc","cdata"],"question_text":"Unfortunately, there is no CDATA in HTML.\nThis is a pity, because it would be perfect for adding\n`javadoc`\ncomments that include XML, so you don't have to escape the < and >, for example:\...
{"title":"WiX 3.0 throws error 217, while being executed by continuous integration","tags":["continuous-integration","wix","build-automation","wix3"],"question_text":"This is the error that is thrown by our automated build suite on Windows 2008, while running\nICEs\n(after migrating from\nWiX\n2.0 to WiX 3.0):\nLGHT021...
{"title":"How do I wait until the user has finished writing down in a text input to call a function?","tags":["javascript","html"],"question_text":"I'm designing a web site and I would like to be able to call a function 1 second after the last user input. I tried using onKeyUp, but it waited 1 second after the first ke...
{"title":"Can a java method return value depending upon condition?","tags":["java","design-patterns"],"question_text":"I have a\n`ICoreClient`\ninterface and\n`AClient`\nand\n`BClient`\nclasses implements this.\n`ICoreClient`\nis exposed for users.\nI need to add a new method in\n`ICoreClient`\ninterface. So, it needs ...
{"title":"DispatcherTimer vs a regular Timer in WPF app for a task scheduler","tags":[".net","wpf","multithreading","timer"],"question_text":"Please, explain the difference between \"DispatcherTimer\" and \"a regular Timer\" that @Kent Boogaart meant for using in a multithreading WPF app as a task sheduler in this topi...
{"title":"Checking for directory and file write permissions in .NET","tags":["c#",".net","winforms","directory","file-permissions"],"question_text":"In my .NET 2.0 application, I need to check if sufficient permissions exist to create and write to files to a directory. To this end, I have the following function that at...
{"title":"java.lang.NoSuchMethodException: userAuth.User.<init>()","tags":["java","spring","validation","hibernate-validator"],"question_text":"I have the class with validation:\n`public class User {\n @Size(min=3, max=20, message=\"User name must be between 3 and 20 characters long\")\n @Pattern(regexp=\"^[a-zA-Z0-9]+...
{"title":"How to re-key array with non-sequential numeric keys","tags":["php","arrays"],"question_text":"I have an array:\n`Array\n(\n [0] => ololo\n [2] => test\n [3] => haha\n [7] => nice\n)`\nHow can I change the indexes of the array to this:\n`Array\n(\n [0] => ololo\n [1] => test\n [2] => haha\n [3] => nice\n)`","...
{"title":"Debug Ionic app on IOS?","tags":["ios","iphone","debugging","cordova","ionic-framework"],"question_text":"My HTML5 app is packaged by Ionic (using Cordova) and loads onto my iPhone like a normal app.\nCan I debug whilst connected to the device? I know with Android you have logcat and in the browser I have dev...
{"title":"PHP Constructor Not Called Upon Instantiation","tags":["php","oop","constructor"],"question_text":"My PHP class constructor appears to not be getting called when the class is initiated. This is what my constructor looks like:\n`public function __contruct()\n{\n $GLOBALS['page_content'] .= \"<p>Constructor ent...
{"title":"What is my script src URL?","tags":["javascript","dom","absolute-path","src"],"question_text":"Is there a simple and reliable way to determine the URL of the currently-executing JavaScript file (inside a web page)?\nMy only thought on this is to scan the DOM for all the script\n`src`\nattributes to find how t...
{"title":"python pip specify a library directory and an include directory","tags":["python","shared-libraries","pip","include-path","pyodbc"],"question_text":"I am using pip and trying to install a python module called pyodbc which has some dependencies on non-python libraries like unixodbc-dev, unixodbc-bin, unixodbc....
{"title":"Where can I find a list of JSHint numeric error codes?","tags":["javascript","visual-studio","jslint","jshint"],"question_text":"I'm using JSHint for Visual Studio. It's not uncommon for JSHint to issue a warning about an issue that I know it safe to ignore. I have been putting\n`\/\/ ignore jslint`\non the r...
{"title":"Check if a file\/directory exists: is there a better way?","tags":["c#",".net","file"],"question_text":"I find myself doing this a lot just to ensure the filename is not in use. Is there a better way?\n`Directory.Exists(name) || File.Exists(name)`","answer_text":"Sure :)\n`internal static bool FileOrDirectory...
{"title":"Php code formatter \/ beautifier and php beautification in general","tags":["php","editor","beautifier"],"question_text":"Do you know any good tools for nicely formatting messy php code? Preferably a script for Aptana\/Eclipse, but a standalone tool will do too.","answer_text":"Well here is my very basic and ...
{"title":"What's the best way to test SQL Server connection programmatically?","tags":["c#","sql-server","database-connectivity"],"question_text":"I need to develop a single routine that will be fired each 5 minutes to check if a list of SQL Servers (10 to 12) are up and running.\nI can try to obtain a simple query in ...
{"title":"How to cast self to UnsafeMutablePointer<Void> type in swift","tags":["swift","pointers","casting"],"question_text":"Trying to pass \"self\" to a C function in swift, when calling following code:\n`var callbackStruct : AURenderCallbackStruct = \n AURenderCallbackStruct.init(\n inputProc: recordingCallback,\n ...
{"title":"How long can a TLD possibly be?","tags":["php","regex","email-validation","tld"],"question_text":"I'm working on an email validation regex in PHP and I need to know how long the TLD could possibly be and still be valid. I did a few searches but couldn't find much information on the topic. So how long can a TL...
{"title":"MySQL OUTER JOIN Syntax error","tags":["syntax","mysqli","outer-join","mysql5"],"question_text":"maybe a\nfacepalm\nfor you guys but as a SQL query noob I'm having a syntax issue, anyone know what's wrong?\n`SELECT * FROM company C\nOUTER JOIN company_address A ON C.company_id = A.company_id\nWHERE A.company_...
{"title":"When does System.gc() do anything","tags":["java","garbage-collection"],"question_text":"I know that garbage collection is automated in Java. But I understood that if you write\n`System.gc()`\nin your code the Java VM may or may not decide at runtime to do a garbage collection at that point. How does this wor...
{"title":"Oracle: SQL query that returns rows with only numeric values","tags":["sql","oracle"],"question_text":"I have a field (column in Oracle) called X that has values like \"a1b2c3\", \"abc\", \"1ab\", \"123\", \"156\"\nhow do I write an sql query that returns me only the X that hold pure numerical values = no let...
{"title":"When to use Path in WPF Binding?","tags":["wpf","xaml","data-binding"],"question_text":"I've seen a lot of WPF Binding examples and have used the feature in a lot of different places in learning MVVM, but something that has seemed quite inconsistent to me is when you specify \"Path=\" in the binding string as...
{"title":"What is the point of www in web urls?","tags":["url","web"],"question_text":"I've been trying to collect analytics for my website and realized that Google analytics was not setup to capture data for visitors to www.example.com (it was only setup for example.com). I noticed that many sites will redirect me to ...
{"title":"YouTube API v3 - List uploaded videos","tags":["youtube-api","youtube-api-v3"],"question_text":"How do I list the user's uploaded videos in the V3 api?","answer_text":"If you are using the client then Greg's answer is correct. To do the same thing with basic requests you make the following 2 requests:\nGET\nh...
{"title":"Android - Expandable TextView with Animation","tags":["android","android-animation","android-textview"],"question_text":"I have a\n`TextView`\nwhich firstly shows a small portion of a long text.\nThe user can press a \"see more\" button to expand the\n`TextView`\nand see the rest of that text.\nMaking tests, ...
{"title":"How do I rename a file?","tags":["c","linux","unix"],"question_text":"How can I rename a file on unix platform programatically without using the standard rename function?","answer_text":"The historical way to rename a file is to use link(2) to create a new hardlink to the same file, then to use unlink(2) to r...
{"title":"Find the nth occurrence of substring in a string","tags":["python","string","substring"],"question_text":"This seems like it should be pretty trivial, but I am new at Python and want to do it the most Pythonic way.\nI want to find the n'th occurrence of a substring in a string.\nThere's got to be something eq...
{"title":"How do I listen for triple clicks in JavaScript?","tags":["javascript","javascript-events"],"question_text":"If this is for double click:\n`window.addEventListener(\"dblclick\", function(event) { }, false);`\nHow can I capture a triple click? This is for a pinned tab in Google Chrome.","answer_text":"You need...
{"title":"Why do I have to define LD_LIBRARY_PATH with an export every time I run my application?","tags":["c","linux","gcc","shared-libraries","ld"],"question_text":"I have some code that uses some shared libraries (c code on gcc). When compiling I have to explicitly define the include and library directories using -I...
{"title":"Java Jar file: use resource errors: URI is not hierarchical","tags":["java","deployment","resources","executable-jar"],"question_text":"I have deployed my app to jar file. When I need to copy data from one file of resource to outside of jar file, I do this code:\n`URL resourceUrl = getClass().getResource(\"\/...
{"title":"How do you make strings XML\"safe\"?","tags":["php","xml","cakephp"],"question_text":"I am responding to an AJAX call by sending it an XML document through PHP echos. In order to form this XML document, I loop through the records of a database. The problem is that the database includes records that have '<' s...
{"title":"Why does GCC-Windows depend on cygwin?","tags":["windows","gcc","cygwin","posix","compiler-construction"],"question_text":"I'm not a C++ developer, but I've always been interested in compilers, and I'm interested in tinkering with some of the GCC stuff (particularly LLVM).\nOn Windows, GCC requires a POSIX-em...
{"title":"Tell gcc to specifically unroll a loop","tags":["c","gcc","pragma","unroll"],"question_text":"How can I tell GCC to unroll a particular loop?\nI have used the CUDA SDK where loops can be unrolled manually using\n`#pragma unroll`\n. Is there a similar feature for gcc? I googled a bit but could not find anythin...
{"title":"linux uptime history","tags":["linux"],"question_text":"How can I get a history of uptimes for my debian box? After a reboot, I dont see an option for the uptime command to print a history of uptimes. If it matters, I would like to use these uptimes for graphing a page in php to show my webservers uptime leng...
{"title":"Problem using SQLite :memory: with NHibernate","tags":["c#","nhibernate","sqlite","orm","integration-testing"],"question_text":"I use NHibernate for my dataacess, and for awhile not I've been using SQLite for local integration tests. I've been using a file, but I thought I would out the :memory: option. When ...
{"title":"Update table from another table and different database","tags":["mysql","sql"],"question_text":"Basically, what I want to do is the following :\nI have a table 'users' in my first database (prc), like this :\n`prc.user :\nid_user : 45 | name_user : Test | login_user : test | pwd_user : test\n[...]`\nAnd in my...
{"title":"Removing whitespaces inside a string","tags":["c++","qt","qstring"],"question_text":"I have a string\n`lots\\t of\\nwhitespace\\r\\n`\nwhich I have simplified but I still need to get rid of the other spaces in the string.\n`QString str = \" lots\\t of\\nwhitespace\\r\\n \";\nstr = str.simplified();`\nI can do...
{"title":"How do I write a join query across multiple tables in CakePHP?","tags":["cakephp","join"],"question_text":"can anyone tell me, how to retrieve joined result from multiple tables in cakePHP ( using cakePHP mvc architecture). For example, I have three tables to join (tbl_topics, tbl_items, tbl_votes. Their rela...
{"title":"Why is the destructor of the class called twice?","tags":["c++","destructor"],"question_text":"Apologies if the question sounds silly, I was following experts in SO and trying some examples myself, and this is one of them. I did try the search option but didn't find an answer for this kind.\n`class A\n{\n pub...
{"title":"How do you make lettered lists using markdown?","tags":["markdown"],"question_text":"Markdown\nallows ordered lists using numbers. How can I instead get an ordered list using\nletters\n? i.e.\n`A. the letter A\nB. the letter B\nC. etc`\ninstead of\n`1. the number 1\n2. the number 2\n3. etc.`","answer_text":"I...
{"title":"How to style unordered lists in CSS as comma separated text","tags":["html","css","xhtml"],"question_text":"I\u00e2\u0080\u0099m looking for a way to style an unordered list in XHTML with CSS such that it is rendered inline and the list items are separated by commas.\nFor example, the following list should be...
{"title":"Usage of MultiDexApplication causes Robolectric test for the Application class to break","tags":["android","robolectric","dex"],"question_text":"Adding Multi dex support with the support v4-r21 using gradle def (\nhttps:\/\/plus.google.com\/+IanLake\/posts\/JW9x4pcB1rj\n)\n`apply plugin: 'com.android.applicat...
{"title":"How to get the RGB values for a pixel on an image on the iphone","tags":["iphone","cocoa-touch","image","bitmap"],"question_text":"I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and captu...
{"title":"How to output JavaScript with PHP","tags":["php"],"question_text":"I am new to PHP. I need to output the following JavaScript with PHP. This is my code:\n`<html>\n<body>\n<?php\necho \"<script type=\"text\/javascript\">\";\necho \"document.write(\"Hello World!\")\";\necho \"<\/script>\";\n?>\n<\/body>\n<\/htm...
{"title":"Python: How to hash a string into 8 digits?","tags":["python","hash"],"question_text":"Is there anyway that I can hash a random string into a 8 digit number without implementing any algorithms myself? Thanks.","answer_text":"Yes, you can use the built-in\nhashlib\nmodules or the built-in\nhash\nfunction. Then...
{"title":"Checking something isEmpty in Javascript?","tags":["javascript","jquery"],"question_text":"How can I check if a variable is empty in Javascript? Sorry for the stupid question, but I'm a newbie in Javascript!\n`if(response.photo) is empty {\n do something\nelse {\n do something else\n}`\n`response.photo`\nwas ...
{"title":"Difference in Bash between IF statements with parenthesis and square brackets","tags":["bash","if-statement"],"question_text":"While learning a bit about\nbash\n, I come to see four types of ways of working with\n`if`\nstatements:\nSingle Parenthesis - ( ... )\nDouble Parenthesis - (( ... ))\nSingle Square Br...
{"title":"How do I get difference between two dates in android?, tried every thing and post","tags":["java","android","date","time"],"question_text":"I saw all the post in here and still I can't figure how do get difference between two android dates.\nThis is what I do:\n`long diff = date1.getTime() - date2.getTime();\...
{"title":"Why this method does not change Integer value?","tags":["java","integer","parameter-passing","pass-by-reference"],"question_text":"I do have one question: \nWhy this method does not change Integer value to 3?\n`public class SomeClass { private Integer value = 1;\npublic Integer getValue() {\n return value;\n}...
{"title":"Does Java have support for multicore processors\/parallel processing?","tags":["java","multithreading","parallel-processing","multicore"],"question_text":"I know that now that most processors have two or more cores, multicore programming is all the rage. Is there functionality to utilize this in Java? I know ...
{"title":"hide an entry from Toc in latex","tags":["latex","tableofcontents"],"question_text":"I would like to know how I can hide a section from the table of contents but without loosing the section number in the body of the document. For example, in this\ntex\nfile I loose the number for\n`hide`\n, and all the sequen...
{"title":"Solve error javax.mail.AuthenticationFailedException","tags":["java","javamail"],"question_text":"I'm not familiar with this function to send mail in java. I'm getting an error while sending email to reset password. Hope you can give me a solution.\nBelow is my code:\n`public synchronized static boolean sendM...
{"title":"ios6 uilabel not center text aligned","tags":["objective-c","ios"],"question_text":"I'm working on a ios app minimum ios 5 and i have just hit a weird issue with uilabels. or maybe im missing something obvious. anyway the problem im having is that i have a uilabel which is to be centered text aligned. all wor...
{"title":"setOpaque(true\/false); Java","tags":["java","swing","graphics","java-2d"],"question_text":"In Java2D when you use setOpaque I am a little confused on what the true and false does.\nFor example I know that in Swing Opaque means that when painting Swing wont paint what is behind the component. Or is this backw...
{"title":"Java garbage collection","tags":["java","garbage-collection"],"question_text":"Java automatically calls garbage collector, then why we need manual calls for garbage collection? When should use\nSystem.gc()","answer_text":"Java automatically calls garbage collector, then why we need manual calls for garbage co...
{"title":"jQuery TitleCase","tags":["javascript","jquery","string"],"question_text":"Is there a built in way with jQuery to \"title case\" a string? So given something like bob smith, it turns into \"Bob Smith\"?","answer_text":"You don't need jQuery for this; it can be accomplished using the native\n`.replace()`\nmeth...
{"title":"Cannot get regular expression work correctly with multiline","tags":["c#","regex","multiline"],"question_text":"I have a quite big XML output from an application. I need to process it with my program and then feed it back to the original program. There are pieces in this XML which needs to be filled out our r...
{"title":"Gemfile.lock write error, permissions?","tags":["ruby","linux","bundler"],"question_text":"I created a Rails model \"model\" a while ago and now I'm trying to run the server. After a\n`bundle install`\nI get:\nThere was an error while trying to write to Gemfile.lock. It is likely that you need to allow write ...
{"title":"Is C# a superset of C?","tags":["c#","c","programming-languages","superset"],"question_text":"Is C# a superset of C in anyway, like Objective-C or C++? Is there a way to compile C online with constructs such compiler flags?","answer_text":"In a word, No.","question_code":[],"answer_code":[],"retrieval_text":"...
{"title":"Is a non-blocking, single-threaded, asynchronous web server (like Node.js) possible in .NET?","tags":["c#","multithreading","events","node.js","asynchronous"],"question_text":"I was looking at\nthis question\n, looking for a way to create a\nsingle-threaded\n, event-based nonblocking asynchronous web server i...
{"title":"Split string into strings by length?","tags":["python"],"question_text":"Is there a way to take a string that is\n`4*x`\ncharacters long, and cut it into 4 strings, each\n`x`\ncharacters long, without knowing the length of the string?\nFor example:\n`>>>x = \"qwertyui\"\n>>>split(x, one, two, three, four)\n>>...
{"title":"How do I include .class files in my project in Eclipse? (Java)","tags":["java","eclipse","class"],"question_text":"Hey all. I am working on a project for school where we are given the .class file but not the source to include in our code. I am using Eclipse, and I want to include the file in my project so I c...
{"title":"JSTL c:if doesn't work inside a JSF h:dataTable","tags":["jsf","datatable","jstl","conditional-rendering"],"question_text":"I'm trying to use\n`<c:if>`\nto conditionally put a\n`<h:outputLink>`\ninside a\n`<h:dataTable>`\nwhen the state is finished.\n`<h:dataTable value=\"#{bean.items}\" var=\"item\" width=\"...
{"title":"Regex for checking if a string is strictly alphanumeric","tags":["java","regex","alphanumeric"],"question_text":"How can I check if a string contains only numbers and alphabets ie. is alphanumeric?","answer_text":"Considering you want to check for ASCII Alphanumeric characters, Try this\n`\"^[a-zA-Z0-9]*$\"`\...
{"title":"draw diagonal lines in div background with CSS","tags":["css","background","lines","css-shapes","diagonal"],"question_text":"I have div for preview box\nHTML:\n`<div class=\"preview-content\">PREVIEW<\/div>`\nCSS:\n`.preview-content {\n background: url(data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECA...
{"title":"JFrame.dispose() vs System.exit()","tags":["java","swing","jvm","jframe"],"question_text":"What is the difference between these two methods -\n`System.exit()`\nand\n`JFrame.dispose()`\n?\nIf we want to close a Java Swing application when a button is clicked, which method should I use?","answer_text":"`System....
{"title":"Byte and char conversion in Java","tags":["java","encoding","unicode","utf-16"],"question_text":"If I convert a character to\n`byte`\nand then back to\n`char`\n, that character mysteriously disappears and becomes something else. How is this possible?\nThis is the code:\n`char a = '\u00c3\u0088'; \/\/ line 1 \...
{"title":"Unable to generate an explicit migration in entity framework","tags":["entity-framework","ef-migrations"],"question_text":"I am adding a new migration but this message shows:\nUnable to generate an explicit migration because the following\n explicit migrations are pending: [201203170856167_left]. Apply the\n ...
{"title":"Get Parameter Encoding","tags":["spring","spring-mvc","java-ee"],"question_text":"I have a problem using spring mvc and special chars in a GET request. Consider the following method:\n`@RequestMapping(\"\/update\")\npublic Object testMethod(@RequestParam String name) throws IOException {\n }`\nto which I send...
{"title":"return json to ajax in symfony?","tags":["symfony1"],"question_text":"In symfony, I call an action and I want this to return json to jQuery frontend.\nThe Jobeet tutorial teaches how to return a partial but I want to return json, not a partial.","answer_text":"If it's just a normal AJAX action you're returnin...
{"title":"Code First Migration with Connection Strings","tags":["ef-code-first","code-first","code-first-migrations"],"question_text":"So I've managed to get Code First running and it works great.\nSince I am still developing the application the structure of the Database isn't finalize and so I need to implement migrat...
{"title":"Django: rename items in values()","tags":["django","django-orm"],"question_text":"I want to do pretty much the same like in\nthis ticket at djangoproject.com\n, but with some additonal formatting. From this query\n`>>> MyModel.objects.values('cryptic_value_name')\n[{'cryptic_value_name': 1}, {'cryptic_value_n...
{"title":"Ansible lineinfile duplicates line","tags":["ansible"],"question_text":"I have a simple file at \/etc\/foo.txt. The file contains the following:\n`#bar`\nI have the following ansible playbook task to uncomment the line above:\n`- name: test lineinfile\n lineinfile: backup=yes state=present dest=\/etc\/foo.txt...
{"title":"Require SSL in WebApi?","tags":[".net","ssl","asp.net-web-api"],"question_text":"Is there a way to require SSL for WebApi? An attribute?\nI don't see an applicable attribute under\n`System.Web.Http`\n, something like the\n`RequireHttps`\nattribute we have for MVC. I'm just trying to avoid rolling my own attri...
{"title":"What are common conventions for using namespaces in Clojure?","tags":["namespaces","clojure","conventions","project-organization"],"question_text":"I'm having trouble finding good advice and common practices for the use of namespaces in Clojure. I realize that namespaces are not the same as Java packages so I...
{"title":"How do I read all classes from a Java package in the classpath?","tags":["java","reflection"],"question_text":"I need to read classes contained in a Java package. Those classes are in classpath. I need to do this task from a Java program directly. Do you know a simple way to do?\n`List<Class> classes = readCl...
{"title":"python 'is not' operator","tags":["python"],"question_text":"I notice there is a comparison operator\n`is not`\n. Should I literally translate it into\n`!=`\ninstead of\n`== not`","answer_text":"To expand on what Ignacio said:\n`a == b`\nand\n`a != b`\ntest whether two objects have the same\nvalue\n. You can ...
{"title":"How to Copy\/Clone a Virtual Environment from Server to Local Machine","tags":["python","django","ubuntu","webserver","virtualenv"],"question_text":"I have an existing Python django Project running in Web Server. Now the client needs to make some changes in the existing code. So I need to set it up in my Loca...
{"title":"WCF 4 Rest Getting IP of Request?","tags":["c#","wcf","rest","tcp"],"question_text":"Hey, how do you get the IP address of the person making a request in something like the following:\n`[ServiceContract] \n [AspNetCompatibilityRequirements(RequirementsMode = \n AspNetCompatibilityRequirementsMode.Required)] \...
{"title":"PHP Mail Encodes Subject Line","tags":["php","email","encoding"],"question_text":"When I try to send a HTML encoded email from PHP, if the subject line contains special chars like\n`\"Here's the information you requested\"`\n, PHP encodes it to read\n`\"Here&#039;s the information you requested.\"`\nHow do I ...
{"title":"How do I use the ngCordova sqlite service and the Cordova-SQLitePlugin with Ionic Framework?","tags":["angularjs","sqlite","cordova","ionic-framework"],"question_text":"I have been trying to incorperate sqlite into a simple Ionic app and this is the process I have been following:\n`ionic start myApp sidemenu`...
{"title":"Caching a promise object in AngularJS service","tags":["javascript","angularjs","promise","angular-promise"],"question_text":"I want to implement a dynamic loading of a static resource in AngularJS using Promises. The problem: I have couple components on page which might (or not, depends which are displayed, ...
{"title":"MergedDictionaries and Resource lookup","tags":["wpf","performance","resourcedictionary","staticresource","mergeddictionaries"],"question_text":"i have a problem with Resource dictionaries and mergeddictionaries in general, especially when it comes to resource-lookup performance. After some performance testin...