input
stringlengths
51
42.3k
output
stringlengths
18
55k
What's the fastest way of find the previous and next record in a result not sorted by ID in MySQL? <p>I've looked around and the only questions/answers I can find on the site are related to sorting by the ID in MySQL. Questions such as: <a href="http://stackoverflow.com/questions/645102">stackoverflow.com/questions/645...
<p>The "less than" and "greater than" operators works on string fields as well. Fetch the current record. Then do:</p> <pre><code>SELECT id, first_name, last_name FROM user WHERE last_name &gt;= $current_lastname AND first_name &gt; $current_firstname AND active_flag = 1 ORDER BY last_name, first_name </cod...
RegEx to get path of file, without domain <p>I'm new to regular expressions, and have no clue where to start, it's like a diff language to me. But I need one quick to accomplish a task.</p> <p>I need to take</p> <pre><code>http://www.domain.com/folder1/folder2/file_path.txt </code></pre> <p>and get just</p> <pre><...
<p>construct a URI object from it and one of the properties of it will have what you want.</p>
Detect when app resigns active in cocoa? <p>Is there any way to detect when an app is no longer active? That is, listen for changes to this:</p> <pre><code>[NSApp isActive] </code></pre>
<p>In your app delegate, implement your choice of <code>-applicationDidResignActive:</code> or <code>-applicationWillResignActive:</code>.</p> <p>Alternately, listen for the <code>NSApplicationDidResignActiveNotification</code> or <code>NSApplicationWillResignActiveNotification</code> notifications on NSApp.</p>
How to find the pattern $iperf in the file using perl <p>How can I find and display the word $iperf in a file </p> <p>The file will look like this </p> <pre><code>$iperf -c 172.29.38.67 -m -M 64 -i 5 -t 20 -P 10 WARNING: attempt to set TCP maximum segment size to 64, but got 536 WARNING: attempt to set TCP maximum se...
<p>It sounds like you need a regex. The string <code>'$iperf'</code> does not exist in your data, so I am going to assume you mean <code>'iperf'</code>. You can find the lines that contain that string by looping over the file one line at a time and testing each line with a regex. If the regex succeeds, then you can ...
generate sql script from tables <p><img src="http://www.freeimagehosting.net/uploads/64fac9c8c4.gif" alt="alt text" /></p> <p>is it possible to generate sql scripts from for all tables ? i want to generate the sql script and import into another database server</p>
<p>Select the tables you want to export, right click, scripts>create table script. It works in mysql, not sure about oracle.</p>
How VNC Disconnects the already connected RDP Session <p>While using VNC combined with RDP, I have noticed a behaviour which VNC do, that is when you have connected to a machine using RDP (mstsc), and then you want to connect to that machine using VNC, it will disconnects the RDP session, and you will see a screen blin...
<p>When you connect using VNC it tries to connect to the console session using WinStationConnectW (Which is undocumented) this will disconnect the RDP session.</p> <p><a href="http://www.google.com/codesearch/p?hl=en&amp;sa=N&amp;cd=9&amp;ct=rc#6EfHfn50pmM/trunk/win/rfb%5Fwin32/TsSessions.cxx" rel="nofollow">Here is a...
How to use NSEnumerator with NSMutableDictionary? <p>How do I use NSEnumerator with NSMutableDictionary, to print out all the keys and values?</p> <p>Thanks!</p>
<p>Unless you need to use NSEnumerator, you can use fast enumeration (which is faster) and concise.</p> <pre><code>for(NSString *aKey in myDictionary) { NSLog(@"%@", aKey); NSLog(@"%@", [[myDictionary valueForKey:aKey] string]); //made up method } </code></pre> <p>Also you can use an Enumerator with fast enum...
C# compilation time for large projects (compared to C++) <p>I often hear people praise the compilation speed of C#. So far I have only made a few tiny applications, and indeed I noticed that compilation was very fast. However, I was wondering if this still holds for <b>large applications</b>. Do big C# projects compile...
<p>Yes, C# normally compiles a lot faster. Not always fast enough though. My biggest C# codebase with maybe a million lines of code with lots of projects took about an hour to compile. But I suspect much of this time is due to visual studios poor build system. Compile time for C++ on the other hand is usually much long...
WPF XAML StringFormat DateTime: Output in wrong culture? <p>I'm having some trouble with the output of a DateTime value. My computer's current culture is set to de-AT (Austria).</p> <p>The following code</p> <pre><code>string s1 = DateTime.Now.ToString("d"); string s2 = string.Format("{0:d}", DateTime.Now); </code></...
<p>Please <a href="http://stackoverflow.com/questions/520115/stringfomat-localization-problem/520334#520334">see my answer on StringFomat Localization problem</a></p>
Retrieving data from a VB.NET arraylist of objects <p>I am trying to retrieve the correct value from an ArrayList of objects (.NET 1.1 Framework):</p> <p>I have the following defined:</p> <pre><code>Public AlList As New ArrayList Public Class ItemInfo Public ItemNo As Int16 Public ItemType As String Publ...
<p>Put the following code:</p> <pre><code>Dim AnItemObj As New ItemInfo </code></pre> <p><strong>inside</strong> the loop which adds AnItemObj to the list. </p> <p>When you add a reference type to a list, you are only adding the reference, not the value. </p> <p>This means that if you add 10 times the same instance...
ASP.NET + C# Multi-Project Solution. Where should I put my global utility functions? <p>As the Title says, I've got a multi-project solution.</p> <p>I've got a "core" project that is loaded with most of the other projects. </p> <p>So my question is this, I have a few utility functions such as FormatPhoneNumber(..) th...
<p>The best way of doing this is to create a dll project (maybe called something like "CommonCode"?), that you can then reference this dll from all of your other projects and access the classes and methods therein.</p> <p>You will have to have some sort of "qualifier" (as you call it) somewhere, but to reduce the impa...
updating data record by record or updating a whole Datatable in web-based application? <p>in web-based application, which method is prefered? I also need some examples about this issue.</p> <p>Thanks in advance.</p>
<p>If you're going to update a large number of records then it would be advisable to use bulk/batch updates. Modern database systems support special bulk update facility. The main benefit of using bulk updates is high performance. Bulk update facility generally reduces the amount of data being transmitted across the th...
usage of system function in cpp program <p>Please explain the syntax of: system(const char *command);</p> <p>I want to use this function for running the command on unix sytem. I need to execute(automate) several test cases with the same command but,they also have other input values which are different.how do I reuse t...
<pre><code>int main() { char *base = "./your_testcase " ; char aux[50] = "./your_testcase " ; char *args[] = {"arg1" ,"arg2" ,"arg3"}; int nargs = 3; for(i=0;i &lt; nargs;i++) { /* Add arg to the end of the command */ strcat(aux,args[i]) ; /* Call command with parameter */ s...
How to remove strings contained in a list in VB.NET? <p>How can I find words like and, or, to, a, no, with, for etc. in a sentence using VB.NET and remove them. Also where can I find all words list like above.</p>
<p>Note that unless you use <a href="http://www.regular-expressions.info/wordboundaries.html" rel="nofollow">Regex word boundaries</a> you risk falling afoul of the <a href="http://stackoverflow.com/questions/259610/profanity-filtering-profanity-dictionaries-scunthorpe-problem-profanity-gen">Scunthorpe (Sfannythorpe) p...
How to delete all datastore in Google App Engine? <p>Does anyone know how to delete all datastore in <a href="http://en.wikipedia.org/wiki/Google%5FApp%5FEngine">Google App Engine</a>?</p>
<p>If you're talking about the <strong>live datastore</strong>, open the dashboard for your app (login on appengine) then datastore --> dataviewer, select all the rows for the table you want to delete and hit the delete button (you'll have to do this for all your tables). You can do the same programmatically through t...
extract cab file and execute the exe file(inside the cab file) automatically <p>I have a cab file(w/ an executable file inside) embedded on my webpage. When the user access the page the cab file will be automatically extracted and the executable file inside should be executed as well. Is this possible? My hunch is that...
<p>You need to use the hook&amp;run values, like in <a href="http://msdn.microsoft.com/en-us/library/aa751974%28VS.85%29.aspx#EXAMPLE" rel="nofollow">this sample</a></p> <blockquote> <pre><code>[version] signature="$CHICAGO$" AdvancedINF=2.0 [Add.Code] time.ocx=time.ocx msvcrt.dll=msvcrt.dll mfc42.dll=m...
Invalid procedure call or argument in vbscript <p>I am using vb script to upload a file to the server. The problem I'm having is that when I set the file to ASCII format like this...</p> <pre><code>Set oFile = oFS.CreateTextFile(sPath &amp; FileName, True, False) </code></pre> <p>I get an error when the sub is called...
<p>I suspect BinaryToString returns not only ASCII (actually the current OEM codepage) characters but also other characters in the unicode range that are outside the OEM codepage set.</p> <p>What exactly does BinaryToString do?</p>
Could ROWLEX be used as .DLL files in commercial projects (because of some non-LGPL components)? <p>As people asked in <a href="http://stackoverflow.com/questions/906808/how-can-rowlex-be-licensed-under-l-gpl-while-it-uses-semweb-which-is-gpl">How can ROWLEX be licensed under L-GPL while it uses SemWeb which is GPL?</a...
<p>You can use ROWLEX in commercial projects AND you can contribute to it, too. If you decide to change ROWLEX and you bind it to your commercially distributed product, L-GPL forces you to publish the modifications. </p> <p>If you decide to do both (contributing to ROWLEX and using the modified ROWLEX in a commercial ...
QtCreator performance on Windows <p>I've finally managed to run the QtCreator debugger on Windows after struggling with the Comodo Firewall incompatibilities.</p> <p>I was hoping to switch from an older version of Qt and Visual C++ to the newest version of Qt and QtCreator, but the debugger performance is atrocious. <...
<p>Yesterday I built a copy of the Qt 4.5.2 libraries using MSVC 2008 and am using the QtCreator 1.2 MS CDB (Microsoft Console Debugger) support. It seems much faster than gdb. Building Qt for MSVC takes a few hours, but it might be worth trying.</p> <p>Also, that means smaller Qt DLLs and EXEs as the MS compiler/li...
Why is this Hibernate servlet throwing an IllegalAccessError exception? <p>I tried to create a very small web app in NetBeans using Hibernate. I placed <code>hibernate3.jar</code> , <code>log4J-1.2.14.jar</code>, <code>sl4j.api.jar</code>, <code>sl4j-log4ja2-1.5.6.jar</code>, <code>dom4j-1.6.1.jar</code>, <code>jta.jar...
<p>The most obvious problem in your stacktrace is:</p> <pre><code>java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory </code></pre> <p>The answer is in <a href="http://stackoverflow.com/questions/467879/hibernate-3-4-with-slf4j-and-log4j">...
TGenericClass<T> containing a TObjectList<T> doesn't compile <p>I'm trying to write a generic class which contains a generic TObjectList&lt; T > which should contain only Elements of TItem.</p> <pre><code>uses Generics.Collections; type TItem = class end; TGenericClass&lt;T: TItem&gt; = class public Si...
<p>Generic types can have several constraints:</p> <ul> <li>A class name, the generic type must be of that class of a descendant of the class.</li> <li>An interface name, the generic type must implement that interface.</li> <li>'class', the generic type must be a class (this can't be combined with a classname).</li> <...
Convert it from DB into YAML in Rails <pre><code>rake db:fixtures:load </code></pre> <p>The YAML file which I put in the test/fixtures following is imported automatically by DB. Is there a method that converts the contents of the database into a YAML file for fixtures?</p>
<p>There's a great plugin called <a href="http://github.com/adamwiggins/yaml%5Fdb/tree/master" rel="nofollow">yaml_db</a>. I used it a couple of time to migrate data from one database to an other.</p>
Debug c++ dll in C# <p>I have a .dll from c++ and I want to debug it in C#, but I don't know how to.</p> <p>When I compiled the c++ project, Visual studio asked me to execute an ".exe".</p> <p>I supposed that I had to create a project to execute the dll.</p> <p>But I am lost, how could I debug it?</p>
<p>If I understand you correctly, you want to debug a C++ coded DLL that you created, in a C# project that calls the DLL, which you also created?</p> <p>I've done this before by going into your C# project properties, and under the Debug section, checking the "Enable unmanaged code debugging" check box. This should all...
ThreadStart.BeginInvoke throws NotSupportedException on Compact framework <p>I'm working with threads on a compact framework project and have code that looks something like below. When I try to step into StartThreads(), a NotSupportedException is thrown. This seems a bit wierd, why is the exception thrown on the line c...
<p>The BeginInvoke mechanism is not supported in CF<strike>, along with the ThreadPool</strike>.</p> <p>The reason you don't see the Exception where you expect is due to the way this is implemented. I am not totally sure about the details but BeginInvoke is not a normal method (of the Delegate class) but something tha...
Queue Oracle transactions using PHP oci_pconnect function in a webservice <p>I have written a webservice using the PHP SOAP classes. It has functions to return XML data from an Oracle database, or to perform insert/update/delete on the database.</p> <p>However, at the moment it is using Autocommit, so any operation is...
<p>Reusing the same uncommitted database session between PHP requests is not possible. You have no way to lock a user into a PHP processes or DB connection as the webserver will send a request to any one of many of them at random. Therefore you cannot hold uncommited data in the Oracle session between requests.</p> <...
Map implementation with duplicate keys <p>I want to have Map with duplicate keys, I know there are many Map implementations(eclipse shows me about 50), so I bet there must be one that allows this. I know its easy to write your own Map that does this, but i would rather use some existing solution. Maybe something in com...
<p>You are searching for a multimap, and indeed both commons-collections and Guava have several implementations for that. Multimaps allow for multiple keys by maintaining a collection of values per key, i.e. you can put a single object into the map, but you retrieve a collection.</p> <p>If you can use Java 5, I would ...
Best practice when you need two user controls (winforms) to communicate <p><strong>Extended problem</strong></p> <p>I would like to add a new problem in addition to the original problem specified below. One of the user controls in the application contains a list of objects that I need to access from another user contr...
<p>The two user controls should not have any knowledge of each other. If you want to always deal with them as a pair, consider creating a third user control to house them.</p> <blockquote> <p>Should the form wait for an Event from A, and then start the operation on B?</p> </blockquote> <p>Yes, this is the only good...
Will text fit in GTK# TextView without scroll bar <p>I have a GTK# Text View with word wrap and scroll bars turned on. I know that horizontal scroll bars will not be show because the words will wrap instead.</p> <p>I want to add some text but before adding it I want to find out if the text will fit without the need fo...
<p>I'm not aware of any way to measure the contents of a TextView without actually updating the text. It's a complex text layout widget that can handle formatted text, images, etc. Inserting text could change the layout quite substantially, so you can't "predict" how some new text will change the size without actually ...
Use NSArrayController with nested NSMutableArrays (Cocoa Bindings Question) <p>I have a NSArrayController with following Object:</p> <pre><code>@interface AdressCard : NSObject &lt;NSCoding&gt; { NSString* name; NSString* street; NSMutableArray* tasks; } </code></pre> <p>I have a simple GUI with an NSTabl...
<p>Use the <code>selection</code> property of the array controller, instead of <code>arrangedObjects</code>, for the second table view.</p> <p>What you're doing is called a master/detail layout; the documentation has <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Tasks/masterdetail.ht...
Generating a static library and an executable with a single installation (autoconf) <p>I know how to build a project or how to create a library using autoconf.</p> <p>What I want to achive is to generate a static library and use this library to build a project in a single configure/make/make install run.</p> <p>I wan...
<p>The easiest way to do this is with libtool and automake "convenience libraries". Here is a minimal example for Makefile.am</p> <pre><code>lib_LTLIBRARIES = libExample.la libExample_la_SOURCES = lfile1.C bin_PROGRAMS = test test_SOURCES = tfile1.C test_LDADD = libExample.la </code></pre> <p>for configure.ac</p> ...
How to resolve "Server Error in '/' Application" error? <p>I am trying to deploy an asp.net application in our server while I am receiving the following error.</p> <pre><code>Server Error in '/' Application. ________________________________________ Configuration Error Description: An error occurred during the proces...
<p>You may get this error when trying to browse an asp.net application. </p> <p>The debug information shows that "This error can be caused by a virtual directory not being configured as an application in IIS." </p> <p>However, this error occurs primarily out of 2 scenarios. </p> <ol> <li>When you create an new web a...
Get earliest timestamps for user's cards in a mysql data table <p>I have a database of users and a database of cards. The users see the cards repeatedly. </p> <p>I kept a record of every time the users saw the cards and how long they looked at the card.</p> <p>Now that I've got that data, I want to analyze it by cons...
<p>You didn't post the names of your columns, so I'll have to make them up:</p> <pre><code>SELECT `username`, `card_id`, MIN(`timeStamp`) FROM `usercardinfo` WHERE `timeStamp` between '2009-04-01' and '2009-06-01' GROUP BY `username`, `card_id` </code></pre>
How to reduce processing time on a web form <p>I have a webform with quite a few fields (between 15 to 40, based on user options). When user ends filling the form, I block it with jQuery.blockUI, and then on Server Side I process the form, packing it on an xml and call a new page. But transition between pages usually t...
<p>I think you need to focus on why it takes so long processing 40 fields. What are the potential bottlenecks on the backend? What queries are you performing that take so long? If you can reduce the processing time to less than 10 seconds you can get away with your page handling the processing otherwise you need a di...
How to get IMEI number of a data card <p>I have one vodaphone data card with SIM embeded in that.</p> <p>there is IMEI number printed on datacard</p> <p>i wanted to know is there any way to read the IMEI number of that data card programatically.</p> <p>I am using datacard for browsing. </p> <p>and also i wanted to...
<p>The data card most likely acts as a modem, and most GSM modems support the <a href="http://www.ctiforum.com/standard/standard/etsi/0707.pdf" rel="nofollow">ETSI GSM 07.07</a> standard.</p> <p>You should get the IMEI by issuing <code>AT+CGSN</code>:</p> <h2>5.4 Request product serial number identification +CGSN</h2...
Trying to get jCarousel to fetch new set of records on click of Next button <p>I've been trying for the last 2 days to get this thing to call my getJSON and fetch a new set of records based on the carousel.last value when you click the next button. It loads 3 pictures on start up just fine but the next button is not e...
<p>I took your code and ran it in FF4 and IE9. Next button is enabled and I even see ajax calls being made when I click the next icon. Is your problem browser specific? </p> <p><img src="http://i.stack.imgur.com/Heyz5.png" alt="enter image description here"></p>
ExtJS and grails <p>Does someone have any examples for using ExtJS (3.0) as frontend with grails, e.g. reading grid data with JSON, error handling with JsonReader, etc.</p>
<p>Searching over google i found <a href="http://grails.org/Using+ExtJS+Layouts+with+Grails+Layouts" rel="nofollow">tutorials</a> in grails site. Moreover , some other example is : </p> <p><a href="http://compiledammit.com/2012/08/20/simple-grails-extjs-coffeescript-example/" rel="nofollow">example one</a> <a href="ht...
File Upload and Unit Testing with Zend Framework <p>How can one best test a controller action which receives a file upload using <code>Zend_Test_PHPUnit_ControllerTestCase</code>?</p> <p>Ideally, <code>$this-&gt;getRequest()-&gt;setPost()</code> would take a filename in the data array, but this does not seem to be sup...
<p>I would recommend taking a look at the <a href="http://framework.zend.com/svn/framework/standard/trunk/tests/Zend/File/Transfer/Adapter/HttpTest.php">unit tests</a> from the <code>Zend_File_Transfer</code> component. They will be able to offer some insight into this.</p> <p>Basically, you can manipulate the <code>$...
How do I work with a Canvas / JCanvas in Netbeans <p>In netbeans it is possible to add a canvas to your app, however it does not seem possible to draw on the canvas because you need to overload the paint(Graphics) method. What is the best way to do this? Thanks!</p>
<p>You just write a class that extends Canvas / JCanvas then drop it onto the GUI designer from the navigator pane. </p>
Java - PDF Generation Framework <p>I am using PDF documents for various purposes using iText library. Its like once class per PDF document. In a way there are a lot of similarities among the classes and the same have been listed below:</p> <ol> <li>The fields have (x,y) location</li> <li>The field can be wrapped after...
<p>take a look at PDFBox Library which is now in the incubator of Apache</p>
Need to have spacing between end of div and beginning of paragraph <p>I have text within a paragraph tag that that fits snug on the bottom of a div, which you will see in this picture: <a href="http://i44.tinypic.com/e05s0z.png" rel="nofollow">http://i44.tinypic.com/e05s0z.png</a></p> <p>I could put some padding at th...
<p>Give the final paragraph an id - #disclaimer, perhaps - then style that to have padding-top.</p> <pre><code>&lt;p id="disclaimer"&gt;Herkimer County Community College does not discriminate on the basis of race, color, sex, national origin, age, handicap, or marital status in admission, employment, or in any aspe...
calling php from js (w/ ajax) <p>I'm building a basic forum where every post contains some text, first and last name, and the date the message was written. I'd like to have the board update with AJAX constantly, and to add new messages on the fly as they are written. I have a file, <code>getlatest.php?date=...</code> t...
<p>The way to avoid the mismatching of dates/times between the server and client is to have each entry have a unique id. This way, you're able to give a specific record rather than a relative time for your offset. Primary keys in MySQL are an example of this.</p>
Best way to initialize an entity framework context? <p>When initialize an entity framework context. </p> <p>One is to initialize at class level, such as</p> <pre><code>public class EntityContactManagerRepository : ContactManager.Models.IContactManagerRepository { private ContactManagerDBEntities _entities = n...
<p>It does matter, because the context controls the lifetime of change tracking data, and also impacts which object instances you can link together when you edit the objects, since objects on two different contexts cannot have a relationship with each other. It looks to me like the examples you're sharing come from an ...
In Python, Using pyodbc, How Do You Perform Transactions? <p>I have a username which I must change in numerous (up to ~25) tables. (Yeah, I know.) An atomic transaction seems to be the way to go for this sort of thing. However, I do not know how to do this with pyodbc. I've seen various tutorials on atomic transact...
<p>By its <a href="http://code.google.com/p/pyodbc/wiki/FAQs#Connecting%5Ffails%5Fwith%5Fan%5Ferror%5Fabout%5FSQL%5FATTR%5FAUTOCOMMIT">documentation</a>, pyodbc does support transactions, but only if the odbc driver support it. Furthermore, as pyodbc is compliant with <a href="http://www.python.org/dev/peps/pep-0249/">...
Free multiple selection calendar <p>Does anybody know a free ASP.NET control that allow to select multiple dates ?</p> <p>I'd like something like the <a href="http://msdn2.microsoft.com/en-us/library/bz9tc508.aspx" rel="nofollow">classic ASP.NET DateTime picker</a> but with multiple selection.</p>
<p>I prefer to use (but not ASP.NET control) the <a href="https://developer.yahoo.com/yui/calendar/" rel="nofollow">YUI calendar</a>.</p>
Mylyn like App for my Desktop <p>so i am a big Fan of Mylyn. I like to manage all my Tickets/Tasks etc in Trac.</p> <p>I am looking forward to get an app like Mylyn for my regular Desktop outside Eclipse. Its not really programming related...but managing Tasks is one challenge we are facing every Day.</p> <p>Any sugg...
<p><a href="http://www.eweek.com/c/a/Application-Development/Tasktop-Updates-Mylyn-Tasktop-Tools-for-Eclipse-Galileo-134393/" rel="nofollow" title="Tasktop">Tasktop</a> is exactly that:</p>
Why does a hyphen in a RewriteRule break when in a sub-folder <p>I have a bunch of RewriteRules in .htaccess for SEO purposes. Sample...</p> <pre><code>RewriteEngine On RewriteRule ^signup$ /signup.php RewriteRule ^account$ /account.php RewriteRule ^logout$ /logout.php RewriteRule ^login$ /login.php RewriteRule ^rece...
<p><strong>Solution</strong> -- It wasn't the hyphens at all.</p> <p>It was because MultiViews was enabled for www. domains, but not for ask. domains</p> <p>/signup would map to /signup.php with MultViews default behavior, </p> <p>but </p> <p>/recent-question doesn't map to recent.php</p> <p>Under the ask. subdoma...
Why is my LINQ DataClass Context Object not showing up? <p>Here is an image of my project's tree view:</p> <p><img src="http://i40.tinypic.com/8y6i9w.jpg" alt="alt text" /></p> <p>As you can see, My linq data object resides in the App_Code folder under 'FYI'.</p> <p>When I open the ControlPanel.ascx and add the Linq...
<p>It is important to always rebuild your project or solution after creating (or modifying) your Linq Context Object. The code for those data classes is actually generated at build-time, so it does not exist until you do so. This catches a <strong>lot</strong> of people, so don't feel bad about asking this one :)</p>
How to get the last changed Revision per file <p>for our build process i need to know the "last changed" Revision of each file in a certain repository.</p>
<p><code>svn info</code> will output one line containing <code>Last Changed Rev:</code> which you could parse.</p>
Bash script what is := for? <p>Does anyone know what is := for?</p> <p>I tried googling but it seems google filters all symbol?</p> <p>I know the below is something like checking if the variable HOME is a directory and then something is not equal to empty string.</p> <pre><code> if [ "${HOME:=}" != "" ] &amp;&amp; ...
<p>From <a href="http://www.delorie.com/gnu/docs/bash/bashref%5F29.html">Bash Reference Manual</a>:</p> <blockquote> <p><code>${parameter:=word}</code></p> <p><em>If parameter is unset or null, the expansion of word is assigned to parameter. The value of parameter is then substituted. Positional parameter...
MVC pass a CV Class to a new Page <p>I'm using MVC, I've got a search page, and I want to pass multiple arguments to the next page. </p> <p>I want to wrap these multiple parameters into an Object (CV) and pass it to the next screen, not just pass all the args individually via the query string.</p> <p>I'm sure there a...
<p>Use TempData. </p> <p>TempData is a lightweight data store which provides next request with the data that you stored and purges it afterwards. </p> <pre><code>TempData["searchParams"] = someParams; return RedirectToAction("Index"); </code></pre> <p>When Index runs you can read the data from TempData["searchParams...
How to put .flv videos on aspx pages <p>I have to design a page in which I have to place few flv video files. In general under upload.aspx page I uploaded few videos which are stored under videos directory in my site. I want to put them in my videoview.aspx page. Now can anyone please help in saying how to put videos i...
<p>You will need a player of some sort.</p> <p>I recommend <a href="http://www.longtailvideo.com/players/jw-flv-player/" rel="nofollow">Longtail's JW player</a></p>
Is it bad to "think" in LINQ when the skill isn't transferrable outside C#? <p>I use LINQ in my code all the time. I've gotten to the point where it just seems so natural to Group, Order, an organize a bunch of objects using the LINQ syntax that I struggle to think how I would do the same things without it.</p> <p>I ...
<p>Fortunately, no. The "LINQ" way of thinking is more properly understood as a "functional" way of thinking, and this is a highly transferable mindset. </p> <p>Obviously when you move from language to language and framework to framework the syntax and framework methods will be different but the mindset is the same. ...
Design patterns used in the .NET framework? <p>One way to increase your understanding of design patterns is to discover how patterns are used in the .NET framework.</p> <p>Have you found any examples of design patterns in the .NET framework? In your answer please give a short description of the pattern, and example of...
<p>The <a href="http://en.wikipedia.org/wiki/Decorator%5Fpattern">Decorator Pattern</a> is used on the Stream classes:</p> <ul> <li>System.IO.Stream <ul> <li>System.IO.BufferedStream</li> <li>System.IO.FileStream</li> <li>System.IO.MemoryStream</li> <li>System.Net.Sockets.NetworkStream</li> <li>System.Security.Cryptog...
Pass and access structures using objective-c <p>I want to know how to pass structures to another function and subsequently access that structure in the called function. I'm developing for the iPhone and the reason I'm using structs is so that I can eventually pass data as structs to a server being built in C.</p> <p>H...
<p>You are passing in a pointer to a struct. Use the -> operator, not the dot.</p> <pre><code>myUser-&gt;firstName </code></pre>
What is the best way to add an API to a Django application? <p>I am adding MetaWeblog API support to a Django CMS, and am not quite sure how to layer the application.</p> <p>I am using django_xmlrpc, which allows me to map to parameterised functions for each request. It is just a case of what level do I hook in calls ...
<p>Web services API's are just more URL's.</p> <p>These WS API URL's map to view functions.</p> <p>The WS view functions handle GET and POST (and possibly PUT and DELETE).</p> <p>The WS view functions use Forms as well as the Models to make things happen.</p> <p>It is, in a way, like an admin interface. Except, th...
JQuery, event bubbling on table cells. How to work out which row is clicked on <p>I have table enclosed by a div that looks similar to this.......</p> <pre><code>&lt;div id="records"&gt; 10 | text1 | Delete 23 | test2 | Delete 24 | text3 | Delete 32 | text4 | Delete &lt;/div&gt; </code></pre> <p>I'd like to make th...
<p>You said the table is populated from ajax, so, you can actually store your metadata into the table, assuming the following html is generated:</p> <pre><code>&lt;tr&gt; &lt;td&gt;23&lt;/td&gt; &lt;td&gt;test2&lt;/td&gt; &lt;td&gt;&lt;a&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;td class='id'&gt;37474&lt;/td&...
WiX 3.0 throws error 217, while being executed by continuous integration <p>This is the error that is thrown by our automated build suite on Windows 2008, while running <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa369554%28v=vs.85%29.aspx">ICEs</a> (after migrating from <a href="http://en.wikipedi...
<p><strong>End of the story</strong>:</p> <p>After fiddling with the permissions of the integration account, <a href="http://en.wikipedia.org/wiki/Distributed_Component_Object_Model">DCOM</a>, service activation, etc. without any luck, I finally simply disabled ICE validation in the continuous integration build, while...
LINQ to Entities: Using DateTime.AddMonth in Lambda Expression <p>I've been reading some posts but I don't find a solution to a problem that I have with LINQ To Entities, Lambda Expressions and <code>DateTime.AddMonth</code>.</p> <p>The problem is that I'm trying to use <code>DateTime.AddMonth</code> inside a Lambda E...
<p>You could return the necessary information without filtering on the date, then filter on the date afterward. (Of course, I'm not sure what size your data will be, so this may be inefficient. If so, you'll need a SQL-based solution of some sort -- maybe a stored procedure.)</p> <pre><code>List&lt;Orders&gt; orders...
Do I have to pthread_join each thread I create? <p>From pthread_join() man page:</p> <p><code>When a joinable thread terminates, its memory resources (thread descriptor and stack) are not deallocated until thread performs pthread_join on it. Therefore, pthread_join must be called once for each joinable thread creat...
<p>You don't <em>need</em> to join a thread, but it is a good idea. Without calling pthread_join(), there is a possibility that the main() function will return before the thread terminates. In this case, pthread_join() makes the application wait until the other thread finishes processing. Plus, when you join the thread...
Simple XML not working on client server <p>I built a site using simpleXML to pull content from XML pages.</p> <p>I just switched the site to the client server and the pages that pull from the XML sheet don't work anymore.</p> <p>Testing server was PHP version 5.2.9</p> <p>Client server is PHP version 5.2.5</p> <p><...
<p>Add more error handling and debug code</p> <pre><code>&lt;?php assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_BAIL, 1); assert_options(ASSERT_QUIET_EVAL, 1); error_reporting(E_ALL); ini_set('display_errors', 1); class award { function titles() { $xml=simplexml_load_file("awards.xml"); if (!$...
How to write "on form submit complete" using javascript? <p>I have a form loading inside my page and there is a button out side this form its function is to submit this form.</p> <pre><code>$('#MyForm').submit(); </code></pre> <p>I want a way to write a submit complete function, means to know that the form successful...
<p>Actually, you can use the jquery form plugin, just use the ajaxSubmit() method.</p> <p><a href="http://malsup.com/jquery/form/#api">Documentation for the jQuery form plugin.</a></p> <pre><code>// setup the form, and handle the success $('#myFormId').ajaxForm({ success: function() { // do what you are lookin...
OpenGL background dissappears with certain Polygon Modes <p>I am creating a simple gradient background by drawing a quad as follows:</p> <pre><code> glMatrixMode GL.GL_PROJECTION glLoadIdentity glMatrixMode GL.GL_MODELVIEW glLoadIdentity ***glPolygonMode GL_FRONT_AND_BACK, GL_LINE*** glDisable glcDepthTest ...
<p>You need to push the polygon mode of GL_FILL onto the stack before drawing your background polygon, then pop it back off the stack.</p>
iPhone - Corrupt JPEG data for image received over HTTP <p>I'm getting an image over HTTP, using NSURLConnection, as follows - </p> <pre><code>NSMutableData *receivedData; - (void)getImage { self.receivedData = [[NSMutableData alloc] init]; NSURLConnection *theConnection = // create connection } - (void)conn...
<p>Your HTTP code looks correct. You might want to log the size of the receivedData once it's done loading and compare it to the expected size of the image on the server. If it's the expected size, then maybe the image itself is corrupted on the server.</p>
struct initializer, typedef with visual studio <p>I wonder why the following does not work with Visual studio</p> <pre><code>typedef struct { float x, y; } complexf; typedef union { complexf f; long long d; } rope; int main(void) { complexf a; rope z = {a}; } </code></pre> <p>The error is at lin...
<p>ANSI C standard (aka C89), 3.5.7:</p> <blockquote> <p>All the expressions in an initializer for an object that has static storage duration <em>or in an initializer list for an object that has aggregate or union type</em> shall be <strong>constant expressions</strong>.</p> </blockquote> <p>The latter part...
iphone MGTwitterEngine - post a tweet with my app signature <p>I'm using MGTwitterEngine in an iPhone app, and it works great. The one thing I want to change is the "posted from MGTwitterEngine" that appears on Twitter. Obviously I'd like it to say "from MyCoolApp", and link to the app's website.</p> <p>When you regis...
<p>You can find detailed information on how to do this in the Readme: <a href="http://svn.cocoasourcecode.com/MGTwitterEngine/README.txt" rel="nofollow">http://svn.cocoasourcecode.com/MGTwitterEngine/README.txt</a></p> <p>You mentioned that you already received your token, so the next step would be to call the method<...
Invalid Pointer Operation <p>I have a form that contains a <code>TOpenDialog</code> component (<code>OpenDialog1</code>) and a button. <code>OpenDialog1</code> has the <code>ofAllowMultiSelect</code> (of <code>Options</code>) property set to true.</p> <p>Upon clicking the button the method <code>AddFilesToListView</co...
<p>"Invalid pointer operation" means you freed memory that didn't belong to you. One of these three things is the cause:</p> <ul> <li>Your program freed something that had already been freed once before.</li> <li>Your program freed something that was never allocated in the first place.</li> <li>Your program freed some...
ASP .Net MVC save and replay post data <p>I am trying to figure out how to do the following:</p> <p>1) After a form is submitted, serialize the raw post data and store it to a database</p> <p>2) Read the post data from the db and replay it by re-posting it to the same URL</p> <p>To explain my end goal, we have three...
<p>I did something similar once for logging purposes. I logged both GET and POST requests such that they could be duplicated, for the purposes of tracking down errors logged by our test group, and by the live application.</p> <p>The biggest trick here is that your web application needs to be, for the most part, state...
Ideas on VBS structure to allow common code <p>To all the VBS Gurus out there...</p> <p>I have written a suite of VB scripts (for automating installs, if you must know) which use a set of common functions for thing like logging, starting/stopping services etc.</p> <p>I have come up with a design which uses a script w...
<p>We achieved the same in VB5.</p> <p>In our application VB scripts were used to customize the business rules and even UI. There was an appropriate file structure , for example base classes were in base\ folder.</p> <p>When VB application was running, we use MSScript control to run scripts. Initialization step was t...
Is there any difference between the **copy** and ** addAll**? <p>1)Is there any difference between these two keywords for the elements of collections??(<strong>Copy</strong> those elements to the other collection and <strong>addAll</strong> those elements to the other collection)</p>
<p>Yes, there is a difference.</p> <p>From the <a href="http://java.sun.com/javase/6/docs/api/java/util/Collections.html">java docs</a>:</p> <p><strong><code>Copy</code>:</strong> Copies all of the elements from one list into another. After the operation, the index of each copied element in the destination list will ...
How can I get the revision number into an Ant property in Luntbuild? <p>I'm sure this must be possible:</p> <p>I want to have the revision number (from Subversion) put into a property that is accessible from Ant when my build runs in Luntbuild. There must be an OGNL expression that I can add to the Build Properties b...
<p>You might find using either the <a href="http://subclipse.tigris.org/svnant.html" rel="nofollow">SvnAnt</a> or <a href="http://code.google.com/p/svntask/" rel="nofollow">svntask</a> Ant tasks to get the Subversion revision number directly in your Ant script might be a valid alternative.</p>
superinterface in java <p>What is super-interface is java? what is the purpose of super-interface?</p>
<p>Here's an example:</p> <pre><code>public interface A { void doSomething(); } public interface B extends A { void doSomethingElse(); } </code></pre> <p>In this example, <code>A</code> is a <em>superinterface</em> of <code>B</code>. It's like being a superclass. Any class implementing <code>B</code> now als...
No data in Simple SQL Server 2005 Analysis Services Cube (Analytics Accelerator for Microsoft Dynamics CRM 4.0) <p>I installed, deployed &amp; processed the cube on my CRM system as discussed in the documentation. At no point in this process do I receive any error. From within the Visual Studio Microsoft CRM MSCRM da...
<p>If you haven't figured it yet it sounds like your cube hasn't been processed. If any piece of it changes and you want these values to show you must reprocess and deploy. Likewise, if you just created the cube you have to process and deploy to your SSAS server to browse it through BIDS or SMS. </p>
xsl cdata-section-elements output property with Xalan-J <p>I'm trying to output a CDATA section in the result of XSLT using Xalan 2.7.1. I have applied this XSL to the XML in a tool and the result contains CDATA. In the method below, no CDATA is in the result and no exception is thrown. I feel like I'm missing somet...
<p>Are you saying you want to output the CDATA as part of the element?</p> <pre><code>&lt;newchildelem&gt;&lt;xsl:value-of select="/parentelem/childelem" /&gt;&lt;/newchildelem&gt; </code></pre> <p>with </p> <pre><code>&lt;newchildelem&gt;&lt;xsl:text&gt;&amp;lt;![CDATA[ &lt;/xsl:text&gt;&lt;xsl:value-of select="/pa...
What's the main difference between Java SE and Java EE? <p>What's the main difference between Java SE and Java EE?</p>
<p><strong>Java SE</strong> (formerly J2SE) is the basic Java environment. In Java SE, you make all the "standards" programs with Java, using the API <a href="http://java.sun.com/javase/6/docs/api/">described here</a>. You only need a JVM to use Java SE.</p> <p><strong>Java EE</strong> (formerly J2EE) is the enterpris...
Periodic restarting auto numbering for SQL Server <p>I have a requirement for a program I'm working on to store job numbers as YY-###### with incrementing numbers starting at 000001 in each year preceded by the last two digits of the year. </p> <p>The only method I've been able to come up with is to make a CurrentJob...
<p>An identity column is by far the fastest and most concurrent solution to generating sequential numbers inside SQL Server. There's no need to make it too complicated though. Just have one table for generating the identity values, and reset it at the end of the year. Here's a quick example:</p> <pre><code>-- Sequence...
Access 2003 VBA: custom form property problem <p>I have a regular form called "Fish". It has a TreeCtl called "loctree" which I used as a location chooser to change a field in Fish. </p> <p>I've since added several subforms to Fish. Two of these have location fields that I would like to use loctree for. Since I didn't...
<p>IIRC, your properties should look like</p> <pre><code>Property Set loc_focusField(target As Field) set locfield = target End Property Property Get loc_focusField() as Field set loc_focusField = locfield End Property </code></pre> <p>Does that work?</p>
Performance impact of changing to generic interfaces <p>I work on applications developed in C#/.NET with Visual Studio. Very often ReSharper, in the prototypes of my methods, advises me to replace the type of my input parameters with more generic ones. For instance, List&lt;> with IEnumerable&lt;> if I only use the lis...
<p>You're worried about performance - but do you have any grounds for that concern? My guess is that you haven't benchmarked the code at all. <em>Always</em> benchmark before replacing readable, clean code with more performant code.</p> <p>In this case the call to <code>Console.WriteLine</code> will utterly dominate t...
In Rails, display time between two dates in English <p>In a Rails project I want to find the difference between two dates and then display it in natural language. Something like</p> <pre><code>&gt;&gt; (date1 - date2).to_natural_language "3 years, 2 months, 1 week, 6 days" </code></pre> <p>Basically <a href="http:/...
<p>The Rails' <code>ActionView</code> module includes two methods that may do what you require: </p> <ul> <li><a href="http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words" rel="nofollow"><code>distance_of_time_in_words</code></a></li> <li><a href="http://api.rubyonr...
Is ajax breaking my javascript objects? <p>I have a page that does ASP.NET ajax postbacks using UpdatePanels. In some javascript, I set up some objects in the window.onload event, which works great. When I do a postback though, it seems like my objects are messed up.</p> <p>One object which was receiving events from...
<p>The <code>this</code> keyword (special variable) changes based on what function is calling it. Basically, it's an issue of scope. You need to either do a closure around the function which is being called on the ajax response, <em>OR</em> put what you need into the global scope, <em>OR</em> do what you are doing (whi...
Randomly select a record from Active Directory Application Mode <p>I need a routine to randomly select records from ADAM (Active Directory Application Mode). Any advice to get me started on this task?</p>
<p>Use a <a href="http://msdn.microsoft.com/en-us/library/system.directoryservices.directorysearcher.aspx" rel="nofollow">DirectorySearcher</a> filter with (objectClass=user) and pick a result at random might work. Something like ...</p> <pre><code>private static Random rnd = new Random(); private static DirectoryE...
NetBeans file upload config <p>Is there a way to stop the confirmation window from opening with the files checked and then having to click ok for the file to upload?</p> <p>I set up a shortcut on the keyboard to upload, and I just want to use the shortcut and have it upload without me having to click anything.</p> <p...
<p>I have been using stable and development versions on linux. Now NetBeans IDE 7.0 M2 (Build 201010151251). </p> <p>I've noticed that development versions never ask for confirmation to upload. Thats good but dangerous. So I set up a shortcut away from the usual combinations like [CTRL][L].</p>
How to Abort a Socket in C# <p>I'm trying to abort a socket connection such that the client at the other end will get a "WSAECONNABORTED (10053) Software caused connection abort." error message when it polls the connection.</p> <p>Close() and Shutdown() will disconnect gracefully. I don't want a graceful disconnection...
<p>What if you kill the process, and/or reboot the machine, and/or unplug the ethernet cable, without calling Close() and/or Shutdown()?</p>
XSD generator from several XMLs <p>I know it is possible to generate skeleton XSD from XML. For example this <a href="http://stackoverflow.com/questions/288236/xsd-code-generator">post</a> has good answers.</p> <p>The question is how to generate XSD based on <strong>several</strong> XMLs. The idea is that each XML mig...
<p><a href="http://www.thaiopensource.com/relaxng/trang.html">Trang</a> is just such a tool written in by the notable James Clark. It can translate between different forms of xml definitions such as Relax NG normal and compact syntax, old school DTD and XML schema. It can also infer schema from one or more xml files. <...
A loop in a loop to fill an array? <p>I am building a time registration program. Users can work on a project, and I want to display in a chart how many hours each user worked on a project, let's say, each month. The chart plugin works like this:</p> <pre><code>first_serie = OpenFlashChartLazy::Serie.new( [["2008-1",1...
<p>I have no idea how you generate all the data for Serie.new, but you can get started using this:</p> <pre><code>@series = [] users = User.find(:all) users.each do |user| @series &lt;&lt; OpenFlashChartLazy::Serie.new(blah, blah, blah) end </code></pre> <p>This will add all of the added Serie objects to an array.<...
display tags jsp tags <p>i am using diaply tags library for displaying my tables.But i cant use the &lt;% %> tagst there.If i try to us it it gives me error.but i can use tag there. If i try to use followin code in my jsp it give an error sayin shoul hav a matcheing ending tag. i have follown java code in jsp</p> <p...
<p>You can use the name attribute of the table tag (normally like this:)</p> <pre><code>&lt;display:table name="crc" ...&gt; &lt;/display:table&gt; </code></pre> <p>To use the crc List as the basis of Javabeans to display.</p> <p>See <a href="http://displaytag.sourceforge.net/1.2/displaytag/tagreference.html#display...
What is the purpose of Scala programming language? <p>It is my opinion that every language was created for a specific purpose. What was Scala created for and what problems does it best solve?</p>
<p>One of the things mentioned in <a href="http://ftp.heanet.ie/mirrors/fosdem-video/2009/maintracks/scala.xvid.avi">talks by Martin Odersky</a> on Scala is it being a language which scales well to tackle various problems. He wasn't talking about scaling in the sense of performance but in the sense that the <em>languag...
CollapsiblePanelExtender: Can I initiate collapse/expand from client-side javascript? (AJAX Control Toolkit) <p>The CollapsiblePanelExtender seems primarily designed to collapse/expand things in response to user mouse events. Is there also a good way to get the extender to collapse/expand things in response to client-s...
<p>I have a partly working solution now.</p> <p>I followed Ian's suggestion and looked through the toolkit source. In <code>CollapsiblePanelBehavior.debug.js</code>, you can that <code>expandPanel()</code> is apparently intended as part of the public interface for the behavior. There's also a <code>get_Collapsed()</co...
Team Build - Automatically Reenable Agent After Becoming Unreachable <p>We have a central Team Foundation Server (2008) deployment where all projects get stored. Each project sets up their own build server running Team Build to do their own automated builds.</p> <p>Here's the problem. When a connection error is detect...
<p>In TFS2008, the AT should ping the unreachable build agent on a regular period (15-30 minutes, can't remember the interval at the moment) to see if it is back up. Are you not seeing this behaviour - do yours stay unreachable?</p> <p>That said, it is possible to write a bit of .NET code that you could run periodica...
Function naming: ActionIfCondition() <p>I often need to use a function which performs and action X is condition Y is set. What is the best way to name such a function? </p> <p>I don't want to repeat <em>if</em> statements, since they could be complex.</p> <p>For instance, if I want to trim a string if a property is s...
<p>Try something like:</p> <pre><code>if(IsComplexCondition(complexData)) { DoThing(otherData); } </code></pre> <p>You generally don't want to couple the condition with the operation because you're making a single function capture too much semantic information at that point. It's "doing more than one thing." In...
Ignoring users when deploying a database project from VS2008 <p>I am currently working on an application that has different permissions/users for the local development environment and test. I want to be able to ignore the users and permissions when deploying to either environment. Under the .sqldeployment file, there...
<p>Sorry, not currently possible in the 2008 version of Visual Studio.</p>
Which linux server distro to use for tomcat? <p>ubuntu 9.04, fedora 11, redhat... what are the differences from a web server/development standpoint?</p>
<p>None. They differ only in how they package things, but they're all essentially the same - same operating system, same software. Some people get quite emotional about this choice, but I've used several, and there's nothing to pick between them these days.</p>
Using Action<T> as an argument in C# (mimicking a function pointer) <p>I need to write a delegate function that can 'wrap' some while/try/catch code around a basic UDP call to verify the link. I made it work for Func for a function that has no arguments, but I can't make it work for Action, which has an argument (but n...
<p>If you want this to be generic enough to handle any number of arguments, try using the non-genernic Action delegate:</p> <pre><code>protected void udpCommand(Action command) { while(!linkDownFail) { try { command(); break; } catch { ...
Preventing an ASP.NET Session Timeout when using Silverlight <p>I'm writing a program which has both an ASP.NET configuration system and a Silverlight application. Most users will remain on the Silverlight page and not visit the ASP.NET site except for logging in, etc.</p> <p>The problem is, I need the session to rem...
<p>On the page hosting the silverlight control, you could setup a javascript timer and do an ajax call to an Http Handler (.ashx) every 5 minutes to keep the session alive. Be sure to have your Handler class implement <code>IRequiresSessionState</code>.</p> <p>I recommend the Handler because it is easier to control t...
How do you stub an individual method in java for unit testing? <p>I've got a method in a class that's writing to some string, which calls another method which does the same. Something like:</p> <pre><code>void foo() { a += "xyx"; bar(); } void bar() { a += "abc"; } </code></pre> <p>For unit testing purposes, I...
<p>Create a subclass that overrides bar() that does nothing.</p>
ADODB.Stream alternative for large images <p>Need to find an alternative to using ADODB.Stream as it will load the entire file into memory and with file sizes over 200MB and simultaneous downloads can easily run out of memory.</p> <p>The only thing I can find to do would be to either rewrite in ASP.Net or write our ow...
<p>I don't think ADODB.Stream actually does read the whole file into memory, it will use a .tmp file in the Temporary directory. However it still isn't the most desirable approach.</p> <p>In the past I've build my own VB6 component to create an IStream implementation on top of the WinAPI having done extensive searchi...
how to distribute a Flash component for use with MTASC? <p>I have a Flash component that's just a library of compiled code with some exposed API calls. Normally we distribute this as a SWC or MXP, and it works just fine. Recently I had a client express interest in using my component, but they do all their development i...
<p>I did find an answer, and I'm not 100% sure if this is exactly the process since I'm no longer at that job and don't have the computer/process in front of me anymore. It was a bit of a hack. </p> <p>What it involved basically was unzipping the SWC file and getting a .swf and a bunch of .asi files out. </p> <p>The ...
GWT Html file with CSS <p>When I'm creating new project with GWT plug in it creates a skeleton project for me. In html file there is a comment saying <strong><em>"Consider inlining CSS to reduce the number of requested files"</em></strong> Why would i consider using inline css? I tough having css in separate file not i...
<p>The answer lies in the way that GWT operates. Since GWT only has one page load per module load the inlined caching doesn't really come into play. </p> <p>If you just want the answer: <strong><em>inlined CSS reduces the number of TCP/IP connections that are needed to load all of the files that compose your project...
Are all .Net Obfuscators equal in speed terms? <p>I currently use the free obfuscation tool that ships with VS and it does what I need but my program seems slower after obfuscation, are other ofuscators any better?</p> <p>Thanks</p>
<p><em>Seems</em> slower? Benchmark it. Prove that you actually have a problem before trying to solve it.</p> <p>I doubt that all obfuscators will have the same performance characteristics, but I also doubt that anyone can really predict what effect any particular one will have on a real-world app without trying it. W...
Javascript - Fastest way to show and hide lots of list items <p>As the user pans around a Google Map, a list of of currently visible markers is updated. This list contains up to 1000 items, and it slows down when several hundred li's are shown or hidden all at once. It's less than half a second, but it's getting anno...
<p>You could store the <code>&lt;li&gt;</code> elements in an array directly so you don't have to do hundreds of CSS selector lookups. Then instead of <code>$("ul#theList li#"+i)</code> you just do <code>liArray[i]</code>.</p> <p>FYI, <code>"ul#theList li#&lt;i&gt;"</code> is equivalent to just <code>"#&lt;i&gt;"</cod...
How to use long id in Rails applications? <p>How can I change the (default) type for ActiveRecord's IDs? int is not long enough, I would prefer long. I was surprised that there is no :long for the migrations - does one just use some decimal?</p>
<p>Credits to <a href="http://moeffju.net/blog/using-bigint-columns-in-rails-migrations">http://moeffju.net/blog/using-bigint-columns-in-rails-migrations</a></p> <pre><code>class CreateDemo &lt; ActiveRecord::Migration def self.up create_table :demo, :id =&gt; false do |t| t.integer :id, :limit =&gt; 8 ...