text
stringlengths
3
121k
Q: If the address of a function can not be resolved during deduction, is it SFINAE or a compiler error? In C++0x SFINAE rules have been simplified such that any invalid expression or type that occurs in the "immediate context" of deduction does not result in a compiler error but rather in deduction failure (SFINAE). ...
Q: ASP.NET ReportViewer Control Fonts to Century Gothic We are using ASP.NET ReportViewer Control to render rdl files. In the rdl files we have set the font to “Century Gothic” and in preview mode it renders the fonts nicely. However – when it gets rendered on browser we see the fonts defaulted to “Times New Roman”. I ...
Q: How to stop and restart memcached server? How to stop and restart memcached server 1.4.5 in linux OS from command line? A: if linux if install by apt-get service memcached stop service memcached restart if install by source code Usage: /etc/init.d/memcached {start|stop|restart|force-reload|status} can also simply...
Q: Javascript searcing and replacing? I want to change a string which start 'a' and end 'n'. For example: "action" I want to replace 'ctio' and all starting 'a' and finishing 'n' with ''. How can do it? A: return theString.replace(/\ba[a-z]*n\b/ig, '') A: in Javascript: var substitute = "\""; var text = "action"; va...
Q: XSL: Dead or not dead I'm currently taking on a new project at home. In this project I'm going to be generating HTML emails. For this purpose, I believe XSL to be a good candidate. However, I have heard people say that XSL is a dead language, and if it's not that it is on it's way out. In fact, MS has been very l...
Q: Why can't I share Session state between 2 web apps with StateServer? What am I missing? I'm having trouble getting 2 identical ASP.NET MVC applications to share the same Session using a Session StateServer. The reason I'm trying to do this is we will eventually be deploying this app across 3 web servers that need to...
Q: How do you subtract Dates in Java? My heart is bleeding internally after having to go so deep to subtract two dates to calculate the span in number of days: GregorianCalendar c1 = new GregorianCalendar(); GregorianCalendar c2 = new GregorianCalendar(); c1.set(2000, 1, 1); c2.set(2010,1, 1); long ...
Q: Cursor backed ExpandableListView data update I'm implementing CRUD functionality using ExpandableListView. Wen I delete a parent data on screen refreshes automatically but it doesn't when I delete a child. I've solved this with: int categoryId = ExpandableListView.getPackedPositionGroup(info.packedPosition); getExpa...
Q: Silverlight Datagrid select on right click Is there a way for a right click event to select a row in toolkit datagrid? I'm using toolkit context menu which works nicely, but the problem is, only left click is able to select rows, and I need right click to be able to do that if I want my context menu to work properly...
Q: AdvancedTableViewCells and UITabBar Very simple, but maybe difficult to answer question. How do you include an AdvancedTableViewCells (à la AppStore) inside a tab bar item? (Just like the App Store Top 25 tab bar item) Thanks for your help ! A: Table cells have nothing to do with tab bars, so you're going to have ...
Q: Copy cell value from table to textbox I have the following table. I want to copy Id value on the seleced row to the text box. If I click on link "Select" in the first row the text box value will 0001. If the table needs modification to get result better and faster, please leave your suggestion. <div> <input i...
Q: Why is there no Char.Empty like String.Empty? Is there a reason for this? I am asking because if you needed to use lots of empty chars then you get into the same situation as you would when you use lots of empty strings. Edit: The reason for this usage was this: myString.Replace ('c', '') So remove all instances of...
Q: Authentication and authorization for RESTfull API (java jersery) implementing service something similar with tinyurl or bit.ly, I'm would like to expose service as API, I'm using java and jersey as RESTfull service implementation. I'm looking for simplest way for authentification of users who use API, OAuth is firs...
Q: Implicit type parameters in Haskell class definition? It normally seems the following is illegal: class Foo a where foo :: a -> b -> a Which makes sense; how do we know what b is? However, if we look at Functor's definition: class Functor f where fmap :: (a -> b) -> f a -> f b we see a and b showing up eve...
Q: How to catch a key press on a C# .NET form I have a parent form that contains a lot of controls. What I am trying to do is filter all of the key presses for that form. The trouble is that if the focus is on one of the controls on the form then the parent form is not getting the key press event, so how do I capture...
Q: SQL time period query I need to select from a table all rows that have date_added between CURDATE() and 6 weeks ago. Help please. A: SELECT * FROM mytable WHERE date_added BETWEEN CURDATE() - INTERVAL 6 WEEK AND CURDATE() A: SELECT * FROM a_table WHERE date_added BETWEEN DATE_SUB(CURDATE(), INTERVAL 6 WEEK)...
Q: How to design DB with parent-child relationships? If I needed to represent, say, locations (e.g. countries, states/provinces/regions, cities, etc.) in a database, how would I do so in such a way that it would be easiest to query, scale the most, etc.? I plan to use this for an application that will allow users to se...
Q: UIPickerView not displaying I have a UIPickerView on a UIView. I've implemented its protocol in the .h and delegates in the .m files: <UIPickerViewDataSource, UIPickerViewDelegate> In IB, I've connected the above to the picker, which I also have an IBoutlet for. The methods look like this: - (NSInteger)numberOfC...
Q: Timezone display in java I need to display timezone in the following format in my UI. (GMT -05:00) Eastern Time(US & Canada). I tried getting the current time and timezone from calendar. But when i tried to get the display name from timezone it just displays as "Eastern time". I am not getting the format mentioned...
Q: Is it OK to copy & paste unit-tests when the logic is basically the same? I currently have like 10 tests that test whenever my Tetris piece doesn't move left if there is a piece in the path, or a wall. Now, I will have to test the same behaviour for the right movement. Is it too bad if I just copy the 10 tests I alr...
Q: (C/C++/C#) DirectX 9 Overlay, preferably the same way xfire or Steam does it I wonder what techniques xfire and/or Steam uses to overlay into games. I'm trying to do something similar and I really would like to know what is the least intrusive way, I.e. won't alert any anti-cheat systems. I don't need any kind of in...
Q: how to play an flv in streaming I need to play an flv in streaming in a website build on a php/apache2/mysql CMS. I like a lot http://www.visionstreetwear.com website and i would like to use this layout with a flv as header. A: I believe you can't do 'true' flash video streaming without paying for streaming service...
Q: PHP get_called_class() alternative I've got an Abstract PHP superclass, which contains code that needs to know which subclass its running under. class Foo { static function _get_class_name() { return get_called_class(); //works in PHP 5.3.*, but not in PHP 5.2.* } static function other_c...
Q: Will index be used when using OR clause in where I wrote a stored procedure with optional parameters. CREATE PROCEDURE dbo.GetActiveEmployee @startTime DATETIME=NULL, @endTime DATETIME=NULL AS SET NOCOUNT ON SELECT columns FROM table WHERE (@startTime is NULL or table.StartTime >= @startTime) ...
Q: django: can we do loader.get_template('my_template.txt')? I want to use django template to process plain text file, and tried this: from django.template import loader, Context t = loader.get_template('my_template.txt') however, it works for this: from django.template import loader, Context t = loader.get_template('...
Q: calendar format using ajax When I am using ajax calendar it is a taking date in the format 07-17-2010 but I want the format as 07/17/2010. This means instead of - (hyphen) I want /(slash). Can we change this? If yes then how can we do this? Please help me. my code is <asp:ToolkitScriptManager ID="ToolkitScriptManage...
Q: Asp.Net MVC application does not update files on web host? I'm developing an MVC 2 application and have it on a web host. It works fine, but the strange thing is that when I update files, the updates don't "take". I can even delete an entire Controller file (just for testing the update problem), and it doesn't matte...
Q: Why do Lua arrays(tables) start at 1 instead of 0? I don't understand the rationale behind the decision of this part of Lua. Why does indexing start at 1? I have read (as many others did) this great paper. It seems to me a strange corner of a language that is very pleasant to learn and program. Don't get me wrong, L...
Q: Iphone app: Resize a png by getting Height and Width from user Ive an image with particular resolution appearing on Iphone screen. I need to resize that image by getting info. as an alert from user(Width and height). Cud anyone help me with block of code for this???? A: WARNING: code typed in answer box, not tested...
Q: final transient fields and serialization Is it possible to have final transient fields that are set to any non-default value after serialization in Java? My usecase is a cache variable — that's why it is transient. I also have a habit of making Map fields that won't be changed (i.e. contents of the map is changed,...
Q: trac wiki: how do I display the current date I want to create a fully printable document in the trac wiki markup. For this I need the current date as text on the page. suggestions? regards Ronny A: You can write a trac macro in python. an example that does format timestamps is available in the trac sources
Q: Efficient mapping of game entity positions in Java In Java (Swing), say I've got a 2D game where I have various types of entities on the screen, such as a player, bad guys, powerups, etc. When the player moves across the screen, in order to do efficient checking of what is in the immediate vicinity of the player, I...
Q: How to set the thumbnail image got from MpMoviePlayerController as a thumbnail when loading the video url string into webview? I got the thumbnail Image by passing the video url to the MPMoviePlayerController and I am playing the video by loading the Url string into the webview How can I set the Thumbnailimage as a ...
Q: jQuery plugin - Can't find download link I can't find the download link from this plugin: http://plugins.jquery.com/project/jgfeed Can somebody help me? A: I had to pull up the google cache of the page to find it, here's a link: http://plugins.jquery.com/files/jGFeed.zip You're not stupid for asking, someone really...
Q: iPhone multi view/window switch I've now put all night and tried to get my iPhone program to perform as intended, it has also succeed me sometimes but now I have pages with a problem I simplehen can not get resolved. 've tried this video guide that makes it I want it to but I stare my project up with NSObject (Windo...
Q: get list of sections from ini-file using shell (sed/awk) I want to create a var from the section names of an ini file like: [foo] ; ... [bar] ; ... [baz:bar] ;... now I need a var like SECTIONS="foo bar baz" thanks in advance A: One line solution could be: export SECTIONS=`grep "^\[" test.ini |sort -u | xargs |...
Q: Help required in user control I am using a user control (.ascx) as below <div class="ui-widget" id="w_instruction"> <div class="ui-state-instruction ui-corner-all w-msg"> <a id="btn_instruction_close" class="ui-dialog-titlebar-close ui-corner-all" href="#" style="float:right;"><img src=...
Q: Why is it a bad idea to allow these in JavaScript == , != , ++ , -- I was checking out JSLint, and some of the rules piqued my interest. Particularly this: Disallow == and != Disallow ++ and -- Why is it a bad idea to disallow these? I understand the first part, basically it wants me to do === instead of ==. ...
Q: Celery, Django.. making a Task / thread launch sub-task / threads? I'm using celery with django and am trying to get a Task, like the one below: class task1 (Task) def run (self): launch_some_other_task.delay() But it doesn't seem to be working, I can go into more detail as far as my code but figured I wou...
Q: set XmlDataProvider source without saving file in my browser wpf application i use databinding to xml that comes from my database. to bind it the better way i use the XmlDataProvider. in the beginning i declare <Grid.DataContext> <XmlDataProvider x:Name="listdataxml" XPath="EssenceList/Essence" Source="model.xml...
Q: Files inside WAR appear double I'm using ANT to build the WAR file for my Java web app. However, when I look inside the WAR file I see every file appear twice (not the folders, just the files). When I extract the WAR file there are no errors and the file structure appears to be correct, no double files. If I then co...
Q: Problem with Command Pattern under Visual Studio 2008 (C++) I've a problem with this pattern under c++ on VS 2008. The same code has been tested in gcc (linux, mac and mingw for widnows) and it works. I copy/paste the code here: class MyCommand { public: virtual void execute() = 0; virtual ~MyCommand () {};...
Q: Stored Procedure: Reducing Table Data A simple question about Stored Procedures. I have one stored procedure collecting a whole bunch of data in a table. I then call this procedure from within another stored procedure. I can copy the data into a new table created in the calling procedure but as far as I can see the ...
Q: How to handle Enum with Generics in JAXB? JAXB runtime is failing to create JAXBContext for a Class whose member variable is defined as @XmlElement(name = "EnumeraatioArvo") private Enum<?> eenum; How to handle such scenario in JAXB? A: I agree with skaffman that this defeats the purpose on enums. If for some ...
Q: iphone html css tutorials I am trying to find some good introductory short tutorials that show how to build web site suitable for iphone brwoser. I am not having any success. Google is not turning up useful sites. please let me know if you are aware of any. thanks A: You should have a look at: * *Building iPhone...
Q: Assigning character pointer to a character pointer array In this below code I wan to copy the string in 'pre' to array 'word' so that I can print the array 'word' later but it's showing NONPORTABLE CONVERSION error.. Tried doing it using strcpy() but it dint work. Any other way of doing it??I want to store the strin...
Q: Internet Explorer cannot view my webpage the way it is supposed to.... Please help! When I load my page in Safari and Firefox, even my ipod touch which is a variant of Safari it loads perfect. When I use any version 6, 7, or 8 of internet explorer problems arise. Basically, in IE 6 or 7 the banner ads look messed ...
Q: Is there reliable method of ensuring crossdomain policy files have been retrieved for all Facebook image servers? I've recently started putting together a Facebook Connect AS3 app and retrieving objects and images through the Graph API. Running anywhere but locally, I receive security errors of the form: Securit...
Q: What are canonical examples of parallel computation? I am writing a paper to test a new application that will demonstrate the benefits of parallelized computation (compared to the traditional serialized version of this application). I want to use the canonical examples for parallel computation in my paper. My fir...
Q: Rails/Activerecord database field timezone I have a database that is written to by a non-rails application and read from by a rails application. There is a datetime field in the database and the data stored in this field is stored in Eastern Time. In my rails app, I understand I can set the application's timezone in...
Q: Custom sort logic in OrderBy using LINQ What would be the right way to sort a list of strings where I want items starting with an underscore '_', to be at the bottom of the list, otherwise everything is alphabetical. Right now I'm doing something like this, autoList.OrderBy(a => a.StartsWith("_") ? "ZZZZZZ"+a : a ) ...
Q: How can I crop the PDF page Can any one help me that how can I cut the PDF page like as Acrobat professional? A: This snippet might help you: public static void CropDocument(string file, string oldchar, string repChar) { int pageNumber = 1; PdfReader reader = new PdfReader(file); iTextSharp.text.Rectang...
Q: how to set the classpath using a java program without setting it form command line? How to set the classpath using a java program without setting it form command line? A: There are three common ways to set the classpath: * *define the environment variable CLASSPATH *add -cp argument to the java call *declare ...
Q: Add/remove data to TableView datasource programmatically HI @ll! I want to add and remove some items to my datasource for my tableview programmatically. First of all: What do I want to achieve? I habe a UIView with a TTTableView control (the Tableview from the Three20 project, but derived from the common UITableView...
Q: How do I implement a custom message queue listener for WAS activation? I'm writing components of a .Net 4.0 web solution (on IIS7, WS2008), and need to provide a service which can consume messages from a message queue. I've found setup examples for configuring WAS service activation using MSMQ... but we aren't usin...
Q: Ruby HTML scraper written in Hpricot having trouble with escaped HTML I am trying to scrape this page: http://www.udel.edu/dining/menus/russell.html. I have written a scraper in Ruby using the Hpricot library. problem: HTML page is escaped and I need to display it unescaped example: "M&amp;M" should be "M&M" exa...
Q: How to create function for FFmpeg lib to encode frame into any (possible) format? So how to create something which would have something like this in its api: Encoder = EncoderFormat(format name); // prepare encoder //...code for frames generation... now we want to encode frame!// EncodeFrame(const CImage* src, void*...
Q: Multiple stylesheets for a Lightbox clone I have a Lightbox clone (colorbox), which works fine and has no real issues. What I would like is an extra arguement that would say: [pseudocode] if (linksRel == "lightbox1") { add stylesheet1 to this lightbox } else { add stylesheet2 to this lightbox } [/pseudocode] Cu...
Q: Manipulating existing XDocument (fails) I got the following Code snippet from my Silverlight Application: var messages = from message in XcurrentMsg.Descendants("message") where DateTime.Parse(message.Attribute("timestamp").Value).CompareTo(DateTime.Parse(MessageCache.Last_Cached())...
Q: Why is myEnum.ONE not equal to myEnum.ONE.toString()? I've got the following enum: public enum myEnum { ONE("ONE"), TWO("TWO"); private String name; private myEnum(String name) { this.name = name; } @Override public String toString() { return name; } }; My question is ...
Q: using collection of strings in a switch statement I'm trying to find a solution for this problem. This is my example code: class Program { private string Command; private static string[] Commands = { "ComandOne", "CommandTwo", "CommandThree", "CommandFour" }; static void Main(string[] args) { Command ...
Q: Using windows domain authentication for authentication The title may seem a little weird but what I find around the internet is methods to sign on to stuff automatically with windows domain authentication (Single Sign On), but that is not what I want. In my use case I want to explicitly ask the person to enter their...
Q: Webkit, IE deselecting text I'm working on making a contentEditable jQuery plugin. I've created a 'tools' bar to perform actions to the text such as making it bold, italics etc using execCommand. The problem is that when you select text and click one of the buttons (divs with onclick events) it deselects the text ...
Q: Setting a parent menu CSS class from a child menu using PHP/WordPress I have the following menu setup that basically has a parent menu of "Products" with two child menu items that I am using inside my WordPress 3 menu structure, specifically inside my sidebar.php file: <ul id="themenu" class="sf-menu sf-vertical"> ...
Q: Fastest rails test runner: spork and zentest? I ran across a thread about slow rspec tests that made me wonder which rails test runner configuration will result in the fastest running recurring tests? I'm aware that ZenTest / autotest-rails can be used in conjunction with spork, but is that the fastest option? A: J...
Q: Challenge: SQL check next record against previous I have some data that needs to be validated, and while I have found a quick formula that works in excel I would like to find some SQL that would do the same so I can use it in my database as a check now and then. The data is simply this: ACACIA ST (KLN) | 1073 | 1149...
Q: How to read local xml file is resource folder as a input stream in android? I am trying to get input stream from something like this. InputSource myInputSource = new InputSource(activity.getResources().openRawResource(com.MYCLass.R.xml.programs)); myXMLReader.parse(myInputSource); and then call parse on the parser...
Q: need to write a function to add values based on query in EXCEL S.no Area 1 55 2 65 3 51 4 70 5 55 6 65 7 75 8 60 9 45 10 50 11 70 12 52 13 65 14 40 15 60 16 55 17 50 18 65 19 85 20 81 By entering range of Sno. e.g 3 to 5 I MUST GET THE ADDITION OF Area for specified range of Sno. No...
Q: how to catch OptimisticLockException in web layer I'm having one issue that is how to catch OptimisticLockException in web layer (.war code) when it is raised by the EJB layer. We are using JEE5, GlassFishV2.1 and JPA (with TopLinks)and Container Managed Transactions.But when the dirty read occur due to trnasaction ...
Q: Using output of previous commands in bash In Mathematica, it is possible to reuse the output of the previous command by using %. Is something similar possible for bash (or some other shell)? For example, I run a make which gives warnings, but I want to find all warnings. So, I type make | grep "warning" but I'm no...
Q: how to define an autoincrement id column in doctrine? I'm using symfony 1.4 with doctrine as my ORM, I need to do one of two thing to get it working, and I don't know how to do it. * *the id fields should not be bigint, just int or *When I define my table as follows: Table: columns: id: type: integer ...
Q: How to qsort an array of pointers to char in C? Suppose I have an array of pointers to char in C: char *data[5] = { "boda", "cydo", "washington", "dc", "obama" }; And I wish to sort this array using qsort: qsort(data, 5, sizeof(char *), compare_function); I am unable to come up with the compare function. For some ...
Q: jQuery: how do I make a collapsable tree nav? I have headers, and each of those headers has sub items. When I click a header, I want it to toggle viewing or showing the headers contents: This is what I have so far: $j('h2').click(function() { if ($j(this).next().is(":hidden")) { $j(this).next().show(); } else {...
Q: indexes of NSTableView rows I sink index of first row in tableview is '0' it is Correct? If yes, HOW can I make so index of first row in tableview become '1' ? this is need because my DataSourse start from '1', and I need that: [myTableView selectedRow] = [myData row] but no [myTableView selectedRow] = [myData (r...
Q: Mail.dll through proxy C# I have the following task: I should read e-mails from gmail and the computer is connected to the internet through proxy. Normally I would use mail.dll http://www.lesnikowski.com/mail like this: using (Imap imap = new Imap()) { imap.ConnectSSL(_server); imap.Login(_us...
Q: Latent Semantic Indexing I'm trying to find out how to carry out the multiplication of the matrices produced after SVD implementation in LSI. I need this for my research. I want to carry out document clustering. A: From what I've read, once you decompose the term-document matrix with the SVD to create [U, S, V], yo...
Q: ASP.NET Problem with Redirects I have a login page which has two options "login as guest" , "login". Each click event will take the user to the same page. However, if login as guest is clicked then i want to be able to change what info is displayed on the page the user is being redirected to. I do not want to use...
Q: Local-to-remote port forwarding using Ruby/Net::SSH for remote db connection I'm accessing a remote database using a local-to-remote port forwarding from my windows box. It works like a charm using putty for port forwarding but it fails when I try to forward using Ruby/Net::SSH. Here is my code snippet: require 'rub...
Q: How to determine order number of an item in sorted table (continued from Read N consequent items by ActiveRecord) My project is C# and uses CastleProject ActiveRecord on MS SQL Server database. I need to understand the order number of an item from a database, if some sorting criteria applied. Example: I have a lot o...
Q: Transparently edit remote files on Windows, with ssh/Putty and netrw Ok guys, maybe this one has been asked before, but I searched and ran threw nothing, so i'm taking a chance here. I'm using the latest vim (gvim 7.3), on Windows 7 64bits. I've got some remote files that I want to edit directly with vim, using netr...
Q: Programmatically set the position of CKEditor's dialogs I'm trying to find a way to programmatically set the position of a CKEditor dialog whenever a new one is opened up. The actual setting of the position part seems easy, but what I can't seem to figure out is how to trap the event of a new CKEditor dialog being ...
Q: How to group the records according to the range in SQL Hi I would like to create a SQL to group the records according to the range For example, suppose I have Number Time Price 100 20100810 10.0 100 20100812 15.0 160 20100810 10.0 200 20100810 12.0 2...
Q: PhoneGap To Bridge Mobile Platform Would you rather develop apps with the PhoneGap framework, or concentrate solely on a specific mobile phone platform? Thanks in advance, sri A: First, let people know which platforms you are interested in developing for. Coming to your question, PhoneGap is an open-source developm...
Q: Customizing Flex Charts I am wondering if it is possible to customize Flex Chart to have grids like in this example: http://imglink.ru/show-image.php?id=bfcb5a0c5bbcfc20f3f21ef764ed79e7 Thank you in advance! A: the simple answer is YES you can. you can give a skin to each of the elements in the Graph, I worked on a...
Q: how to align floats in IE6 I am having problems displaying floated paragraphs and images in IE6. There was no problem displaying those in Opera and Firefox,though. I have three divs inside a container. Each div has its own paragraph and image either floated to the left or right. In order for me to achieve a desired ...
Q: Dealing with deprecated methods in iPhone How do you deal with deprecated methods in iPhone that require you to use a newer method, not available in older versions? Consider the case of setStatusBarHidden:animated:, which was deprecated in iOS 3.2. The documentation points you to use setStatusBarHidden:withAnimation...
Q: Java Swing automatically gather data from forms I have a form in Swing with a lot of textfields receiving data. The idea is when a button is clicked, the app gathers all the data from the textfields at once. Do you know a good practice for this? Or is it necessary to gather the data textfield by textfield? A: If yo...
Q: International Assist on iPhone Does anyone know if the International Assist feature on the iPhone works when dialing a number using the tel:// URL scheme from an application? For those unfamiliar, IA automatically prefixes the "+1" to US numbers when using the iPhone internationally. I know that this works when dial...
Q: Lotusscript date time issues I have a couple of dates stored in a view. And I am using getItemValue to retrieve them. Dim repsondedDate As NotesDateTime Set repsondedDate = timePart1doc.GetItemValue("dateResponded") When I try to do the following, I get a type missmatch at run time. Dim dateDifference As double Set ...
Q: ASP.NET sessions over multiple domains Is there a proper .NET solution for providing persistent server sessions over multiple domains? i.e. If a user of the site logs in under www.site1.com, they will also then be logged in under www.site2.com Security is an issue with the program we are working on... Thanks! A: Do...
Q: Application dedicated Android Device is it possible? I have been tasked with sourcing an off the shelf touch pad device that can be used as a dedicated industrial instrument controller. Is it possible to run a dedicated application and prevent user access to all other functions/applications within Android. Also ...
Q: Eager Loading Children for a LINQ stored procedure call I have a special stored procedure that returns a List of Distributors from my database. I then iterate through the loop of Distributors and output the results to a web page. However, I need to load the State and the Country for each Distributor. I would rath...
Q: How can I make Rack::Session::Pool work in a test using Sinatra and RSpec? How can I make sessions work in my RSpec tests? I have tried something like this: describe "createnewlist_route_spec" do include Rack::Test::Methods use Rack::Session::Pool def app @app ||= Sinatra::Application end it "should...
Q: Finding the device model and make How do I find the make and model of an Android device? A: android.os.Build contains properties you are interested in. Build.MODEL, Build.PRODUCT and Build.MANUFACTURER should give you the info you need. They are all String objects. A: This should help. Build.DEVICE; Build.BRAND; ...
Q: Is it possible to run a SQL-only file from a "rake db:create"? I'm trying to install a software called Teambox in my Dreamhost shared account, following these instructions. I have no experience with Rails. I just want to install the software in the shared hosting. In this shared hosting, all dependencies are ok, but...
Q: jQuery set iFrame onLoad attribute I need to trigger a function when the iframe loads a second time (the user clicks some link in the iframe). When the iframe page changes I can set the window location to the iframe src. What I thought would be best is to set an onLoad attribute on the iframe element after the first...
Q: possible issues with submitting data from my site to payment gateway I'm planning to use eWay (http://eway.com.au) as payment gateway for my store, however they do not allow much customisation on their hosted page. I want to avoid touching credit card numbers at any point and so their hosted page would do for me. So...
Q: C++ I'm getting expected ‘;’ before '\xa' from g++ 4.4.3 from this code #include <iostream> using namespace std; int main() { // char[20] name = "blah"; int ssn = 123456789; int dob = 12742; cout << ssn '\n'; cout << dob'\n'; return 0; } A: cout << ssn '\n'; c...
Q: add foreign key support for RoR 3.0? im using migration files to create the database tables but i want to set up foreign keys too. is there any good gem for this? i cant find gems for 3.0. thanks A: I'm using foreigner. It works with Rails 3 and it has a very simple API to create foreign keys. A: There is also for...
Q: inline list size issue I am using an inline-block list as a horizontal navigation bar with drop down menus. But I can't seem to get it to fill up the entire width of the screen. To make it more frustraiting, when I change the zoom level of the browser screen, the list resizes at a different rate from everything else...