text
stringlengths
74
309k
{"title":"How can I make iframe respect z-index in IE?","tags":["css","internet-explorer","iframe"],"question_text":"I have a youtube iframe element in my website, but it's next to my menu items. When I hover over a menu item, a submenu opens that partially covers the iframe (because of it's position, that's not it's s...
{"title":"Visual Studio 2015 Debugging: Can't expand local variables?","tags":["debugging","variables","visual-studio-2015"],"question_text":"I'm using Visual Studio 2015 preview, and I'm trying to debug my project. I was using VS 2012 previously, and depended largely on being able to hover over and expand local variab...
{"title":"Today App Extension Widget Tap To Open Containing App","tags":["ios","ios8","ios-app-extension","today-extension"],"question_text":"I've implemented a Today widget for my application +Quotes which displays the day's quote within the notification center with the help of these\nApple Docs\n. What I'd like to ac...
{"title":"AngularJS - ng-if check string empty value","tags":["angularjs"],"question_text":"it's a simple example:\n`<a ng-if=\"item.photo == ''\" href=\"#\/details\/{{item.id}}\"><img src=\"\/img.jpg\" class=\"img-responsive\"><\/a>\n<a ng-if=\"item.photo != ''\" href=\"#\/details\/{{item.id}}\"><img ng-src=\"\/{{item...
{"title":"windbg: Command output to text file","tags":["windbg"],"question_text":"How can I Save Output of a command in WinDbg to a Text File?","answer_text":"Start WinDbg from the command line using the -logo option:\n`windbg.exe -logo logfile.txt`\nThat will get everything done logged to the file specified. You can f...
{"title":"How to custom Modal View Controller presenting animation?","tags":["ios","core-animation","modalviewcontroller"],"question_text":"Instead of setting uiviewcontroller's\n`modalTransitionStyle`\n, I want to add an CAAnimation(or some other thing). This code can perform an custom animation in navigationControlle...
{"title":"Introducing FOREIGN KEY constraint may cause cycles or multiple cascade paths","tags":["entity-framework","cascading"],"question_text":"I am getting this error\nIntroducing FOREIGN KEY constraint\n 'FK_dbo.Regions_dbo.Countries_CountryId' on table 'Regions' may cause\n cycles or multiple cascade paths. Specif...
{"title":"How to do a web.config transform for smtp?","tags":["web-config","smtp","xdt-transform"],"question_text":"I have this in my root web.config\n`<mailSettings>\n <smtp from=\"no-reply@test.com\" deliveryMethod=\"SpecifiedPickupDirectory\">\n <specifiedPickupDirectory pickupDirectoryLocation=\"C:\\temp\"\/>\n <ne...
{"title":"Running full commands through remote ssh","tags":["bash","ssh","sh"],"question_text":"Possible Duplicate:\nhow to use ssh to run shell script on a remote machine?\nI am trying to make a bash script that runs on my remote server's daily cron jobs to automatically login through ssh to another unix box, run a fe...
{"title":"How to pass arguments when debugging a dot net application","tags":[".net","console"],"question_text":"I have an command line that uses arguments, I have no problem with this, but each time I want to test the application, I need to compile it, run the CMD, call the application with the parameters from the CMD...
{"title":"Is there a reasonable approach to \"default\" type parameters in C# Generics?","tags":["c#","generics","types","default","parameters"],"question_text":"In C++ templates, one can specify that a certain type parameter is a default. I.e. unless explicitly specified, it will use type T.\nCan this be done or appro...
{"title":"New Line in Node.js","tags":["javascript","node.js","newline"],"question_text":"I'm trying to Append data to a Log file using Node.js and that is working fine but it is not going to the next line. \\n doesn't seem to be working in my function below. Any suggestions? Thanks\n`function processInput ( text ) \n{...
{"title":"What does an @functions code block in a razor file do, and when (if ever) should I use it?","tags":["c#","asp.net-mvc-3","razor","orchardcms"],"question_text":"Whilst looking at a theme I downloaded from the Orchard CMS gallery, I noticed that a Layout.cshtml file had this block of code at the top of the file...
{"title":"About `let 5 = 10`","tags":["haskell"],"question_text":"If I say\n`let 5 = 10`\n, why does\n`5 + 1`\nreturn\n`6`\ninstead of\n`11`\n?","answer_text":"When you say\n`let 5 = 10`\nit's not a redefinition of 5, it's a pattern matching, the same which occurs when you say\n`foo 5 = undefined\n ... foo 10 ...`\nThe...
{"title":"What is my \"Target\" and how do I add a file to it for unit testing?","tags":["xcode","unit-testing"],"question_text":"I'm trying to add my parser.m file to the target of my unit test (or, of my unit test file?), but I have no idea how.\nHere's an example of a page that indicates the necessity of using the t...
{"title":"Scale background image to wrap content of layout","tags":["android","background","android-linearlayout","relativelayout","framelayout"],"question_text":"I have a layout that contains some text fields and has a background image that's displayed at the top of my activity. I'd like the background image to scale ...
{"title":"SqlAlchemy - Filtering by Relationship Attribute","tags":["filter","sqlalchemy","foreign-key-relationship"],"question_text":"I haven't much experience with SQLAlchemy and an problem, which I can't solve but searching an trying a lot of code.\nThis is my Class (reduced to the most significant code):\n`class Pa...
{"title":"How to concatenate strings in a Windows batch file?","tags":["windows","batch-file","string-concatenation"],"question_text":"I have a directory for which I want to list all the\n`.doc`\nfiles with a\n`;`\n.\nI know the following batch command echos all the files:\n`for \/r %%i In (*.doc) DO echo %%i`\nBut now...
{"title":"How do you scrape AJAX pages?","tags":["ajax","web-scraping","screen-scraping","scrape"],"question_text":"The title says it all. Please advise how to scrape AJAX pages.","answer_text":"Overview:\nAll screen scraping first requires manual review of the page you want to extract resources from. When dealing with...
{"title":"How can I write a Powershell alias with arguments in the middle?","tags":["powershell","g++","alias"],"question_text":"I'm trying to set up a Windows PowerShell alias to run MinGW's g++ executable with certain parameters. However, these parameters need to come after the file name and other arguments. I don't ...
{"title":"jQuery hyperlinks - href value?","tags":["jquery","hyperlink","href"],"question_text":"On my website I use jQuery to hook the events of elements, namely hyperlinks. As these hyperlinks only perform actions on the current page, and do not lead anywhere, I have been putting a href attribute of \"#\" in:\n`<a hr...
{"title":"Rails route to only index","tags":["ruby-on-rails","ruby","ruby-on-rails-3","ruby-on-rails-3.2"],"question_text":"This might be a simple routing question in Rails but I have searched around and received answers for Rails 2 rather than Rails 3.\nI generated a scaffold and the\n`resources :users`\nwhich include...
{"title":"Why does new String('hello') === new String('hello') evaluate to False?","tags":["javascript","equality","comparison-operators","equality-operator","identity-operator"],"question_text":"Why does the following statement return false in JavaScript?\n`new String('hello') === new String('hello')`","answer_text":"...
{"title":"How to detect IE 11 with javascript in Asp.net","tags":["javascript","asp.net","internet-explorer","browser-detection","internet-explorer-11"],"question_text":"Hello I want to detect the Browser , IE 8 or more will be appropriate for me. For this i used following code but it fails for IE 11 . For other its de...
{"title":"Nginx serves .php files as downloads, instead of executing them","tags":["php","nginx","php-5.5"],"question_text":"I am installing a website in a droplet (Digital Ocean). I have a issue for install NGINX with PHP properly. I did a tutorial\nhttps:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-...
{"title":"Textarea height: 100%","tags":["html","css"],"question_text":"Here's my fiddle:\nhttp:\/\/jsfiddle.net\/e6kCH\/15\/\nIt may sound stupid, but I can't find a way to make the text area height equal to 100%. It works for the width, but not for height.\nI want the text area to resize depending of the window size....
{"title":"Can I link a plain file into my executable?","tags":["c++","c","gcc","linker","embedded-resource"],"question_text":"Some frameworks (Qt, Windows, Gtk...) offer functionality to add resources to your binaries. I wonder if it would be possible to achieve this\nwithout\nthe framework, since all that is really ne...
{"title":"Difference between using App trait and main method in scala","tags":["scala"],"question_text":"What is the difference between\n`object Application extends App {\n println(\"Hello World\")\n}`\nand\n`object Application {\n def main(args: Array[String]): Unit = {\n println(\"Hello World\");\n }\n}`","answer_tex...
{"title":"Is there any way to accept only numeric values in a JTextField?","tags":["java","swing","jtextfield"],"question_text":"Is there any way to accept only numeric values in a\n`JTextField`\n? Is there any special method for this?","answer_text":"As this question re-appears quite often, I put some more effort in t...
{"title":"Why doesn't F5 rebuild project before execution in Visual Studio?","tags":["visual-studio","visual-studio-2010","build"],"question_text":"If I press\nF5\n, my project runs but it doesn't \"see\" any of the changes that I made. I need to manually (re)build before pressing\nF5\nfor it to work.\nIt worked well p...
{"title":"how to use javascript to change div backgroundColor","tags":["javascript","background-color"],"question_text":"The html below:\n`<div id=\"catestory\">\n <div class=\"content\">\n <h2>some title here<\/h2>\n <p>some content here<\/p>\n <\/div>\n <div class=\"content\">\n <h2>some title here<\/h2>\n <p>some co...
{"title":"Qt 5.1.1: Application failed to start because platform plugin \"windows\" is missing","tags":["c++","windows","qt","visual-studio-2012"],"question_text":"Edit:\nSome people started to mark my question as a duplicate. Do not forget that many similar questions existed when I asked this one (see e.g. the list be...
{"title":"How to add JSTL to Maven?","tags":["maven","jstl"],"question_text":"I'm working on a JSF 2.0 project using Mojarra, PrimeFaces and Tomcat 6.x.\nI need to use c:forEach for some primefaces component like dynamic number of p:tab but i have problem with the c:forEach. All the other tag of JSTL work nice.\nI have...
{"title":"MP3 playing using AVAudioPlayer not working on device","tags":["iphone","iphone-sdk-3.0","ios4","avaudioplayer"],"question_text":"I am testing my app on my 3GS iPhone with iOS 4.2\nI am using the following code which plays a sound in my IBAction. It works perfectly in the simulator (both iPad and iPhone) - I ...
{"title":"What is WPF and how does it compare to WinForms?","tags":["c#","wpf","windows"],"question_text":"I've been looking at WPF, but I've never really worked in it (except for 15 minutes, which prompted this question). I looked at this\npost\nbut its really about the \"Flash\" of a WPF. So what is the difference be...
{"title":"Parallelize Bash Script with maximum number of processes","tags":["bash"],"question_text":"Lets say I have a loop in bash:\n`for foo in `some-command`\ndo\n do-something $foo\ndone`\n`do-something`\nis cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4\n`do-something`\n's a...
{"title":"Which built-in .NET exceptions can I throw from my application?","tags":["c#",".net","exception"],"question_text":"If I need to throw an exception from within my application which of the built-in .NET exception classes can I use? Are they all fair game? When should I derive my own?","answer_text":"See\nCreati...
{"title":"Java Regex - reduce spaces in a string","tags":["java","regex"],"question_text":"I don't have time to get my head around regex and I need a quick answer. Platform is Java.\nI need the string\n`\"Some text with spaces\"`\n...to be converted to\n`\"Some text with spaces\"`\ni.e., 2 or more consecutive spaces to...
{"title":"How to draw a shape using a piece of image in php","tags":["javascript","php","html","css","html5-canvas"],"question_text":"I need to create a frame image by using a piece of an image.\nFor Example:\nUser will upload a image piece from back-end:\nNow I need to create a frame on front-end as per the front-end ...
{"title":"Hex-encoded String to Byte Array","tags":["java","arrays","string","bytearray"],"question_text":"`String str = \"9B7D2C34A366BF890C730641E6CECF6F\";`\nI want to convert\n`str`\ninto byte array, but\n`str.getBytes()`\nreturns 32 bytes instead of 16.","answer_text":"I think what the questioner is after is conve...
{"title":"Can I redefine a C++ macro then define it back?","tags":["c++","boost","macros","c-preprocessor"],"question_text":"I am using both the JUCE Library and a number of Boost headers in my code. Juce defines \"T\" as a macro (groan), and Boost often uses \"T\" in it's template definitions. The result is that if yo...
{"title":"Python script gives `: No such file or directory`","tags":["python","hashbang"],"question_text":"I have several python scripts which work just fine but one script has (as of this morning) started giving me this error if I try to run it from the bash:\n: No such file or directory\nI am able to run the 'broken'...
{"title":"Why has the std::vector::resize signature been changed in C++11?","tags":["c++","c++11","vector","stl","resize"],"question_text":"What are the reasons behind the change in\n`std::vector::resize`\nfrom the pre-C++11:\n`void resize( size_type count, T value = T() );`\nto the compatible C++11 form:\n`void resize...
{"title":"Implementation of BlockingQueue: What are the differences between SynchronousQueue and LinkedBlockingQueue","tags":["java","collections","concurrency","java.util.concurrent"],"question_text":"I see these implementation of\nBlockingQueue\nand can't understand the differences between them. My conclusion so far:...
{"title":"The view 'Index' or its master was not found.","tags":["asp.net-mvc","asp.net-mvc-routing","asp.net-mvc-areas"],"question_text":"`The view 'Index' or its master was not found. The following locations were searched:\n~\/Views\/ControllerName\/Index.aspx\n~\/Views\/ControllerName\/Index.ascx\n~\/Views\/Shared\/...
{"title":"String.IsNullOrEmpty() Check for Space","tags":["c#"],"question_text":"What is needed to make\n`String.IsNullOrEmpty()`\ncount whitespace strings as empty?\nEg. I want the following to return\n`true`\ninstead of the usual\n`false`\n:\n`String.IsNullOrEmpty(\" \");`\nIs there a better approach than:\n`String.I...
{"title":"Remove .pyc files from Git remote repository","tags":["git","bitbucket","pyc"],"question_text":"Accidentally, I have pushed the .pyc files to the master repository. Now I want to delete them but I can\u00c2\u00b4t do it. Is there any way to remove them directly from the Bitbucket site?\nThanks in advance.","a...
{"title":"Entity Framework. View return duplicate records","tags":["entity-framework","duplicates"],"question_text":"I use Entity Framework that contains view. And I have query:\n`var data = this.context.vwRevenues\n .Where(x => x.revenue >= 0);\n .OrderByDescending(x => x.year)\n .ThenByDescending(x => x.month)\n .Tak...
{"title":"How does std::flush work?","tags":["c++","stream"],"question_text":"Can someone please explain (preferably using plain english) how\n`std::flush`\nworks?\nWhat is it?\nWhen would you flush a stream?\nWhy is it important?\nThank you.","answer_text":"Since it wasn't answered\nwhat\n`std::flush`\nhappens to be, ...
{"title":"Convert RGBA PNG to RGB with PIL","tags":["python","png","jpeg","python-imaging-library","rgba"],"question_text":"I'm using PIL to convert a transparent PNG image uploaded with Django to a JPG file. The output looks broken.\nSource file\nCode\n`Image.open(object.logo.path).save('\/tmp\/output.jpg', 'JPEG')`\n...
{"title":"Setting equal heights for div's with jQuery","tags":["jquery","html","height","equals"],"question_text":"I want to set equal height for divs with jQuery. \nAll the divs may have different amount of content and different default height. Here is a sample of my html layout:\n`<div class=\"container\">\n <div cla...
{"title":"python csv unicode 'ascii' codec can't encode character u'\\xf6' in position 1: ordinal not in range(128)","tags":["python","csv"],"question_text":"I have copied this script from [python web site][1] This is another question but now problem with encoding:\n`import sqlite3\nimport csv\nimport codecs\nimport cS...
{"title":"how to store Image as blob in Sqlite & how to retrieve it?","tags":["android","image","blob"],"question_text":"I want to store an image(from url) into a sqlite database.\nFor that I use:\n`db = new DataBase(getApplicationContext());\nURL url = new URL(\"http:\/\/sree.cc\/wp-content\/uploads\/schogini_team.png...
{"title":"Check a radio button with javascript","tags":["javascript","html","checkbox"],"question_text":"For some reason, I can't seem to figure this out.\nI have some radio buttons in my html which toggles categories:\n`<input type=\"radio\" name=\"main-categories\" id=\"_1234\" value=\"1234\" \/> \/\/ All\n<input typ...
{"title":"How can I test that a value is \"greater than or equal to\" in Jasmine?","tags":["javascript","tdd","jasmine"],"question_text":"I want to confirm that a value is a decimal (or 0), so the number should be greater than or equal to zero\nand\nless than 1.\n`describe('percent',function(){ \n it('should be a decim...
{"title":"Defining methods via prototype vs using this in the constructor - really a performance difference?","tags":["javascript","performance","memory-management","prototype"],"question_text":"In JavaScript, we have two ways of making a \"class\" and giving it public functions.\nMethod 1:\n`function MyClass() {\n var...
{"title":"PHP\/regex: How to get the string value of HTML tag?","tags":["php","html","regex"],"question_text":"I need help on regex or\n`preg_match`\nbecause I am not that experienced yet with regards to those so here is my problem.\nI need to get the value \"get me\" but I think my function has an error.\nThe number o...
{"title":"Styling native tooltip from title=\"Tooltip text\"","tags":["css","input","tooltip","title"],"question_text":"I have input element that has title attribute which of course will result with tooltip with message of the attribute value.\nFor some reason this tooltip needs to be styled with css.\nHow can it be do...
{"title":"Are C# auto-implemented static properties thread-safe?","tags":["c#","static","thread-safety","properties","automatic-properties"],"question_text":"I would like to know if C# automatically implemented properties, like\n`public static T Prop { get; set; }`\n, are thread-safe or not. Thanks!","answer_text":"Sec...
{"title":"Using intents to pass data between activities in android","tags":["android","android-intent"],"question_text":"I am trying to pass the data between Activities\nI use intents to pass data between regular activities\nconsider the code below\n::\n`AndroidTabRestaurantDescSearchListView.java`\n`public class Andro...
{"title":"How to create a single instance application in C or C++","tags":["c++","c","linux","single-instance"],"question_text":"What would be your suggestion in order to create a single instance application, so that only one process is allowed to run at a time? File lock, mutex or what?","answer_text":"A good way is:\...
{"title":"Floating Point Comparison in Shell Script","tags":["linux","bash","unix","shell"],"question_text":"Can you please suggest to me the syntax for doing floating point comparison in a Bash script? I would ideally like to use it as part of an\n`if`\nstatement. Here is a small code snippet :\n`key1=\"12.3\"\nresult...
{"title":"Error while running zipalign","tags":["android","eclipse","export","package"],"question_text":"I got this error when trying to export a signed apk in Eclipse\nError while running zipalign:\nUnable to open \n as zip archive\nI have run the Help->Check for Updates to make sure the latest update is installed and...
{"title":"Free memory allocated in a different function?","tags":["c","pointers","memory-management","malloc","free"],"question_text":"I'm trying to learn C and I'm currently trying to write a basic stack data structure, but I can't seem to get basic\n`malloc`\n\/\n`free`\nright.\nHere's the code I've been using (I'm j...
{"title":"C\/C++: Array size at run time w\/o dynamic allocation is allowed?","tags":["c++","c","array-initialization"],"question_text":"I've been using C++ for a few years, and today I don't know if this is a mere brainfart or what, but how can this be perfectly legal:\n`int main(int argc, char **argv)\n{\n size_t siz...
{"title":"How to generate unique ID with node.js","tags":["javascript","node.js","express"],"question_text":"`function generate(count) {\n var founded = false,\n _sym = 'abcdefghijklmnopqrstuvwxyz1234567890',\n str = '';\n while(!founded) {\n for(var i = 0; i < count; i++) {\n str += _sym[parseInt(Math.random() * (_sym...
{"title":"Using alias() for 'select as' in SQLAlchemy","tags":["python","sqlalchemy","pyramid"],"question_text":"Let's say I have a table 'shares' with the following columns:\n`company price quantity\nMicrosoft 100 10\nGoogle 99 5\nGoogle 99 20\nGoogle 101 15`\nI'd like to run the equivalent of a SQL statement like thi...
{"title":"RegExp in preg_match function returning browser error","tags":["php","regex","apache","wamp","connection-reset"],"question_text":"The following function breaks with the regexp I've provided in the $pattern variable. If I change the regexp I'm fine, so I think that's the problem. I'm not seeing the problem, th...
{"title":"How to detect whether UISwitch is on\/off?","tags":["objective-c","uiswitch"],"question_text":"I am trying to detect when a UISwitch it on \/ off\n`\/\/ .h\nIBOutlet UISwitch *privateSwitch;\n@property (nonatomic, retain) IBOutlet UISwitch *privateSwitch;\n\/\/.m\n@synthesize privateSwitch;\nprivateSwitch = [...
{"title":"How to exclude one particular field from a collection in Mongoose?","tags":["javascript","mongodb","mongoose","mongodb-query"],"question_text":"I have a NodeJS application with Mongoose ODM(\nMongoose 3.3.1\n). I want to retrieve all fields except 1 from my collection.For Example: I have a collection Product ...
{"title":"UITextField: move view when keyboard appears","tags":["iphone","objective-c","cocoa-touch","uitextfield"],"question_text":"I'm currently working on an iPhone application with a single view, which has multiple UITextFields for input. When the keyboard shows, it overlays the bottom textfields. So I added the co...
{"title":"oracle drop index if exists","tags":["oracle","indexing"],"question_text":"How do you drop an index only if it exists?\nIt seems simple but I did found anything on the net.\nThe idea is to drop it only if it exists, because if not, I will have an error and my process stops.\nI found this to find if the index ...
{"title":"Android Understanding Heap Sizes","tags":["android","heap","virtual-machine","dalvik","ddms"],"question_text":"I'm fairly new to Android development and I can't seem to grasp the Java Out of Memory exception. I know it means that my app has gone over the VM budget but after Googling this many times I still do...
{"title":"How to exit from setInterval","tags":["javascript","setinterval"],"question_text":"I need to exit from a running interval if the conditions are correct:\n`var refreshId = setInterval(function() {\n var properID = CheckReload();\n if (properID > 0) {\n <--- exit from the loop--->\n }\n }, 10000);`","answer_tex...
{"title":"Directly accessing nested dictionary values in Objective-C","tags":["iphone","objective-c","dictionary","nsdictionary","key-value-coding"],"question_text":"Is there a way to directly access an inner-array of an an outer array in Objective-C? For example, a call to an external data source returns the following...
{"title":"What does 'x << ~y' represent in JavaScript?","tags":["javascript","bitwise-operators"],"question_text":"What does 'x << ~y' represent in JavaScript?\nI understand that the bitwise\n`SHIFT`\noperation does this:\nx << y AS x * 2\ny\nAnd a tilde\n`~`\noperator does:\n`~x AS -(x+1)`\nSo, I assume the following:...
{"title":"abstract test case using python unittest","tags":["python","unit-testing","testcase"],"question_text":"Is it possible to create an abstract\n`TestCase`\n, that will have some test_* methods, but this\n`TestCase`\nwon't be called and those methods will only be used in subclasses? I think I am going to have one...
{"title":"mockito ArrayList<String> problem","tags":["java","unit-testing","arraylist","mocking","mockito"],"question_text":"I have a method that I am trying to unit test. This method takes a parameter as an ArrayList and does things with it. The mock I am trying to define is:\n`ArrayList<String> mocked = mock(ArrayLis...
{"title":"NoClassDefFoundError when using Powermock","tags":["java","unit-testing","junit","easymock","powermock"],"question_text":"I'm running a\n`junit`\ntest case using the\n`PowerMock`\ntest runner.\nI'm using the following command line to execute it:\n`java -cp .:junit-4.9b2.jar:easymock-3.0.jar:powermock-easymock...
{"title":"Hide horizontal scrollbar (Angular ui-grid)","tags":["angular-ui-grid"],"question_text":"I'm trying to hide the horizontal scrollbar of a Angular ui-grid, but I can't find the right property. (Property\nenableScrollbars=false\nremoves both.)\nIs it possible to remove only the horizontal scrollbar?","answer_te...
{"title":"How make middle div to fill space between floating elements?","tags":["css3","html","css-float","side-by-side"],"question_text":"I have three div elements: left, middle and right.\nLeft and right are fixed and floating. What I want is the\nmiddle div to fill the gap\nin between them.\nThis is my code:\n`<!DOC...
{"title":"Remove all deleted files in next commit with Mercurial","tags":["mercurial"],"question_text":"Let's say I have the current\n`status`\n:\n`M File1.cs\nM File2.cs\nM File3.cs\n! File4.cs\n! File5.cs\n! File6.cs`\nHow do I bulk\n`remove`\nfiles 4, 5, 6 (\n`!`\n) from the next commit?\nAt the moment, I am just re...
{"title":"Android SQLite - Cursor & ContentValues","tags":["android","sqlite","cursor"],"question_text":"Is there any way to GET the ContentValues object from the SQLite? It's very useful, that we can insert ContentValues in DB, and it should be more useful to get the CV from there.","answer_text":"You can use the meth...
{"title":"Reading Text File From Server on Android","tags":["android","http","file"],"question_text":"I have a text file on my server. I want to open the text file from my Android App and then display the text in a TextView. I cannot find any examples of how to do a basic connection to a server and feed the data into a...
{"title":"java.io.IOException: setDataSource failed.: status=0x80000000","tags":["android","media-player","live-wallpaper","surfaceholder"],"question_text":"I am tying to play url using media player in activity using :\n`mediaPlayer = MediaPlayer.create(getApplicationContext(),\nUri.parse(\"http:\/\/www.pocketjourney.c...
{"title":"Retrospectively add --recursive to a git repo","tags":["git","version-control","git-submodules","git-clone"],"question_text":"If you\n`git clone`\nwith\n`--recursive`\n, you can get all the git submodules too.\nIf I've forgotten to add this magical flag when cloning, as can happen, how do I now go and get any...
{"title":"Array of PHP Objects","tags":["php","arrays","object"],"question_text":"So I have been searching for a while and cannot find the answer to a simple question. Is it possible to have an array of objects in PHP? Such as:\n`$ar=array(); \n$ar[]=$Obj1 \n$ar[]=$obj2`\nFor some reason I have not been able to find th...
{"title":"Undo a fast-forward merge","tags":["git"],"question_text":"I've made some changes to my git repo that I wish to undo.\nMy git repo looked like this:\n`A-B---- master\n \\ \/\n C-D * develop`\nI was on the\n`develop`\nbranch, forgot that it differed from the\n`master`\nbranch, made a change on\n`develop`\n, me...
{"title":"Getting the IP Address of a Remote Socket Endpoint","tags":["c#","sockets","endpoints"],"question_text":"How do I determine the remote IP Address of a connected socket?\nI have a RemoteEndPoint object I can access and well as its AddressFamily member.\nHow do I utilize these to find the ip address?\nThanks!\n...
{"title":"Angularjs: build url with query string","tags":["javascript","angularjs"],"question_text":"How to build a url with query parameters in Angularjs.\nI see the API\n$location.search()\nthe problem is $location(url) is to redirect to the url. In my case, I want to pass a url and key:value pairs for the query para...
{"title":"Reporting Services: Tablix RepeatColumnHeaders doesn't work on some reports","tags":["reporting-services"],"question_text":"So I've got various reports that consist of a DataSet rendered in a Tablix... pretty garden variety stuff. There is a property for the Tablix control named\nRepeatColumnHeaders\n, which ...
{"title":"What exactly is \"exit\" in PowerShell?","tags":["powershell"],"question_text":"You can exit PowerShell by typing\n`exit`\n. So far so good. But what exactly is this?\n`PS Home:\\> gcm exit\nGet-Command : The term 'exit' is not recognized as the name of a cmdlet, function, script file, or operable program. Ch...
{"title":"Use the XmlInclude or SoapInclude attribute to specify types that are not known statically","tags":["c#",".net","xml","xmlserializer"],"question_text":"I've got a very strange problem when working with .NET's\n`XmlSerializer`\n.\nTake the following example classes:\n`public class Order \n{\n public PaymentCol...
{"title":"Generate a random number in a certain range in MATLAB","tags":["matlab","random","numbers","integer"],"question_text":"How can I generate a random number in MATLAB between 13 and 20?","answer_text":"If you are looking for Uniformly distributed pseudorandom integers use:\n`randi([13, 20])`","question_code":[],...
{"title":"Lambdas from a list comprehension are returning a lambda when called","tags":["python","lambda"],"question_text":"I am trying to iterate the lambda func over a list as in\n`test.py`\n, and I want to get the call result of the lambda, not the function object itself. However, the following output really confuse...
{"title":"Swift: NSDate formatting with strftime & localtime","tags":["objective-c","c","swift","strftime","localtime"],"question_text":"How do I convert the following Objective-C code into Swift code?\n`#define MAX_SIZE 11\nchar buffer[MAX_SIZE];\ntime_t time = [[NSDate date] timeIntervalSince1970];\nstrftime(buffer, ...
{"title":"Can I multiply strings in Java to repeat sequences?","tags":["java","string"],"question_text":"I have something like the following:\n`int i = 3;\nString someNum = \"123\";`\nI'd like to append\n`i`\n\"0\"s to the\n`someNum`\nstring. Does it have some way I can multiply a string to repeat it like Python does?\...
{"title":"msysgit error with hooks: \"git error: cannot spawn .git\/hooks\/post-commit: No such file or directory\"","tags":["windows","git","msysgit"],"question_text":"I'm having trouble getting post-recieve and post-commit hooks to work correctly with msysgit (Windows 7 Pro\/32 and Ultimate\/64). For post-commit hook...
{"title":"Why do some Java library methods delegate to a native method with a similar signature","tags":["java","native"],"question_text":"After delving into the source code for the JRE library, I noticed a strangely common code structure, like this:\n`public int foo(double bar) {\n return foo0(bar);\n}\nprivate native...
{"title":"Regular Expression to get all characters before \"-\" ","tags":["c#","regex"],"question_text":"How can I get the string before the character \"-\" using regular expressions?\nFor example, I have \"text-1\" and I want to return \"text\".","answer_text":"So I see many possibilities to achieve this.\n`string tex...