Forum
stringclasses
148 values
Title
stringlengths
8
190
Body
stringlengths
24
72.4k
Tags
stringlengths
3
128
CreationDate
stringlengths
23
23
Reputation
int64
1
626k
AcceptedAnswer
int64
0
1
Score
int64
-15
440
ViewCount
int64
1
696k
AnswerCount
int64
0
123
CommentCount
int64
0
64
FavoriteCount
int64
0
227
stackoverflow.com
HttpBrowserCapabilities Custom Browser file parsing
<p>If I have a custom .browser file, and I want to evaluate what will happen if it is given a particular User Agent, is there any way to do that through the .NET API?</p> <p>I was attempting to use HttpBrowserCapabilites, but I'm not sure how to load a custom .browser file into that class.</p>
<httpbrowsercapabilities>
2009-05-06T19:39:37.770
8,171
0
1
626
2
0
0
stackoverflow.com
How to cache information in a DAO in a threadsafe manner
<p>I often need to implement DAO's for some reference data that doesn't change very often. I sometimes cache this in collection field on the DAO - so that it is only loaded once and explicitly updated when required. </p> <p>However this brings in many concurrency issues - what if another thread attempts to access the data while it is loading or being updated. </p> <p>Obviously this can be handled by making both the getters and setters of the data synchronised - but for a large web application this is quite an overhead.</p> <p>I've included a trivial flawed example of what I need as a strawman. Please suggest alternative ways to implement this. </p> <pre><code>public class LocationDAOImpl implements LocationDAO { private List&lt;Location&gt; locations = null; public List&lt;Location&gt; getAllLocations() { if(locations == null) { loadAllLocations(); } return locations; } </code></pre> <p>For further information I'm using Hibernate and Spring but this requirement would apply across many technologies. </p> <p>Some further thoughts:</p> <p>Should this not be handled in code at all - instead let ehcache or similar handle it? Is there a common pattern for this that I'm missing? There are obviously many ways this can be achieved but I've never found a pattern that is simple and maintainable.</p> <p>Thanks in advance!</p>
<java><caching><concurrency><dao>
2009-06-26T09:38:54.833
8,362
1
2
3,744
6
1
3
stackoverflow.com
Re-order Items in a ListBox - Windows Forms - (Java programmer learning C#)
<p>There is the first time I'm going to do a particular control in C#. The control is a ListBox of items that will have an up arrow and a down arrow on the side. When you select an item in the ListBox, you can use the up and down arrow arrows to reposition that item in the ListBox. </p> <p>My two questions are: (1) Is there a prebuilt control for something like this, before I start writing my own?</p> <p>and if not</p> <p>(2) I'm not sure what control to use for the up / down arrows. I could use buttons that say "Up" and "Down", but I'd prefer actual arrows and am not sure the best way to go about making those.</p> <p>I am using VisualStudio2008 and .NET Framework 2.0.</p>
<c#><.net><winforms><visual-studio-2008>
2009-07-20T19:23:56.837
509
1
1
1,084
2
0
0
stackoverflow.com
Silverlight 3 won't install on Windows XP embedded 2002
<p>Well, I tried HARD to install silverlight 3.0 on Windows XP embedded but keeps displaying that "Install Sivlerlight Logo" as if it never picks it up or installs at all ... Anyone had same problems? Any solutions? </p>
<silverlight-3.0><embedded>
2009-07-21T13:00:13.140
14,226
1
0
962
1
3
0
stackoverflow.com
How can I create a tabular report in SQL when the column names are in the database, not the query?
<p><a href="http://www.geocities.com/colinpriley/sql/sqlitepg09.htm" rel="nofollow noreferrer">http://www.geocities.com/colinpriley/sql/sqlitepg09.htm</a> has a nice technique for creating a tabular report where the column names for the table can be coded in the query but in my case, the columns should be values from the database. Say I have daily sales figures like:</p> <pre><code> Transaction Date Rep Product Amount 1 July 1 Bob A12 $10 2 July 2 Bob B24 $12 3 July 2 Ted A12 $25 ... </code></pre> <p>and I want a weekly summary report that shows how much of each product each rep sold:</p> <pre><code> A12 B24 Bob $10 $12 Ted $25 $0 </code></pre> <p>My column names come from the Product column. Say, any product that has a row in the specified date range should have a column in the report. But other products -- which weren't sold in that time frame -- should not have a column of all 0s. How can I do that? Bonus points if it works in SQLite.</p> <p>TIA.</p>
<sql><sqlite><crosstab>
2009-07-30T18:45:57.273
3,414
0
1
890
1
1
0
stackoverflow.com
C# call a static method at runtime without a build time reference?
<p>I am writing a system in C# .net (2.0). It has a pluggable module sort of architecture. Assemblies can be added to the system without rebuilding the base modules. To make a connection to the new module, I wish to attempt to call a static method in some other module by name. I do not want the called module to be referenced in any manner at build time.</p> <p>Back when I was writing unmanaged code starting from the path to the .dll file I would use LoadLibrary() to get the .dll into memory then use get GetProcAddress() get a pointer to the function I wished to call. How do I achieve the same result in C# / .NET.</p>
<c#><.net><.net-2.0>
2009-09-10T18:00:22.460
2,128
1
6
6,103
2
0
1
stackoverflow.com
What is the best way to post a date/time into a django view?
<p>I'd like to build a view that allows the user to get a list of things that are happening around a certain time.</p> <p>What is the best way to build this request? E.g. If I wanted to get all of the events that are happening right now I could post to /events/2009/09/29/8/23/</p> <p>That seems rather tedious especially if I want to have multiple dates in a request. I could end up with urls that look like /events/between/2009/09/29/8/23/2006/11/16/14/45/</p> <p>Is there a simple (javascipt) way to convert a date/time to a timestamp and pass that in as an int, which I can then convert to a datetime inside the view?</p>
<javascript><django><django-views>
2009-09-30T00:25:43.200
12,115
1
0
172
3
0
0
stackoverflow.com
Facebook API: How do I get the 'Allow Access?' page to display?
<p>I want users to add my Facebook Canvas application to their profile. I can create my own page with a 'connect' button to do this, but how do I do this within the canvas page?</p> <p>What do I mean?</p> <p>Go to any typical application, usually the first screen you see is an 'Allow Access?' screen with a button for 'Allow' or cancel (link).</p> <p>How do I get such a screen to display for my canvas application?</p>
<facebook>
2009-10-20T08:34:45.180
2,591
1
0
1,573
1
0
1
stackoverflow.com
CSC Command Parameters Useage for C# Build Time
<p>ParseXSD.cs</p> <pre><code>using System; using System.Collections; using System.Xml; using System.Xml.Schema; class XmlSchemaTraverseExample { static void Main() { // Add the customer schema to a new XmlSchemaSet and compile it. // Any schema validation warnings and errors encountered reading or // compiling the schema are handled by the ValidationEventHandler delegate. XmlSchemaSet schemaSet = new XmlSchemaSet(); schemaSet.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); schemaSet.Add("http://www.w3.org/2001/XMLSchema", "tmp.xsd"); schemaSet.Compile(); // Retrieve the compiled XmlSchema object from the XmlSchemaSet // by iterating over the Schemas property. XmlSchema customerSchema = null; foreach (XmlSchema schema in schemaSet.Schemas()) { customerSchema = schema; } // inserted more code here.... } </code></pre> <p>}</p> <p>Currently, my ConsoleApp worked very well. </p> <p>And i want to remove the hard code (xsd file path) out from my code below.</p> <p>// i don't know how to update this line.</p> <pre><code>schemaSet.Add("http://www.w3.org/2001/XMLSchema", "tmp.xsd"); </code></pre> <p>Then i could run my <strong>ParseXSD.cs</strong> file at the building time with the CSC command below.</p> <p>// i don't know the correct command format. I could update the path parameter easily. NO hard code.</p> <pre><code> CSC ParseXSD.cs d:/tmp/tmp.xsd </code></pre> <p>Please give me some guide. thanks in advance.</p>
<c#><csc>
2009-12-16T06:35:23.387
8,879
1
0
1,059
1
0
0
stackoverflow.com
Which browser plugin technology to use for cross platform design?
<p>I mean ActiveX is IE only and dead, and so java applets are dead. Flash is still not present in mobile browsers, Mozilla is present only on 1 phone, so XPCOM is also not an option.</p> <p>How do you write a plugin that need access to file system, and do some other things, like unzip files, upload, download, etc.</p>
<plugins><cross-browser><mobile-browser>
2010-01-30T10:41:39.150
13,676
0
1
150
1
0
0
stackoverflow.com
Get name of virtual directory?
<p>I'm using Request.ApplicationPath to learn the name of the Virtual Directory in which I'm running. Is there a more reliable way?</p>
<c#><asp.net><iis><path><virtual-directory>
2010-01-30T18:43:09.397
15,814
1
17
20,402
3
3
1
stackoverflow.com
Simple forloop - Python
<p>this is probably too simple of a question, but here I go.</p> <p>I have paginated items, each page contains 100 items. The program fetches items till it reaches the item index specified within item_num</p> <p>This is what I have:</p> <pre><code>item_num = 56 range(0, item_num/100 + (item_num%100 &gt; 0)): get_next_100() </code></pre> <hr> <p>I'm not really sure about the <strong>(item_num%100 > 0) boolean</strong> I used.</p> <p>Is there anything wrong with what I did?</p>
<python>
2010-03-23T20:54:11.930
24,057
1
2
268
2
0
0
stackoverflow.com
What type of websites does memcached speed up
<p>I have read this article about <a href="http://www.igvita.com/2008/02/11/nginx-and-memcached-a-400-boost/" rel="nofollow noreferrer">400% boost of your website</a>. This is done by a combination of nginx and memcached. The how-to part of this website is quite good, but i mis the part where it says to what types of websites this applies.</p> <p>I know nginx is a http engine, I need no explanation for that. </p> <p>I thought memcached had something to do with caching database result. However i don't understand what this has to do with the http request, can someone please explain that to me.</p> <p>Another question I have is for what types of websites is this used. I have a website where the important part of the website consist of data that changes often. Often being minutes.</p> <p>Will this method still apply to me, or should I just stick with the basic boring setup of apache and nothing else.</p>
<performance><apache><memcached><nginx>
2010-03-27T05:56:53.517
15,577
1
1
1,332
2
0
0
stackoverflow.com
Replicating Mail Contact "Bubble" in iPhone SDK
<p>When creating a new message using Mail on the iPhone, and after typing the contact, a blue "bubble" appears around the text. Is there some way I can replicate this behavior in my own application?</p> <p>Thanks for any help!</p>
<iphone><text><email><nsstring>
2010-04-06T20:54:51.113
3,733
1
1
621
1
0
1
stackoverflow.com
standard rectangle class
<p>I have a project that has a GUI (written in QT) and a command-line version. I made use of the rectangle class included in QT: <a href="http://doc.trolltech.com/4.6/qrectf.html" rel="nofollow noreferrer">QRect</a>. I would like to break the command-line version's dependency on QT, so I need a drop-in rectangle class that supports intersection and union. I could write one, but I'd prefer including one if possible.</p> <p>Any ideas?</p>
<c++>
2010-04-14T23:59:35.850
31,033
1
4
4,870
1
6
0
stackoverflow.com
twitter login button
<p>HI</p> <p>I have a django application running on app engine and I want to add a twitter login to my application.</p> <p>Do you have a good links how to do that. I already registered my app in twitter.</p> <p>Just don't know how to do login/logout buttons.</p> <p>Thanks, Arshavski Alexander</p>
<django><google-app-engine>
2010-04-16T05:40:56.473
4,803
1
0
735
1
0
1
stackoverflow.com
How do I use PORT ftp raw command in c#?
<p>I am trying to make a FTP client in c#. I found a class that support basic FTP commands on <a href="http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp_members.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp_members.aspx</a>.</p> <p>on the list, PORT command is missing.</p> <p>How do I use PORT command in c#?</p>
<c#><ftp><port>
2010-05-25T07:59:26.847
21,835
0
1
1,687
3
0
0
stackoverflow.com
Producer/consumer in Grails?
<p>I'm trying to implement a Consumer/Producer app in Grails, after several unsuccessful attempts at implementing concurrent threads. Basically I want to store all the events coming from a clients (through separate AJAX calls) in a <strong>single queue</strong> and then process such a queue in a linear way as soon as new events are added.</p> <p>This looks like a <strong>Producer/Consumer problem</strong>: <a href="http://en.wikipedia.org/wiki/Producer-consumer_problem" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Producer-consumer_problem</a></p> <p>How can I implement this in Grails (maybe with a timer or even better by generating an event 'process queue')?</p> <p>Basically I'd like to a have a <strong>singleton service</strong> waiting for new events in the queue and processing them linearly (even if the queue is loaded by several concurrent processes).</p> <p>Any hints?</p> <p>Cheers!</p>
<design-patterns><grails><queue><producer-consumer>
2010-05-25T14:28:38.507
3,553
0
2
661
2
0
0
stackoverflow.com
scaling a CCMenuItem in Cocos2d (Objective-C)
<p>I'm trying to make a CCMenuItem that has scaled images. For example, I tried:</p> <pre><code>CCSprite* normalSprite = [CCSprite spriteWithFile:@"button_play.png"]; CCSprite* selectedSprite = [CCSprite spriteWithFile:@"button_play.png"]; selectedSprite.scale = 1.2; CCMenuItem menuItem = [CCMenuItemSprite itemFromNormalSprite:normalSprite selectedSprite:selectedSprite target:self selector:@selector(onPlay:)]; </code></pre> <p>But it looks like CCMenuItemSprite ignores the scale of the underlying sprites. Is there a way to do this (aside from just creating scaled versions of the underlying images)? Thanks.</p>
<iphone><objective-c><image>
2010-06-21T02:46:00.317
289
0
4
2,810
3
0
0
stackoverflow.com
regarding difference between sharepoint server and biz talk server.which one good to learn
<p>hi every iam willing to learn advance to .net language ,so someone suggested me to do biztalk server ,some one told to do sharepointserver iam totally confused what to do .so plz some one tell me difference between both and which is good in the sence of oputunities.</p>
<sharepoint-2007><biztalk2006r2>
2010-06-22T05:07:14.007
91
1
1
199
1
0
0
stackoverflow.com
serving different views in code igniter
<p>I'm pretty new to code igniter. Is there best practice for serving different view for different context. For example, I'd like to serve specific pages for mobile user agents with the same controllers.</p>
<php><codeigniter>
2010-06-30T05:28:45.180
3,973
1
2
1,321
1
0
2
stackoverflow.com
Java Date Format Conversion
<p>I am currently pulling three form field inputs off the request object. The day, the month, and the year.</p> <p>Day would be 11 for 11th day of the month Month would be 12 for december Year would be 2010 representing this year.</p> <p>I need to convert this into a Java Date object, but since so much has been changed, I am not sure what the best way to store this in a java object. I need it in the format</p> <p><pre>YYYY-MM-DD HH:MM:SS</pre> so I can compare to dates in the MySql Database.</p>
<java><mysql><date>
2010-07-06T16:57:52.720
8,614
1
2
1,494
3
0
0
stackoverflow.com
Rails questions, SQL statement in logs
<p>So I am new to Rails, so pardon the basic question. </p> <p>I see rails spits this out (in the console) for every request I make to my controller. Why? I'm not even doing any DB operation, I just started writing a HelloWorld rails app. I did pick mysql as the db when creating this rails project (rails -d mysql helloworld)</p> <pre><code>SQL (0.1ms) SET NAMES 'utf8' SQL (0.1ms) SET SQL_AUTO_IS_NULL=0 </code></pre> <p>So I noticed, that rails attempts to establish a DB connection for every request, irrespective whether you do a DB/ActiveRecord operation. It does this right after it does action_controller/dispatch. This seems like a waste of DB resource to me, why establish a connection to DB when I may not even do a ActiveRecord operation??</p>
<sql><mysql><ruby-on-rails>
2010-07-13T18:08:00.500
11,441
1
4
341
1
1
1
stackoverflow.com
WCF Service: ASP.NET Cache or SQL
<p>I'm currently developing a WCF REST Web Service that will be running on Microsoft Azure. To limit the number of requests per IP address to prevent abuse, I currently store the IP and timeout using the ASP.NET Cache.</p> <p>This method works great but since muliple VM instances with Azure don't share a single cache, the requests could be split between different VMs and be cleared if a VM is reset.</p> <p>I don't think this is a major problem but since I already store user info in a SQL Azure database and authenticate users using the WCF service, would I be better off using the database instead of the ASP.NET cache?</p> <p>Any adive would be really helpful.</p>
<sql><wcf><caching><throttling>
2010-07-22T01:04:44.207
99
1
2
379
2
0
0
stackoverflow.com
Referencing Firebug Console Inside of a Custom Javascript Object
<p>I have several custom Javascript objects and want to do some debugging via the Firebug console inside of them. However, if I try to use console.log(), I get an error about console not being defined. I tried referencing console as window.console and it made no difference. When I run a check to see if console is defined, it returns false:</p> <pre><code>if(window.console &amp;&amp; window.console.firebug) </code></pre> <p>So, my question is, how can I reference the Firebug console inside of my custom objects so that I can do my debugging?</p>
<javascript><object><console><firebug>
2010-08-10T19:50:16.547
187
1
0
140
1
0
0
stackoverflow.com
Enabling 2 different models in a rails app talk to the same table
<p>I'm having a few integration issues. I have 2 models which need to be mapped so as to enable them to talk to the same table. So one model has a few attributes that are mapped to the corresponding columns in the table and likewise for the other model. </p> <p>I've heard of aliasing, a technique that can be used. Help would be appreciated. Thanks ! </p>
<ruby-on-rails><database><model>
2010-08-11T07:06:13.680
8,617
1
4
781
1
0
1
stackoverflow.com
Edit RewriteRule to allow title in URL's
<p>I have real trouble understanding mod_rewrite, and got some help in creating a RewriteRule to have simple urls for our site</p> <pre><code>RewriteRule ^news/([a-zA-Z0-9_-]+)$ /news/$1/ [R] RewriteRule ^news/([a-zA-Z0-9_-]+)/$ news/show.php?id=$1 </code></pre> <p>So someone can visit site.com/news/700/ and the url will look the same to them, but puts the request to our server with /news/show.php?=700 to pull the article out. </p> <p>I want to include the title of the article into the url, just to make it more user friendly when someone see's a link to our site. </p> <p>site.com/news/700/heres-our-important-title </p> <p>Can someone let me know what I need to change to make this happen so the code will still work properly? So a url can have that extra text at the end, but it will still only pull the id number after /news/. </p> <p>Thanks.</p>
<mod-rewrite>
2010-08-17T03:12:02.600
1,962
1
0
200
1
0
0
stackoverflow.com
Ruby: Sorting an array that is "linked" to another array
<p>In my rails app, I have a loop in my controller that does this:</p> <pre><code>event_prices = [] event_dates = [] for event in @customer.events event_prices.push(event.total_prices) event_dates.push(event.event_time.strftime("%b %d, %Y at %I%p")) end </code></pre> <p>I then use the arrays to push data into a highcharts graph. What I want to do is sort the <code>event_dates</code> array in order, but if I do that, I'll lose the order of the <code>event_prices</code>. Right now, the <code>event_price[1]</code> corresponds to <code>event_dates[1]</code> and so on, but if I call a <code>sort!</code> on <code>event_dates</code>, it won't sort <code>event_prices</code> along with it.</p> <p>So how can I get it so that I sort both arrays the same way?</p>
<ruby-on-rails><ruby><sorting>
2010-08-19T02:31:36.197
609
1
0
641
2
0
0
stackoverflow.com
Why do I get "Invalid receiver type 'NSInteger'"?
<p>Probably a simple question: Why do I get an compiler warning for the following objective-C code?</p> <pre><code>//_classificationView.tag is a NSString CGFloat imageWidth = [_classificationView.tag floatValue] * 14.0; </code></pre> <p>And why does it say something about NSInteger?</p> <p>Thanks for answers! Dennis</p>
<iphone><objective-c><xcode><compiler-construction><primitive-types>
2010-08-26T12:44:27.183
1,321
1
0
1,865
1
0
0
stackoverflow.com
What is a semantic open database
<p>I read an article on a website and it mentioned something about semantic open databases. I tried googling this term but could not determine what the term meant. Here is the article here:</p> <p><a href="http://wiki.creativecommons.org/Grants/SocialCompare" rel="nofollow noreferrer">http://wiki.creativecommons.org/Grants/SocialCompare</a></p> <blockquote> <ul> <li><p>new data created from scratch to motivate users to do the same thing. </p></li> <li><p>a tool to import data from external open existing databases (such as semantic open databases). </p></li> <li><p>the translations of the website interface or some open data in several languages to be used worldwide more easily.</p></li> </ul> </blockquote>
<database>
2010-09-09T03:33:44.063
60,529
1
2
100
1
0
0
stackoverflow.com
Open GL + Applying Brightness on the Image + Undo Brightness operation
<p>I am working on one module of application. in this I need to perform brightness operation on the image [ I have done this using OpenGL ES ].</p> <p>Now I am stuck on how to revert back this brightness operation if in between user clicks "Cancel". As I am drawing on same layer for brightness operation. </p> <p>I am new to OpenGL and might missing some basics. can anyone help me to give me some direction regarding same.</p> <p>Thanks,</p> <p>Sagar</p>
<iphone><opengl-es>
2010-09-13T05:46:38.627
1,022
1
1
191
1
0
0
stackoverflow.com
IPhone App Build Successful But nothing shows
<p>Very new to Iphone development here, I have a project which is successfully building (which is a first for me :) It loads the simulator but it just closes as soon as it loads, how can I debug this? It appears the Interface Builder xib files are not loading, I've added a xib thats from a hello world project, (they have different project names) Is this an issue?</p> <p>Any advice would help, Thanks!</p>
<iphone><objective-c><xcode>
2010-09-28T01:06:29.723
12,085
1
0
99
1
1
0
stackoverflow.com
C++ cout pointer
<p>Hello Can somebody explain why second <strong>cout</strong> in func(char *p) doesn't work:</p> <pre><code>#include &lt;cstdlib&gt; #include &lt;iostream&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;stdlib.h&gt; using namespace std; char *strhex(char *str); char *func(char *p); int main() { char *ptr; char *p=strhex("d"); cout&lt;&lt;"main:"&lt;&lt;p&lt;&lt;endl; cout&lt;&lt;func(p)&lt;&lt;endl; system("PAUSE"); return 0; } char *func(char *p) { cout&lt;&lt;"func1:"&lt;&lt;p&lt;&lt;endl; char buffer[500]=""; char *zbuffer = buffer; cout&lt;&lt;"func2:"&lt;&lt;p&lt;&lt;endl; ///doesn't work return zbuffer; } char *strhex(char *str) { char buffer[500]=""; char *pbuffer = buffer; int len = strlen( str ); for( int i = 0; i &lt; len ;i++ ) { itoa(str[i],pbuffer,16); pbuffer +=2; }; *pbuffer = '\0'; pbuffer=buffer; return pbuffer; } </code></pre> <p>Edit: i'm using DEV C++ 4.9.9.2 on Windows</p>
<c++>
2010-10-15T23:59:15.343
1,159
1
0
1,674
4
5
0
stackoverflow.com
Regular Expression Pattern Error C#
<p>When I have an Expression declared like </p> <pre><code> someText = Regex.Replace(someText, @"/*.*?*/", ""); </code></pre> <p>The Error Says System.ArgumentException: par<code>"/*.*?*/" </code>parsing - Nested quantifier *.</p> <p>How to rewrite the code to avoid this error?</p>
<asp.net>
2010-10-19T22:56:30.733
1
0
0
179
4
1
0
stackoverflow.com
Tkinter: Set a 'scale' value without triggering callback?
<p>I have a Tkinter GUI where there is a <code>Scale</code> object. I have a callback assigned (by the <code>command</code> constructor parameter) to perform an action when the user changes the scale position. However, there is also a case where the value represented by the scale is modified externally, and so I set the scale position using <code>Scale.set()</code>. In this case, I want to set the scale, but <em>not</em> trigger the callback, since the rest of the program already knows about the change. However, I notice that the callback is indeed triggered by <code>set()</code>.</p> <p>Is it possible to do one of:</p> <ol> <li><p>Set the scale value without triggering the callback.</p></li> <li><p>Differentiate in the callback whether it was triggered by user interaction or by <code>Scale.set()</code> being called.</p></li> </ol> <p>Thanks.</p>
<python><tkinter>
2010-10-27T23:21:26.720
7,883
1
5
2,346
2
1
0
stackoverflow.com
How do I get the script to a database view
<p>I lost the script for a view that I created. Can I retrieve / recreate the script from the database using management studio?</p>
<sql-server><sql-server-2008>
2010-11-05T22:43:28.063
14,568
1
6
43,230
3
0
1
stackoverflow.com
Django add empty field on forms
<p>I have used self.fields to get all the users full names instead of just user names, now I would like to just add an empty field as the first choice...</p> <p>Currently.</p> <pre><code>def __init__(self, user, *args, **kwargs): super(TrophiesForm, self).__init__(*args, **kwargs) self.fields['outfitter'].choices = [(user.pk, user.get_full_name()) for user in users] </code></pre>
<django><django-forms>
2010-11-08T09:23:37.280
4,663
1
0
163
1
0
0
stackoverflow.com
access same class across two web service references in C#
<p>I'm trying to create a C# class that can call the same methods on the same classes, but the classes can come from two different web service references. I am accessing <code>SomeWebService</code> and <code>SomeWebServiceAlt</code>, where they have the same classes but are on different servers. The goal is to be able to first try using the methods in <code>SomeWebService</code>, and if that one wigs out, to try <code>SomeWebServiceAlt</code>. I was hoping to have some kind of generic class for accessing either web service, but I'm having trouble with type constraints because there aren't any common interfaces or base classes for the different classes I use from within either reference. That is, I use <code>ConnectionClass</code> from both the <code>SomeWebService</code> namespace and the <code>SomeWebServiceAlt</code> namespace, but the two <code>ConnectionClass</code> classes are not seen as related by C#, so I can't just say <code>where TClass : CommonBaseClassAcrossWebServices</code>. How should I do this? I'm ending up repeating code and doing:</p> <pre><code>if (typeof(SomeWebService.ConnectionClass) == typeof(TConnection)) { ... } else if (typeof(SomeWebServiceAlt.ConnectionClass) == typeof(TConnection)) { ... } </code></pre> <p>This seems really redundant and dirty. I'm using .NET 3.5, and I don't have control over the two web services. That's a difference between my question and similar questions I've seen on here: other people had control of the web services.</p> <p>I feel like my solution is going to end up using reflection to somehow check and see if an expected method exists, and then call that method on whichever web service's class I'm working with.</p>
<c#><web-services><generics><types>
2010-11-09T19:36:05.427
30,084
1
0
1,936
3
1
0
stackoverflow.com
Python basics- why aren't the contents of my file printing?
<p>I'm running this from eclipse, the file name I'm working with is ex16_text.txt (yes I type it in correctly. It writes to the file correctly (the input appears), but the "print txt.read()" doesn't seem to do anything (prints a blank line), see the output after the code:</p> <pre><code>filename = raw_input("What's the file name we'll be working with?") print "we're going to erase %s" % filename print "opening the file" target = open(filename, 'w') print "erasing the file" target.truncate() print "give me 3 lines to replace file contents:" line1 = raw_input("line 1: ") line2 = raw_input("line 2: ") line3 = raw_input("line 3: ") print "writing lines to file" target.write(line1+"\n") target.write(line2+"\n") target.write(line3) #file read txt = open(filename) print "here are the contents of the %s file:" % filename print txt.read() target.close() </code></pre> <p>Output:</p> <p>What's the file name we'll be working with?ex16_text.txt we're going to erase ex16_text.txt opening the file erasing the file give me 3 lines to replace file contents: line 1: three line 2: two line 3: one writing lines to file here are the contents of the ex16_text.txt file:</p>
<python>
2010-11-11T23:58:25.747
85
1
3
2,615
2
0
0
stackoverflow.com
Does Exhanger.exchange block?
<p>Does exchanger.exchange() cause thread to move to blocking state. In java docs, it is mentioned that the first thread that reaches the exchanger will be 'waiting' for the second one.</p>
<java><multithreading>
2010-12-11T23:53:56.973
23
0
0
226
4
0
0
stackoverflow.com
MVVM Model for a collection of models?
<p>As I'm learning the MVVM pattern, I've hit a question. I'm building a sample notes application. In this application you can see a list of notes with NotesView. The DataContext of NotesView is NotesModelView. </p> <p>My question is should NotesModelView contain a collection of NoteModel or NoteModelView (which contains a NoteModel)?</p>
<mvvm>
2010-12-15T07:51:32.387
21
0
2
708
4
0
1
stackoverflow.com
How can i make writes to a gzip file from my perl script non-blocking?
<p>I'm currently writing a script that takes a database as input and generates all valid combinations from the 10+ tables, following certain rules. Since the output is pretty darn huge, i'm dumping this through gzip into the file, like this:</p> <pre><code>open( my $OUT, '|-', "gzip &gt; file" ); for ( @data ) { my $line = calculate($_); print $OUT $line; } </code></pre> <p>Due to the nature of the beast though i end up having to make hundreds of thousands of small writes, one for each line. This means that between each calculation it waits for gzip to receive the data and get done compressing it. At least i think so, i might be wrong.</p> <p>In case I'm right though, I'm wondering how i can make this print asynchronous, i.e. it fires the data at gzip and then goes on processing the data.</p>
<perl><nonblocking>
2010-12-28T10:37:21.190
2,396
1
2
260
3
0
0
stackoverflow.com
How to make a dynamic select column on MySQL for my search
<p>Example $_GET on my search form.</p> <ul> <li><code>$_GET['s']</code> = keyword</li> <li><code>$_GET['c']</code> = category</li> <li><code>$_GET['r']</code> = region</li> <li><code>$_GET['t']</code> = type</li> </ul> <p>Example if statement :</p> <pre><code>if(isset($s)) { $s = "title LIKE '%{$keyword}%"; } if(isset($c)) { $c = " AND category='{$category}'"; } if(isset($r)) { $r = " AND region='{$region}'"; } if(isset($t)) { $t = " AND type='{$type}'"; } </code></pre> <p>Then MySQL query :</p> <pre><code>$select = "SELECT * FROM ads WHERE $s.$c.$r.t AND status='1'"; </code></pre> <p>Question :</p> <p>How to make my <code>$select</code> can be dynamic? Current way is only worked if all input is not empty. Other than that give me syntax error. :P</p> <p>Let me know..</p>
<php><mysql>
2010-12-30T18:06:38.487
1,512
1
0
740
5
0
0
stackoverflow.com
What is the fastest Android SDK setup?
<p>What is the best platform and setup for running Android SDK? It is so slow that I cannot stay focused on it.</p> <p>If I had any hardware resources at my disposal and cost wasn't an issue, what should I do?</p> <p>Also, is there some sort of cloud SDK host that can provide a faster experience. (Security isn't a concern. Just need to debug web sites.)</p>
<android><android-emulator>
2011-01-10T19:15:04.513
18,147
1
0
635
2
3
1
stackoverflow.com
Passing array to method in C#
<p>I guess it's rather stupid question. I want to pass an array argument to method by value, not by link, i.e. I want to make a copy of object to prevent changing of argument inside the method. Thanks in advance.</p>
<c#>
2011-01-10T20:42:39.777
77
0
2
18,099
4
1
0
stackoverflow.com
Disable Lock Screen
<p>I am looking for a way to replace the stock lock screen (with an app, not a rom). What is the best way to do it, for a start to disable the lock screen on as much devices as possible? Thanks!</p>
<android>
2011-01-15T20:21:11.943
789
1
23
36,825
4
1
12
stackoverflow.com
Multilingual implementation in buddypress
<p>i’m working on the wordpress and buddypress. I was easily implemented the multilingual for wordpress but it’s really very hard to implement for buddypress.</p> <p>I gone through most of the forums, most of the people said buddypress multiligual plugin only works for Wordpress Multisite. Is it any way to enable the multilingual for buddypress or already any plugin exists for this task??</p> <p>I tried the buddypress multilingual lpugin too. But it's not supporting!! Please leave your suggestions!</p>
<php><wordpress><multilingual><buddypress>
2011-01-21T12:32:19.603
2,595
1
0
723
1
0
0
stackoverflow.com
to build a "quick" web backend for a mobile application, Ruby on Rails or Django?
<p>I am currently in the process of building a mobile app, on iphone. I want the app to be able to connect to a web back-end server to manage user logins and to and retrieve user data. Which would be quicker/simpler to build that type of back-end RoR or Django?</p>
<ruby-on-rails><ruby><django><mobile>
2011-01-25T03:03:17.643
5,341
1
0
1,288
3
1
0
stackoverflow.com
Switch from Files to DB sessions on old magento version
<p>I have a client running an old version of magento. It appears that there is no session_save in the local.xml, like in newer versions of magento. Any idea where to change this setting in the older version of magento: The version is 1.1.4</p> <p>Thanks!</p>
<magento>
2011-02-03T02:35:24.933
1,723
1
0
301
1
0
0
stackoverflow.com
sql syntax with arithmetic
<p>I am getting a syntax error and I am not sure what I am doing wrong, any help would be much appreciated. </p> <pre><code> INSERT INTO mashstp ( mid, name, time, temp, desc ) VALUES ( '#mid#', '#mashstXML.mash_step.name.xmltext#', '( #mashstXML.mash_step.step_temp.xmltext# * 1.8 ) + 32 F', '#mashstXML.mash_step.description.xmltext#') </code></pre>
<sql><xml><coldfusion>
2011-02-06T21:08:48.890
1,266
1
0
106
3
3
0
stackoverflow.com
use session and still be ajax?
<p>i am using ajax and jsp, but instead of using out.write() in jsp side, i do write the response string into session o object, then i open a colorbox panel and write the session value into page.</p> <p>is doing this make my site not-ajax? </p> <p>i understand that using querystring is an other way around, what is the difference between my solution and querystring solution?</p> <p>thnx </p>
<ajax><jsp><colorbox>
2011-03-03T17:58:30.743
4,416
1
0
197
1
0
0
stackoverflow.com
performance and flexibility question - how should i categorize my XML files database? using XML or directories?
<p>I am not sure this is the question for this forum.</p> <p>I am creating a program that uses between 500-1500 files, I would like to know which way is the preferable way to use in-order to categorize my DB.</p> <p>I am currently categorizing my files from inside the xml files by having a tag:</p> <pre><code>&lt;Category&gt;Basic&lt;/Category&gt; </code></pre> <p>this gives me high flexibility of controling the xml files. though it removes a lot of performance, gives me higher space usage, less possibility to create more features (due to low performance).</p> <p>What i thought i should do is to create a folder called "Basic" (e.g) and store my "Basic" categorized XML files in there - which will give me more performance (etc..) though less flexibility.</p> <p>should I use folders instead?</p> <p>Thanks in advanced,</p> <p>Din.</p>
<c#><performance><flexibility>
2011-03-08T12:36:35.433
1,081
0
0
101
1
3
0
stackoverflow.com
Is data access in a 16x16 array faster than a 256x256 array?
<p>I was working upon something, and stumbled across this hurdle while programming. Is data access in a 16x16 array faster than a 256x256 array? The only thing that created doubt in my mind is that modern day computers can access data randomly.</p>
<arrays>
2011-03-10T12:26:25.693
979
1
0
105
1
0
0
stackoverflow.com
Unusual behaviour of text field .Clear text field data on click event of button
<p>When user click on button , I want to clear text field. How can i do this? </p> <p>My code is as follows =></p> <pre><code>textFieldName.text = nil; textViewAddress.text = nil; </code></pre> <p>But this code is not clearing the text field, but it clears the textView. Also when i use backspace button from keyboard of iphone it is not clearing textfield. If i write something in textfield it starts writing on top of existing characters. </p> <p>Please help me friends. Thanks</p>
<iphone><uitextfield>
2011-03-18T12:46:35.987
2,739
1
0
622
1
2
0
stackoverflow.com
Function Overloading
<p>In C++, Why function overloading not implemented on the basis of return type?</p>
<c++>
2011-03-31T10:41:42.270
2,833
0
1
398
5
1
0
stackoverflow.com
Does HttpWebRequest Obey robots.txt in .Net?
<p>I am creating a tool for Web Developers which will 'scan' the HTML on their site. </p> <p>This requires my Asp.Net application to download a page from their site.</p> <p>To protect from abuse, I want to make sure I obey robots.txt, among other methods.</p> <p>Does HttpWebRequest do this already? Or is there an open source implementation I can use to validate a robots.txt file given a user-agent string?</p>
<.net><web-crawler><robots.txt>
2011-04-01T01:14:27.233
1,650
1
2
770
1
0
0
stackoverflow.com
How to get tab's content's height and width in android?
<p>I want to get the tab content i.e. framelayout's height and width in the first tab's activity. But it always returns 0. I know that we cannot call getHeight() or getMeasuredHeight() in onCreate() because the view isnt drawn yet, but then when to call it ? In activity I dont have access to onDraw or onMeasure method, so how and when can I access the height and width ?</p>
<android><android-layout><android-tabhost>
2011-04-30T13:34:11.623
2,263
1
0
1,912
1
1
0
stackoverflow.com
How do I animate on hover or timeout with jquery/javascript?
<p>So I want to animate and display a menu on an element hover or when certain time has passed without a hover.</p> <p>This I what I've got but it doesn't work.</p> <pre><code>var didAnimationStart = 0; $(document).ready(function() { $('#logoi').hover(startAnimation()); var t = setTimeout("if (didAnimationStart==0) startAnimation();",10000); }); function startAnimation() { didAnimationStart = 1; $('.linea').animate({ width: "93%", }, 3000 ); $('.menu-txt').animate({ opacity: "1", }, 2500 ); } </code></pre>
<javascript><jquery><css><hover>
2011-05-25T03:25:44.187
4,946
1
1
440
1
1
0
stackoverflow.com
Update iframe with php page after ajax post
<pre><code>$("form#update").submit(function() { var formData = $("form#update").serialize(); $.ajax({ type: "POST", url: "graph.php", data: formData + "&amp;criteria=" + critSelected, success: function(data){ $('div.graph').fadeOut(function(){$('div.graph').html(data).fadeIn();}); } }); return false; }); </code></pre> <p>I have this script that responds to a form submit. graph.php will be a full html page I would like to display without loading the entire page again. Is there any way for me to change the source of an iframe on the same page as the form to graph.php (say it's inside the div 'graph')? I've tried placing $('iframe').attr('src', url); in the success function to no avail. Help is appreciated. Thanks!</p>
<php><jquery><ajax><iframe>
2011-05-26T19:38:37.403
582
1
0
2,307
2
0
0
stackoverflow.com
Missing values of map(key, value) in Freemarker when access randomly?
<p>I'm having a strange problem with Freemarker map. My example is meant to display a list of cars with the associated owners' name:</p> <p><code>Car(id,name,ownerId)</code></p> <p><code>User(id,name)</code></p> <p>Notice that the <code>ownerId</code> is the only bridge I can access <code>owner</code> from <code>car</code>. For some reasons, we don't create hibernate relation for these domains.</p> <p>I added to model a list <code>carList</code> of <code>Car(id,name,ownerId)</code> and a <code>Map&lt;String, String&gt; map</code> which contains <code>(userId, name)</code> of <strong>all</strong> users.. It's because Freemarker only accept Map with key of type String.</p> <p>While looping through the carList, I try to get the owner name through the map.</p> <pre><code>&lt;#list carList as car&gt; ${map?values[car.ownerId]} - ${car.ownerId}&lt;br/&gt; &lt;/#list&gt; </code></pre> <p>But the strange thing is that the result I got:</p> <pre><code>Tom - 1 Jerry - 2 Jerry - 2 David - 4 - 5 - 5 </code></pre> <p>The name of user "5" is missing, but it exists in the database. Besides, when I loop through the map the result is right:</p> <pre><code>&lt;#list map?keys as key&gt; ${key} - ${map[key]} &lt;/#list&gt; </code></pre> <p>The results:</p> <pre><code>1 - Tom 2 - Jerry 3 - Mickey 4 - David 5 - Mike </code></pre> <p>The missing name happens for only a specific user. Do anyone know what is missing here?</p>
<spring-mvc><freemarker>
2011-06-02T08:33:30.710
10,586
1
0
3,065
2
1
0
stackoverflow.com
AS3 - Pausing on loss of focus
<p>I'm working on a Flash mobile game. If the app loses focus (a call comes in for example) I need the game timer to stop until focus is restored. Here is my current code but I'm getting a "Argument count mismatch error" onDeactivate(). Expected 0, got 1.</p> <p>Here is the related code, I think:</p> <pre><code>addEventListener(Event.ACTIVATE, onActivate); addEventListener(Event.DEACTIVATE,onDeactivate); public function onActivate():void { addEventListener(Event.ENTER_FRAME, showTime); } public function onDeactivate():void { removeEventListener(Event.ENTER_FRAME, showTime); } </code></pre> <p>I'm getting the error when testing in flash and I close the window. What am I missing? Thanks for any help you can offer.</p>
<actionscript-3><timer><focus>
2011-06-04T18:01:42.887
77
1
0
1,059
1
1
0
stackoverflow.com
How to display a custom list in ASP.NET webform
<p>I am working on an ASP.NET webform that functions similar to a blog. On the main form I want to display a list of the recent post titles and under each the first 75 characters of the post text. What would be a good control to use to display these titles/descriptions? Should I just dynamically add Labels into an on the page or is there a better way?</p>
<asp.net><label><blogs><dynamic-data>
2011-06-08T03:50:24.007
9,766
0
0
4,353
4
2
0
stackoverflow.com
Rolling back a merge in TFS2008 with tfpt.exe
<p>I need to roll back a merge operation in TFS2008. The branch will need to be merged at a later date. I know I can use the tfpt.exe rollback operation on the trunk to restore the files modified by the merge, but rollback doesn't modify the merge information so future merges from the branch into the trunk won't restore the changes undone by the rollback. Also, merges from the trunk into the branch will risk overwriting changes in the branch.</p> <p>I've probably left out quite a bit of necessary information, so I'll update the question as needed.</p> <p>What is the best way to undo the merge, and still be able to merge all changes in at a later date?</p> <p>Thanks.</p>
<merge><branch>
2011-06-23T17:11:27.413
1,358
1
1
314
1
0
0
stackoverflow.com
NSlog returns NULL for NSMutableDictionary from different class
<p>Really confused with why this is not working.</p> <p>PracticeTeamSelection.m</p> <pre><code>NSLog(@"Practice Roster : %@", practiceRoster); </code></pre> <p>PracticeActual.m</p> <pre><code>PracticeTeamSelection *teamSelectionViewController = [[PracticeTeamSelection alloc]init]; NSLog(@"practice List : %@", [teamSelectionViewController practiceRoster]); </code></pre> <p>So practiceRoster is an NSMutableDictionary, and when i run the first bit of code I am returned exactly what i am supposed to be, however when i run the next bit of code in PracticeActual.m it returns (Null).</p> <p>in my PracticeTeamSelection in the .h I do the following with the proper synthesize</p> <pre><code>@property(nonatomic,retain) NSMutableDictionary *practiceRoster; </code></pre> <p>and in the PracticeActual.m in include</p> <pre><code>#import "PracticeTeamSelection.h" </code></pre> <p>But maybe it is being release somewhere with out my knowledge. Does anyone have any thoughts?</p> <p>Thanks</p>
<iphone><objective-c><ios><xcode>
2011-06-28T22:16:25.027
2,664
1
0
665
2
6
0
stackoverflow.com
How to add minimize button for a userform?
<p>I need to create a userform for my excel vba program., But how can I add "minimize" button for this userform? Thanks.</p>
<vba><excel>
2011-07-04T04:22:29.070
3,643
1
4
19,946
2
0
2
stackoverflow.com
Generate dynamic Flex-ComboBoxes by Class-Properties
<p>I have an Flex-Object with for example 3 properties.</p> <p>myObj.prop1 myObj.prop2 myObj.prop3</p> <p>I like to generate 3 Comboboxes to show the data. No problem if I do it hardcoded in sourcecode.</p> <p>But how can I find the prop1 to prop3 at runtime?</p> <p>If next time I have 5 properties with different name it should generate 5 combos.</p> <p>Thanks for any help Jan</p>
<apache-flex>
2011-07-06T14:35:53.957
33
1
1
281
1
1
0
stackoverflow.com
SQLite Date/Time Manipulation
<p>I'm looking at doing some basic date/time manipulation using SQLite however the documentation isn't very clear. All I want to do is add some minutes that already exist in the same row in the database. I have a datetime, and then a duration. So I want to get the start date/time as well as the end date/time. I've looked at something along these lines:</p> <p>I see you can use datetime, but you have to specify a 'localtime' which doesn't seem to work.</p> <p>Basically, I want the equivalent of DATEADD in SQL Server.</p>
<sqlite>
2011-07-09T08:46:20.157
17,712
1
6
9,537
2
0
1
stackoverflow.com
VB6 - what different of .row and .rows in datagridview
<p><code> If LooseFlexGrid.Row = LooseFlexGrid.Rows - 1 Then</p> <p>....</p> <p>end if </code> wat is different of .row &amp; .rows ??</p>
<vb.net><vb6>
2011-07-22T08:27:32.360
21
1
0
1,312
1
1
0
stackoverflow.com
fuzzy searching an array in php
<p>after i searched i found how to do a fuzzy searching on a <strong>string</strong> </p> <p>but i have an array of strings </p> <p><code>$search = {"a" =&gt; "laptop","b" =&gt; "screen" ....}</code></p> <p>that i retrieved from the DB MySQL</p> <p>IS there any php class or function that does fuzzy searching on an array of words</p> <p>or at least a link with maybe some useful info's</p> <p>i saw a comment that recommend using PostgreSQL</p> <p>and it's fuzzy searching capability but </p> <p>the company had already a MySQL DB </p> <p>Is there any recommendation ??</p>
<php><fuzzy-search>
2011-08-01T10:03:24.737
1,804
1
4
6,013
2
0
4
stackoverflow.com
How to send a session scoped attribute through jquery ajax call
<p>I have an issue I have this jQuery code:</p> <pre><code> $(document).ready(function(){ $("#follow").click(function(){ $.ajax({ type: 'POST', url:'/tweety-0.0.1-SNAPSHOT/twitter/tiles/follow', data:{ searchedUser: $('#searchedUser').val() } }) }) }) </code></pre> <p>this piece of code get hidden id and send it's value to the following method in my controller:</p> <pre><code>@RequestMapping(value="/follow",method=RequestMethod.POST) public @ResponseBody void followUser(@RequestParam("searchedUser") String userToFollow, @ModelAttribute("user") User user) { if(userToFollow.equals(user.getUsername())){ // do nothing }else{ service.followUser(userToFollow,user.getUsername()); } } </code></pre> <p>I want to send a session scoped attribute through the previous ajax call. Any clue on how doing that??</p>
<jquery><ajax><spring><spring-mvc>
2011-08-02T08:02:29.197
1,346
1
1
4,213
2
0
0
stackoverflow.com
Android Thread modify EditText
<p>I am having a problem with modifying EditText in another function started by the thread:</p> <pre><code>Thread thRead = new Thread( new Runnable(){ public void run(){ EditText _txtArea = (EditText) findViewById(R.id.txtArea); startReading(_txtArea); } }); </code></pre> <p>my function is as follows:</p> <pre><code>public void startReading(EditText _txtArea){ _txtArea.setText("Changed"); } </code></pre> <p>It always force closes while trying to modify the edittext. Does someone know why?</p>
<java><android><multithreading><android-edittext>
2011-08-11T15:01:15.173
1,611
1
4
9,314
5
0
1
stackoverflow.com
Problem after installing wxruby, no suitable image found, on Mac OS 10.6 & 10.7 & Red-Hat
<h2>I am trying to install wxruby. I've tried gem install wxruby, gem install wxruby-19-2.0.0 downloading the wxruby-2.0.1-universal-darwin-9.gem. I tried the arch -i386 ruby change and got an error on arch of unsupported architecture (on Snow Leopard and Lion).</h2> <p>I've tried it on Mac OS X Lion and Snow Leopard. Under ruby 1.8.7 and 1.9.2. And also tried on Linux (RED-HAT). All gave the same error. When I tried to compile it I got a swig version error which I fixed and then ton's of errors in the code of not finding size_t and other items. I tried a new install of wxwidgets (on Snow Leopard) and that did not help.</p> <p>It always installs fine but when I run some test code I get: /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in <code>require': dlopen(/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError) /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in</code>require' from /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in <code>&lt;top (required)&gt;' from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in</code>require' from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in <code>rescue in require' from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in</code>require' from ./test_wxruby.rb:3:in `'</p> <p>It does the same thing when I use irb require 'rubygems' require 'wx'</p> <p>Please help. I really want to use this. My other cross-platform option is JRuby.</p>
<user-interface><rubygems><wxruby>
2011-08-12T22:47:29.837
21
0
2
812
1
0
0
stackoverflow.com
iphone is there a way to create a view over the tabbar?
<p>I have an application that pulls up a login page when it first starts. This login page goes over the application and does not let anyone through until they've logged in. I also have a settings tab on my main application that needs to lead back to this login screen. Right now it displays the login screen with the tab bar over it. Is there a way to get the login view over the tab bar?</p>
<iphone>
2011-08-13T17:51:37.077
69
0
1
93
3
0
0
stackoverflow.com
CakePHP where can I put this code for reuse?
<p>I have a model called <strong>PageMetaData</strong> that contains a <em>title</em> and a <em>description</em>. This is to be tied to any other model and to be used as the title tag and meta description for the page.</p> <p>So I have a model called Brand. Brand has a field called page_meta_data_id and Brand <em>belongsTo</em> PageMetaData</p> <p>Now on the view for Brand I can run this code:</p> <pre><code>if(!empty($data['PageMetaData']['title'])) { $this-&gt;set('title_for_layout', $data['PageMetaData']['title']); } else if(!empty($data['Brand']['name'])) { $this-&gt;set('title_for_layout', $data['Brand']['name']); } if(!empty($data['PageMetaData']['description'])) { echo $this-&gt;Html-&gt;meta('description', $data['PageMetaData']['description'],array('inline'=&gt;false)); } else if(!empty($data['Brand']['description'])) { echo $this-&gt;Html-&gt;meta('description', $data['Brand']['description'],array('inline'=&gt;false)); } </code></pre> <p>And if a PageMetaData has been associated to the current Brand and has a value for title, it will set that as the page title, otherwise if the brand has a field called name it will us that. Same for description.</p> <p>The problem is I don't want to have to diplicate this code in every view for every model that uses PageMetaData.</p> <p>I cannot figure out where I can abstract the code to, to avoid duplication.</p> <p>I cannot put it in a Behavior or a Helper because you cannot set the title from either. I cannot put it in a Component because it cannot access the data found from the model.</p> <p>Is there somewhere I can put this code for reuse?</p>
<cakephp><cakephp-1.3>
2011-08-18T15:47:52.030
54,256
1
1
139
2
0
0
stackoverflow.com
Java: Force subclasses to override methods of the Superclass
<p>How can I write a method and force the subclasses to override this method. In Eclipse it should show in the Quick-Fix Dialog: "Add unimplemented methods".</p> <p>Thanks</p>
<java><methods><overriding><superclass>
2011-09-11T20:26:32.217
189
1
13
13,936
5
0
0
stackoverflow.com
tomcat hbase jar inclusion
<p>I am trying to setup a simple hbase webapp using tomcat. To my knowledge I understand that i need to include the hbase jar, and hadoop jar in order to use hbase along with the zoopkeeper jar.</p> <p>The problem is when I include the hbase jar in my maven pom, it downloads all sorts od transitive dependent jars that I dont want (e.g. jetty, servlet-api etc) because hbase itself has its own in built jetty web app that is used for monitoring. I believe this conflicts with tomcat packaging and start up that results in my having the following exception:</p> <pre><code>HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet jersey-serlvet threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:619) root cause com.sun.jersey.api.container.ContainerException: No WebApplication provider is present com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebApplicationFactory.java:69) com.sun.jersey.spi.container.servlet.ServletContainer.create(ServletContainer.java:391) com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.create(ServletContainer.java:306) com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:607) com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210) com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556) javax.servlet.GenericServlet.init(GenericServlet.java:212) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:619) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.28 logs. </code></pre> <p>When I comment out the hbase jar from my pom (all the dependent jars for hbase vanish too as expected), and tomcat deploys fine and I can access my rest/spring servlet.</p> <p>I have tried to use exclusions to excluse hbase direct dependencies with the following:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.apache.hbase&lt;/groupId&gt; &lt;artifactId&gt;hbase&lt;/artifactId&gt; &lt;version&gt;0.90.3-cdh3u1 &lt;/version&gt; &lt;exclusions&gt; &lt;exclusion&gt; &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt; &lt;artifactId&gt;servlet-api&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt; &lt;artifactId&gt;jetty-util&lt;/artifactId&gt; &lt;!-- &lt;version&gt;1.4&lt;/version&gt; --&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt; &lt;artifactId&gt;jsp-2.1&lt;/artifactId&gt; &lt;!-- &lt;version&gt;6.1.14&lt;/version&gt; --&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.apache.thrift&lt;/groupId&gt; &lt;artifactId&gt;thrift&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;com.google.guava&lt;/groupId&gt; &lt;artifactId&gt;guava&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.jruby&lt;/groupId&gt; &lt;artifactId&gt;jruby-complete&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt; &lt;artifactId&gt;jsp-api-2.1&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt; &lt;artifactId&gt;servlet-api-2.5&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;commons-httpclient&lt;/groupId&gt; &lt;artifactId&gt;commons-httpclient&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;commons-lang&lt;/groupId&gt; &lt;artifactId&gt;commons-lang&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt; &lt;artifactId&gt;avro&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt; &lt;artifactId&gt;jsp-2.1&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;tomcat&lt;/groupId&gt; &lt;artifactId&gt;jasper-compiler&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;tomcat&lt;/groupId&gt; &lt;artifactId&gt;jasper-runtime&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;com.google.protobuf&lt;/groupId&gt; &lt;artifactId&gt;protobuf-java&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;javax.servlet&lt;/groupId&gt; &lt;artifactId&gt;servlet-api&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;exclusion&gt; &lt;groupId&gt;log4j&lt;/groupId&gt; &lt;artifactId&gt;log4j&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;/exclusions&gt; &lt;/dependency&gt; </code></pre> <p>But to no avail I still have the problem.</p> <p>So has does anyone have an exiting pom where they have including hbase and hadoop and somehow got tomcat to work perhaps using jersey too?</p> <p>I know the above is not detailed I will add more details. I will paste the maven full pom.</p> <p>thanks so much</p>
<tomcat><maven><jersey><hbase>
2011-09-18T09:45:34.913
51
0
1
1,429
1
5
1
stackoverflow.com
Hibernate composite-key and foreign generator
<p>I'm trying to make a foreign key of a child class automatically get the id of it's parent.</p> <p>Child class:</p> <pre><code>public class Child implements Serializable { // primary (composite) key private int parentId; // I want this to be set automatically private String name; // random value private String val; public Child(String name, String val) { this.name = name; this.val = val; } public void setParentId(int id) { [...] } </code></pre> <p>Parent xml:</p> <pre><code>&lt;map name="children" inverse="true" lazy="true" cascade="all,delete-orphan"&gt; &lt;cache usage="nonstrict-read-write"/&gt; &lt;key column="parent_id"/&gt; &lt;index column="child_name" type="string"/&gt; &lt;one-to-many class="myPack.Child"/&gt; &lt;/map&gt; </code></pre> <p>Child xml:</p> <p></p> <pre><code>&lt;class name="Child" table="child_tbl" lazy="true"&gt; &lt;composite-id&gt; &lt;key-property name="ParentId" type="int" column="parent_id"/&gt; &lt;key-property name="Name" column="name" type="string"/&gt; &lt;generator class="foreign"&gt; &lt;param name="property"&gt;ParentId&lt;/param&gt; &lt;/generator&gt; &lt;/composite-id&gt; &lt;property name="Val" blablabla [...] </code></pre> <p>However it fails with:</p> <blockquote> <p>HibernateException: Unable to resolve property: ParentId</p> </blockquote> <p>Does Hibernate support foreign generators on composite-ids? Or is the fact that the parent class holds a Map an issue?</p>
<hibernate><generator>
2011-10-11T14:29:52.393
817
0
0
5,020
1
0
0
stackoverflow.com
android about Multi-thread process
<p>I have many tasks,and I should use Multi-thread to process them ,what's the best solution,?the mean is I can use The least number of threads but process the most task With the fastest time.</p>
<android><handle>
2011-10-18T08:24:42.927
45
1
0
942
4
0
0
stackoverflow.com
Is there a way to prevent page flickering/stuttering when scrolling with ScrollTo script?
<p>I am using <a href="http://flesler.blogspot.com/2009/05/jqueryscrollto-142-released.html" rel="nofollow">Ariel Flesler's ScrollTo script</a> on <a href="http://nickputman.com/test/" rel="nofollow">this page</a>. I have two links at the bottom of the page that scroll to the top of the page (one also opens a contact form). I am noticing that at the start of the scroll there is a flickering/stuttering towards the top of the page, and I am wondering if there is anything I can do to prevent this, either by amending the script, or using another scrolling script. I'd be glad of any advice.</p> <p>Thanks,</p> <p>Nick</p>
<javascript><jquery><scroll><scrollto>
2011-10-19T09:26:40.957
4,148
1
2
1,940
1
0
0
stackoverflow.com
Are multiple domain can improve images loading speed
<p>I read this article <a href="http://www.websiteoptimization.com/speed/tweak/parallel/" rel="nofollow noreferrer">Optimize Parallel Downloads to Minimize Object Overhead</a> and write a test demo But the result is not I expected,look at the waterfall figure multiple domain's images indeed parallel download but the total time no less.</p> <p>Who can tell me why,thanks</p> <p><strong>multiple domain image download</strong></p> <p><img src="https://i.stack.imgur.com/QMGmh.png" alt="multiple domain"></p> <p><strong>single domain image download</strong></p> <p><img src="https://i.stack.imgur.com/eemah.png" alt="single domain"></p>
<http><web-optimization>
2011-11-07T08:20:52.967
1,174
1
1
378
1
0
0
stackoverflow.com
Smaller UIView in UIScrollView to stop touches
<p>I've read the various threads on this but none have given me the exact solution I need, but they have got me pretty close</p> <p>I have the topmost UIViewController which contains a paging UIScrollingView (created via the xib)</p> <p>The UIScrollingView loads an array of dummy viewcontrollers which are swapped for various viewControllers as the user swipes through the pages.</p> <p>One of these subviews contains a bunch of sliders - the usual problem: if the user misses a slider slightly they scroll the page instead.</p> <p>Within the subview I placed a UIView behind the sliders partially covering the screen: 'uiviewblocker'</p> <p>The idea is that this 'uiviewblocker' eats any touches in the immediate area around the sliders, but swipes outside the uiview are handled by the parent UIViewController. I subclassed the UIView 'uiviewblocker' to a duplicate UIViewController 'MyView' so I can detect it.</p> <p>I've got as far as...</p> <p>The parent UIScrollView:</p> <pre><code>scrollView.delaysContentTouches = NO; </code></pre> <p>The subview UIViewController</p> <pre><code>-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { NSLog(@"touchesBegan"); //[self.nextResponder touchesBegan: touches withEvent:event]; UIView *touchView = [[touches anyObject] view]; if ([touchView isKindOfClass:[MyView class]]) { NSLog(@"funky shit"); [super touchesBegan:touches withEvent:event]; //[self.delegate touchesBegan:touches withEvent:event]; //[self touchesBegain:touches withEvent:event]; // View does not respond: crashes //UIView *parent = self.view.superview; //[parent setCanCancelContentTouches:YES]; // UIView does not respond //UIScrollView * parentScrollView = (UIScrollView*)self.superview; // Superview not in structure } else { NSLog(@"normal shit"); } } </code></pre> <p>So now I can detect when the user is touching the safety area UIview by testing for it's class 'MyView' but I can't work out how to either tell the parent UIScrollView to abort or just the touch there and then</p>
<objective-c><ios><uiscrollview><uitouch><uiscrollviewdelegate>
2011-11-11T16:11:55.573
1,676
1
2
802
2
1
1
stackoverflow.com
SVG in the Android Browser
<p>I know it's not supported natively, but are there any JS Shims that render into a canvas object or something that would allow me to render SVG on the native android browser? (Not Opera, etc since I'd like to avoid having the user need to install another browser)</p>
<javascript><android><canvas><svg>
2011-11-14T17:50:09.887
956
1
7
2,974
1
1
2
stackoverflow.com
Create code first poco classes from database
<p>I know that I can create the POCO files from .edmx, but this only give's you a part of the code, because if you are going to use code first approach you need to provide more info to the POCO clases for example the key and foreign key by annotations or mapping, Now I was wondering , if exit's some way about how can I created this POCO classes with the annotations from a existing database. </p>
<c#><entity-framework-4.1><ef-code-first>
2011-11-16T21:33:54.847
17,394
1
3
2,035
2
0
1
stackoverflow.com
mySQL delete w/ join or subquery
<p>I have a select query which works:</p> <pre><code>SELECT actions.id FROM actions LEFT JOIN users ON users.id = actions.user_id WHERE users.id is null; </code></pre> <p>And I wanted to delete these records. I tried changing the select line to "DELETE" which produced an error. I also tried a subquery:</p> <pre><code>DELETE FROM actions WHERE id IN ( SELECT actions.id FROM actions LEFT JOIN users ON users.id = actions.user_id WHERE users.id is null ); </code></pre> <p>Both attempts cause errors. While I've already solved the problem via PHP, it seems like this ought to be something the database can do with a single command. Is there a way?</p> <p>The query is basically selecting all the rows in <code>actions</code> that do not have a corresponding entry in <code>users</code> ( the tables in question are now using foreign keys so this issue won't happen again ).</p>
<mysql>
2011-11-18T16:48:32.003
5,170
1
3
1,072
3
0
1
stackoverflow.com
Proper exception to raise if None encountered as argument
<p>What is the "proper" exception class to raise when one of my functions detects <code>None</code> passed where an argument value is required? For instance:</p> <pre><code> def MyFunction(MyArg1, MyArg2): if not MyArg2: raise ?Error? </code></pre> <p>I think I've seen <code>TypeError</code> used here (and it's true that I'm receiving a <code>NoneType</code> where some other type is expected) but that doesn't strike me as quite right for this situation where I think the Exception could be more explicit.</p>
<python><exception>
2011-11-28T14:45:50.573
48,002
1
50
70,433
5
3
4
stackoverflow.com
Want to create an image of words that appear the most
<p>I want to create one of these </p> <p><a href="http://images.google.com/imgres?q=words%20that%20appear%20the%20most&amp;hl=en&amp;biw=1366&amp;bih=624&amp;gbv=2&amp;tbm=isch&amp;tbnid=K7A_A7P6ZW_DJM%3a&amp;imgrefurl=http://freelancetheology.com/2011/08/29/1-john-chapter-2-%25E2%2580%2593-if-you-know-god-then-you%25E2%2580%2599ll-love-each-other/&amp;docid=9JyFjFZKPfMbqM&amp;imgurl=http://freelancetheology.com/wp-content/uploads/2011/08/1-John-2-wordleweb.jpg&amp;w=448&amp;h=303&amp;ei=heTeTr7wD6n20gGPqt2tBw&amp;zoom=1&amp;iact=hc&amp;vpx=368&amp;vpy=152&amp;dur=2052&amp;hovh=185&amp;hovw=273&amp;tx=116&amp;ty=94&amp;sig=110825066536887775144&amp;page=1&amp;tbnh=120&amp;tbnw=178&amp;start=0&amp;ndsp=18&amp;ved=1t:429,r:1,s:0" rel="nofollow">Click To See Image</a></p> <p>Im going to parse Html from a website and want to create they above with the words that appear most commonly. Are their any libraries I can use or can someone point me in the right direction- Thanks Community!</p>
<html><image><html-parsing>
2011-12-07T04:02:01.087
1,539
1
0
37
1
0
0
stackoverflow.com
how to add class to razor form and give padding?
<pre><code> @using (Html.BeginForm()) { @Html.TextBoxFor(m =&gt; m.Name, new { @Value = "Name" }) @Html.TextBoxFor(m =&gt; m.Email, new { @Value = "Email" }) &lt;input type="submit" value="Go" /&gt; } </code></pre> <p>how do i add a css class to this and add padding? I have the following css i wish to add to try pad it a bit</p> <pre><code> .newsletterform { color:black; padding-left:20px; } </code></pre>
<css><asp.net-mvc-3><razor>
2011-12-08T10:32:39.777
27,461
1
9
21,237
1
0
1
stackoverflow.com
Using HTML agility pack on WP7.5
<p>Is there a reference/guide for using HTML Agility Pack on WP7.5? I tried compiling the source on my VS2010 but I wasn't able to reference the DLL created on my local machine. Basically, I'm looking for a text extractor to obtain the text from a given URL. I understand that the HTML Agility Pack works best. Any ideas/suggestions? Thanks :)</p>
<c#><windows-phone-7><html-agility-pack><windows-phone-7.1>
2011-12-10T06:47:37.713
714
1
4
2,149
2
2
0
stackoverflow.com
Comparing two images - Detect egg in a nest
<p>I have a webcam directly over a chicken nest. This camera takes images and uploads them to a folder on a server. I'd like to detect if an egg has been laid from this image.</p> <p>I'm thinking the best method would be to compare the contrast as the egg will be much more reflective than the straw nest. (The camera has Infrared so the image is partly grey scale)</p> <p>I'd like to do this in .NET if possible.</p>
<vb.net><image-processing>
2011-12-10T19:12:27.687
1,377
1
0
551
1
0
0
stackoverflow.com
How to log Future's underlying Callable
<p>Given this code,</p> <pre><code>Collection&lt;?&gt; callables = ... ExecutorService executorService = ... List&lt;Future&lt;?&gt;&gt; futures = executorService.invokeAll(callables, TIMEOUT, TimeUnit.SECONDS); </code></pre> <p>I'd like to know which of the <code>callables</code> were cancelled (did not finish in time). I know I can query each <code>Future</code> with <code>.isCancelled()</code> but that gives me no information as to which exact <code>Callable</code> was cancelled.</p> <p>One solution would be for <code>Future</code> to implement a <code>toString()</code> method that delegates to the underlying <code>toString()</code> of <code>Callable</code>. Unfortunately, this is not done.</p>
<java>
2011-12-13T02:30:41.047
4,946
1
1
281
1
0
0
stackoverflow.com
Magento 1.6.1: What is options_container?
<p>When I use the Magento product.info API call to get the information of a specific product it always seem to give a field named '<strong>options_container</strong>' with a value '<strong>container2</strong>'.</p> <p>What is it? </p> <p>Don't see it in the GUI control panel when creating the product.</p> <p>And here's some more fields that if someone could enlighten me about, that'd be great:</p> <ol> <li>msrp_enabled</li> <li>msrp_display_actual_price_type</li> <li>msrp</li> </ol> <p>I'm trying to create products via the product.create API call. As I don't know what these fields mean and they all have non-empty values by default (which I can't seem to be able to set in GUI), I don't know what would happen if I leave them blank when creating a product via the product.create API call - or what value I should use for them... Thanks!</p>
<api><magento><e-commerce>
2011-12-21T06:36:29.873
12,160
1
6
6,019
2
0
1
stackoverflow.com
How to map entities using hibernate and an oracle function
<p>I'm trying to map a few entities based on the result of an oracle stored function that return a cursor.</p> <p>My code looks like this:</p> <pre><code>this.getSession().createSQLQuery("{?=call my_pkg.my_func(:myPar1,:myPar2)}") .addEntity(MyTargetClass.class) .setParameter("myPar1",par1) .setParameter("myPar2",par2) .list(); </code></pre> <p>With this code I get the following exception:</p> <p>java.sql.SQLException: Missing IN or OUT parameter at index:: 3</p> <p>How can I tell Hibernate that the missing parameter is a cursor?</p> <p>According to this <a href="http://docs.jboss.org/hibernate/core/3.2/reference/en/html/querysql.html" rel="nofollow">doc</a> it should be possible, but there's no sample code as to actually invoke the function.</p>
<java><oracle><hibernate>
2011-12-21T17:14:52.117
4,330
1
3
1,640
1
0
1
stackoverflow.com
Calculate polar decompostion of a numpy matrix?
<p>The <a href="http://en.wikipedia.org/wiki/Polar_decomposition" rel="nofollow">polar decomposition</a> of a square complex matrix A is a matrix decomposition of the form</p> <pre><code>A = UP, </code></pre> <p>where U is a unitary matrix and P is a positive-semidefinite Hermitian matrix. This differs from the <a href="http://en.wikipedia.org/wiki/QR_decomposition" rel="nofollow">QR Decomposition</a> implemented as <a href="http://docs.scipy.org/doc/scipy/reference/tutorial/linalg.html#qr-decomposition" rel="nofollow">scipy.linalg.qr</a>.</p> <p>How can I find P with numpy/scipy?</p>
<python><matrix><numpy>
2012-01-05T14:55:34.393
693
1
2
1,876
2
1
0
stackoverflow.com
Page jump on span.click()
<p>I have this weird thing happening: when clicking spans in the navigation the content has to switch. Everything works except that when you click a span the page jumps to it (the span will be right at the top then). All I find about page jumps is about anchor tags and return false; but nothing about spans. In my opinion, the switching content can't be to blame because there never is only one div that has display: none (and if that was the case the page should jump to the top instead of jumping to the span, right?) Preventing any actions doesn't seem to work on spans.</p> <pre><code>$("#subnavi span").click(function(){ $("#inner-content div:visible").animate({height: "toggle", opacity: "toggle"}, "slow"); $("#content-"+this.id).animate({height: "toggle", opacity: "toggle"}, "slow"); $("#subnavi span").attr("class", ""); $(this).attr("class", "active"); }); </code></pre> <p>If the explanation was confusing, go here: <a href="http://gaming-siblings.com/v2.0/#news" rel="nofollow">http://gaming-siblings.com/v2.0/#news</a> and click Statistics in the navigation on the left. The page will jump down to the span you just clicked and scroll back a little due to the div's height. Why does it jump to the span?</p> <p>It's probably not weird but reasonable. I just don't get it :-)</p> <p>I've tried this for 2 days now, taking breaks from it because that mostly helps but not this time.</p> <p>Any ideas / solutions? As mentioned return false; or preventDefault() didn't work when I tried (because it's spans I guess).</p>
<jquery><click><html><page-jump>
2012-01-15T10:52:42.310
45
1
2
800
1
0
0
stackoverflow.com
How can I refresh a select option in a form without resulting loss of form input (Django + jQuery)
<p>I have a form that has a dropdown list. However, a user can register a new value (into the database as well) by clicking a button next to it.</p> <p>I managed to register it thru AJAX approach. However, I failed to find a way to refresh the dropdown list so that a user can select the newly inserted value. </p> <p>I tried <code>location.reload(true)</code> but this will erase the existing form inputs. Is there a way for me to just refresh the dropdown list, or refresh without inputs loss?</p> <p>My JQuery looks like this</p> <pre><code>$('#formSupplier').submit(function(e){ $('#divProcessingMessage').show(); $('#divSupplierForm').hide(); $.post('/item/xhr_reg_supplier/',$('#formSupplier').serializeArray(), function(data){ if(data){ alert('Supplier registration successful') $('#divProcessingMessage').hide(); $('#divSupplierForm').show(); //Clear the form's field $('#formSupplier').find(':input').each(function(){ switch(this.type) { case 'password': case 'select-multiple': case 'select-one': case 'text': case 'textarea': $(this).val(''); break; case 'checkbox': case 'radio': this.checked = false; } }); $('#supplier_form').hide(); location.reload(true); } else { alert('Supplier registration failed') } } ); </code></pre> <p>I am using django 1.3.1 framework fyi.</p>
<jquery><python><django><web>
2012-01-29T12:27:30.147
2,898
1
0
2,353
2
2
0
stackoverflow.com
Show soft keybord on edit text in a tab with multiple activities?
<p>I am using multiple activities in my tab activity. There is an edit text field in my first activity under the first tab, but when I move from first activity within the first tab to the second activity and when I go back to my first activity using replaceview property and pressing the hardware back button, my edit text field do not show the softinputkeyboard.</p> <p>What should I do in this? I used onResume this code, but still not working.</p> <pre><code>edittext.requestFocus(); InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(etSearch, InputMethodManager.SHOW_IMPLICIT); </code></pre> <p>help me out in this. Thanks in advance.</p>
<android>
2012-01-31T06:34:02.690
139
1
1
265
1
3
0
stackoverflow.com
Selenium2 Servlets
<p>i'd like to add the own servlets by starting of selenium-server-standalone-2.19.0.jar -servlets, but cannot figure out how to do it.</p> <p>is it possible to find the developer's guide about selenium2 servlets?</p> <p>one example would be also very nice.</p> <p>tnx a lot!</p> <p>a working solution of mine:</p> <p>1) checkout of <a href="http://selenium.googlecode.com/svn/tags/selenium-2.19.0" rel="nofollow">http://selenium.googlecode.com/svn/tags/selenium-2.19.0</a></p> <p>2) created HubServlet which extends from RegistryBasedServlet</p> <p>package org.openqa.grid.web.servlet.alpha; ... public class HubServlet extends RegistryBasedServlet { ... }</p> <p>3) building</p> <p>./go clean release (only once)</p> <p>./go //java/server/src/org/openqa/grid/selenium:selenium:uber (everytime i change something on org.openqa.grid.web.servlet.alpha.HubServlet)</p>
<selenium-grid>
2012-02-10T11:36:51.023
41
0
0
3,393
1
0
0
stackoverflow.com
Callbacks for arguments in Scilab
<p>I'm writing a GUI in Scilab and assigning callbacks to <code>pushbutton</code> controls. When a button is pressed, another control is affected, e.g. text inside a textbox changes. This whole routine itself (creation and initialization of the GUI) lives inside a function, that is I have to call my <code>create_my_gui()</code> to run it.</p> <p>My problem lies in variable scope and callback usage. Several of my buttons affect several other controls in exactly the same way, so I would like to use the same callback function and pass a handle to the control I'm trying to affect into the callback.</p> <p>For example when I press the <em>N</em>-th button, I'd like to pass the handle <em>N</em>-th control into the callback:</p> <pre><code>function buttonPressCallback ( controlHandle ) controlHandle.string = 'Button pressed!'; endfunction </code></pre> <p>The problem is that callbacks are defined as strings:</p> <pre><code>myButton3.callback = 'buttonPressCallback ( myTextBox3 )' </code></pre> <p>And after I've run my <code>create_my_gui()</code> function, all variables go out of scope and are destroyed, <em>including</em> handles to all controls. When I press the button, Scilab tries to run whatever string was specified as the callback and complains about the variable, <code>myTextBox3</code> for example, not existing.</p> <p>Is there a way I can refer to uicontrols in Scilab after the function that created them exited? I understand that Scilab has very peculiar ways of addressing things and perhaps I'm just not thinking in correct Scilab programming patters just yet. Is there the "right way" of doing this?</p>
<user-interface><callback><scope><scilab>
2012-02-21T14:50:25.523
12,361
1
0
2,360
2
0
1
stackoverflow.com
TextWrangler Color Formatting and File Extensions
<p>Is there anyway to force TextWrangler to make alternate file extensions format like html? I use Twig and I like to name my templates homePage.twig, login.twig etc... But, sometimes (I don't know why) the code will not format strings, nodes and what not with alternate colors and I just end up with a big block of dark gray text. If I put at the top of the page TextWrangler will format the text, but I can't save the file that way. AND, the kicker is, this doesn't ALWAYS happen. Sometimes it will format correctly, sometimes it won't and I can't tell what is triggering it.</p> <p>Thoughts?</p>
<textwrangler>
2012-03-05T18:06:42.333
3,698
1
3
6,638
1
0
0
stackoverflow.com
Truncating an int (or long, or whatever) to a specific size (n bytes), signed and unsigned
<p>Say I have these two variables:</p> <pre><code>size_t value; size_t size; </code></pre> <p>And I want to "cast" <code>value</code> to the size of <code>size</code>. So if <code>size</code> is 4, <code>value</code> is casted to be 4 bytes long. If <code>size</code> is 3, <code>value</code> is presumably truncated to 3 bytes long, preserving sign (assume a signed int may be loaded into <code>value</code> then taken out later to be cast back to signed) and stored in an int/uint depending on sign choice. Preferably with a method that would work to turn, for example, an unsigned long, or whatever other integral type, to any arbitrary size in bytes along with being signed/unsigned.</p>
<c++>
2012-03-06T02:13:56.860
1,800
1
1
2,774
2
2
0
README.md exists but content is empty.
Downloads last month
39