instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have an app built on iOS 4.2, which works fine on the simulator. When I build and run the app on the device it hangs. The only way to wake it up is to kill GDB (i.e. hit the red stop sign). As long as GDB isn't running the app runs fine. I can open it up from the spring board and test as normal. Although if GDB is st...
stackexchange/codereview
I'm looking for a simple rails blog webapp with newsletter functionality. As the title says, I'm looking for something simple that can be extensible via plugins later. Please avoid the answers like "roll your own, it's easy". We really don't have time to do it right now. Thanks!
stackexchange/codereview
Any thoughts on the best way to implement a table (i.e. a small relational database) in python without using any external databases extra modules and when the sqlite3 module is broken or missing. user:~ $ python3 >>> import sqlite3 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/bns/rm...
stackexchange/codereview
In page if the table with the class controls is available then only I want to add CSS to a div like overflow-y visible. Using jQuery. <html> <body> <table class="controls" > </table> <div style="overflow"></div> </body> </html>
stackexchange/codereview
I have some shared preferences (latitude, longitude) that I want to access from a service, that is not subclassed from Activity. In particular, when I try to access getPreferences, this function doesn't exist's on a service. My code is posted below My goal here is to allow WRITE these shared preferences with my servi...
stackexchange/codereview
I have set up an openid logging in system for mysite and the famous disqus commenting system. How can I integrate these both, i.e. retrieve the logged in user information in the disqus commenting system preventing the users to enter their details twice on the same site else whats use of simplifying the logging in ta...
stackexchange/codereview
I am new to CoreData and in my iPhone app I want to know how to save some text, then load it back in. But the trick is, loading it back in when the date in the UIDatePicker is the same as when I saved it, like a calendar. Update Thanks for the replies, especially the for the code sample. However I have some issues unde...
stackexchange/codereview
is it possible to use some kind of reflection on parameters in T-SQL module (function,procedure)? procedure x(@foo nvarchar(max),@bar nvarchar(max)) ... set @foo = isnull(@foo,0); set @bar = isnull(@bar,0); would it be possible to iterate over my parameters and set their values in a loop? Or do I need to use SQLCLR...
stackexchange/codereview
This is the class that I have to test: public class Downloader { public String download(String uri) { HttpClient client = this.getHttpClient(); client.setURI(uri); return client.get(); } private HttpClient getHttpClient() { HttpClient client = new HttpClient(); // + some config return clie...
stackexchange/codereview
If I have an unordered list like <ul id="list"> <li>Helo World-1</li> <li>Helo World-2</li> <li>Helo World-3</li> </ul> I want to add a sublist item to it dynamically. Is there any method in javascript to do that. How could I do it. edit I need an item at next level, i.e. a sub list of Helo World that I mentioned in ...
stackexchange/codereview
this code "var results.." throwing exception "The calling thread cannot access this object because a different thread owns it". LINQ query is not bad. Please what I am doing wrong? DataClassesDataContext db = new DataClassesDataContext(); bool doStg() { try { var results = from t ...
stackexchange/codereview
Originally I was going to ask why I was having problems calling (seq) on a result set as a test for emptiness, but a bit of research showed that it's apparently because the jdbc cursor hasn't moved anywhere. Fine and dandy. Is there a way to call next() on the resultset if I don't know its name? I can bind it to a s...
stackexchange/codereview
I am facing a problem on SQL Server 2008 R2 where I have to use a contains search while ignoring German Umlaute-Letters (ä, ö, ü). For all non German speaking developers: The German Umlaut-Letters can be represented as the regular underlying letter (a when using ä) and an e. So Müller is the same as Mueller and Bäcker ...
stackexchange/codereview
I've 3 groups created in iphone settings bundle Root.plist file. Its showing fine. But for every group, i want to add some description. It will be something like follows: GroupName Description Settings in that group. Is it possible. How to add description? If the description color is different to identify from group na...
stackexchange/codereview
I need to break a string in lines so each won't exceed a maximum character count per line. I can't just break in the Nth character because I don't want to break in the middle of a word. The application is internationalized, so since the text boundary is locale-sensitive I can't just break in ' '. Is there any thing to ...
stackexchange/codereview
Right now I use the FixtureCategory attribute on my classes to separate my unit tests. There is one set of closely related tests that are getting too large. I don't want to separate them into their own fixture categories, I just want them to be a subcategory of a larger set of tests. Is there any attribute I can use or...
stackexchange/codereview
I have an interface like Public Shared Function myfunction(Byval myvar as string, Optional ByVal myarray As ArrayList = Nothing) As String but I want to declare an optional arraylist with default values... how to do that?
stackexchange/codereview
I have the following snippet of PowerShell script in my profile: . (join-path (split-path (& { $myInvocation.ScriptName })) "export-errors.ps1") Now, I understand that this causes the script export-errors.ps1 that exists in the same directory as my profile script to be executed. My question is, why? I don't understand...
stackexchange/codereview
I'm working on an ASP.net web application. I have a form with a submit button. The code for the submit button looks like <input type='submit' value='submit request' onclick='btnClick();'>. I want to write something like the following: function btnClick() { if (!validData()) cancelFormSubmission(); } How d...
stackexchange/codereview
I use the (query-replace-regexp "from" "to") expression regularly when making large changes in a text file. I'd like a regular expression, if one exists, for removing all lines that don't match. For example, in a RedHat SPEC file for building a RPM I want to leave just the lines that begin with /^Patch/ in them (and de...
stackexchange/codereview
If you had to design a database with paid users and trial users would you put them in the same table and differentiate between them with a field? Or would you put them in two separate tables? Or would you do the best of both worlds and put them in the same table but create two views 1) PaidUsers and 2) TrialUsers Than...
stackexchange/codereview
I've been doing PHP for a while now, never needed assistance, but totally confused this time. I have a single line of code with one echo statement. Problem: URL parameters are automatically assuming PHP variable values of the same name. For example, I have a URL with a parameter named var_name like this: http://www.exa...
stackexchange/codereview
I'm trying to achieve this layout with CSS (without tables, I guess. Whatever). Any ideas?
stackexchange/codereview
I am using the Sort method of the MvcContrib Grid to generate sorting links, e.g. <%= Html.Grid(Model).AutoGenerateColumns().Sort((GridSortOptions)ViewData["sort"]) %> I have a need to change the default controller/action that’s generated by the sort method. For example, defaultControllerName/defaultActionName...
stackexchange/codereview
I'm loading as2 swf into AIR application. It works properly when loaded from file. But when loaded from bytes, it is broken in some way (it reacts to mouse, but some elements are inactive) var bytes:ByteArray = ... //loaded from resources var loader:Loader = new Loader(); var context:LoaderContext = new LoaderContext(f...
stackexchange/codereview
Consider the code: Number n=new Integer(20); cast(n) //return's n casted to Integer <T> T cast(Number num)//to cast from abstract to concrete implemenation { // Get which implementation of Number this by calling num.getClass() //cast to Specific implementation and return } Is the above code possible ? Can cas...
stackexchange/codereview
Is it possible to rewrite this loop: for k,n in [[aa,1],[ab,2], [ac,3], [ad,4], [ba,5], [bb,6], [bc,7], [bd,8], [ca,9],[cb,10],[cc,12],[cd,13],[da,14],[db,15],[dc,16],[dd,17],...zd,220]]: with two range functions or "list multiplication"? I have tried all sorts of approaches, but none worked so far. Thank...
stackexchange/codereview
Thought is was time to bring this to the Stack. We have IIS 7.5 (classic mode), .net 2.0 on Windows Server 2008. The app was upgraded from .net 1.1 with no issues/changes needed. It was migrated from Server 2000. Once in its new home, Forms Authentication started to hiccup for IE users. IE users can log in, arrive...
stackexchange/codereview
I'm building an app that deals with streaming music from a server that's using Http Live Streaming Protocol to send the information. I'm using AVPlayer (with AVPlayerItem) to decode the m3u8 files that the server is sending but this class is only referenced in iOS 4. There's the option of using MPMoviePlayerControlle...
stackexchange/codereview
I have a search form: <form id="global_search"> <input id="global_search_input" name="search_query" placeholder="Enter search text"> <input id="global_search_button" type="submit" value="" onclick="slide_box_search(search_query); return false;" class="listings_box"> </form> and I want to display th...
stackexchange/codereview
I have a ASP.NET webservice which is called by a Java client. The client sends a SOAP message as input but the problem is that it never reaches my webservice method. I always get null input. I used TraceListener and saw this warning which may cause the problem: The element was not expected in this context: ... Expected...
stackexchange/codereview
I have some heavily templated c++ code that I am working with. I can compile and profile with AMD tools and sleepy in debug mode. However without optimisation most of time spent concentrated in the templated code and STL. With optimised compilation, all the profile tools that I know produce garbage information. Does an...
stackexchange/codereview
I got following scenario. A web part needs certain configuration parameters (primitive data types) like e.g. an URL (string) to retrieve and show data from an external system. As each instance of the web part within a web application should retrieve the data from the same system, the parameters are stored in the SPProp...
stackexchange/codereview
I am trying to set up this script for my local bands newsletter. Currently, someone sends an email with a request to be added, we manually add it to newsletter mailer I set up. (Which works great thanks to help I found here!) The intent now is to have my script below log into the email account I set up for the list on ...
stackexchange/codereview
While trying to start local Google App Engine (v1.3.8) Server on my Fedora 14 with Python 2.5 (installed from source) I get the importerror ImportError: No module named _sqlite3 I have the following package installed - sqlite, sqlite-devel, python2.5, python2.7. I did some Google and it looks like this error comes whe...
stackexchange/codereview
i've done a checkout, after that i modify a file that has been download. Then i do svn revert . where the file is, expecting it has again the contents that has after doing the checkout but it has the modification i have made after. So how can i go the state of the file after doing the checkout? Javier
stackexchange/codereview
How can I split a Windows Forms code behind file into multiple files so it's more readable? If I have 20 buttons with 20 click_Button events, that one file is going to be bigger than I'd like it go be. Windows Forms seem to be very fragile in that if I delete a button or a button_Click event from the code-behind file, ...
stackexchange/codereview
how does one get the picked value of a combo box from delphi 7 lets say it has items, how does one know which row (item) was picked?
stackexchange/codereview
What is the best way to check, from PHP, if connection to a MySQL server will succeed? I've seen some solutions that first try to open a socket connection (with fsockopen) and connect to MySQL (via whatever extension you are using) only if the socket connection was successful. I'm not too sure about this since you have...
stackexchange/codereview
I want to know what's the most optimized way to work with mysql. I have a quite large database for orders. i have another table for previous orders, whenever the order is completed, it's erased from orders and is moved to previous orders. should i keep using this mothod or put them all in the same table and add a colum...
stackexchange/codereview
I am trying to create a resizable div at the mouse position and resize it immediately to its desired size. My failed attempt so far: http://jsfiddle.net/YKnfR/1/ Any ideas on how to achieve this behaviour?
stackexchange/codereview
I deleted all of the files from an svn repo. I then tried to recommit the files. This was going fine until some nested folders started to chuck out this message. How do i overcome this? Execute: Add Error: Error while performing action: '/opt/lampp/htdocs/cmsv5/cms/images/breadcrumb' is already under version con...
stackexchange/codereview
I'm evaluating setting up a REST system using WCF against using MVC (which I currently have). I've got it running but would like to be able to replicate some functionality that I get with MVC. That is, I need to be able to specify the WCF equivalent of a 'default action'. Whilst service route has a defaults property, I...
stackexchange/codereview
I'm doing a little app where a user enters a block of queries and then executes them. The thing is that I want to show relevant information, like for example if he inputs something like: SELECT * FROM server; UPDATE server SET name = 'Kojak'; It gets: The rows selected The number of rows affected by the UPDATE My pr...
stackexchange/codereview
I am really new to Solaris SMF and was writing an SMF for Weblogic Nodemanager. I followed the steps from : http://www.camelrichard.org/controlling-weblogic-node-manager-solaris-smf-non-root To test if SMF is restarting the service when it gets killed, I am sending it a kill signal from another terminal, but it does n...
stackexchange/codereview
hey guys i made a form with jquery and the only problem is in slideToggle function jquery $(".ChoosePayMethod").click(function(){ var ID = $(this).attr("id"); if ($('input[name=ChoosePayMethod]:checked')) { $("#PayMethod_"+ID).slideToggle("slow"); } html <label><input type="radio" name="Ch...
stackexchange/codereview
Hi I'm trying to store my current url in a session variable. My app uses query strings like www.domain.com/add?url=http://www.google.com but current_url() returns 'ww.domain.com/add'. The url without the query strings. I've checked the helper file and current_url seems to just append the uri segments to the site_url se...
stackexchange/codereview
According to this post a typical firefox user has 2-3 tabs open. How can they say that ? Does Mozilla receive user statistics from firefox? Can you get this information using javascript ? Can you get this information with other browsers ?
stackexchange/codereview
Possible Duplicates: css/ html help in making rounded table like container What is the best way to create rounded corners using CSS? how to make a rectangle/square with curved edges in html?
stackexchange/codereview
I have Android code for making a menu. Now I want to do the same for BlackBerry. My Android code overrides Activity.onCreateOptionsMenu and uses a MenuInflater to create the menu items.
stackexchange/codereview
This may seem like a silly question at first, but I can't seem to get jQuery to load another page - when I include a link: <a href="test.html" data-pop >Go to the test page</a> The address (assuming we're coming from index.html) simply acquires a #test.html, which means the end of my address ends up looking like this...
stackexchange/codereview
I'm skinning a lot of components lately and spend a lot of time building them up from scratch only so I can make some small changes from the default. Are mxml files for the default skins available anywhere so that I can just copy/paste then edit to save time? Cheers, Chris
stackexchange/codereview
I have this script: function onEdit(e) { var sheet = e.source.getActiveSheet(); var range = e.source.getActiveRange(); // 3 is column C if (range.getColumn() == 3) { if (range.getValue() != "") { sheet.insertRowAfter(range.getRow()); } } }​ When the script inserts a row, I would like it to type " " (a ...
stackexchange/codereview
I have an embedded PDF in my HTML. <object id="myPDF" type="application/pdf" data="visual.pdf" style="width:500px; height:500px"></object> This works perfectly, and the file is displayed on the page, along with the basic features such as "print", "save", etc. Is there any way of providing <input type="button" /> whose...
stackexchange/codereview
How can I do this: In my page, I have a section like a welcome box. It contains title and content. I would want to allow users to hide and show the content when they click a button. And when they will refresh the page, the content will be shown according to their previous action (to hide/show). How to do this that it w...
stackexchange/codereview
I've done .Net development for awhile but I'm new to the WPF technology. What is the supposed purpose of App.xaml? Also, what type of xaml code do you usually put in it? It seems like for simple applications it could be ignored and left untouched. Is this true?
stackexchange/codereview
Out of the below two synchronization strategy, which one is optimized (as in processing and generated byte code) and also the scenario in which one should use one of them. public synchronized void addName(String name) { lastName = name; nameCount++; nameList.add(name); } or public void addName(St...
stackexchange/codereview
for the sake of simplicity let's assume that I'm making a simple Pong clone game for Android. Let's assume that it would only be playable in the landscape mode. (ignore square phones for now). I'd like the game to look in the same scale on each phone, to the extent that if you took a screenshot of the game on QVGA phon...
stackexchange/codereview
With a string like "HorsieDoggieBirdie", is there a non-capturing regex replace that would kill "Horsie" and "Birdie", yet keep "Doggie" intact? I can only think of a capturing solution: s/(Horsie)(Doggie)(Birdie)/$2/g Is there a non-capturing solution like: s/Horsie##Doggie##Birdie//g where ## is some combination of...
stackexchange/codereview
I have a class that resembles this: However, after the initial constructor, the copy constructor is being called 10 times. If I don't do the thread creation step. It gets called 4 times which is what I'd expect. Why is that, and how do I avoid it? Should I avoid using std::vector in this case and just do new delete in...
stackexchange/codereview
I need help with jQuery jqGrid and subgrid. I am able to create a Subgrid inside my jqGrid succesfully. The next step is to add a custom option list in the main grid navbar somewhere so that depending on which option the user selects, a different kind of subgrid opens. Is it possible to add custom options to the jqGri...
stackexchange/codereview
usually , we use http get method to do a spellcheck query, but now I have to use solrj to do this, pls help me to solve this question , thx.
stackexchange/codereview
I use GVim 7.2 on Windows XP. In my installation some of the jump commands don't work, such as +O and Ctrl+I, whereas :jump and Ctrl+T work. What might be the reason for this? I checked my _vimrc file for a remapping of <C-o> but there doesn't seem to be any remapping. Where should I look into to find the reason of t...
stackexchange/codereview
I have a context menu that gets menu items through databinding (I'm using the MVVM pattern): <ContextMenu ItemsSource="{Binding Path=ContextMenuItems}" /> This works fine. However, in the cases when there are no menu items to show, I don't want the context menu to show up at all. Is there a way to accomplish this? Som...
stackexchange/codereview
When you view a page from my site in Google Instant Previews, you see an AJAX error message (caused by some AJAX that fires on document ready): I assume the way to fix this is to make my javascript compatible with whatever javascript engine Google's "browser" uses (like one might design for IE6). So: what javascript d...
stackexchange/codereview
I need to open and count the number of lines in a text file using a stored procedure. The stored procedure should return a value whenever executed. Can you help me?
stackexchange/codereview
Creating my tables from my models.py. I donno how to do 2 things - I want to specify MySQL to create some of my tables as InnoDB & some as MyISAM. How do I do it? Also I want to specify my tables DEFAULT CHARSET as utf8. How do I do it? This is what I see when I run syncdb - ... ) ENGINE=MyISAM DEFAULT CHARSET=latin1...
stackexchange/codereview
On one page on my site, I have a table in the right column that is too wide and rather than showing scrollbars, IE is wrapping it below the content in the left column. I can't find a fix for this because I don't know how to describe what's happening. Here's the code I'm using to demonstrate the problem: <style> #col1...
stackexchange/codereview
We have a web service (WCF in C#) that has been used on an intranet until now. Going forward we want to open it up to the internet. Obviously we are concerned that naughty people cannot access the interfaces. What is the best practise method of ensuring this in WCF? Is it WSS? I'm presuming some kind of login interfac...
stackexchange/codereview
all.I'm a beginner of Mysql and I have one simple question here. I want to insert a value to a specific row and column: INSERT INTO users (doctor_id) VALUES('123') WHERE user_id='12'; But it says there's syntax error in this command, I don't know how to write it. Hope someone can help me~ Many thanks in advance!
stackexchange/codereview
I've got an app with multiple ListView controls where there's a requirement that the item's in the ListView must be fully visible. There should never be partial ListViewItem's showing in the list. If the user releases the ScrollViewer at a position that ends up showing a partial item, then the list should "snap" and co...
stackexchange/codereview
recently I was installing some perl modules on my RHEL 5 with perl version 5.8.8 and all instalations went fine. I can see that the modules exist in the @INC but my TWiki site claims that it can't find them returning an error: Can't locate Net/LDAP.pm in @INC (a lot of paths which contain the modules) at TWiki.pm line ...
stackexchange/codereview
I have the following set-up class Player < ActiveRecord::Base has_many :cards, :inverse_of => :player do def in_hand find_all_by_location('hand') end end end class Card < ActiveRecord::Base belongs_to :player, :inverse_of => :cards end This means the following works: p = Player.find(:first) c = p....
stackexchange/codereview
I have two data frames. The one consists of three variables, namely "date", "strike" and "vol" with 20 observations a day, 100 a month and 1200 a year (in trading days), which looks like this Date Price Vol 2008-09-01 20 0.2 2008-09-01 30 0.5 ... So for each month I have certain...
stackexchange/codereview
I have overridden onKeyDown/onkeyUp for one of my activities in order to capture the Volume keys press events and manipulate the sound of the application. However I've noticed that while a menu (be it options menu or context menu ) is activated then I can't no longer capture the volume keys press events. How could this...
stackexchange/codereview
When I execute this code: select client.* from client FOR XML AUTO,TYPE, ELEMENT as a query to the database, I get the output as desired, but I need to save it manually. Is there a way to save it automatically? And is it possible to schedule this procedure? I'm kinda new to SQL so take it easy when you anwser please!...
stackexchange/codereview
here is my problem: Context: kerberos authentication for two kinds of webapps, one using Apache mod_auth_kerb and the other using SPNEGO (GSSAPI) for Tomcat. I use mod_jk for connecting Tomcat to Apache. Problem: kerberos headers from client Tomcat seem to be modified by Apache, which leads to authentication failures (...
stackexchange/codereview
I've read thread from 2005 and people said SOQL does not support string concatenation. Though wondering if it is supported and someone has done this. I'm trying to concat but no luck :( Below is APEX code trying to find record with specified email. String myEmail = 'my@email.com'; String foo = 'SELECT emailTo__c, sourc...
stackexchange/codereview
Super easy, I am sure - but in conditional if/then statements using droid, how do I go about using them with integers, ie: int currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); public void getResult(int currentHour, Intent intent) { if (currentHour < 14) then: //do something } I know this is...
stackexchange/codereview
I would like to declare a variable 'XMLOutput' and have it produce the contents of a table in XML format. If you could provide a really simple example I could work off of I would really appreciate it. I tried using the xmlelement() but could not get it to work.
stackexchange/codereview
I'm attempting to generate some reports dynamically, very simple HTML tables with borders. I've tried TCPDF and it renders up to 400 rows just fine but anything more than that (about 20 pages) it can't handle it. DOMPDF can't even do that. These reports can be thousands of rows. Any idea on a faster library or a bette...
stackexchange/codereview
I have a big file with tens of thousands of lines containing data separated by | for bulk insert in my database. I know there should be say 10 columns. Because some of the data may accidentally contains the delimiter |, errors can occur because the number of columns will not match for this line. I'm trying to count the...
stackexchange/codereview
Trying to pull the text value of the label that is dynamically populated by a SQL database. Any help would be greatly appreciated! ASP.NET <asp:Label ID="PlatformName" Text='<%# DataBinder.Eval(Container.DataItem, "PlatformName") %>' runat="server" /> C# Code Behind (Which gives me the object, not the string value in...
stackexchange/codereview
I have an XML File <?xml version="1.0" encoding="UTF-8"?> <data> <contact-information> <full-name>Peter John</full-name> <address_line_1>some place</address_line_1> <address_line_2>some place2</address_line_2> <city>some city</city> <state>some state</state> <zip>54000</zip> <country>some country</cou...
stackexchange/codereview
I've written a new Visual Studio language service for my software studio's internal scripting language following the directions from a very useful article Writing Your First Visual Studio Language Service. I've got my grammar working great, some simple goto cases up and running, and text coloring. I've done my testing ...
stackexchange/codereview
Hi how can I change text value of text box in parent window from child window.. i.e I have parent window have textbox1 and button and child window has textbox2 and button. I need to update the value of textbox1 when I enter some text in child window's textbox2. i did some simple function to do this logically its correc...
stackexchange/codereview
I have a table in SQL Server 2000 with a text field containing XML that I need to display on a C# ASP.NET 2.0 page. I need to retrieve the XML and then filter out a list of about 80 possible elements (or white list 20 possible elements to keep might be better). I can pull the xml out of the DB and display it on my .as...
stackexchange/codereview
Is there any way to test iphone application on real device without paying $99 to Apple because i dnt want to enrolled to apple iphone developer program i m newbie just playing around with iphone development.
stackexchange/codereview
what is the order of execution in web ? PHP, HTML, Javascript, css and mysql are the items to execute
stackexchange/codereview
I have a code that is meant to run a check on my database to see if a given value is unique, and if so, insert it into the db. If it isn't unique, reiterate the process until it finds a unique value. do { // Generate a new user ID (15 numbers) and check to make sure it doesn't already exist. $new_user_id = mt_r...
stackexchange/codereview
In my WinForms app (C#) I have a circle (defined by a Rectangle) that I am presently filling with a solid color. I would like to fill this with a circular (not linear) gradient (so one color in the center fades to another color uniformly around the edges). I have experimented with PathGradientBrush, but am having no lu...
stackexchange/codereview
I have a table in Access 2003 that has the following fields Ptr_RateTable MinOfWeight_Up_To Adder I need to find the unique values for MinOfWeight_Up_To for any table, without showing the table names in my results. I am trying to condense tables sizes in the mainframe by finding tables that can be condensed at the sa...
stackexchange/codereview
In my application I am using Entity Framework. My Table -Article -period -startDate I need records that match => DateTime.Now > startDate and (startDate + period) > DateTime.Now I tried this code but its now working Context.Article .Where(p => p.StartDate < DateTime.Now) .Where(p => p.StartDate.AddDays(p.Per...
stackexchange/codereview
Using JavaScript what’s the simplest way to set a headers id from it’s content and swap spaces for hyphens and make lowercase. For example, if header is: <h1>Header one content</h1> how can we change that to: <h1 id="header-one-content">Header one content</h1> Thanks
stackexchange/codereview
I am creating a Google App Engine web application written in Python, and I would like to create a drop down box that displays different values corresponding to pages of a book that a user could choose from. I would like the action of the drop down box to be to direct the user to the page that corresponds to this link:...
stackexchange/codereview
i am using contact picker, is it possible to select multiple contacts with the help of checkbox in contactpicker activity? is there any other possible way? P.S: now i am using a contactpicker activity,which helps to get a single contact! :-(
stackexchange/codereview
Possible Duplicate: Convert std::string to const char* or char* is there any to get the string back from the stl map and into a char array?? multimap<string, string> testcase; testcase.insert(pair<string,string>("DB","something")); for( i=testcase.begin(); i!=testcase.end(); ++i){ char cate[20] =(*i).fir...
stackexchange/codereview
I'm trying to setup a model relationship in rails and could use your help, as it's not working :0 class User < ActiveRecord::Base has_many :request_threads end class RequestThread < ActiveRecord::Base belongs_to :user, :foreign_key => :creator_id end In terms of schemas, the request_threads table has creator_id i...
stackexchange/codereview
If I do something like the following: ifstream file; file.open("somefile", ios::binary); unsigned int data; file >> data; My stream will always set the failbit and the data will remain uninitialized. However, if I read a char or unsigned char instead, the stream is fine. perror() is telling me "result too large". ...
stackexchange/codereview
import urllib2, sys if len(sys.argv) !=3: print "Usage: download.py <link> <saveas>" sys.exit(1) site = urllib2.urlopen(sys.argv[1]) meta = site.info() print "Size: ", meta.getheaders("Content-Length") f = open(sys.argv[2], 'wb') f.write(site.read()) f.close() I'm wondering how to display...
stackexchange/codereview