text
stringlengths
74
309k
{"title":"Why in Java (high + low) \/ 2 is wrong but (high + low) >>> 1 is not?","tags":["java","bit-manipulation","bitwise-operators","binary-search"],"question_text":"I understand the\n`>>>`\nfixes the overflow: when adding two big positive longs you may endup with a negative number. Can someone explain how this bitw...
{"title":"Where to change minSdkVersion setting in PhoneGap app","tags":["android","cordova"],"question_text":"I'm having a strange issue when trying to build a basic PhoneGap app on OS X. The app is setup with just the Android platform. I'm getting the following error when I enter \"PhoneGap build\".\n`:processDebugMa...
{"title":"How handler classes work in Android","tags":["android","handler"],"question_text":"I am new to android and was reading the demo applications on official android website. And I came across a method of\n`Handler`\nclass named as\n`postDelayed(Runnable r, long milliseconds)`\n.\nCan anybody please explain what t...
{"title":"How to align input forms in HTML","tags":["html","forms","alignment"],"question_text":"I'm new to HTML and I'm trying to learn how to use forms.\nThe biggest issue I am having so far is aligning the forms. Here is an example of my current HTML file:\n`<form>\n First Name:<input type=\"text\" name=\"first\"><b...
{"title":"T-SQL: Export to new Excel file","tags":["sql-server-2008","tsql","excel"],"question_text":"I have a script that does various things and the end result is one large table. I was wondering how I could export this final table to a new Excel file (with column headers as well).\nI would need to do this within the...
{"title":"Setting Font of TextBox from code behind","tags":["c#","wpf","code-behind"],"question_text":"This maybe a stupid question but how do I set the font of a\n`TextBox`\nfrom a\n`string`\nin the code behind?\n`\/\/ example\ntxtEditor.FontFamily = \"Consolas\";`","answer_text":"`txtEditor.FontFamily = new FontFamil...
{"title":"Should I subclass CCSprite, CCNode, or NSObject?","tags":["ios","cocos2d-iphone"],"question_text":"I see that certain texts always seem to subclass CCSprite. I read somewhere that it is not good to do that and that it is better to start with something basic. I wanted to find out what the pro game developers d...
{"title":"Getting total result count from Rails query using will_paginate","tags":["ruby-on-rails","will-paginate"],"question_text":"I get a list of objects from my Rails app, and use will_paginate to page as usual, and then I have a little method used to save details of the search to the database:\n`per_page=10\nsessi...
{"title":"VBA Check if variable is empty","tags":["vba"],"question_text":"I have an object and within it I wanna check if some properties is set to false, like:\n`If (not objresult.EOF) Then\n 'Some code \nEnd if`\nBut somehow, sometimes\n`objresult.EOF`\nis\n`Empty`\n, and how can I check it?\n`IsEmpty`\nfunction is f...
{"title":"Why do I get \"Unknown validator: 'MessageValidator'\"?","tags":["ruby-on-rails","ruby-on-rails-3","validation"],"question_text":"I get this error\nUnknown validator: 'MessageValidator'\nI have no idea why I'm getting that.\nWhat's wrong with my code?\n`validates :title, \n :presence => true, \n :uniqueness =...
{"title":"java native Process timeout","tags":["java","process"],"question_text":"At the moment I execute a native process using the following:\n`java.lang.Process process = Runtime.getRuntime().exec(command); \nint returnCode = process.waitFor();`\nSuppose instead of waiting for the program to return I wish to termina...
{"title":"Can javax.persistence.Query.getResultList() return null?","tags":["java","hibernate","jpa"],"question_text":"And if so, under what circumstances?\nJavadoc and JPA spec says nothing.","answer_text":"You are right. JPA specification says nothing about it. But\nJava Persistence with Hibernate book, 2nd edition\n...
{"title":"PayPal: express checkout pay without account","tags":["paypal","express-checkout"],"question_text":"Is it possible to do an express checkout payment in PayPal without an account?\nI remember that I saw it somewhere, but I don't remember where.\nOnce a time in PayPal there was a link under \"Create a PayPal ac...
{"title":"Git basic workflow","tags":["git","push"],"question_text":"Possible Duplicate:\ngit push error '[remote rejected] master -> master (branch is currently checked out)'\nI am new to Git and trying to use it for a local grails project.\nThe steps I followed:\ncreate the grails project\ngo to the project directory...
{"title":"MySQL - Find MIN but not zero","tags":["mysql"],"question_text":"I am trying to fetch the minimum value of a column in MySQL using the\n`MIN`\nfunction. But is it possible to tell MySQL to ignore the zero values? Problem is that I am storing\n`0`\nas default value instead of\n`NULL`\nfor a\n`tinyint`\ncolumn....
{"title":"NDK - How to use a generated .so library in another project","tags":["android","android-ndk"],"question_text":"I have used ndk successfully to build & use a .so file in one project. I need to use this library in another project. I would rather not copy the source there, but just use the library. Trying to cop...
{"title":"findAll() in yii","tags":["php","yii","yii-cactiverecord"],"question_text":"EmailArchive Table:\n`id email_id to from\n1 101 uk msm\n2 102 uu avc\n3 101 rk uk\n4 103 xyz abc\n5 104 xyz poi\n6 104 abc xyz\n7 101 xyz abc`\nNow in Yii I want record where email_id=101\nI am using below code, but its not working.\...
{"title":"Setting expire headers for fonts not working","tags":["apache",".htaccess","fonts","webfonts","expires-header"],"question_text":"I am using the below code in my .htaccess file to try and set the expire headers for some fonts, but upon checking my firefox cache and checking the expire header it the font is set...
{"title":"What's the Point of Selenium?","tags":["unit-testing","testing","selenium"],"question_text":"Ok, maybe I'm missing something, but I really don't see the point of Selenium. What is the point of opening the browser using code, clicking buttons using code, and checking for text using code? I read the website and...
{"title":"Where are the readonly\/const in .NET?","tags":[".net","language-design","library-design"],"question_text":"In C++ you'll see\n`void func(const T& t)`\neverywhere. However, i havent seen anything similar in .NET. Why?\nI have notice a nice amount of parameters using struct. But i see no functions with readonl...
{"title":"Which class design is better?","tags":["oop","class-design"],"question_text":"Which class design is better and why?\n`public class User\n{\n public String UserName;\n public String Password;\n public String FirstName;\n public String LastName;\n}\npublic class Employee : User\n{\n public String EmployeeId;\n ...
{"title":"What is __declspec and when do I need to use it?","tags":["c++"],"question_text":"I have seen instances of __declspec in the code that I am reading. What is it? And when would I need to use this construct?","answer_text":"This is a Microsoft specific extension to the C++ language which allows you to attribute...
{"title":"Can you use static constants in PHP?","tags":["php","constants"],"question_text":"I expected the following to work but it doesn't seem to.\n`<?php\nclass Patterns\n{\n public static const EMAIL = \"\/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$\/ix\";\n public static const INT = \"\...
{"title":"What is the OR operator in an IF statement","tags":["c#"],"question_text":"In C#, how do I specify OR:\n`if(this OR that) {do the other thing}`\nI couldn't find it in the help.\nUpdate:\nMy code is:\n`if (title == \"User greeting\" || \"User name\") {do stuff}`\nand my error is:\nError 1 Operator '||' cannot ...
{"title":"How to run Jasmine tests on Node.js from command line?","tags":["node.js","jasmine","jasmine-node"],"question_text":"How to run Jasmine tests on Node.js from command line?\nI have installed jasmine-node via npm and wrote some tests.\nI want to run tests inside spec directory and get results in terminal, is th...
{"title":"How to get the last path in a URL?","tags":["php","url-parsing"],"question_text":"I would like get the last path segment in a URL:\n`http:\/\/blabla\/bla\/wce\/news.php`\nor\n`http:\/\/blabla\/blablabla\/dut2a\/news.php`\nFor example, in these two URLs, I want to get the path segment: 'wce', and 'dut2a'.\nI t...
{"title":"Installation of VB6 on Windows 7 (or Windows 8) (or Windows 10)","tags":["windows-7","vb6","installation","legacy","legacy-code"],"question_text":"Possible Duplicate:\nHas anyone had success with Visual Studio 6 on Windows 7?\nDoes the VB6 IDE run on Windows 7 64-bit?\nI have been having problems installing V...
{"title":"How can I align text directly beneath an image?","tags":["html","css","text","justify"],"question_text":"I used to know how to put an image on top and then justify the text below the image so that it stays within the borders of the width of the image. However, now I have no idea how to do this. How is this ac...
{"title":"What is the difference between sites-enabled and sites-available directory?","tags":["apache2","webserver","ubuntu-12.04"],"question_text":"What is use of these two directories in apache2 and how can we do it?","answer_text":"The difference is that virual sites listed in\n`sites-enabled`\ndirectory are served...
{"title":"How to choose returned column name in a SELECT FOR XML query?","tags":["sql","sql-server","xml","sql-server-2005"],"question_text":"MS SQL has a convenient workaround for concatenating a column value from multiple rows into one value:\n`SELECT col1\n FROM table1\n WHERE col2 = 'x'\n ORDER by col3\n FOR XML pa...
{"title":"Model Containing List of Models (MVC-3, Razor)","tags":["model","asp.net-mvc-3","razor"],"question_text":"This problem has been plaguing me for two days now. There are some similar posts, but none that address my problem completely.\nUsing MVC-3, Razor syntax:\n-- EDIT.cshtml --\n`@using (Html.BeginForm(\"Edi...
{"title":"jQuery scrollTop() doesn't seem to work in Safari or Chrome (Windows)","tags":["javascript","jquery","safari"],"question_text":"I've got a simple setup to allow a \"help\"-style window to be loaded and scrolled to a particular point on the page. More or less the code looks like this:\n`var target = \/* code *...
{"title":"Alternative to BackgroundWorker that accepts more than one argument?","tags":["c#",".net","multithreading","asynchronous","backgroundworker"],"question_text":"The BackgroundWorker object allows us to pass a single argument into the DoWorkEventHandler.\n`\/\/ setup\/init:\nBackgroundWorker endCallWorker = new ...
{"title":"What tools do you recommend to profile Rails apps?","tags":["ruby-on-rails","ruby","profiling"],"question_text":"I've been looking for profiling tools for Rails for a while. I'm currently playing and testing ruby-prof and railsbench, but I kinda frustrated with the amount of tweaking and mangling required to ...
{"title":"How can I split multiple joined words?","tags":["string","nlp"],"question_text":"I have an array of 1000 or so entries, with examples below:\n`wickedweather\nliquidweather\ndriveourtrucks\ngocompact\nslimprojector`\nI would like to be able to split these into their respective words, as:\n`wicked weather\nliqu...
{"title":"What does the C# CoClass attribute do?","tags":["c#","coclass"],"question_text":"I found code something like the following in a 3rd party library we're using.\n`[CoClass(typeof(BlahClass))]\npublic interface Blah : IBlah\n{\n}`\nWhat is this doing exactly? The msdn documentation didn't illuminate the subject ...
{"title":"Find an element with a specific data attribute jQuery","tags":["javascript","jquery","html5"],"question_text":"I understand that I can always iterate down the DOM tree and check every element for a data field and if the value is correct but I would like a cleaner solution. For example\n`<div id=\"theDiv\">\n ...
{"title":"Angularjs bootstrap dropdown not working","tags":["javascript","html","angularjs","twitter-bootstrap","angular-ui-bootstrap"],"question_text":"Am bit new to angularjs and bootstrap.\nAm trying to add a simple dropdown. But it is not working.\nTried out the suggestion @\nBootstrap 3 simple dropdown not working...
{"title":"Android - Set Spinner Default Value to null","tags":["android","spinner"],"question_text":"I'm trying to get a Spinner to load up with no selected value. once the user selects a value it then takes them to another page.\nThis is proving to be a problem because at present, the page just loads straight away bef...
{"title":"Git collaboration - how to manage configuration files","tags":["git","configuration-files","gitignore"],"question_text":"I'm writing a short script with a few simple variables at the top of the page. I want to work on them with a friend, but we aren't sure how to manage the variables needing to be changed aft...
{"title":"How to prevent arithmetic overflow error when using SUM on INT column?","tags":["sql-server-2008-r2","int","sum","overflow","arithmeticexception"],"question_text":"I am using\nSQL Server 2008 R2\nand I have an\n`INT`\ncolumn where the data inserted never surpasses the max\n`INT`\n, but I have a query which us...
{"title":"If Int32 is just an alias for int, how can the Int32 class use an int?","tags":["c#","compiler-construction","internals"],"question_text":"Been browsing through .NET source code of\n.NET Framework Reference Source\n, just for fun of it. And found something I don't understand.\nThere is a\nInt32.cs\nfile with ...
{"title":"Can I animate the UIScrollView contentOffset property via its layer?","tags":["ios","uiscrollview","core-animation","cakeyframeanimation"],"question_text":"I want to zoom and scroll a UIScrollView with a CGPathRef. Because of that I assume I have to animate the UIScrollView's layer property? But which propert...
{"title":"How to spawn parallel child processes on a multi-processor system?","tags":["python","exec","subprocess","multiprocessing"],"question_text":"I have a Python script that I want to use as a controller to another Python script. I have a server with 64 processors, so want to spawn up to 64 child processes of this...
{"title":"App Transport Security Xcode 7 beta 6","tags":["ios","xcode","swift"],"question_text":"I'm currently working on\nXcode 7 beta 6\n. I'm trying to send a \"DELETE\" request to\nhttp:\/\/mySubdomain.herokuapp.com\nThe error I receive is:\nApp Transport Security has blocked a cleartext HTTP (http:\/\/) resource l...
{"title":"\"Time Since\/Ago\" Library for Android\/Java","tags":["android"],"question_text":"Any suggestions for a good library for Android\/Java to display time since?\n(e.g. 10 minutes ago, 5 days ago)","answer_text":"From the Google I\/O 2012 App:\n`\/*\n * Copyright 2012 Google Inc.\n *\n * Licensed under the Apach...
{"title":"INotifyPropertyChanged property name - hardcode vs reflection?","tags":[".net","wpf","reflection"],"question_text":"What is the best way to specify a property name when using INotifyPropertyChanged?\nMost examples hardcode the property name as an argument on the PropertyChanged Event. I was thinking about usi...
{"title":"List file names based on a filename pattern and file content - GREP?","tags":["linux","shell","unix","ftp","grep"],"question_text":"How can I use Grep command to search\n`file name`\nbased on a wild card\n`\"LMN2011*\"`\nlisting all files with this as beginning?\nI want to add another check on those file cont...
{"title":"How to SFTP with PHP?","tags":["php","sftp"],"question_text":"I've came across many PHP scripts for web FTP clients. I need to implement a SFTP client as a web application in PHP.\nDoes PHP support fot SFTP? I couldn't find samples.\nCan anyone help me with this?","answer_text":"PHP has ssh2 stream wrappers (...
{"title":"How to know date is today?","tags":["javascript"],"question_text":"I am trying this but is not working... why?\n`<html>\n<body>\n <script type=\"text\/javascript\">\n var today=new Date(); \/\/today is Nov 28, 2010\n today.setHours(0);\n today.setMinutes(0);\n today.setSeconds(0);\n document.write(today+\" \"...
{"title":"Haxe \/ OpenFL \/ Flixel","tags":["haxe","flixel","openfl"],"question_text":"I've been looking through the sites of Haxe \/ OpenFL \/ Flixel but am struggling to understand what each one is for.\nAs I understand it.\nHaxe is a language that can be deployed to multiple platforms.\nOpen FL is something to do wi...
{"title":"Why use ++i instead of i++ in cases where the value is not used anywhere else in the statement?","tags":["c++","operators"],"question_text":"I'm well aware that in C++\n`int someValue = i++;\narray[i++] = otherValue;`\nhas different effect compared to\n`int someValue = ++i;\narray[++i] = otherValue;`\nbut eve...
{"title":"How to use LDFLAGS in makefile","tags":["makefile","ldflags"],"question_text":"I am new to Linux OS. I am trying to compile a\n`.c`\nfile using a makefile. The math library has to be linked. My makefile looks like this:\n`CC=gcc\nCFLAGS=-Wall -lm\nall:client\n.PHONY: clean\nclean:\n rm *~ *.o client`\nWhen I ...
{"title":"how can I use xbuild to build release binary","tags":["c#","xbuild"],"question_text":"When I use xbuild it always use debug as target, how do I make it use release?\nFor example I would expect something like\n`xbuild --release`\nbut that doesn't work","answer_text":"It looks like you should be able to so some...
{"title":"How to correctly present a popover from a UITableViewCell with UIPopoverArrowDirectionRight or UIPopoverArrowDirectionLeft","tags":["objective-c","ipad","uipopovercontroller","popover"],"question_text":"I always try to present a popover from a cell inside a tableView this way:\n`[myPopover presentPopoverFromR...
{"title":"How to add multiple values to a dictionary key in python?","tags":["python","dictionary","key"],"question_text":"I want to add multiple values to a specific key. How can I do that?\n`a = {}\na[\"abc\"] = 1\na[\"abc\"] = 2`","answer_text":"Make the value a list, e.g.\n`a[\"abc\"] = [1, 2, \"bob\"]`\nUPDATE:\nT...
{"title":"Symfony 2 sample app?","tags":["symfony2"],"question_text":"I'd love to find a simple sample app for Symfony 2 to learn from. Are there any good tutorials for it yet?\nThe documentation is good\n, but I'd like to see some minor thing built with it step by step, with all (or at least some) of the different par...
{"title":"Run code only if script called from the command line","tags":["ruby","command-line"],"question_text":"So when I call my script from the command line, I want it to take in an int and do something with the value:\n`ruby script.rb\nputs ARGV[0], etc...`\nHowever, whenever the script is loaded or required and not...
{"title":"SQL Server Convert Varchar to Datetime","tags":["sql","sql-server","datetime","formatting","varchar"],"question_text":"I have this date format: 2011-09-28 18:01:00 (in varchar), and I want to convert it to datetime changing to this format 28-09-2011 18:01:00. How can I do it?","answer_text":"`SELECT CONVERT(D...
{"title":"Getting ITMS-4238 \"Redundant Binary Upload\" error no mater what I change the build version or app version to","tags":["ios","itunesconnect","xcode6"],"question_text":"I rejected a binary i had which was 1.0 (1.0).\nThe status went into Rejected by developer.\nI went to upload a new binary and ran into this ...
{"title":"Google Chrome Extension Numbers on the Icon","tags":["icons","google-chrome-extension"],"question_text":"I've been experimenting with a Chrome Extension, and I want to make one similar to my Google Voice Extension where the icon shows a little blue \"1\" next to the icon when I receive an event, Is this a who...
{"title":"Reading an Excel file in PHP","tags":["php","import-from-excel"],"question_text":"I'm trying to read an Excel file (Office 2003). There is an Excel file that needs to be uploaded and its contents parsed.\nVia Google, I can only find answers to these related (and insufficient topics): generating Excel files, r...
{"title":"Meaning of - <?xml version=\"1.0\" encoding=\"utf-8\"?>","tags":["xml","xml-declaration"],"question_text":"I am new to XML and I am trying to understand the basics. I read the below line in \"Learning XML\", but I am still not clear. Can someone point me to a book or website which explains these basics clearl...
{"title":"How do I use constants from a Perl module?","tags":["perl","module","export","constants"],"question_text":"If I define a constant in a Perl module, how do I use that constant in my main program? (Or how do I call that constant in the main program?)","answer_text":"Constants can be exported just like other pac...
{"title":"jQuery Drag And Drop Using Live Events","tags":["jquery","jquery-ui","drag-and-drop","draggable","livequery"],"question_text":"I have an application with a long list that changes frequently, and I need the items of that list to be draggable.\nI've been using the jQuery UI draggable plugin, but it is slow to a...
{"title":"How to use alpha transparency in OpenGL?","tags":["c++","opengl","transparency","alpha"],"question_text":"Here's my code:\n`void display(void);\nint main(int argc, char** argv)\n{\n glutInit(&argc, argv);\n glutInitDisplayMode(GLUT_SINGLE|GLUT_RGBA);\n glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\n glEn...
{"title":"Custom form helpers","tags":["ruby-on-rails","ruby","forms","helpers"],"question_text":"Is there a way that I can create a custom form helper so that instead of:\n`special_field_tag :object, :method`\nI can achieve something like:\n`form.special_field :method`","answer_text":"Yes, you can add to the FormBuild...
{"title":"querySelector and querySelectorAll vs getElementsByClassName and getElementById in JavaScript","tags":["javascript"],"question_text":"I would like to know what exactly is the difference between\n`querySelector`\nand\n`querySelectorAll`\nagainst\n`getElementsByClassName`\nand\n`getElementById`\n?\nFrom\nthis l...
{"title":"Query to find tables modified in the last hour","tags":["mysql","database"],"question_text":"I want to find out which tables have been modified in the last hour in a MySQL database. How can I do this?","answer_text":"MySQL 5.x can do this via the INFORMATION_SCHEMA database. This database contains information...
{"title":"Android: got CalledFromWrongThreadException in onPostExecute() - How could it be?","tags":["android"],"question_text":"I have an app in production for a few weeks, using ACRA, and I had zero errors until one strange error reported today.\nI've got:\n`android.view.ViewRootImpl$CalledFromWrongThreadException: O...
{"title":"Reload UITableViewController","tags":["iphone","uitableview"],"question_text":"I'm trying to reload data in a\n`UITableViewController`\nafter a location is found. This also means after the\n`viewDidLoad`\nmethod. My class is extending a\n`UITableViewController`\nwith this interface:\n`@interface RootViewContr...
{"title":"Python, default keyword arguments after variable length positional arguments","tags":["python","named-parameters","default-parameters","variable-length-arguments"],"question_text":"I thought I could use named parameters after variable-length positional parameters in a function call, but I get a syntax error w...
{"title":"Remove a listener from a view in android","tags":["android","view","checkbox","listener"],"question_text":"Is there any way to remove a listener from a view in android? I have a Checkbox that I attached a checkchangedlistener to. The problem is that calling\n`setChecked()`\non it causes my listener to fire.\n...
{"title":"Reapply a commit that was undone by conflict?","tags":["git","github","tortoisegit"],"question_text":"I have this commit that was undone by someone who doesn't know how to deal with conflicts. Is there an easy way to try auto merging the commit back in? I tried using \"merge to master\" but it just says up to...
{"title":"SharePoint 2013 add javascript after whole page load","tags":["javascript","sharepoint-2013"],"question_text":"Disclaimer: I have no experience with SharePoint2013.\nI have problem - I must include\/fire some javascript functions after the whole page has been loaded. I tried listening to DOMDocumentReady and ...
{"title":"Vim regex backreference","tags":["regex","vim"],"question_text":"I want to do this:\n`%s\/shop_(*)\/shop_\\1 wp_\\1\/`\nWhy doesn't\n`shop_(*)`\nmatch anything?","answer_text":"There's several issues here.\nparens in vim regexen are not for capturing -- you need to use\n`\\( \\)`\nfor captures.\n`*`\ndoesn't ...
{"title":"jQuery: selecting checked checkbox","tags":["jquery","checkbox","input","jquery-selectors"],"question_text":"Suppose I have the following HTML:\n`<form id=\"myform\">\n <input type='checkbox' name='foo[]'\/> Check 1<br\/>\n <input type='checkbox' name='foo[]' checked='true'\/> Check 2<br\/>\n <input type='che...
{"title":"include an SVG (hosted on github) in MarkDown","tags":["svg","github","markdown"],"question_text":"I know with that an image can be placed in a MD with the MD syntax of either\n`![Alt text](\/path\/to\/img.jpg)`\nor\n`![Alt text](\/path\/to\/img.jpg \"Optional title\")`\n, but I am having difficulty placing a...
{"title":"CSS image max-width set to original image size?","tags":["css","image"],"question_text":"Can you do this? I'm having users upload images into a container that is width:100%, but I don't want the images to be larger than their original size. Many thanks!","answer_text":"Just don't set the\n`width`\nof the imag...
{"title":"building Python from source with zlib support","tags":["python","python-3.x"],"question_text":"When building Python 3.2.3 from source on Ubuntu 12.04, the zlib module is not available.\nI downloaded the official source distribution from python.org, and attempted to build and install it with the following comm...
{"title":"Idiomatic way to do conversion\/type assertion on multiple return values in Go","tags":["casting","go","return-value"],"question_text":"What is the idiomatic way to cast multiple return values in Go?\nCan you do it in a single line, or do you need to use temporary variables such as I've done in my example bel...
{"title":"variable length of %s with the % operator in python","tags":["python"],"question_text":"I'm trying to do this:\n`max_title_width = max([len(text) for text in columns])\nfor column in columns:\n print \"%10s, blah\" % column`\nBut I want to replace the\n`10`\nwith the value of\n`max_title_width`\n. How do I do...
{"title":"Linking a qtDesigner .ui file to python\/pyqt?","tags":["python","user-interface","qt","pyqt","qt-designer"],"question_text":"So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python?","answer_text":"Another way to use .ui in your code...
{"title":"How to locate the git config file in Mac","tags":["git","osx"],"question_text":"As title reads, how to locate the git config file in Mac? Not sure how to find it. Need to set\n`git config --global http.postBuffer 524288000`\nNeed some guidance on finding it..","answer_text":"The global Git configuration file ...
{"title":"getServletConfig().getServletContext() equivalent in Spring","tags":["java","spring","spring-mvc"],"question_text":"I referred to a lot of posts but still I am unable to find a correct working answer.\nI want to get it from my Java class itself and not using EL in jsp.\nHow to get the servlet context path in ...
{"title":"link_to and remote => true + jquery : How? Help?","tags":["jquery","ruby-on-rails","ruby-on-rails-3","partial"],"question_text":"Im trying to make an \"Users\" link on the index of my rails website so that it shows the registered users (User.all) BUT i want that to appear on the right part of the website, as ...
{"title":"How can i get selector from jQuery object","tags":["javascript","jquery","jquery-selectors","tree-traversal"],"question_text":"`$(\"*\").click(function(){\n $(this); \/\/ how can i get selector from $(this) ?\n });`\nIs there easy way to\nget selector from $(this)\nor something like that? There is a way, how ...
{"title":"AssertionFailedError: <class> has no public constructor","tags":["java","android","unit-testing","android-studio"],"question_text":"I am working with Android Studio and I need to add a unit tests to my project.\nI read various tutorials, but nothing hepled me.\nMy problem is:\nTestXMLParser.java:\n`public cla...
{"title":"In Swift fileExistsAtPath(_ path: String, isDirectory isDirectory: UnsafeMutablePointer<ObjCBool>) -> Bool accepts single parameter only","tags":["ios","swift"],"question_text":"The method fileExistsAtPath() in the example below accept single argument only.\n`if fm.fileExistsAtPath(result, isDirectory:&isDir)...
{"title":"Is Ajax in WordPress","tags":["php","ajax","wordpress"],"question_text":"Is there anyway to detect if the current server operation is currently an AJAX request in WordPress?\nFor example:\n`is_ajax()`","answer_text":"If you're using AJAX\nas recommended in the codex\n, then you can test for the\n`DOING_AJAX`\...
{"title":"Get the Id of current table row with Jquery","tags":["jquery","html"],"question_text":"Hi I have the following code in a form . When the user clicks a button I want to get the current row in order to identify which of the buttons was clicked\n`<tr id=\"TEST1\" >\n <td align=\"left\" valign=\"middle\">\n <div ...
{"title":"How to Calculate Jump Target Address and Branch Target Address?","tags":["assembly","mips","jta"],"question_text":"I am new to\nAssembly language\n. I was reading about\nMIPS\narchitecture and I am stuck with\nJump Target Address\nand\nBranch Target Address\nand\nhow to calculate each\nof them.\nI would be ve...
{"title":"Jekyll's \"--auto\" doesn't work?","tags":["jekyll"],"question_text":"I have just reinstalled my whole system and started working on my projects again. I used and still use Jekyll in some of them however I have a problem with auto generation using\n`--auto`\nor\n`_config.yml`\n's\n`auto: true`\n. It simply do...
{"title":"Efficient way of finding distance between two 3D points","tags":["c++","performance","math"],"question_text":"I am writing a code in C++ and want to compute distance between two points.\nQuestion 1:\nI have two points P(x1, y1, z1) and Q(x2, y2, z2) , where x, y and z are floats\/doubles.\nI want to find the ...
{"title":"Functional Programming in C++","tags":["c++","functional-programming"],"question_text":"Can someone guide me how do functional programming in C++? Is there some good online material that I can refer?\nPlease note that I know about the library FC++. I want to know how to do that with C++ standard library alone...
{"title":"Access static variables within class in Swift","tags":["swift"],"question_text":"Is\n`ClassName.staticVaribale`\nthe only way to access static variable within the class? I want something like\n`self`\n, but for class. Like\n`class.staticVariable`\n.","answer_text":"There are two ways to access a static proper...
{"title":"how to pass variable arguments to another method?","tags":["iphone","ios","objective-c","varargs"],"question_text":"i have googled and came to know that how to use the variable arguments. but i want to pass my variable arguments to another method. i m getting errors. how to do that ?\n`-(void) aMethod:(NSStri...
{"title":"How do I determine if a database role exists in SQL Server?","tags":["sql","sql-server"],"question_text":"I'm trying to figure out how I can check if a database role exists in SQL Server. I want to do something like this:\n`if not exists (select 1 from sometable where rolename='role')\nbegin\nCREATE ROLE role...
{"title":"How to know installed Oracle Client is 32 bit or 64 bit?","tags":["oracle","64bit","oracleclient"],"question_text":"OS: Windows 2008 Server R2\nOracle Client: 11.2\nMany Thanks","answer_text":"A simple way to find this out in Windows is to run SQLPlus from your Oracle homes's bin directory and then check Task...
{"title":"Run vim command from commandline","tags":["bash","shell","vim","zsh"],"question_text":"There are lots of SO questions on running shell programs from vim. What I'm wondering is if it is possible to do the reverse - i.e.\n`$ vim :BundleInstall`\nfor example, to allow me to run\nBundleInstall\nas part of a scrip...