instruction
stringlengths
0
30k
|untagged|
I have two code base's of an application. I need to copy all the files in all the directories with .java from the newer code base, to the older (so I can commit it to svn). How can I write a batch files to do this?
|batch-file|
I have two code bases of an application. I need to copy all the files in all the directories with .java from the newer code base, to the older (so I can commit it to svn). How can I write a batch files to do this?
Without knowing the platform I can't give a direct answer. However, since you don't care about abandoned carts, then I would differ from my colleagues here and suggest storing it on the client. Why store it in the database if you don't care if it's abandoned? <br/> Then again, it does depend on the size of the object ...
Without knowing the platform I can't give a direct answer. However, since you don't care about abandoned carts, then I would differ from my colleagues here and suggest storing it on the client. Why store it in the database if you don't care if it's abandoned? <br/> Then again, it does depend on the size of the object ...
The book that cracked pointers for me was [Illustrating Ansi C][1] by Donald Alcock. Its full of hand-drawn-style box and arrow diagrams that illustrate pointers, pointer arithmetic, arrays, string functions etc... Obviously its a 'C' book but for core fundamentals its hard to beat [1]: http://www.amazon.co.u...
I found the following code on Google Groups for determining the type of an Outlook object: Type t = SomeOutlookObject.GetType(); string messageClass = t.InvokeMember("MessageClass", BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty, null, SomeOutlook...
Feedburner analysis gives you statistics like: ![alt text][1] ![alt text][2] ![alt text][3] [1]: http://www.blogperfume.com/feed-analysis/feed-analysis1.png [2]: http://www.blogperfume.com/feed-analysis/feed-analysis2.png [3]: http://www.blogperfume.com/feed-analysis/feed-analysis3.png
Deploying to multiple servers
Internationalised labels in Facelets
|internationalization|facelets|java|
Does [Facelets][1] have any features for neater or more readable internationalised user interface text labels that what you can otherwise do using JSF? For example, with plain JSF, using h:outputFormat is a very verbose way to interpolate variables in messages. [1]: https://facelets.dev.java.net/
|java|internationalization|jsf|facelets|
Does [Facelets][1] have any features for neater or more readable internationalised user interface text labels that what you can otherwise do using JSF? For example, with plain JSF, using h:outputFormat is a very verbose way to interpolate variables in messages. *Clarification:* I know that I can add a message fil...
Internationalised labels in JSF/Facelets
You can use the provided system views to do this: eg select * from INFORMATION_SCHEMA.COLUMNS where table_name = '[table name]' alternatively, you can use the system proc **sp_help** eg sp_help '[table name]'
You can use the Any< T>(T=>bool) operator instead of SingleOrDefault< T>(T => bool). And it should probably be Expression< Func< bool>>. You can also make it an extension method on the DataContext. if (!table.Any(where)) { db.InsertOnSubmit(record); db.SubmitChanges(); }
public static void InsertIfNotExists<TEntity> ( this Table<TEntity> table , TEntity entity , Expression<Func<TEntity,bool>> predicate ) where TEntity : class { ...
If there is not a particular reason to use msxml implementation of node-set on windows you coul use exslt one everywhere, by including the implemenation downloaded from http://exslt.org with your stylesheet, [exslt howto][1] describes the needed steps. You can use either "Extension namespaces" way or "Named templates" ...
If you just want the column names, then select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tablename' On MS SQL Server, for more information on the table such as the types of the columns, use sp_help tablename
The list that Dori posted is pretty comprehensive, and I don't think that its possible to list all the libraries out there since there might be one being written even as I type (it seems to be a passion for some people). I feel that going with jQuery and/or prototype will probably get you off the ground and building...
On top of the fact that the member function can modify global data, it is possible for the member function to modify explicitly declared mutable members of the object in question.
I think you're very right on both bullet points. If they're storing the passwords hashed, as they should, then password length doesn't affect their DB schema whatsoever. Having an open-ended password length throws in one more variable that a brute-force attacker has to account for. It's hard to see any excuse for li...
Should I inject things into my entities?
|oop|
When using an IoC container, is it considered good design to inject other classes into them? i.e. a persistence class
First, do not assume that banks have good IT security professionals working for them. [Plenty don't][1]. That said, maximum password length is worthless. It often requires users to create a new password (arguments about the value of using different passwords on every site aside for the moment), which increases the...
The keyword [mutable][1] on member variables allows for const functions to alter the state of the object at hand. And no, it doesn't cache data (at least not all calls) since the following code is a valid const function that changes over time: int something() const { return m_pSomeObject->NextValue(); } N...
Corey is correct, but bear in mind that any member variables that are marked as **mutable** *can* be modified in const member functions. It also means that these functions can be called from other const functions, or via other const references. --- Edit: Damn, was beaten by 9 seconds.... 9!!! :)
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...
|php|iis|com|adsi|
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...
If it needs to be pixel-perfect, then you'll need to use px in your stylesheets. Use a [css reset stylesheet][1], then size everything based on pixels. To ensure that your css is rendering correctly in different browsers, you might find a service like [BrowserShots][2] useful, however, I think you'll find it very d...
SELECT * FROM Items WHERE column LIKE '%foo%' OR column LIKE '%bar%' order by (select count(*) from items i where i.column= item.column) DESC you could also group by [column] and count(*) then order, if you don't care about the details
Different situations require different approaches. Personally I perfer refactoring to a better design whenever possible. Refactoring leads to less bugs than a rewrite. But, even if you plan to throw one away, its still a good idea to write a bunch of acceptance tests to make sure your 2nd version is on the right t...
Unless you're browsing through a proxy, the web servers hosting the sites you want to access must be configured to listen to a port other than 80 or 8080.
Take a look at the [Advanced Bash-Scripting Guide][1] for a lot of wisdom on shell scripting - not just Bash, either. Don't listen to people telling you to look at other, arguably more complex languages. If shell scripting meets your needs, use that. You want functionality, not fanciness. New languages provide valu...
I am a fan of [YUI][1]. It supports [Animation][2] and [Ajax][3]. In addition, there is just a plethora of controls: menus, movable windows, tree controls, sliders, tabview, the list goes on and on. I have used their code and I've had a good [cross-browser][4] experience with it. Doesn't surprise me. They do ext...
When are you attempting to retrieve the value from the TextBox? i.e. when is the code sample you provided being executed? If you aren't already, you'll want to set up a handler method for the ItemCommand event of the DataGrid. You should be looking for the new TextBox value within that method. You should also make s...
When are you attempting to retrieve the value from the TextBox? i.e. when is the code sample you provided being executed? If you aren't already, you'll want to set up a handler method for the ItemCommand event of the DataGrid. You should be looking for the new TextBox value within that method. You should also make s...
|php|deployment|
I have to deploy my php/html/css/etc code to multiple servers and i am looking at my options for software that allows easy and secure deployment to multiple servers. Also helps if it could be tied into my SVN. Any suggestions?
[Resharper][1] will do this for you [1]: http://www.jetbrains.com/resharper/
[Resharper][1] will do this for you and you can set it up in the Clean Code option that you can run solution wide ;o) [1]: http://www.jetbrains.com/resharper/
One of the things that really helped me understand these concepts is to learn UML - the Unified Modeling Language. Seeing concepts of object-oriented design in a graphical format really helped me learn what they mean. Sometimes trying to understand these concepts purely by looking at what source code implements them ...
From lassevek's response to a [similar question on SO][1]: > Pointers is a concept that for many > can be confusing at first, in > particular when it comes to copying > pointer values around and still > referencing the same memory block. > > I've found that the best analogy is to > consider the pointer as a ...
Use [Fiddler](http://www.fiddlertool.com/Fiddler2/version.asp) to watch the traffic between the server and IE. Be sure to go to Tools > Fiddler Options... > HTTPS > and check 'Decrypt HTTPS traffic' Any non-HTTPS traffic generated between any server and IE should be easy to spot in the Web Sessions list.
On http://www.lipsum.com there are links to several offline Lorem Ipsum generators, about halfway down the frontpage. Or you could write one of your own in a matter of minutes.
On http://www.lipsum.com there are links to several offline Lorem Ipsum generators, about halfway down the frontpage. Or you could write one of your own in a matter of minutes. Edit: This isn't accurate, I wrongfully assumed all of the linked lorem ipsum generators were offline ones, not only the LaTeX one.
WCF is the best choice. It supports a number of different communication mechanisms (including Named Pipes) and can be completely configuration driven. I would highly recommend that you take a look at WCF. Here is a blog that does a [WCF vs Remoting performance comparison][1]. A quote from the blog: > The WCF...
WCF is the best choice. It supports [a number of different transport mechanisms][1] ([including][2] [Named][3] [Pipes][4]) and can be completely configuration driven. I would highly recommend that you take a look at WCF. Here is a blog that does a [WCF vs Remoting performance comparison][5]. A quote from the bl...
For backing up, I wrote a combination of a batch file and a VBScript that runs once a week as a scheduled task. It: - Scans through a particular folder on the file system recursively looking for SVN repositories (we have a multitude of small repositories, as we found that one uber-repository quickly became difficu...
Beside writing more stable code, here's one idea that answers your question. Whether you are using processes or threads. You can write a small / simple watchdog program. Then your other programs register with that watchdog. If any process dies, or a thread dies, it can be restarted by the watchdog. Of cours...
I will go with * Company.Website - the project * Company.Website.Tests The short reason and answer is simple, testing and project are linked in code, therefore it should share namespace. If you want splitting of code and testing in a solution you have that option anyway. e.g. you can set up a solutio...
[UltraCompare][1] is the best for binary comparison. It has a smart comparator that is really useful. [1]: http://www.ultraedit.com/products/ultracompare.html
In case you are interested, there is an ASP.NET Virtual Earth Mapping Server Control here: [http://simplovation.com/page/webmapsve.aspx][1] This is essentially a "wrapper" around Virtual Earth that abstracts out most (if not all) of the JavaScript that you would traditionally need to write. It allows you to handl...
You can use [xdelta](xdelta.org). This is open source binary diff tool that you can use then to make binary patches, but I think it also gives the information about differences found.
One way to handle this might be to extend the XmlHTTPRequest object with an explicit timeout method, then use that to determine if you're working in offline mode (that is, for browsers that don't support navigator.onLine). Here's how I implemented Ajax timeouts on one site (a site that uses the [Prototype][1] library)...
Math jocks are likely to know this, but for anyone else.. Due to a nice mathematical propertiy of the Gaussian, you can blur a 2D image quickly by first running a 1D Gaussian blur on each row of the image, then run a 1D blur on each column.
Is the system clock running UTC, and the OS changing it to local time on the server. This is a pretty common configuration, but will break programs that bypass the OS's functions to retrieve the date/time.
Have you tried: $ENV{'SCRIPT_NAME'} or use FindBin '$Bin'; print "The script is located in $Bin.\n"; It really depends on how it's being called and if it's CGI or being run from a normal shell, etc.
There are two varients of UNION. 'UNION' and 'UNION ALL' In most cases what you really want to say is UNION ALL as it does not do duplicate elimination (Think SELECT DISTINCT) between sets which can result in quite a bit of savings in terms of execution time. Others have suggested multiple result sets which is a ...
I've always created a basic CSS style sheet which works in W3C Fully compliant browsers like firefox and then created alternative browser specific style sheets to fix any styling issues in other browsers, i.e. IE6, IE7 etc. You can use the following code within the HTML to select appropriate IE style sheets. ...
At the basis there is no guarantee that such a thing will ever work perfectly. As long as the browser developers find ways to do their own thing rather than the 'standard' way of doing things, you will have differences. I've had positive results using the [Yahoo User Interface Base CSS](http://developer.yahoo.com/yu...
Without knowing more about your particular circumstances, I can only offer the following guesses: Try using fsync()/sync() to force the kernel to flush data to the storage device more frequently. It sounds like the kernel buffers all your writes and then ties up the bus or otherwise stalls your system while performi...
As for example usages of *unsigned char*: *unsigend char* is often used in computer graphics which very often (though not always) assigns a single byte to each colour component. It is common to see an RGB (or RGBA) colour represented as 24 (or 32) bits, each an *unsigned char*. Since *unsigned char* values fall in t...
You can run the web server on any port. 80 is just convention as are 8080 (web server on unprivileged port) and 443 (web server + ssl). However if you're looking to see some web site by pointing your browser to a different port you're probably out of luck. Unless the web server is being run on that port explicitly yo...
Perhaps this is obvious, but FWIW this will only work if the web server is serving requests for that website on the alternate port. It's not at all uncommon for a webserver to only serve a site on port 80.
You can only access a website throught the port that is bind with the http server. Example: i hava a web server and it is listening for connections on port 123, the you only can get my pages connecting to my 123 port.
profiles = [ProfileResource.search(params)].flatten output = profiles.collect do |profile| profile.to_hash end
If your question is about IIS(or other server) configuration - yes, it's possible. All you need is to create ports mapping under your Default Site or Virtual Directory and assign specific ports to the site you need. For example it is sometimes very useful for web services, when default port is assigned to some UI front...
You might want to give this a go: * SELECT * FROM Items WHERE column LIKE '%foo%' OR column LIKE '%bar%' ORDER BY CASE WHEN column LIKE '%foo%' AND column LIKE '%bar%' THEN 1 ELSE 0 END DESC Note: this is drycoded and probably not very portable.
The [Zeus][1] editor has support for Java Script. It has the stock standard set of features like code folding and syntax highlighting features etc, but more importantly Zeus is fully scriptable and Zeus scripts can be written in Java Script. [1]: http://www.zeusedit.com
You could use a UNION: <pre>SELECT * FROM Items WHERE column LIKE '%foo%' AND column LIKE '%bar%' UNION SELECT * FROM Items WHERE column LIKE '%foo%' AND NOT (column LIKE '%bar%') UNION SELECT * FROM Items WHERE column LIKE '%bar%' AND NOT (column LIKE '%foo%');</pre> But this may be bad performance-wise. Wor...
If you just want the column names, then select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tablename' On MS SQL Server, for more information on the table such as the types of the columns, use sp_help 'tablename'
Sometimes Delphi adds of automatic form the line: {$R ' *.res'} to the files of project or packages. Comment (//) that line and to compile again.
Oracle ORDImage processing in PL/SQL: Getting IMG-00710 and ORA-01031
|oracle-database|plsql|
I have loaded image into an Oracle ORDImage object and am processing it by PL/SQL. I can read its properties, but cannot process it with the process() method. if l_ordimage.width > lMaxWidth then l_ordimage.process('maxScale 534 401'); end if; This should scale the image down, conserving asp...
I have loaded image into a new, initialized Oracle ORDImage object and am processing it by PL/SQL. I can read its properties, but cannot process it with the process() method. vLocalImage ORDImage := ORDImage.init(); ... vLocalImage.source.localdata := PORTAL.wwdoc_admin.get_document_blob_content(pFile...
As for Hibernate: a very good tool for application which deals with a rapidly changing database schema, a large amount of tables, do lots of simple CRUD operations. Reports with complex queries involved are rather less well handled. But in these case I prefer mixing in JDBC or native queries. So, for a short answer: I ...
As for Hibernate: a very good tool for application which deals with a rapidly changing database schema, a large amount of tables, do lots of simple CRUD operations. Reports with complex queries involved are rather less well handled. But in these case I prefer mixing in JDBC or native queries. So, for a short answer: I ...
If the handler for the PDF is acrobat (it doesn't have to be), it exposes a JS interface that is documented here: [http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf][1] [1]: http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf See if you can call openDoc(urlToPdf) on document.getElemen...
I've gotten that error over the permissions thing, but it looks like you have that covered. I also have seen it with one of the flags in the connection string -- you might play with that a bit.
Are one or more resources (CSS url-image ref overlooked easily) pointing to a subdomain that's not covered by the certificate (https://www.example.com vs https://static.example.com)?
No. The number of users with support for SSLv2 at all, much less SSLv2 *only*, is negligible. It has been obsolete since 1996, and is disabled or not even included in all modern browsers of significance.
JQuery error option in $.ajax utility
|jquery|ajax|
The documentation indicates that the error: option function will make available: XHR instance, a status message string (in this case always error) and an optional exception object returned from the XHR instance (Book: JQuery in Action) Using the following (in the $.ajax call) I was able to determine I had a "parsere...
The documentation indicates that the error: option function will make available: XHR instance, a status message string (in this case always error) and an optional exception object returned from the XHR instance (Book: JQuery in Action) Using the following (in the $.ajax call) I was able to determine I had a "parsere...
Without knowing more about your particular circumstances, I can only offer the following guesses: Try using fsync()/sync() to force the kernel to flush data to the storage device more frequently. It sounds like the kernel buffers all your writes and then ties up the bus or otherwise stalls your system while performi...
PHP efficient array searching to fill in form fields
|php|arrays|
I am using Form Tools v1.4.7. I am attempting to customize its edit_submission.php file. Essentially, I want it to just show me the original form with the data filled in. Currently, edit_submission.php just loops through an array and displays all the fields in the database with the data filled in. That is fine if yo...
I am using Form Tools v1.4.7. I am attempting to customize its edit_submission.php file. Essentially, I want it to just show me the original form with the data filled in. Currently, edit_submission.php just loops through an array and displays all the fields in the database with the data filled in. That is fine if yo...
How do I efficiently search an array to fill in form fields?
I am looking for an efficient way to pull the data I want out of an array called $submission_info so I can easily auto-fill my form fields. The array size is about 120. I want to find the field name and extract the content. In this case, the field name is **loanOfficer** and the content is **John Doe**. Output of...
I use mysqldump via the command line : exec("mysqldump sourceDatabase -uUsername -p'password' > outputFilename.sql"); Then you just download the resulting file and your done.
I like what tpqf said, but rather than disabling an account when cheating is discovered, implement a honeypot so whenever they log in, they see their hacked scores and never suspect that they have been marked as a troll. Google for "phpBB MOD Troll" and you'll see an ingenious approach.