instruction
stringlengths
0
30k
My team has been using Ext with DWR for almost year a year, and have had nothing but good things to say. If you take this approach, you will end up using DWR's generated JavaScript classes for making your requests to the server. This will often be done in place of using the Ext.Ajax and Ext.data.Connection classes. ...
apply-template and call-template do not perform the same task, performance comparison is not really relevant here. call-template takes a template name as a parameter whereas apply-template takes an xpath expression. Apply-template is therefore much more powerful since you do not really know which template will be exec...
apply-template and call-template do not perform the same task, performance comparison is not really relevant here. call-template takes a template name as a parameter whereas apply-template takes an xpath expression. Apply-template is therefore much more powerful since you do not really know which template will be exec...
We actually maintain a Netbeans and an Eclipse project for our code in SVN right now with no troubles at all. The Netbeans files don't step on the Eclipse files. We have our projects structured like this: sample-project + bin + launches + lib + logs + nbproject + src ...
Visual Studio: Detecting unneeded Assemblies
|visual-studio|.net|
On larger and/or long running projects, I tend to reference many assemblies and namespaces, and often I end up removing some functionality later on or moving it into a different project. I just wonder, is there a way to check every project (heck, every .cs file) in my whole Visual Studio solution and get a list of a...
|.net|visual-studio|
On larger and/or long running projects, I tend to reference many assemblies and namespaces, and often I end up removing some functionality later on or moving it into a different project. I just wonder, is there a way to check every project (heck, every .cs file) in my whole Visual Studio solution and get a list of a...
[Get Types][1] gives you a list of [Type][2] objects defined in the assembly. That object has a namespace property. Remember that an assembly can have multiple namespaces. [1]: http://msdn.microsoft.com/en-us/library/system.reflection.assembly.gettypes.aspx [2]: http://msdn.microsoft.com/en-us/library/syste...
Firewall is always possible, but it does say that ssh can connect, so that seems unlikely. I'd say have a look at the routes ("route" command on Linux), and make sure you don't have like two default routes, or weird ones or whatever. All in all I'd say test ping and ssh and your program on the same distant IP, and if ...
If I were you, I'd check out the [W3C Link Checker][1]. [1]: http://validator.w3.org/checklink
You can't perform short-circuiting of function call arguments using a regular function call. For example: #define andm(a, b) (a) && (b) bool andf(bool a, bool b) { return a && b; } andm(x, y) // short circuits the operator so if a is false, b would not be evaluated andf(a, b) // b will always ...
You can't perform short-circuiting of function call arguments using a regular function call. For example: #define andm(a, b) (a) && (b) bool andf(bool a, bool b) { return a && b; } andm(x, y) // short circuits the operator so if x is false, y would not be evaluated andf(x, y) // y will always ...
Although I would go with the majority and say that it seems like what you want is an fft solution (fft algorithm is pretty quick), if fft is not the answer for whatever reason you may want to try fitting a sine curve to the data using a fitting program and reading off the fitted frequency. Using [Fityk][1], you can ...
What's the best way to serialize a HashTable for SOAP/XML?
|c#|soap|rest|.net|asp.net-2.0|
What's the best way to serialize a HashTable (or a data best navigated through a string indexer) with SOAP/XML? Let's say I have an Foo that has an property Bar[] Bars. A Bar object has a key and a value. By default, this serializes to the following XML: `<Foo> <Bars> <Bar key="key0" value="value0...
|c#|.net|xml|rest|soap|
From the page you linked, ['montage'][1] is the tool you want. It'll take a bunch of images and concatenate/tile them into a single output. Here's an example image I've made before using the tool: ![alt text][2] [1]: http://www.imagemagick.org/script/montage.php [2]: http://davr.org/ds2/demos2/index.png "mon...
PL/SQL is a mature language that integrates well with SQL. With each version of Oracle it becomes more and more powerful. Also starting from Oracle 11, PL/SQL compiles to machine code by default.
what's the best app to draw wireframes on the mac? (And why)
|macos|user-interface|wireframe|
need something less print-oriented than omnigraffle. think pixels! also, need good building blocks (aka stencils).
what's the best app to draw UI wireframes on the mac? (And why)
I want to draw user interfaces for web and desktop applications. I need something less print-oriented than omnigraffle. think pixels! Also, need good building blocks (aka stencils). Form elements, tableviews, etc.
<tt>$0</tt> is typically the name of your program, so how about this? use Cwd 'abs_path'; print abs_path($0); Seems to me that this should work as <tt>abs_path</tt> knows if you are using a relative or absolute path.
Doing sudo sh -c "echo >> somefile" should work. The problem is that > and >> are interpreted by your shell, not by sudo, so the permissions are your ones, not the ones of the user you are "sudoing" into.
Doing sudo sh -c "echo >> somefile" should work. The problem is that > and >> are handled by your shell, not by the "sudoed" command, so the permissions are your ones, not the ones of the user you are "sudoing" into.
If you use Hibernate then [Hibernate Tools][1] is a must. I really like the ability to write my HQL or JPQL and view the generated SQL real time! If you're not using Hibernate I'm guessing your using a database in some form or another. Therefore, I would recommend the [Data Tools Platform][2]. In fact, you woul...
Is there an efficient algorithm to generate a 2D a 'concave' hull?
|geometry|math|2d|
Having a set of (2D) points from a GIS file (a city map), I need to generate the polygon that defines the 'contour' for that map (its boundary). Its input parameters would be the points set and a 'maximum edge length'. It would then output the corresponding (probably non-convex) polygon. The best solution I found so...
Is there an efficient algorithm to generate a 2D 'concave' hull?
|math|geometry|2d|
Basically, the compiler will reorder the components of your record types, unless you use the pragma PACK or the pragma PRESERVE_LAYOUT commands with your record types. Also, the compiler will pad objects to maintain the alignment of record components. Components follow: Integer: 8, 16, or 32 bit twos-complement sign...
I've used jQuery UI's sortable plugin with good results. Markup similar to this: <table id="myTable"> <thead> <tr><th>ID></th><th>Name</th><th>Details</th></tr> </thead> <tbody class="sort"> <tr id="1"><td>1</td><td>Name1</td><td>Details1</td><tr> <tr id="2"><td>2</td><td>Name1</td>...
>Is it possible to check what version of BPL (ie Rtl70.BPL, Indy70.bpl etc) are installed >on a clients computer when the program starts? >I have had some programs crash because the BPL on there computer is different to the ones >on the build machine. >If i have to add each BPL used into the installer on each update,...
What are the quickest and easiest ways to ensure existing web pages display well on mobile platforms?
|javascript|css|browser|mobile|
The pages in question contain a lot of javascript and CSS. How well are these supported by mobile platforms generally? Is there a browser emulator (or equivalent tool) to assist testing?
No, I don't think that this would at all be "useful". Instead, you should watch out not to throw NPEs in the first place. Checking your values before you use them (`null` validation) and the likes. This should happen *before* you call a library method and *after* you get back a result (iff the API specifies that the...
Which DBMS? It can be done via CTE or Union for example, but if you are using, for example, MySQL, then you can forget about it.
Well, one possibility is to create a new syndication feed that is a clone of the first feed, and then simply iterate through each post on the second one, check the first for its existence, and add it if it doesn't exist. Something along the lines of: SyndicationFeed newFeed = feed.clone; foreach(Syndicat...
None of these regex suggestions will work. Depending on whether they're greedy or not, they will match either the very last &lt;/div&gt; in the document, or the very first &lt;/div&gt; after your starting string, which may be a div nested inside the one you're interested in. Regular expressions are not really the id...
The ucfirst function in a map certainly does this, but only in a very rudimentary way. If you want something a bit more sophisticated, have a look at John Gruber's TitleCase script: <http://daringfireball.net/2008/08/title_case_update>
Accessing Websites through a Different Port?
|browser|ports|
Greetings, I am wanting to access a website from a different port than 80 or 8080. Is this possible? I just want to view the website but through a different port. I do not have a router. I know this can be done because I have a browser that accessing websites through different ports, Called XB Browser by Xero Bank... ...
The only way I see the two interacting would be to place both a WMP and a Flash component on a web page, then have JavaScript to manipulate the two. For example, you could have Flash buttons for play/stop/etc, and when those are clicked, javascript handles the click event and tells the WMP control to start/stop playing...
Since you don't show the code that gets the date of your object, this question is impossible to answer without some knowledge of the Outlook object you are trying to access. If you have an array of objects you can sort them by date and filter ones prior to a certain one. my $sub = sub { my $ad = $a->date_s...
How To Tell What Files IE Thinks Are "nonsecure"?
|security|internet-explorer-6|internet-explorer-7|
We have a CMS system whose web interface gets served over HTTPS. This works beautifully for Firefox, but when we load it in IE6 or IE7, it complains that "This page contains both secure and nonsecure items." I've loaded the page in Firefox and checked with Firebug, and every connection seems to be going through HTTP...
I used Xenu's Link Sleuth in the past. It will crawl your site and tell you which links point to nowhere. It is not super fancy but it works. [http://en.wikipedia.org/wiki/Xenu%27s_Link_Sleuth][1] The Wikipedia page lists a whole bunch of other products. [1]: http://en.wikipedia.org/wiki/Xenu%27s_Link_Sleuth
[WebHTTrack][1] [1]: http://www.httrack.com/page/21/fr/index.html Can take a long time to go through a large web site (I archived a 250MB website and it took approximately 2 hours - it wasn't local though) It has a log so you should be able to track 404s easily.
The best book I've read on these topics is Thinking in C++ by Bruce Eckel. You can download them for free [here][1]. [1]: http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
The best book I've read on these topics is Thinking in C++ by Bruce Eckel. You can download it for free [here][1]. [1]: http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
Also check out Google's webmaster tools. http://www.google.com/webmasters/tools/ They give you the ability to see the 404's that GoogleBot discovers when crawling your website (along with lots and lots of other stuff).
Check out the prism framework from Microsofts patterns and practices group?
I've been working with SharePoint since v.1 and I could tell you that SharePoint is a: - Document management server - Web content management server - Portal solution - Search engine - List-based repository - Collaboration site - Replacement for file shares - etc etc... ...but if I have to s...
Don't forget to use: connection.setDoOutput( true) if you intend on sending output.
For classes: The breakthru moment for me was when I learned about interfaces. The idea of abstracting away the details of how you wrote solved a problem, and giving just a list of methods that interact with the class was very insightful. In fact, my professor explicitly told us that he would grade our programs b...
Executing a script file from a Windows Installer Custom Action
|visual-studio-2008|vbscript|windows-installer|
I need to execute a batch file as part of the un-install process in a Windows installer project (standard OOTB VS 2008 installer project-vdproj). One cannot execute a bat file directly from the Custom Actions in the installer project, so I wrote a quick vbs script to call the required bat file. vbs code: Se...
Storage is cheap, why limit the password length. Even if you're encrypting the password as opposed to just hashing it a 64 character string isn't going to take much more than a 6 character string to encrypt. Chances are the bank system is overlaying an older system so they were only able to allow a certain amount of...
There's [Araxis Merge][1] available for windows. Here's a [page][2] that describes their binary comparison feature. [1]: http://www.araxis.com/merge/index.html [2]: http://www.araxis.com/merge/topic_comparing_binary_files.html
Passwords are hashed to 32, 40, 128, whatever length. The only reason for a minimum length is to prevent easy to guess passwords. There is no purpose for a maximum length.
Combo Box Item comparison and compiler warnings
|visual-studio|compiler-construction|
In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if there was any logical reasoning behind it In a WinForms project, if I use the line if(myComboBox.Items[i] == myObject) I get a compiler warning that I might get 'Possible unintended references' as I am comparing typ...
In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if there was any logical reasoning behind it In a WinForms project, if I use the line if(myComboBox.Items[i] == myObject) I get a compiler warning that I might get 'Possible unintended references' as I am comparing typ...
Ctrl-Minus, Ctrl-Plus, navigates back and forward where you've been recently (only open files, though).
Unfortunate most of the profilers I tried failed when used with tail calls, most notably ANTS. I just end up writing my own. There is a simple implementation on CodeProject that you can use as a base.
Since you're using seam, you can use EL in the messages file. Property: label.widget.count = You have a total of #{widgetCount} widgets. XHTML: <h:outputFormat value="#{messages['label.widget.count']}" /> This still uses outputFormat, but is less verbose.
Since you're using Seam, [you can use EL][1] in the messages file. Property: label.widget.count = You have a total of #{widgetCount} widgets. XHTML: <h:outputFormat value="#{messages['label.widget.count']}" /> This still uses outputFormat, but is less verbose. [1]: http://docs.jboss.com/se...
[Opera][1] has an option to view pages as through a mobile device. I've found it useful in the past. [1]:http://www.opera.com
Personally two of my favourite shortcuts are: * ⌃⇧L (that's ctrl+shift+L): Which wraps the currently selected text with a link to whatever's in the clipboard, and works for every text language I've tried it in. * ⌃⇧⌘L (that's ctrl+shift+cmd+L): Which googles for the selected text and links to the top result. ...
MySQL is the same: select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tablename'
I'd say best practise would be to follow the icon example Microsoft is setting with XP and Vista icons. It's so rare to see anything less than 256 colour icons these days, that when I do see them I think the program is quaint and outdated. Perhaps best bet is to wait for Microsoft to add SVG icon support; perhaps in Wi...
This sounds like a tricky situation. There are however several options you can use but it all depends on what your application does. Let's call WebApp1 your authenticate site, and WebApp2 your distination site once authenticated. Can WebApp2 not call WebApp1 behind the scenes? (Services) THe problem with pass...
Again no language agnostic response, put in Java it goes like this: Connection conn = Database.getCurrent().getConnection(); PreparedStatement ps = conn.prepareStatement(insertSql, Statement.RETURN_GENERATED_KEYS); try { ps.executeUpdate(); ResultSet rs = insertStatement.getG...
Again no language agnostic response, but in Java it goes like this: Connection conn = Database.getCurrent().getConnection(); PreparedStatement ps = conn.prepareStatement(insertSql, Statement.RETURN_GENERATED_KEYS); try { ps.executeUpdate(); ResultSet rs = ps.getGeneratedKeys(...
Again no language agnostic response, but in Java it goes like this: Connection conn = Database.getCurrent().getConnection(); PreparedStatement ps = conn.prepareStatement(insertSql, Statement.RETURN_GENERATED_KEYS); try { ps.executeUpdate(); ResultSet rs = ps.getGeneratedKeys(...
You might also look at a framework for css like [Blueprint][1] or [css-boilerplate][2] or the [yui grids][3] framework. Usually, these frameworks set you up with a standard set of css class definitions that you can apply to elements to lay them out in a specific and defined way. [1]: http://code.google.com/p/bl...
Did you check the configuration you are setting the OverwriteDataSource project property setting to False? The default Configuration is Active(DebugLocal) but you may have to set the OverwriteDataSource setting to False for another Configuration such as Production. You can use the All Configurations to force the Over...
How To Read Active Directory Group Membership From PHP/IIS using COM?
|iis|php|adsi|com|
I have the following code: $bind = new COM("LDAP://CN=GroupName,OU=Groups,OU=Division,DC=company,DC=local"); When I execute it from a command-prompt, it runs fine. When it runs under IIS/PHP/ISAPI, it barfs. Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `LDA...
when viewing a website it gets assigned a random port, it will always come from port 80 (usually always, unless the server admin has changed the port) there's no way for someone to change that port unless you have control of the server.
What is round-robin scheduling?
|computer-science|homework|operating-system|
In a multitasking operating system context, sometimes you hear the term round-robin scheduling. What does it refer to? What other kind of scheduling is there?
If website server is listening to a different port, then yes, simply use http://address:port/ If server is not listening to a different port, then obviously you cannot.
No, as the server decides what port it is run on. Perhaps you could install a proxy, which would redirect the port, but in the end the connection would be made on port 80 from your machine.
On Ubuntu, some the IDEs that are available in the repositories are: - [Kdevelop](http://www.kdevelop.org/) - [Geany](http://geany.uvena.de/) - [Anjuta](http://anjuta.sf.net/) There is also: - [Eclipse](http://eclipse.org) (Recommended you don't install from repositories, due to issues with file/folder per...
On Ubuntu, some the IDEs that are available in the repositories are: - [Kdevelop](http://www.kdevelop.org/) - [Geany](http://geany.uvena.de/) - [Anjuta](http://anjuta.sf.net/) There is also: - [Eclipse](http://eclipse.org) (Recommended you don't install from repositories, due to issues with file/folder per...
From an API user perspective, another alternative to constructors are static factory methods (like BigInteger.valueOf()), though for the API author (and technically "for real") the objects are still created using a constructor.
Batch file to copy files from one directory to another.