input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Best practise to reset a database index once a year? <p>Using php and mysql (and Drupal), I want to generate an index based on the number of items in the database by year - 20090001, 20090002, 20090003, etc.</p>
<p>Is there a way to do this without testing if the year has changed for each and every item - a cron job p... | <p>What you can do is have a multi-column primary key, one column for the year and one for the id. You still set auto-increment on the id column and mysql sorts out the increments for each year you add in the year column. The only caveat is you need to add the year to the list of values when you do an insert. The detai... |
Streaming video in from web camera <p>I wonder how can in load video from a web camera in flash using as3</p>
<p>Thanks in advance.</p>
| <p>uhm are you looking for <a href="http://livedocs.adobe.com/flex/gumbo/langref/flash/media/Video.html#attachCamera%28%29" rel="nofollow"><code>Video::attachCamera</code></a>?</p>
<p><strong>edit:</strong> sorry, didn't get your question first ... so yeah, there are of course alternatives to FMS ... apart from those ... |
Ensuring record value integrity in a open-source database <p>How can I ensure the records in a database can not be altered by other than the middle tier software (e.g. discourage the DBA of changing values)?</p>
<p>I want to implement a simple multi-tier accounting program using open-source stack. The primary function... | <p>First: Since you'll hand out all the code to the customer, there is no way to make it really secure.</p>
<p>Second: A way with (in my opinion) good balance between effort and effect would be to add an extra column, then when ever you change the values, concatenate all the values, add a secreat password to it (bette... |
Fancy groupings with Thinking Sphinx <p>I have tables boards, users, joins, and roles. The joins table defines the association a user has to a board, as well as the role that user has on that board. I'm trying to either get all of a user's boards at once with a way to differentiate what role a user has on each board, o... | <p>When you run a grouped query, one matching result <em>per group</em> is returned. It sounds like a specific board is being returned for each group, because that board has three roles.</p>
<p>I don't think it's actually possible to do what you want to do in a single query (ie: limit role values to a specific user) -... |
Cannot access Page without authentication <p>I deployed the sample application (the blue one you get when you create a new project) to IIS7 on Windows Server 2008. When I try to access mysite.com/home/about I get redirected to Accoun/Login.</p>
<p>This does not happen when I run the site on VS integrated server.
I di... | <p>Further on eu-ge-ne's answer, if 'Anonymous Authentication' is enabled then you need to make sure the user it is impersonating (default IUSR) has read access to your website directory.</p>
<p>If you have set it to use your application pool identity's user (default NETWORK SERVICE) then obviously make sure that that... |
"<" operator error <p>Why is the ( i < UniqueWords.Count ) expression valid in the for loop, but returns "CS0019 Operator '<' cannot be applied to operands of type 'int' and 'method group'" error when placed in my if? They are both string arrays, previously declared.</p>
<pre><code>for (int i = 0;i<UniqueWord... | <p>don't forget your parens:</p>
<pre><code>UniqueWords.Count()
</code></pre>
|
What is the most efficient way to compare/sort items from two arrays? <p>I have a question about efficient implementation. Lets say I have two arrays:</p>
<pre>
One array is all possible items in a house: Table, Chair, TV, Fireplace, Bed
The other is an array of items in a particular house: Table, TV, Bed
</pre>
<p... | <pre><code>var allItems = (new [] {"Table", "Chair", "TV", "Fireplace", "Bed"});
var hasItems = (new [] {"Table", "Chair"});
var hasList = hasItems.ToList();
var needsList = allItems.Except(hasItems).ToList();
</code></pre>
|
How to remove the focus from a TextBox in WinForms? <p>I need to remove the focus from several TextBoxes. I tried using:</p>
<pre><code>textBox1.Focused = false;
</code></pre>
<p>Its <code>ReadOnly</code> property value is <code>true</code>.</p>
<p>I then tried setting the focus on the form, so as to remove it from ... | <p>You need some other focusable control to move the focus to. </p>
<p>Note that you can set the Focus to a Label. You might want to consider where you want the [Tab] key to take it next.</p>
<p>Also note that you cannot set it to the Form. Container controls like Form and Panel will pass the Focus on to their first ... |
Is there a better way to write this working, but extremely ugly, code? <pre><code>- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
NSLog(@"switching views");
if([viewController isKindOfClass: [UINavigationController class]] &&
... | <p>Why not just put the reload data call in the viewDidAppear method of the SavedViewController class?</p>
|
How do I find the currently selected (or active) Row in an UltraGrid <p>Using the Infragistics UltraGrid (e.g. <code>myGrid</code>), I want to:</p>
<ol>
<li>Hook an event that will fire when active row is changed (selected, clicked, etc).</li>
<li>Do something with the selection</li>
</ol>
<p><strong>SUMMARY ANSWER</... | <p>The following <a href="http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WinGrid%5FAfterRowActivate%5FEvent.html" rel="nofollow">page</a> talks about the event fired when the active row has changed.</p>
<p>To get the active row, you can use the property <strong>yourGrid.ActiveRow</strong> or <st... |
Auto sizing zoom on an image in .NET <p>I'm considering a personal learning project. Using .NET(preferably VB) I want to build a simple desktop app that's only function is to display comics, like CDisplay, but with more advanced navigation. I want to be able zoom in by clicking on certain areas of an image, individual ... | <p>You can do this entirely in .Net. Here is an excellent overview of the subject:</p>
<p><a href="http://www.codeproject.com/KB/books/1861004990.aspx">http://www.codeproject.com/KB/books/1861004990.aspx</a></p>
<p>It's C#, but it's really not hard to translate this stuff into VB. In both languages, it's just a mat... |
How should I name a method that does this...? <p>I have a method that receives two range endpoints - start of range and end of range and an integer.</p>
<p>It checks to see if the integer falls between the two end points and returns either the integer or the corresponding end point if the integer falls outside the bou... | <p>How about <code>ConstrictToRange</code> / <code>LimitToRange</code> / <code>ConfineToRange</code>? Something of this form would be seem to convey the meaning quite succinctly.</p>
|
Replace character in SQL results <p>This is from a Oracle SQL query. It has these weird skinny rectangle shapes in the database in places where apostrophes should be. (I wish we would could paste screen shots in here)</p>
<p>It looks like this when I copy and paste the results.</p>
<pre><code>spouse�s
</code></pre>... | <p>This seems a problem with your charset configuracion. Check your NLS_LANG and others NLS_xxx enviroment/regedit values. You have to check the oracle server, your client and the client of the inserter of that data.</p>
<p>Try to <a href="http://download.oracle.com/docs/cd/B19306%5F01/server.102/b14200/functions046.h... |
Returning JSON AND XML format from a .NET 3.5 WCF web service (REST) <p>I have an existing web service that returns XML responses and I would like to add some new methods that return JSON. Do I have to create a separate web service that returns in JSON or can I have a mix?</p>
<p>If I use the ResponseFormat = WebMessa... | <p>I don't see why this isn't possible. You annotate the service with the [ServiceContract] attribute (not DataContractFormat). It should look like</p>
<pre><code> [ServiceContract]
public interface IDoStuff
{
[OperationContract]
[WebInvoke(Method = "POST",
UriTemplate = "DoStuff",... |
When to separate columns into new table <p>I have company, customer, supplier etc tables which all have address information related columns.</p>
<p>I am trying to figure out if I should create a new table 'addresses' and separate all address columns to that.</p>
<p>Having address columns on all tables is easy to use ... | <p>The answer to all design questions is this:</p>
<p>It depends.</p>
<p>So basically, in the Address case it depends on whether or not you will have more than 1 address per customer. If you will have more than 1, put it in a new Addresses table and give each address a CustomerID. It's overkill (most times, it depe... |
Record video from browser to server <p>I'm looking to record video from a user's browser to the web server. We've already got a working Red5 server up. I'm in need of details how to configure the server to store the video somewhere on disk, as well as a browser frontend to complete this.</p>
<p>Also, I'd like to have ... | <p>to be honest, i have never worked with red5, and it's a little too big to find the right entrypoint right now ...</p>
<p>you might wanna take a look at <a href="http://haxevideo.org/" rel="nofollow">haxevideo</a> (you'll need <a href="http://haxe.org" rel="nofollow">haXe</a> for that ... it's much smaller, and you ... |
Auto redirect to URL returned in XML? <p>Is there a way to automatically go to a URL returned via XML from an API call? For instance I call and it returns the XML file that I parse with simple_xml_load() and then I create a link like so, </p>
<pre><code><a target=_blank href='" . $title->links->homedetails .... | <p>If I understood your question correctly this would do the trick:</p>
<pre><code><?php header('Location: '.$title->links->homedetails.'?scrnnm=Nexus-Software'); ?>
</code></pre>
<p>It redirects the user to the location specified. You just have to watch out to call it before any output is sent to the bro... |
Get Song Currently Playing In Windows Media Player <p>Using C# how can I get the name of the song, artists etc that is currently playing in Windows Media Player? Applications like MSN Messenger / Google Talk do this. Thanks</p>
| <p>For C#</p>
<p>I spent hours trying to get it to work for my program.
Finally I figured it out.</p>
<p>This solution is assuming you have either the windows media player control ON a form in your project or have created the object through code..</p>
<ol>
<li>create a new Windows Media Player Song object and point ... |
Calculating SVG paths <p>I have a quite complex image map (made up of over 150 pieces) and I want to convert the coords within the map to SVG path standard format.</p>
<p>The reason why is I want to use the following instead of an image map <a href="http://raphaeljs.com/australia.html">http://raphaeljs.com/australia.h... | <p>Assuming you are talking about a HTML image map? SVG path markup is very similar to what you gave in a HTML imagemap. Say you have:</p>
<pre><code><area shape="poly" alt="" coords="0,0,115,0,115,23,92,60,92,111,0,111" />
</code></pre>
<p>The same thing in path markup would be </p>
<pre><code>M 0,0,115,0,1... |
Is there any way to pass an anonymous array as an argument in C++? <p>I'd like to be able to declare an array as a function argument in C++, as shown in the example code below (which doesn't compile). Is there any way to do this (other than declaring the array separately beforehand)?</p>
<pre><code>#include <stdio... | <p>It's allowed with a typecast in C++11 and in <code>extern "C"</code> with C99:</p>
<pre><code>void PrintArray(size_t len, const int *array)
{
for(size_t i = 0; i < len; i++)
printf("%d\n", array[i]);
}
int main(int argc, char **argv)
{
PrintArray(5, (const int[]){1, 2, 3, 4, 5});
return 0;
}... |
How to get \uXXXX to display correctly, using PHP5 <p>I have inherited a database which contains strings such as:</p>
<p>\u5353\u8d8a\u4e9a\u9a6c\u900a: \u7f51\u4e0a\u8d2d\u7269: \u5728\u7ebf\u9500\u552e\u56fe\u4e66\uff0cDVD\uff0cCD\uff0c\u6570\u7801\uff0c\u73a9\u5177\uff0c\u5bb6\u5c45\uff0c\u5316\u5986</p>
<p>The qu... | <p>1) I downloaded and installed a unicode font named <a href="http://www.code2000.net/code2000%5Fpage.htm" rel="nofollow">CODE2000</a></p>
<p>2) I wrote this:</p>
<pre><code><?php header('Content-Type: text/html;charset=utf-8'); ?>
<head></head>
<body style="font-family: CODE2000">
<?php
/... |
Multi-Parent linking <p>Where I can find the display algorithm for multi-parents linking.
I like to draw it on 2-dimension paper without crossing lines.</p>
<p>So it is connecting with Set of parents to set of children where there is many to many relationship.</p>
| <p>You might want to read <a href="http://en.wikipedia.org/wiki/Planar%5Fgraph#Kuratowski.27s%5Fand%5FWagner.27s%5Ftheorems" rel="nofollow">this</a> and <a href="http://en.wikipedia.org/wiki/Planarity%5Ftesting" rel="nofollow">this</a> before looking further. Planarity is a tricky animal and in many real world applicat... |
How to code this form? <p>Im trying to get away from using the html TABLE tag, but cant figure out how to build, what I want it to look like. I have made a screenshot of me using the table tag,
How would I do this with divs or/and spans etc, and still retain the vertical alignment of the labels (firstname, lastname in ... | <p>It's good that you don't want to use the table tag for layout. The thing to keep in mind when switching is to try to make the HTML as semantical as possible. What this means might vary, since there are no real strict rules, but it could look something along these lines:</p>
<pre><code><form [..]>
<ul>... |
Treatment of error values in the SQL standard <p>I have a question about the SQL standard which I'm hoping a SQL <a href="http://catb.org/jargon/html/L/language-lawyer.html" rel="nofollow">language lawyer</a> can help with.</p>
<p>Certain expressions just don't work. <code>62 / 0</code>, for example. The SQL standard ... | <p>All implementations of SQL that I've worked with treat a division by 0 as an immediate <code>NaN</code> or <code>#INF</code>. The division is supposed to be handled by the front end, not by the implementation itself. The query should not bottom out, but the result set needs to return <code>NaN</code> in this case. ... |
Terminal symbol and non-terminal symbol <p>could anyone tell me the difference between Terminal and non-terminal symbol in the case of Java? </p>
<p>Does Terminal mean a Keyword and non-terminal any common string literal?</p>
| <p>In grammars, a terminal is some form of token (keyword, identifier, symbol, literal, etc.) whilst a non-terminal reference rules.</p>
<p>So both a keyword and a literal string would be terminals. A statement would be non-terminal.</p>
<p>(That's probably a really bad description. Read the dragon book.)</p>
<p>EDI... |
How long do prepared queries "last" for on the server side? <p>I was just wondering how prepared queries work. I am using PHP and MySQL.</p>
<p>I know that prepared queries compile the query and then repeated uses only have to change the parameters, so it saves time. But how long does that compiled query have an effec... | <p>ryeguy, they last for the length of the connection. Per the MySQL manual:</p>
<blockquote>
<p>A prepared statement is specific to the session in which it was created. If you terminate a session without deallocating a previously prepared statement, the server deallocates it automatically.</p>
</blockquote>
<p>If ... |
cannot get issuetoken by using REST <p>In the white paper, it said that we can use REST to ask for the token then use the token to attache to the request we are going to fire, then can invoke the service in the service bus, how ever, i cannot get the token</p>
<p>Bellow are the codes i use to make REST call, i can get... | <pre><code> String uri = String.format("https://accesscontrol.windows.net/isssuetoken.aspx?u=%s&p=%s", "solutionname", "password");
</code></pre>
<p>the like above is wrong...
the white paper get a misstake,</p>
<p>there is one extra 's' in the link,
it should be
String uri = String.format("https://ac... |
MySQL SSL connection through ADODB library <p>I have a MySQL database hosted on a remote server and it is enabled to accept only SSL connection. When I connect to this database using Java JDBC with SSL options, it works fine. There is a special jdbc string that I use for JDBC connection as below
"jdbc:mysql://:/?verify... | <p>I have no experience connecting MySQL with SSL. MySQL driver have <a href="http://id2.php.net/manual/en/mysql.constants.php" rel="nofollow">flags</a> (<code>MYSQL_CLIENT_SSL</code>) that you can use when connecting. </p>
<p>To set it when connecting using AdoDB, you can try my connection template:</p>
<pre><code>$... |
Python networking library for a simple card game <p>I'm trying to implement a fairly simple <a href="http://www.sirlin.net/yomi" rel="nofollow">card game</a> in Python so that two players can play together other the Internet. I have no problem with doing the GUI, but I don't know the first thing about how to do the net... | <p>Both of those libraries are very good and would work perfectly for your card game.</p>
<p>Pyro might be easier to learn and use, but Twisted will scale better if you ever want to move into a very large number of players.</p>
<p>Twisted can be daunting at first but there are some books to help you get over the hump... |
PHP Class won't return to a String <p>I'm fairly new to PHP so I have a small problem as I'm learning:</p>
<p>I built a Class called DataStrip.php</p>
<pre><code><?php
final class DataStrip
{
public function DataStrip()
{
// constructor
}
public function stripVars($vars)
{
return $vars;
}
}
?>
</c... | <p>What do you expect it to happen? You're not saving the result of what stripVars returns into a variable:</p>
<pre><code>$result = $a->stripVars($projCat);
print $result;
</code></pre>
<p>What you are trying to do is print the object variable itself. If you want to control what happens when you try to print an o... |
CakePHP Pagination with Webservice <p>I am invoking a web service and get data. The result has "TotalPages", "TotalResults" information.</p>
<p>Based on this, I need to generate a paging mechanism using cakephp.</p>
<p>Please share some code snippet or advise me on how to achieve this.</p>
| <p>The <a href="http://book.cakephp.org/2.0/en/core-libraries/components/pagination.html" rel="nofollow">Pagination Helper</a> will make displaying the paginated data a lot easier for you. However, it operates on the assumption that you are using a Cake Model. Luckily, you can create a Datasource (the manual is <a href... |
Why HTML/JavaScript/CSS are not compiled languages and will they ever be? <p>Why HTML/JavaScript/CSS are not becoming compiled languages (or maybe even merge into a single compiled language)? What if browsers were running "Browser Virtual Machine" and html/javascript/css sources could by compiled to a "browser bytecode... | <p>Ah, but Javascript IS becoming a compiled language. Check out Firefox 3.5 with <a href="https://wiki.mozilla.org/JavaScript:TraceMonkey">TraceMonkey</a>. It's insanely fast compared to um you-know-who's browser. It's true that JS will never be C, but it's a much more dynamic language than C is, and in many ways t... |
Using Mono for developing in C++ <p>I am starting to use Mono to develop applications in C# and C++. I wanted to ask you, how is Mono compiling the C++ code? is it using GCC? It is amazing to see that it has the STL containers... Also, can I use the Boost libraries and GSL libraries with Mono? Thanks in advance!!!</p>
| <p>I think you must be using <a href="http://monodevelop.com/">MonoDevelop</a>, the IDE, as opposed to Mono itself.</p>
<p>Yes, MonoDevelop uses gcc/g++ to compile C/C++ source code, but it is not compiled to CIL - it is compiled to a native binary.</p>
<p>If I am understanding correctly, then you should be able to u... |
winforms report generator for pdf output <p>Need to generate some financial report where the formatting is controlled by the data</p>
<p>haven't done reporting in a while but does any reporting support that</p>
<p>e.g. based on a flag in the source dataset
the row text could be bold
the row could have an underlining
... | <p>There is a component called the ReportViewer for WinForms which ships with Visual Studio. This will do exactly what you need. You can bind it to one or more DataTables and it will essentially render you a report in PDF or in XLS or what have you. If you don't need to present it to the user, just use the <a href="... |
Looking for a simple mySQLi class example with descriptions <p>I am looking for an example of a simple, but functional example of a class extending the mySQLi class in PHP5. I am interested in stored procedures also. Basically what I need is an example of a practical and usable class. I learn best by example and unfort... | <p>Did you check <code>PHP PEAR MDB2</code> ?
<a href="http://pear.php.net/package/MDB2" rel="nofollow">http://pear.php.net/package/MDB2</a></p>
<p>Its not so simple, its the best DAL in php IMHO...</p>
|
How to load web user controls with interface type <p>I have a web user control which call some methods of an interface. Four different classes use this interface.</p>
<pre><code>public interface IMultiTextProvider
{
bool Insert(string text, Guid campaignId);
IEnumerable<IMultiTextItem> GetItems(Guid cam... | <p>I would go for the "ProviderType" solution, using as a property of the control to get the type to instantiate. Here's a quick example on how to create an object starting from the type name (with a console application).</p>
<pre><code>namespace TypeTest{
public interface IMultiTextProvider {
bool Insert... |
Is comeau compiler worth it compared to gcc? <p>I have been using gcc, g++ for my C, C++ application development till now and have found it to be amazing. But browsing through Stack Overflow I found many members stating that error reporting in Comeau compiler is much more than any other compiler. Is this true? I haven'... | <p>My experience with writing C++ is that compiling your code with more than one compiler is a great way to find odd corner-cases in your code. In our case, we've used gcc, Apple gcc, and the Visual Studio compiler cl (which is free). When on Windows, I prefer the cl compiler since it compiles faster (around five times... |
How to create 20 databases at a time in sqlserver? <p>I have written the following procedure to create a series of 20 databases.
But it is not creating them. The database is not created even when I go to my H: drive and didnot find the ldf and mdf named bharath1 bharath2 like...</p>
<p>What did I do wrong with this?</... | <p>OK, I don't see the BEGIN and END block right after the WHILE loop which may cause SQL to do an endless loop to run a SET @command statement only.</p>
<p>You need to enclose the WHILE with BEGIN and END...</p>
<pre><code>DECLARE @command as varchar(1000), @i int
SET @i = 0
WHILE @i < 5
BEGIN
SET @command = 'C... |
MySQL db problem in Python <p>For me mysql db has been successfully instaled in my system.I verified through the following code that it is successfully installed without any errors.</p>
<pre><code>C:\Python26>python
Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "... | <p>1) Try using your package manager to download <strong><a href="http://www.novell.com/products/linuxpackages/server10/i386/python-mysql.html" rel="nofollow">python-mysql</a></strong> which includes MySQLdb.</p>
<p>2) Ensure <code>/usr/lib/python2.4/site-packages/</code> is in your <a href="http://docs.python.org/usi... |
how to swap the visibility of applications using c# <p>i have a parent form, it will have two tabs calling the two child forms respectively.
I did this usind MDI.</p>
<p>For instance, say i have two tabs named "Calculator" and "Notepad". I mean to say that
the name of tabs are the process names running in windows.</p>... | <p>Override the TabIndexChanged event of the TabControl and determine which tab page is now currently active. Based on the active tab page you then use a ProcessInfo instance to load the applcition you want to run:</p>
<p>Here's code to get you going:</p>
<pre><code>public partial class Form1 : Form
{
public Form... |
Downloading big files (~40MB) and saving as attachments with paperclip <p>I have found some code `</p>
<pre><code>require 'socket'
host = "download.thinkbroadband.com"
path = "/1GB.zip" # get 1gb sample file
request = "GET #{path} HTTP/1.0\r\n\r\n"
socket = TCPSocket.open(host,80)
socket.print(request)
# find beginni... | <p>It may not be exactly what you're looking for but you might want to check out <a href="http://trevorturk.com/2008/12/11/easy-upload-via-url-with-paperclip/" rel="nofollow">http://trevorturk.com/2008/12/11/easy-upload-via-url-with-paperclip/</a>.</p>
|
Android service not starting via alarm <p>Is there any problem with launching a service via an Alarm's
BroadcastReceiver's onReceive? My service never has it's onCreate or
onStart method called.</p>
<p>My Alarm's receiver gets a wakelock, calls context.startService(new
Intent(context, FmiDaemon.class)); (context given... | <p>Old question but in case anyone else has this problem:</p>
<p>1) Add a log entry to the start of your receiver class onReceive. If your log doesn't show this message, you don't have the alarm setup right or your receiver isn't in the in the manifest file.</p>
<p>2) Add your receiver class to your AndroidManifest.x... |
Is it possible to use both order by and where in a single query <p>I have created a table. In one field, I have a priority of that record (between 1-9).
I didn't set priority for all the records, so for some records, it will remain null. </p>
<p>When displaying these records in my HTML page, I just check those priori... | <p>Here's a short sample that shows how to convert NULL's into a value and then sort on it..</p>
<pre><code>create table test
(
priority int null,
detail varchar(10)
)
insert into test values (1, 'one')
insert into test values (3, 'three')
insert into test values (8, 'eight')
insert into test values (9, 'nine... |
Get a MS GeoId from a 3 lettor ISO code (ISO 3166-1 alpha-3) <p>I have a <a href="http://en.wikipedia.org/wiki/ISO%5F3166-1%5Falpha-3" rel="nofollow">3 letter ISO code</a> (e.g. DEU for germany, USA for America...) and would like to get the GeoID as listed in <a href="http://msdn.microsoft.com/en-us/library/dd374073%28... | <p>I think you'll have to manually set up the mapping to begin with, unless someone has already done it. With a little tinkering you could use a db or similar to do a join on the names and probably get 90% or more of them, then fill in the rest by hand.</p>
<p>I would keep the mapping in an external file, database ta... |
Implementing own Session Management in ASP.NET <p>What options are there to implement an own session management in ASP.NET?</p>
<p>I just found one older solution about "highjacking" the built-in session management.</p>
<p>Is there a nice way to implement a component which performs all session tasks?
How can i includ... | <p>You need two things, implement the IHttpSessionState and a HttpModule. In the HttpModule you hook the applications AcquireRequestState and ReleaseRequestState events.</p>
<p>In the Web.Config you need to remove the default session module and include your own.</p>
<p>The System.We.SessionState namespace has a num... |
Why does this XFBML markup embedded within an iframe'd facebook application not display anything? <p>I've been trying to get this application working on Facebook, but
nothing seems to render within the application except</p>
<pre><code>"Hi this is some sample text."
A box stroked in red. "I am My photo " and a defaul... | <p>A couple other people were facing the same problem:</p>
<p><a href="http://forum.developers.facebook.com/viewtopic.php?pid=158131#p158131" rel="nofollow">Facebook Forum Discussion about this problem.</a></p>
<p>The problem was with the Connect URL and the base domain I was using and a LITTLE
bit of PATIENCE.</p>
... |
How to use display none and block for a flash object? <p>I have embedded some flash like this: </p>
<pre><code><div id="id" style="display:none;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" wid... | <p>I suspect what you need to do is add an extra parameter:</p>
<pre><code><param name="wmode" value="opaque" />
</code></pre>
<p>as Flash defaults to rendering the movie in a borderless window overlaid onto the page, ie outside the reach of the DOM.</p>
<p>Setting the windowing mode to "opaque" or "transparen... |
Rationale behind EventArgs class <p>I'm learning events in C# and understand that the <code>EventArgs</code> class carries data about the event. But I am having difficulties understanding why <code>EventArgs</code> is necessary. </p>
<p>For instance, in <a href="https://msdn.microsoft.com/en-us/library/9aackb16(VS.71)... | <p>The upsides with the EventArgs class are (as I see it) mainly these two:</p>
<ul>
<li>You can add members to the EventArgs class withouth altering the signature of the event</li>
<li>You disconnect the information passed to the event handler from the object instance</li>
</ul>
<p>It may even be that the informatio... |
How to avoid network stalls in GetFileAttributes? <p>I'm testing the existence of a file in a remote share (on a Windows server). The underlying function used for testing is WinAPI's <em>GetFileAttributes</em>, and what happens is that function can take an inordinate amount of time (dozens of seconds) in various situat... | <p>The problem isn't GetFileAttributes really. It typically uses just one call to the underlying file system driver. It's that IO which is stalling.</p>
<p>Still, the solution is probably easy. Call <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363794%28v=vs.85%29.aspx" rel="nofollow">CancelSynchr... |
Using ASP.NET WebService with javascript <p>I have this code in my project:</p>
<pre><code>var UI =
{
Layouts:
{
ShowLayoutSettings: function(pid, lid) {
My.PageServices.GetPageLayout(lid, pid, UI.Layouts._onShowLayoutSettings);
},
_onShowLayoutSettings: function(obj) {
alert(obj.ID);
}... | <p>if it worked with returning a string, then you probably need to tell the ajax extension to create javascript code for the object you're trying to return. Add an attribute above your webmethod</p>
<pre><code>[GenerateScriptType(typeof(PageLayout))]
</code></pre>
<p>where PageLayout is the name of the class the Get... |
How to control text resize rate in HTML page <p>We have designed an application which has two frames. First frame have displays available menu list in it and second frame have the menu content displayed in it. We have designed our pages and style sheets so that the page text content is re sizable using View > Text Size... | <p>There is no way to control the text size forced from the IE menu options.</p>
<p>You could implement your own font size control though using Javascript or jQuery.</p>
|
Query to get only the duplicate data <p>I have a table with data</p>
<pre><code> ID Name
1 John
2 Robert
3 John
4 Sam
5 Jack
6 Sam
Now i wa... | <pre><code>SELECT Name
FROM YourTable
GROUP BY Name
HAVING COUNT(*) > 1
</code></pre>
|
Invoke Rich Modal Panel Onclick <p>I am using the following code for displaying dynamic image in rich DataTable.
Onclick of the thumbnail I need to display Full Image fetched from different location.</p>
<p>But the second a4j:mediaOutput tag is fetching all the Full images and keeping in memory.
(Ofcourse modalPanel i... | <pre><code> <h:outputLink value="#" id="link">
<a4j:mediaOutput element="img" cacheable="false" session="true" style="height:75px; width:75px;"
createContent="#{daImageRetrievalBean.retrieveThumbnail}" value="#{digAsset.digitalAssetId}" mimeType="image/jpeg" />
<ri... |
What enterprise-class open source CMS has the steepest (easiest) learning curve for a programmers team? <p>As a company specialized in developing custom CMS, we have been asked to deploy a open source CMS in our next project.</p>
<p>We are free to choose a system. What would you recommend for a team familiar with MVC ... | <p>If you're looking for an enterprise-class CMS I would not even mention joomla.
I see that you're not aware of <a href="http://www.silverstripe.org" rel="nofollow">Silverstripe</a>. I recommend to check it out!</p>
|
Make installation package of C# project <p>I have done a software in C#. How can I make a Installation Package for the software?</p>
| <p>I would recommend <a href="http://nsis.sourceforge.net/Main%5FPage" rel="nofollow">NSIS</a>, it has been brilliant for me.</p>
<p>If you want to use Visual Studio, <a href="http://en.csharp-online.net/Deploying%5FWindows%5FApplications%E2%80%94Visual%5FStudio%5FSetup%5Fand%5FDeployment%5FProject%5FTypes" rel="nofol... |
Adding Redundant Information to a MVC Route <p>As you come to this question you'll notice the title of the question is in the address bar and the link you clicked on to get here. I am not sure the exact terminology so found it difficult to search for but how can I do something similar? That is, How can I add data to th... | <p>Taking the example of a Stack Overflow question like this one the URL is:</p>
<p><a href="http://stackoverflow.com/questions/1142480/adding-redundant-information-to-a-mvc-route">so.com/questions/1142480/adding-redundant-information-to-a-mvc-route</a></p>
<p>However, the functional part of the URL is:</p>
<p><a hr... |
C# WinForms MonthCalendar Control - Customizable Date Range? <p>I have a list of dates.
I would like to be able to populate a windows forms monthcalendar control to show these dates as selectable(clickable) dates, whilst any date that is not in the list is disabled on the calendar control.
Is it possible to do this?</p... | <p>You can set the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.monthcalendar.mindate%28VS.80%29.aspx" rel="nofollow">MinDate</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.monthcalendar.maxdate%28VS.80%29.aspx" rel="nofollow">MaxDate</a> properties in order to gi... |
Smarter way to format sql/php code? <p>i have an large SQL Statement, is there any "smarter" way to format this stuff ??</p>
<p><pre><code>
$serverFields = 'SERVER_ID, SERVERNAME, SERVERLOCATION_ID, SERVERLOCATIONDETAIL_ID,
SERVEROS_ID, SERVEROSVERSION_ID, IP_BACKEND, IP_FRONTEND, IP_BACKU... | <p>I sometimes use <a href="http://www.sqlinform.com/" rel="nofollow">SQLInform</a> to format large SQL scripts, but that may not be what you are after.</p>
|
What's the accepted techniques for staying logged on to a web site? <p>Most web sites you can log on to also provide the feature so it remembers you between sessions.
What's the accepted and secure techniques for implementing that ? (What do you put in the cookies and how do you handle it on the server/db?)</p>
| <p>This recent 2009 <a href="http://static.springsource.org/spring-security/site/docs/3.0.x/reference/remember-me.html" rel="nofollow">chapter</a> in Spring Security 3.0 discusses Remember-Me type authentication. The general concepts are not specific to Spring Security so you should be able to benefit from it even if y... |
google api feed like twitter <p>im tryin to integrate my twitter search with google so that the query will show both twitter and google feedback BUT does google have an search api like twitter does where it will be able to send me back a json feed</p>
<p>then what is the url that i need to use like in the case of twi... | <p>Executive Summary: Yes, they have a REST interface that returns JSON.</p>
<p>The <a href="http://code.google.com/apis/ajaxsearch/documentation/#fonje" rel="nofollow">Google Search API documentation reveals all</a>. </p>
|
python + Spreadsheet <p>Can anybody please tell me is there any possible way to connect to spreadsheet from python? I want to store some data from a form and submit it to google spreadsheet. Please help on this issue. What steps do I have to follow?</p>
<p>Thanks in advance...</p>
| <p>The easiest way to connect to Google Spreadsheet is by using this <a href="http://burnash.github.com/gspread">spreadsheet library</a>. These are the steps you need to follow:</p>
<pre><code>import gspread
# Login with your Google account
gc = gspread.login('account@gmail.com','password')
# Spreadsheets can be ope... |
asp.net issue with F5 after postback, because it does what it should <p>I have a web form with a detail and a list view on it, the user fills the data in the fields of the detail view and then presses the "save" button, and everything is ok for the moment.</p>
<p>However, if they press <kbd>F5</kbd> after this operati... | <p>This will be the same for any webpage that uses a POST request for its operations.</p>
<p>You could stop this by using <code>Response.Redirect("yourpage.aspx")</code> after your save button event. This will send them to a fresh version of your page without post data in it.</p>
<p>Another way of doing it would be f... |
Using ASP.NET Controls without databinding <p>It appears that I have been using asp.net databinding for so long I have forgotten some of the basics. </p>
<p>I am dynamically creating a table in an ASPX page without databinding.</p>
<pre><code> foreach (XXX x in TTTT){ %>
<tr>
<td>&... | <p>You can pass the parameters by query string.<br />
something like this : <br /></p>
<pre><code>foreach (XXX x in TTTT){ %>
<tr>
<td><%=x.val %></td>
<a href='?Action=Resolve&pkid=<%=X.pkid%>'>
<img src='../images/IMG.png' />
... |
Blackberry MDS Simulator not launching <p>I have a problem with MDS-CS simulator coming with JDE 4.5.0 installation.
I have to establish network connectivity and I need to run MDS for that.
Whenever I launch MDS simulator, a window appears and exits immediately.</p>
<p>How do I resolve this problem ?</p>
<p>I searche... | <p>If you are running Vista, make sure that the Research in Motion directory has correct read/write/execute permissions. It's always the case when we install a new JDE or a new simulator in Vista, that this occurs; where half the things load, such as the JDE, and other things don't, such as the MDS and ESS, and the pro... |
Accessing a dialog box's handle and automatically manipulating the user interface <p>I have some VB code which makes use of a COM api and results in a certain dialog box popping up on the screen. My program is a console application, that needs to run in a batch file, but I haven't found any other way to do things other... | <p>To get an <code>HWND</code> of the dialog, I would call <a href="http://msdn.microsoft.com/en-us/library/ms633499%28VS.85%29.aspx" rel="nofollow">FindWindow()</a>. You can pass it the class name and caption of your dialog, and it should return its <code>HWND</code> to you. You can use a tool like Spy++ (installed by... |
Duplicating Word document using OpenXml and C# <p>I am using Word and OpenXml to provide mail merge functionality in a C# ASP.NET web application:</p>
<p>1) A document is uploaded with a number of pre-defined strings for substitution.</p>
<p>2) Using the OpenXML SDK 2.0 I open the Word document, get the mainDocumentP... | <p>This piece of code should copy all parts from an existing document to a new one.</p>
<pre><code>using (var mainDoc = WordprocessingDocument.Open(@"c:\sourcedoc.docx", false))
using (var resultDoc = WordprocessingDocument.Create(@"c:\newdoc.docx",
WordprocessingDocumentType.Document))
{
// copy parts from source... |
Do you use a flag or make it two operations? <p>An interesting discussion arose today around the concept of having one method with flags versus two methods for each state of the flag. Which makes more sense and why?</p>
<pre><code>void Submit(object data, bool isDraft);
</code></pre>
<p>or</p>
<pre><code>void Submit... | <p>If you do use a single function, don't use a bool, use an enum:</p>
<pre><code>enum DocType { Draft, Final };
void Submit(object data, DocType type );
</code></pre>
<p>This has two main advantages - it is self documenting at the call site:</p>
<pre><code>Submit( mydata, Draft );
</code></pre>
<p>and it extends ... |
Values from multiple tables on a row <p>I have the following 3 tables</p>
<pre><code>Table1
ID | NAME
-----------
1 | X
2 | Y
3 | Z
Table2
ID | NAME
-----------
1 | A
2 | B
3 | C
Table3
ID | P (Boolean field) | Other cols
1 | True ...
2 | True....
1 | False
</code></pre>
<p>Now I need a query on ta... | <p>This:</p>
<pre><code>SELECT CASE WHEN p
THEN
(
SELECT name
FROM table2 t2
WHERE t2.id = t3.id
)
ELSE
(
SELECT name
FROM table1 t1
WHERE t1.id = t3.id
)
END
FROM table3 t3
</code></pre>
<p>, or t... |
PyQt: Overriding QGraphicsView.drawItems <p>I need to customize the drawing process of a QGraphicsView, and so I override the drawItems method like this:</p>
<pre><code>self.graphicsview.drawItems=self.drawer.drawItems
</code></pre>
<p>where <code>self.graphicsview</code> is a QGraphicsView, and <code>self.drawer</co... | <p>There is an exception that occurs when the items are painted, but it is not reported right away. On my system (PyQt 4.5.1, Python 2.6), no exception is reported when I monkey-patch the following method:</p>
<pre><code>def drawItems(painter, items, options):
print len(items)
for idx, i in enumerate(items):
... |
DropDownList Items in List <p>Can anyone tell me shortest way to add all items of dropdownlist in a <code>List<string></code></p>
<p>I want to populate a <code>List<string></code> with the values of a DropDownList</p>
| <p>Depends if you want the ListItem Text and you are able to leverage 3.5</p>
<pre><code>public static List<string> GetStrings(DropDownList dl)
{
return dl.Items.Cast<ListItem>().Select(i => i.Text).ToList();
}
</code></pre>
|
Is there a Java API or built-in function for solving annuity problems? <p>I was asked by my boss to create a module for calculating reverse compound. </p>
<p>The question is: if I want to achieve $1.000.000,00 in 24 months with interest rate 18%/year (or 1.5%/month). how much money do I have to save every month?</p>
... | <p>Let us say that you are investing <code>D</code> dollars at the beginning of each month for <code>M</code> months earning an interest rate of <code>r</code> compounded monthly. We will set <code>i = r / 12</code>. At the end of <code>M</code> months you will have</p>
<pre><code>D * (1 + i)^M + D * (1 + i)^(M - 1) +... |
Is it better to use php sessions with objects or access db? <p>I'm at a crossroads, not exactly sure what is better to use. Right now I'm using sessions arrays to store calculations on the fly, but I need to switch to objects because I would like have some functions. But I was also considering using ajax and insert the... | <p>The session should be much faster, but it will not persist if the user closes their browser. I use sessions for that sort of thing (shopping carts, last accessed searches, etc) most of the time. On a site with a medium-large number of users, you'll need to do maintenance on a table to clean out old session informati... |
Create NTFS junction point in Python <p>Is there a way to create an NTFS junction point in Python? I know I can call the <code>junction</code> utility, but it would be better not to rely on external tools.</p>
| <p>you can use python win32 API modules e.g.</p>
<pre><code>import win32file
win32file.CreateSymbolicLink(srcDir, targetDir, 1)
</code></pre>
<p>see <a href="http://docs.activestate.com/activepython/2.5/pywin32/win32file__CreateSymbolicLink_meth.html" rel="nofollow">http://docs.activestate.com/activepython/2.5/pywin... |
How to concat two or more gzip files/streams <p>I want to concat two or more gzip streams without recompressing them. </p>
<p>I mean I have A compressed to A.gz and B to B.gz, I want to compress them to single gzip (A+B).gz without compressing once again, using C or C++.</p>
<p>Several notes:</p>
<ul>
<li>Even you c... | <p>Look at the <a href="http://www.ietf.org/rfc/rfc1951.txt">RFC1951</a> and <a href="http://www.ietf.org/rfc/rfc1952.txt">RFC1952</a></p>
<p>The format is simply a suites of members, each composed of three parts, an header, data and a trailer. The data part is itself a set of chunks with each chunks having an header... |
Selecting a node from an InfoPath form <p>I am trying to get an XmlNode within an InfoPath form, and I can't get it to return anything but null.. I'm following the example at <a href="http://suguk.org/forums/thread/17780.aspx" rel="nofollow">http://suguk.org/forums/thread/17780.aspx</a> and running into this issue..</p... | <p>Try this instead:
manager.AddNamespace("my", "http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-09-22T20:08::03");</p>
<p>(changed microsooft.comm to microsoft.com) :)</p>
|
Are iPhone 'standard' sounds (e.g. shutter, email sent) available for use? <p>I was hoping to make use of the sounds that Apple has created for its applications, like the sound that is played when the camera's shutter is fired.</p>
<p>It appears that these sounds aren't available for usage from within the SDK. Is thi... | <p>In a way; you have to get them from the SDK (the demos) and <em>put</em> them in your application. </p>
|
How to get the first element in a string? <p>I'm trying to figure out a way to check a string's first element if it's either a number or not.</p>
<pre><code>if not(myString[0] in [0..9]) then //Do something
</code></pre>
<p>The problem is that I get an error "Element 0 inaccessible - use 'Length' or 'SetLength"</p>
... | <p>Strings are 1-based:</p>
<pre><code>if not (myString[1] in ['0'..'9']) then // Do something
</code></pre>
|
gtk_menu_item_new_with_labelex vs gtk_menu_item_new_with_label <p>what is the difference between these two function calls:</p>
<pre><code>menu_item_new_with_labelex vs gtk_menu_item_new_with_label
</code></pre>
| <p>gtk_menu_item_new_with_label() is a standard gtk constructor that creates a GtkMenuItem containing a GtkAccelLabel with the specified text.</p>
<p>gtk_menu_item_new_with_labelex() is not a standard function; it does not exist in any of the gtk header files; in fact, google has never heard of it. If you see it in yo... |
datagrid add item to datasource lose viewstate <p>I do have a page that has a TextBox a Button and a Datagrid.</p>
<p>The goal here is simple : Each time I input something in the TextBox and press the Button, it does a little check and then it adds the item to the datagrid and a business logic datasource.</p>
<p>The ... | <p>You're going to have to save the state of the radioboxes in your business object <em>before</em> adding a new item the List, so that when you bind it again, the choices will be reflected back in the datagrid.<br />
If you're doing that, you might as well disable the ViewState for the grid...</p>
|
ASP.NET2.0 FormsAuthentication.RedirectFromLoginPage() <p>NET 2.0 form authentication. </p>
<p>Also i am using Login Web server control in aspx page. </p>
<p>My question is that , Is it necessary to write FormsAuthentication.RedirectFromLoginPage() method when we are using "Login Web server control " because i think ... | <p>You don't need to do anything if you are using the login server control.</p>
|
How to include all files of a directory with cmake? <p>I want to try CMake to manage a new C++ project. However, some files are automatically generated. I have no way to know the name of the generated files. The only thing I know is that these files are all generated in the foo/ directory. Is there a way to ask CMake t... | <p>You may do this with <code>GLOB</code></p>
<pre><code>FILE(GLOB ALL_CPP_SRCS *.cpp)
</code></pre>
|
Installing StarTeam 2006 on Windows Server 2000 or 2008 <p>Help, can anyone give me any pointers as too how and install StarTeam 2006 on a windows server. The installer does not work - pheewww.</p>
<p>If there is anyone out there who has been able to copy the files off one server and get them working on another - i'd... | <p>OK, ok, I found the answer.</p>
<p>First, renamed the outer setup file as .zip, then use winzip to unpack it. (for both client and server).</p>
<p>Then find the Client and Server setup routines from within the extracted files, then right click on these setup routines and put them into Windows XP compatibility mode... |
Aliasing Resources (WPF) <p>I am trying to alias a resource in XAML, as follows:</p>
<pre><code><UserControl.Resources>
<StaticResourceExtension x:Key="newName" ResourceKey="oldName"/>
</UserControl.Resources>
</code></pre>
<p><code>oldName</code> simply refers to a resource of type <code>Imag... | <p>Try as I might, I cannot reproduce your problem. I think there is more at play than the code you have posted. This works fine for me:</p>
<p><em>App.xaml</em>:</p>
<pre><code><Application x:Class="WpfApplication1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://sche... |
C# WinForms - Disable Specific Controls When Not In Use? <p>Say for instance I have a C# Winforms applciations that uses a tabcontrol with four different tab pages.
Above this control on the main form are a series of groupboxes containing various buttons and textboxes relevant to the different functions running on each... | <pre><code>button3.Enabled = false
</code></pre>
|
ASP.net Performance and Compile Queries <p>I have an ASP.net site that is essentially just a user interface for a class library I created. Each of the classes in this class library contain a static definition class with static references to compiled queries. </p>
<p>Like so:</p>
<pre><code>class MyRecord
{
/*Som... | <p>Static items are shared across threads within the same AppDomain, and so you will no re-compile the query for each request.</p>
|
Can I configure environment specific content? <p>In the same way that you can generate specific content based on browser type is there a way to generate specific content based on the server running PHP without reference to the server or site name?</p>
<p>For example, a way for PHP to automatically detect the environme... | <p>you can specify an environment variable in apache (conf, vhost, .htaccess or as an httpd daem) and then acces it via the Ë$_ENVËsuperglobal</p>
|
Nhibernate Enum Error <p>This is a bug?
Using NHibernate.Expression.Example.Create(userExample) if my class use Int32 on property 'Type' all works fine.</p>
<pre><code>public class User:Person
{
public virtual String NickName { get; set; }
public virtual String Password { get; set; }
public virtual Int32 ... | <p>Without seeing your query, you can try this expression. I assume your storing the enum as an int your db.</p>
<pre><code> Expression.Eq("Type",(int) userType);
</code></pre>
|
Team Foundation Server - What Process Template is for me? <p>So I finally was able to complete the installation of TFS and started the creation of my first team project which introduced me to the process template.</p>
<p>After following to the link to <a href="http://go.microsoft.com/fwlink/?LinkId=80608">Microsoft's ... | <p>Are you already using a software development process like scrum? If yes you can try this Team Process Template over <a href="http://scrumforteamsystem.com/en/default.aspx">here</a>.</p>
<p>How large is your project team and the project? Microsoft has published one of it's internal Process Templates (MPT) over <a hr... |
How can I use a Django template tag for greater than on a forloop.counter? <p>I want the effect of an "ifgt" template tag in a django template page:</p>
<pre><code>{%ifgt forloop.counter 10%}<!---special greater than 10 code--!>{%endif%}
</code></pre>
| <p>If you <strong>only</strong> need <em>greater-than</em>, you can use the following easy snippet (put it into <em>app/templatetags/greaterthan.py</em>):</p>
<pre><code>from django import template
register = template.Library()
@register.filter
def gt(a, b):
return a > b
</code></pre>
<p>And in a template:</p... |
What would be a better way to handle this sql logic? <p>Inside of a stored procedure, I populate a table of items (#Items). Just basic information about them. However for each item, I need to make sure I can sell them, and in order to do that I need to perform a whole lot of validation. In order to keep the stored proc... | <ol>
<li>Turn your validation stored procedure into a user defined function that accepts an item id or the data columns needed to validate an item record</li>
<li>Create the temp table</li>
<li>Insert all your items</li>
<li>Write a delete query for the temp table that calls your new UDF in the WHERE clause.</li>
</ol>... |
How do I force windows authentication with local asp.net development server? <p>I'm developing an ASP.NET application which needs Windows Authentication. I have the web.config set up to deny anonymous users and use Windows mode for authentication, but my local development version still lets me pass right through to th... | <p>You will also need to configure IIS and have your application point to IIS instead of the local web server</p>
<blockquote>
<p>To configure Windows authentication</p>
<ol>
<li>Start Internet Information Services (IIS).</li>
<li>Right-click your application's virtual directory, and then click Properties.<... |
Silverlight Tutorial Part 6: Using User Controls to Implement Master/Detail Scenarios - How to gray out background? <p>I am working through the above Tutorial from ScottGu located here (<a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-6-using-user-controls-to-implement-master-detail-scenarios.asp... | <p>Under the heading <strong>Building a Basic Modal Dialog Using a User Control</strong>, Scott's post describes:</p>
<p>"The first control above is configured to stretch to take up all of the available space on the screen. Its background fill color is a somewhat transparent gray (because its Opactity is .765 you ca... |
how to search for whole words efficiently in a sqlite db <p>I have a table that has a title column. I want to search for whole words like foo. so match " hi foo bye" o "foo", but not "foobar" or "hellofoo". Is there a way without changing the table structure to do this? I currently use 3 like queries, but it is ... | <p>You might be interested in a search indexer like lucene, ferret, or sphinx. These would run as separate processes that would index your data for fast searching where stemming, etc. can be configured.</p>
<p>Alternatively, depending on your data, you could just return all results that contain "foo" in any context a... |
QT + How to call slot from custom C++ code running in a different thread <p>I am new to QT and I am doing some learning.</p>
<p>I would like to trigger a slot that modify a GUI widget from a C++ thread(Currently a Qthread).</p>
<p>Unfortunatly I get a: ASSERTION failed at: Q_ASSERT(qApp && qApp->thread() == Q... | <p>stribika got it almost right:</p>
<pre><code>QMetaObject::invokeMethod( textEdit, "append", Qt::QueuedConnection,
Q_ARG( QString, myString ) );
</code></pre>
<p>cjhuitt's right, though: You usually want to declare a signal on the thread and connect it to the <code>append()</code> slot, t... |
Are solid-state drives good enough to stop worrying about disk IO bottlenecks? <p>I've got a proof-of-concept program which is doing some interprocess communication simply by writing and reading from the HD. Yes, I know this is <em>really</em> slow; but it was the easiest way to get things up and running. I had alway... | <p>The short answer is probably no. A famous researcher named Jim Gray gave a talk about storage and performance which included <a href="http://loci.cs.utk.edu/dsi/netstore99/docs/presentations/keynote/sld023.htm" rel="nofollow">this great analogy</a>. Assuming your brain as the processor, accessing a register takes 1 ... |
What tools, IDE, languages do you recommend for 2D game development? <p>I like programming but I also like to draw and design nice-looking things, so I thought it will be nice to mix this two things developing some simple 2d games...</p>
<p>I've tried Flash but I don't liked it a lot from the programmer point of view,... | <p>i would recommend you to take a look at XNA</p>
<p><a href="http://www.xna.com/" rel="nofollow">http://www.xna.com/</a></p>
<p><a href="http://creators.xna.com/en-US/" rel="nofollow">http://creators.xna.com/en-US/</a></p>
|
ASP Classic Webapp - Connect to different SQL DB via login <p>Need a way to connect to a unique SQL db via login in ASP classic.</p>
<p><strong>THE SETUP</strong></p>
<ul>
<li>Webapp: ASP classic/SQL 2005.</li>
<li>Webapp stores information for multiple companies. </li>
<li>All data stored in one master SQL 2005. A... | <p>The connection string must be stored some where right? A include .asp I guess.</p>
<p>Add code in that include to examine the company name (stored in the session?) and fixup the connection string accordingly.</p>
<p><strong>Edit</strong>:</p>
<p>The issue is you may have code out there in a myriad different ASP ... |
Hacking JavaScript Array Into JSON With Python <p>I am fetching a .js file from a remote site that contains data I want to process as JSON using the simplejson library on my Google App Engine site. The .js file looks like this:</p>
<pre><code>var txns = [
{ apples: '100', oranges: '20', type: 'SELL'},
{ appl... | <p>It's not too difficult to write your own little parsor for that using <a href="http://pyparsing.wikispaces.com/">PyParsing</a>.</p>
<pre><code>import json
from pyparsing import *
data = """var txns = [
{ apples: '100', oranges: '20', type: 'SELL'},
{ apples: '200', oranges: '10', type: 'BUY'}]"""
def js_g... |
Opening SWFUpload dialog w/o using a flash button? <p>SWFUpload has a parameter where you specify the button to be clicked to open a dialog.</p>
<p>Is there a simple way to manually open the dialog box without the use of the SWFUpload-provided button?</p>
<p>Main thing is I have multiple places on my page where I wan... | <p>there is a way, but it doesn't work in flash 10, therefore obsolete. For a non-flash solution, ajaxUpload is a good one.</p>
|
Why does sIFR chop off letters? <p>What would cause the bottom of characters like p, f, y to be invisible when using <a href="http://wiki.novemberborn.net/sifr/" rel="nofollow">sIFR</a>?</p>
| <p><code>line-height</code> is too small? There's some coverage about using <code>line-height</code> correctly with sIFR <a href="http://novemberborn.net/sifr3/font-sizing" rel="nofollow">here</a>.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.