instruction stringlengths 0 30k ⌀ |
|---|
Don't do all the interesting parts first.
I motivate myself to do the boring code by always leaving a decent bit until last and being strict about completing the boring section first. |
My advice: forget the traditional GUI testing. It's too expensive. Coding the tests takes a lot of time, the tools aren't really stable so you will get unreliable test results. The coupling between the code and the test is very strong and you'll spend a lot of time with the maintenance.
The new trend is to ignore th... |
ALTER TABLE <table name> ADD <new column name> <data type> NOT NULL
GO
ALTER TABLE <table name> ADD CONSTRAINT <constraint name> DEFAULT <default value> FOR <new column name>
GO
|
If you really want to hijack the API, look at [syringe.dll][1] (L-GPL).
[1]: http://www.geocities.com/SiliconValley/1741/downloads/ |
"if YOU don't finish and launch it, someone else will."
Told myself that one before. Sometimes however its good to take a break for a couple hours then come back to it. Then you are not as burned out on it as you were. |
Parameter efficency - passing a pointer (Int - 4 bytes) as opposed to copying a whole (arbitarily large) object.
Java classes are passed via reference (basically a pointer) also btw, its just that in java that's hidden from the programmer. |
I've run into similar issues when using Selenium to test an application with iFrames. Basically, it seemed that once the primary page (the page containing the iframes) was loaded, Selenium was unable to determine when the iframe content had finished loading.
From looking at the source for the link you're trying to l... |
Is it really necessary to store it as a datetime at all ? If not stored it as a string 2008 or 2008-8 or 2008-8-1 - split the string on hyphens when you pull it out and you're able to establish how specific the original input was |
Generally optimization levels higher than -O2 (just -O3 for gcc but other compilers have higher ones) include optimizations that can increase the size of your code. This includes things like loop unrolling, lots of inlining, padding for alignment regardless of size, etc. Other compilers offer vectorization and inter-... |
Generally optimization levels higher than -O2 (just -O3 for gcc but other compilers have higher ones) include optimizations that can increase the size of your code. This includes things like loop unrolling, lots of inlining, padding for alignment regardless of size, etc. Other compilers offer vectorization and inter-... |
I would say that "[Beyond Code - Learn to Distinguish Yourself in 9 Simple Steps][1]" is quite a good and motivational book. I doesn't cover technical issues, but it describes ways of working with people, being professional, ... For me, this is a book you can read again and again if you are in need of some pep talk. Be... |
I'd probably store the datetime and an additional "precision" column to determine how to output it. For output, the precision column can map to a column that contains the corresponding formatting string ("YYYY-mm", etc) or it can contain the formatting string itself. |
The additional column could simple be used for specifying what part of the date time has been specified
1 = day
2 = month
4 = year
so 3 is day and month, 6 is month and year, 7 is all three. its a simple int at that point |
Yes, a higher level can sometimes mean a better performing program. However, it can cause problems depending on your code. For example, branch prediction (enabled in -O1 and up) can break poorly written multi threading programs by causing a race condition. Optimization will actually decide something that's better th... |
We did a move from a MySQL3 to PosgreSQL 8.2 than 8.3. Postgresql has the basic of SQL and a lot more so if your MYSQL do not use fancy MySql stuff you will be ok.
From my experience, our MySql database (version 3) doesn't have Foreign Key... PostGreSql let you have so we had to change that... and it was a good thin... |
Dropping a connected user from an Oracle 10g database schema |
|oracle-database| |
Is there a better way to forcefully disconnect all users from an Oracle 10g database schema than restarting the Oracle database services?
We have several developers using SQL Developer connecting to the same schema on a single Oracle 10g server. The problem is that when we want to drop the schema to rebuild it, ine... |
Sending Excel to user through ASP.NET |
|excel|vba|internet-explorer| |
I have a web application that is able to open an excel template, push data into a worksheet and send the file to a user. When the file is opened a VBA Macro will refresh a pivot table based on the data that was pushed into the template.
The user receives the standard File Open / Save dialog.
In Internet Explore... |
1. Keep track of a recurrence rule (probably based on iCalendar, per @[Kris K.][1]). This will include a pattern and a range (Every third Tuesday, for 10 occurrences).
2. For when you want to edit/delete a specific occurrence, keep track of exception dates for the above recurrence rule (dates where the event _doesn... |
what you're looking for is [ksort][1]. Dig the PHP manual! ;)
[1]: http://php.net/manual/en/function.ksort.php |
A simple Flash would do the trick better than anything else.
However please consider that unless you develop your page for the Intranet application and the feature was specifically requested by the users it will most likely go against the best usability practices for web.
Most users consider the pages which produce s... |
There's a false dichotomy here.
SELECT * FROM SalesLead
INNER JOIN LeadSource ON SalesLead.FK_LeadSourceID = LeadSource.LeadSourceId
where LeadSource.LeadSource = "foo"
doesn't break any more than the original
SELECT * FROM SalesLead Where LeadSource = 'foo'
when `foo` changes to `foobar... |
As someone else has mentioned, try NetBeans, It's similar to Eclipse in that it is a platform that supports an IDE, and is plug-in based. Its build system is also already based around Ant, allowing you to tap in at various extension points. In general, I've found it a bit more stable than Eclipse as well, but YMMV. |
The usual way to do this is to call Process.destroy()... however it is an incomplete solution since when using the sun JVM on *nix destroy map onto a SIGTERM which is not guaranteed to terminate the process (for that you need SIGKILL as well). The net result is that you can't do real process management using Java.
T... |
The usual way to do this is to call Process.destroy()... however it is an incomplete solution since when using the sun JVM on *nix destroy maps onto a SIGTERM which is not guaranteed to terminate the process (for that you need SIGKILL as well). The net result is that you can't do real process management using Java.
... |
SORT has a number of limitations that can make it somewhat difficult to use. For example, although SORT appears to read UTF-16 (LE) files okay, it appears to output files using the current locale settings. |
sort.exe has a number of limitations that can make it somewhat difficult to use. For example, although sort.exe appears to read UTF-16 (LE) files okay, it appears to output files using the current locale settings. |
Might be worth looking at [Google Breakpad][1], a cross-platform crash dump generator and tools to process the dumps.
[1]: http://code.google.com/p/google-breakpad/ |
If you introduce generics, you can avoid casting.
class DecodedTorrent : BDictionary<BDictionary<BList<BDictionary<BInteger>>>>
{
}
----------
DecodedTorrent torrent = BItem.DecodeFile("mytorrent");
int x = torrent["info"]["files"][0]["length"];
Hmm, but that probably won... |
My thought is:
Yes on standard-library objects
No on non-standard objects unless you have the source code in front of you and can check it. |
I looked back at this question and I think what you're facing is that the ASMX code will be built into a DLL with a random name as part of the dynamic compilation of your site. Your code to look up the type will, by default, only search its own assembly (another App_Code DLL, by the looks of the error you received) an... |
Ok, I used Literals to create anchor tags with onclicks on them and that seems to be working great. Thanks alot. |
[LINQ to XML](http://msdn.microsoft.com/en-us/library/bb308960.aspx) is very powerful if you're using .net 3.5, [LINQ to XSD](http://www.hanselman.com/blog/LINQToEverythingLINQToXSDAddsMoreLINQiness.aspx) may be useful to you too! |
Use xsd.exe command line program that comes with visual studio to create class files that you can use in your project/solution, and the System.Xml.Serialization namespace (specifically, the XmlSerializer class) to serialize/deserialze those classes to and from disk. |
You can generate serializable C# classes from a schema (xsd) using xsd.exe:
xsd.exe dependency1.xsd dependency2.xsd schema.xsd /out:outputDir
If the schema has dependencies (included/imported schemas), they must all be included on the same command line. |
You can dump/restore the database for each test suite, etc. Since you are automating this, it may be something in the setup/teardown functionality. |
If you are using a `log4j.properties` file, this file is typically expected to be in the root of your classpath, so make sure it's there. |
One primary need I have for late static binding is for a set of static instance-creation methods.
This [DateAndTime class][1] is part of a chronology library that I ported to PHP from Smalltalk/Squeak. Using static instance-creation methods enables creation of instances with a variety of argument types, while keepi... |
In BCGToolbar, it's enough to create a toolbar in the resources & load it (but not display the window), but the toolbar button must have the same ID as the menu item you want to link it to. |
You could also have a look at testing using Groovy. In Groovy you can easily mock Java interfaces using the 'as' operator:
def request = [isUserInRole: { roleName -> roleName == "testRole"}] as HttpServletRequest
Apart from this basis functionality Groovy offers a lot more on the mocking front:
http://doc... |
Short answer is:
You cannot.
Long answer is:
If you are asking this question, you do not probably know enough to be able to create a lock free structure. Creating lock free structures is extremely hard, and only experts in this field can do it. Instead of writing your own, search for an existing implementation... |
Short answer is:
You cannot.
Long answer is:
If you are asking this question, you do not probably know enough to be able to create a lock free structure. Creating lock free structures is extremely hard, and only experts in this field can do it. Instead of writing your own, search for an existing implementation... |
I don't know enough to tell you the exact difference(s) between XML sockets in Flash and Flash Lite, but they are definitely supported in Flash Lite versions 2.1 and later. See the [Flash Mobile Blog][1] for an example.
[1]: http://flashmobileblog.com/examples/ |
I've also used both. I had the problem that I have around 150 projects on my workspace, and subversive would take an awful long time when I selected all plugins and said "synchronize repository". The UI would freeze for an extremely long time. I find subclipse to be more stable.
Anyways, I combine the tools a lot... |
Yes, a higher level can sometimes mean a better performing program. However, it can cause problems depending on your code. For example, branch prediction (enabled in -O1 and up) can break poorly written multi threading programs by causing a race condition. Optimization will actually decide something that's better th... |
You might also consider using a non binary format like Html |
Wait a minute...
By re-reading your question... I think **this site** (i.e. [stackoverflow][1]) is the very best place for what you are asking for!
You can publish a problematic java snippet and receive answer.
Case in point : [What is the syntax for mod in java][2]
I have to leave you now: I need to check ... |
I don't know a lot about DB design, but I think a clean way to do it would be with boolean columns indicating if the user has input month and day (one column for each). Then, to save the given date, you would:
1. Store the date that the user input in a datetime column;
2. Set the boolean month column if the user ha... |
If you are looking for a free, secure solution: I would recommend using any of a number of VNC servers that are available, blocking the ports that VNC uses to communicate, and then using SSH tunneling to connect. This way, ssh is encrypting everything, but you can still rely on free, open source (?), and cross platfor... |
If you are looking for a free, secure solution: I would recommend using any of a number of VNC servers that are available, blocking the ports that VNC uses to communicate, and then using SSH tunneling to connect. This way, ssh is encrypting everything, and you can still rely on free, open source (?), and cross platfor... |
You can use [TortoiseSVN][1] in its default installation to view diffs of word documents, it just opens up word and uses word's own review/changes mode to do it.
[1]: http://tortoisesvn.net/node/152 |
You can use [TortoiseSVN][1] in its default installation to view diffs and perform merges of word documents, it just opens up word and uses word's own review/changes mode to do it.
Edit: By default it also diffing capabilities for PowerPoint, Excel, OpenOffice and StarOffice formats. (Check the TortoiseSVN\Diff-Scri... |
php $_GET sort problem |
|-get|sorting| |
here is the input i am getting from my flash file
process.php?Q2=898&Aa=Grade1&Tim=0%3A0%3A12&Q1=908&Bb=lkj&Q4=jhj&Q3=08&Cc=North%20America&Q0=1
and in php i use this code
foreach ($_GET as $field => $label)
{
$datarray[]=$_GET[$field];
echo "$field :";
echo $_GET[$field];;
echo "<br>";
... |
|php|sorting|arrays|query-string| |
Adding a SVN repository in Eclipse |
|svn|eclipse| |
I'm trying to add an svn repository to eclipse.
I've installed subclipse, and it seems to be working fine. But, when I try to "add a new SVN repository", I input this, for example:
*http://svn.python.org/projects/peps/trunk*
I get this:
*Error validating location: "org.tigris.subversion.javahl.ClientExcept... |
|svn|eclipse|subclipse| |
The generate script option is probably the easiest way to go. You'll undoubtedly have to do some search/replace on a few data types though. |
mysqldump equivalent for MSSQL |
|mssql|windows|data-migration| |
Is there an equivalent schema & data export/dumping tool for MSSQL as there is for MySQL with mysqldump. Trying to relocate a legacy ASP site and I am way out of happy place with working on a windows server. |
|windows|data-migration|sql-server| |
|windows|sql-server|data-migration| |
Is there an equivalent schema & data export/dumping tool for MSSQL as there is for MySQL with mysqldump. Trying to relocate a legacy ASP site and I am way out of happy place with working on a windows server.
Note: The DTS export utility own seems to export data, without table defs.
Using the Enterprise Manager a... |
Force https |
|php|ssl|https| |
I've got just one page that I want to force as an https page (php on apache). How do I do this without making the whole directory require https? Or, if you submit a form to an https page from an http page, does it send it by https instead of http?
Here is my example:
http://www.mysite.com/buyCrap.php
needs to ... |
What is the actual SQL you're using? I don't see anything wrong with the example you put up. Try looking for misplaced commas and/or quotes that could be triggering the error. |
I put the tests in a separate project but in the same solution. Granted, in big solutions there might be a lot of projects but the solution explorer is good enough on separating them and if you give everything reasonable names I don't really think it's an issue. |
Maybe the empty list has no height, and therefore no droppable area available. If that's the case, perhaps you just need to set a minimum height, or some padding on the block. |
I have used both and have ended up going the Qt route. These are the reasons:
* Trolltech offer quick and one-to-one support via email
* Qt innovates, and introduces powerful new features regularly
* The Qt documentation is amazing, and in the rare cases where it isn't, you can read the source code
* Having the s... |
Disable the page validation if you really need the special characters like > and < etc. Then ensure that when the user input is displayed, the data is HTML encoded.
There is a security vuln with the page validation, so it can be bypassed. Also the page validation shouldn't be solely relied on.
See: http://www.pr... |
I recently found the [Oracle SQL Developer][1].
- nice looking GUI (makes you not poke out your eyes like the standart Oracle tools
- has many many features
- lets you connect to multiple oracle instances
- you can use sane configuration like ip:port username/password and do not have to use those strange ... |
I recently found the free [Oracle SQL Developer][1].
- nice looking GUI (makes you not poke out your eyes like the usual Oracle tools)
- has many nice features, like showing tables filtered
- lets you connect to multiple oracle instances at once
- you can use sane configuration like ip:port username/pass... |
As with most things, SysInternals has you covered this time with [Junction][1]
[1]: http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx |
[Here][1]. UTF8 charset uses 3 bytes per character. CLIENT_NAME is 3 x 500 = 1500 bytes. Shorten `CLIENT_NAME` to 250.
*later:* +1 to creating a hash of the name and using that as the key.
[1]: http://www.xaprb.com/blog/2006/04/17/max-key-length-in-mysql/ |
[Here][1]. For the UTF8 charset, MySQL may use UP TO 3 bytes per character. CLIENT_NAME is 3 x 500 = 1500 bytes. Shorten `CLIENT_NAME` to 250.
*later:* +1 to creating a hash of the name and using that as the key.
[1]: http://www.xaprb.com/blog/2006/04/17/max-key-length-in-mysql/ |
[Here][1]. For the UTF8 charset, MySQL may use up to 3 bytes per character. CLIENT_NAME is 3 x 500 = 1500 bytes. Shorten `CLIENT_NAME` to 250.
*later:* +1 to creating a hash of the name and using that as the key.
[1]: http://www.xaprb.com/blog/2006/04/17/max-key-length-in-mysql/ |
I think the debugger in Visual Studio (Express) is the killer thing that prevents me from using another IDE. |
Citrix, the people behind pc anywhere and the windows remote desktop have a hosted app called "Go to my pc" <https://www.gotomypc.com/>
I've heard people says it good. |
I like [DZone Snippets][1] from ![alt text][2]
It is a public source code repository.
You can build up your personal collection of code snippets, and categorize them with tags / keywords.
[1]: http://snippets.dzone.com/tag/java
[2]: http://www.dzone.com/links/themes/reader/images/dzlogo-tagline-small.gif |
I like [DZone Snippets][1] from ![alt text][2]
It is a public source code repository.
You can build up your personal collection of code snippets, and categorize them with tags / keywords.
(just add **[another suggestion][3]**)
[1]: http://snippets.dzone.com/tag/java
[2]: http://www.dzone.com/links/t... |
The CW 68K linkers support this using .seg files added to your project.
The format is
{ "<segment_name>" [= <hex>] "<name1>" ... "<namen>" }
"<segname1>" = "<segname2">
The brace delimited areas specify segment names and list all the functions/symbols that will be allocated to that segment. The option... |
In some situations [Copilot][1] is a good solution. Not so much for day-to-day admin, but great for remote tech support.
If you need the solution to be cross-platform (ie, controlling an OS X box from Windows) then VNC is the obvious choice. I've had much better luck with the free [Vine VNC Server][2] than with Ap... |
Short answer: No.
Longer answer: No, not at all. There's a reason it hasn't been updated.
[EDIT] @ MrBrutal - Sorry - do you mean to generate code or just represent a design? |
Short answer: No.
Longer answer: No, not at all. There's a reason it hasn't been updated.
[EDIT] @ MrBrutal - Sorry - do you mean to generate code or just represent a design? Because I took your question as to generate code for you. |
Um... maybe there isn't much of a need for one, given that Vi/Vim is pretty much available everywhere and got the whole modal thing right? :) |
I believe Eclipse has Vi bindings and there is a Visual Studio plugin/extension, too (which is called Vi-Emu, or something). |
In Mastering Regular Expressions from Jeffrey Friedl (great book) it is mentioned that you could use \p{Letter} which will match unicode stuff that is considered a letter. |
For more information about "immediate mode" GUI, I can recommend the [Molly Rocket forums][1]. There's a good video presentation of the thinking behind IM-GUI, along with lots of discussion.
I recently hacked together a very quick IM-GUI system based on presentation on Jaari's page, and in my case, where I really ju... |
For more information about "immediate mode" GUI, I can recommend the [Molly Rocket forums][1]. There's a good video presentation of the thinking behind IM-GUI, along with lots of discussion.
I recently hacked together a very quick IM-GUI system based on presentation on Jari's page, and in my case, where I really jus... |
Why is the PyObjC documentation so bad? |
|python|macos|cocoa|tutorials|pyobjc| |
For example, <http://developer.apple.com/cocoa/pyobjc.html> is still for OS X 10.4 Tiger, not 10.5 Leopard.. And that's the official Apple documentation for it..
The official PyObjC page is equally bad, <http://pyobjc.sourceforge.net/>
It's so bad it's baffling.. I'm considering learning Ruby primarily because th... |