Accepted students for Google Summer of Code ™ have been announced ! Congratulations to all the students accepted for this year’s program. We’re looking forward to a great...
The final step is to put an object into the Lookup on key listening in each of the JEditorPanes, e.g., a "City" object for the CityEditorPane and a "Country" object for the CountryEditorPane. Then, within the CompletionProviders, only add items to the CompletionResultSet if the object of interest is in the Lookup.
The result is that you can then have different code completions in different JEditorPanes, as shown below:
I've also included the Tools | Options | Editor | Code Completion tab, so that the code completion can be customized.
The full source code for the example is here:
java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.2/misc/CustomerApp
A google scholar search turns up numerous papers on testability, including models for computing testability, recommendations for how ones code can be more testable, etc.
They all come with the assertion that more testable code is more stable, however I can't find any studies which actually demonstrate this.
I tried looking for studies evaluating the effect of testable code vs. quality, however the closest I can find is Improving the Testability of Object Oriented Systems, which discusses the relationship between design flaws and testability.
Is testable code is actually more stable? And why, or why not?
Please back up your answers with references or evidence to back up your claim.
Normally, when we release source code we're hoping that other people will build on it and improve it. Today's release of Jarlsberg , a small yet full-featured microblogging...
Most of the projects that I work on consider development and unit testing in isolation which makes writing unit tests at a later instance a nightmare. My objective is to keep testing in mind during the high level and low level design phases itself.
I want to know if there are any well defined design principles that promote testable code. One such principle that I have come to understand recently is Dependency Inversion through Dependency injection and Inversion of Control.
I have read that there is something known as SOLID. I want to understand if following the SOLID principles indirectly results in code that is easily testable? If not, are there any well-defined design principles that promote testable code?
I am aware that there is something known as Test Driven Development. Although, I am more interested in designing code with testing in mind during the design phase itself rather than driving design through tests. I hope this makes sense.
One more question related to this topic is whether it's alright to re-factor an existing product/project and make changes to code and design for the purpose of being able to write a unit test case for each module?
My C code contains many functions with pointers to different structs as parameteres which shouldn't be NULL pointers. To make my code more readable, I decided to replace this code:
if(arg1==NULL || arg2==NULL || arg3==NULL...) {
return SOME_ERROR;
}
With that macro:
NULL_CHECK(arg1,arg2,...)
How should I write it, if the number of args is unknown and they can point to different structs?(I work in C99)
When using robocopy windows utility, what flags do I set so that robocopy aborts on the very first error it sees, similar to xcopy /dry command?
I need to mirror two dirs, and on occasion some files would be locked. I do not want robocopy to continue trying to copy files, or override the files that are not locked - rather the very first error should stop the whole copy process.
I have written a stored procedure in MSSQL Server 2008 R2 which sends emails when my Application logs errors. It works fine on servers at our office but when I ran it on our remote servers I got
must issue a starttls command first
So maybe there is a setting somewhere which is different between the two servers, and that's why it's working on one and not the other. How do I set the server so that it issues a "starttls commaned first"?
Is there an option or style where I can make a selection and on its first letter, have that be set at a larger font size, and possibly another color?
Say I have a selection of text all set to 11 point in black, but I would like the first letter to be at 14 point in red.
How would I do this?
when i start my pc when the first screen i see the resultion is small but when it gets to log in screen its good how di i change the resultion screen size of the first screen
thats the screen thats small and the log in screen and when i log in all thats good only that screen pls help me someone thanks
the graphic card is gtx 680 thanks im not sure wht topic this goes in
It worked perfectly one day I didn't read the nividia 3d thing and i didn't read and i unstalled the drivers and that change and then later installed it back after how do I fix this? Thanks
I got the following, quite puzzling error today when running a unit test:
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/http/Cookie
A google search found this post, which explains that it is caused by having an interface in the classpath, and not an actual implementation.
In this case it’s the java-ee interface. To fix this I added the jetty servlet api implementation to my pom:
jetty
javax.servlet
test
Piece of cake. I have run in to this before, so I figured I would capture the fix here in case I run in to it again.
I have done with my web application. Now I am into code review phase. I have looked for some tools for code review in StackOverflow. But my question is:
Why should I depend on a tool for my code review?
K Software discounts Comodo code signing certificates to US$99 per year.
In the past, I've seen Commodo code signing certificates for US$80.
I'm excluding CAcert which AFAIK are FREE but are not covered by browsers like Internet Explorer AFAIK.
QUESTION:
What is the best price per year for a code signing certificate?
Thank you ~~ gerry (lowry)
Edit: **THIS SHOULD NOT HAVE BEEN CLOSED**
from the FAQ: http://stackoverflow.com/faq
----------------------------
What kind of questions can I ask here?
Programming questions, of course! As long as your question is:
* detailed and specific <====== YES!
* written clearly and simply <====== YES!
* of interest to other programmers <====== YES!
I've been programming for over 40 years. http://gerrylowryprogrammer.com/
I've taught computer programming at the community college level.
I'm a Star level contributer to forums.asp.net. http://forums.asp.net/members/gerrylowry.aspx
IMO, I've a very good idea what is of interest to other programmers.
MORE INFORMATION
http://en.wikipedia.org/wiki/Code_signing
http://msdn.microsoft.com/en-us/library/ms537361%28VS.85%29.aspx
also: via Google:
code signing
Ensuring the integrity of code and executables that one distributes is just as much about programming as is knowing how to flip
bits in assembler, use delegates in C#, and use the BDD context/specification still of "test first testing".
I posted this question and have a freshly minted code signing cert from Thawte.
I followed the instructions (or so I thought) and the code signing claims to be done right, however when I try to verify the tool shows an error.
I have no idea what it means and no idea how to fix this. Any comments would be appreciated.
Command line to sign exe:
signtool sign /f mdt.pfx /p password /t http://timestamp.verisign.com/scripts/timstamp.dll test.exe
Results:
The following certificate was selected:
Issued to: [my company]
Issued by: Thawte Code Signing CA
Expires: 4/23/2011 7:59:59 PM
SHA1 hash: 7D1A42364765F8969E83BC00AB77F901118F3601
Done Adding Additional Store
Attempting to sign: test.exe
Successfully signed and timestamped: test.exe
Number of files successfully Signed: 1
Number of warnings: 0
Number of errors: 0
Note that there are no errors or warnings.
Now, when I try to verify imagine my surprise:
signtool verify /v test.exe
results in:
Verifying: test.exe
SHA1 hash of file: 490BA0656517D3A322D19F432F1C6D40695CAD22
Signing Certificate Chain:
Issued to: Thawte Premium Server CA
Issued by: Thawte Premium Server CA
Expires: 12/31/2020 7:59:59 PM
SHA1 hash: 627F8D7827656399D27D7F9044C9FEB3F33EFA9A
Issued to: Thawte Code Signing CA
Issued by: Thawte Premium Server CA
Expires: 8/5/2013 7:59:59 PM
SHA1 hash: A706BA1ECAB6A2AB18699FC0D7DD8C7DE36F290F
Issued to: [my company]
Issued by: Thawte Code Signing CA
Expires: 4/23/2011 7:59:59 PM
SHA1 hash: 7D1A42364765F8969E83BC00AB77F901118F3601
The signature is timestamped: 4/27/2010 10:19:19 AM
Timestamp Verified by:
Issued to: Thawte Timestamping CA
Issued by: Thawte Timestamping CA
Expires: 12/31/2020 7:59:59 PM
SHA1 hash: BE36A4562FB2EE05DBB3D32323ADF445084ED656
Issued to: VeriSign Time Stamping Services CA
Issued by: Thawte Timestamping CA
Expires: 12/3/2013 7:59:59 PM
SHA1 hash: F46AC0C6EFBB8C6A14F55F09E2D37DF4C0DE012D
Issued to: VeriSign Time Stamping Services Signer - G2
Issued by: VeriSign Time Stamping Services CA
Expires: 6/14/2012 7:59:59 PM
SHA1 hash: ADA8AAA643FF7DC38DD40FA4C97AD559FF4846DE
Number of files successfully Verified: 0
Number of warnings: 0
Number of errors: 1
Somewhat strange problem... when I start my .NET app for the first time after rebooting my machine, the SQL Server queries are really slow... when I pause the debugger, I notice that it's hanging on getting the response from the query. This only happens when connecting to a remote SQL server (2008)... if I connect to one on my local machine, it's fine. Also, if I restart the app, it works fast, even off the remote SQL server, and subsequent runs are also fine. The only problem is when I connect to a remote SQL server for the first time after rebooting my machine. What's more, I have even noticed this same exact behavior with a 3rd party app (also .NET) that also connects to a remote SQL server.
Another piece of info... this has only started hapenning since I upgraded my machine from XP to Win7 (64 bit). Also, other developers on my team who upgraded to Win7 are seeing the same behavior (both with the app we're developing and the 3rd party .NET app).
(copied from http://stackoverflow.com/questions/2014814/sql-server-queries-are-really-slow-only-on-first-run )
Hi,
This might sound slightly confusing, but please bear with me.
I'm trying to execute a copy of the Perl interpreter using Java's Runtime.exec(). However, it returned error code 9. After running the file a few times, the perl interpreter mysteriously started to return code 253 with no changes in my command at all.
What does code 253 / code 9 mean? A google search for perl interpreter's exit codes turned up nothing. Where can I find a list of exit codes for the Perl interpreter? Thanks!
I recently stumbled upon Code Contracts and have started using them in my C# projects. However, I also have a number of projects written in C++/CLI.
For C# and VB, Code Contracts offer a handy configuration panel in the project properties dialog. For a C++/CLI project, there is no such panel.
From the documentation, I got the impression that adding Code Contracts support to a C++/CLI project should be a simple matter of calling some external tools as part of the build process (namely ccrefgen.exe, cccheck.exe, and ccrewrite.exe). However, the number of command line options and restrictions concerning the call sequence have me somewhat intimidated.
Can anybody point me to a simple way to run the Code Contracts tools as an automated part of the build process in Visual Studio?
Does anybody know what is the best R alternative to SAS first. or last. operators? I did find none.
SAS has the FIRST. and LAST. automatic variables, which identify the first and last record amongst a group with the same value with a particular variable; so in the following dataset FIRST.model and LAST.model are defined:
Model,SaleID,First.Model,Last.Model
Explorer,1,1,0
Explorer,2,0,0
Explorer,3,0,0
Explorer,4,0,1
Civic,5,1,0
Civic,6,0,0
Civic,7,0,1
Hello,
I'm trying to run my first ASM 8086 program on MASM on Windows Vista 64bit OS.
I put this program on my MASM editor:
.model small
.stack
.data
message db "Hello world, I'm learning Assembly !!!", "$"
.code
main proc
mov ax,seg message
mov ds,ax
mov ah,09
lea dx,message
int 21h
mov ax,4c00h
int 21h
main endp
end main
and the MASM editor gives me this output that I got no idea what's wrong with the program:
Assembling: D:\masm32\First.asm
D:\masm32\First.asm(9) : error A2004: symbol type conflict
D:\masm32\First.asm(19) : warning A4023: with /coff switch, leading underscore required for start address : main
_
Assembly Error
Where is the problem with this code? This is my first ASM program please remember.
Thank you :)
I created a long code snippet with Snippet Editor. After saving I can see and use it within Visual Studio, however, the code is suddenly trunctated after about 120 lines and there appears some garbled text at the end. Is there a size limit to code snippets? If yes, is this a visual studio, or a Snippet Editor "feature"?
Hi,
If I already have domain classes, and I want to be able persist them using EF via a model first approach how do I do this?
For example do I go to the EF designer (in VS2010) and create the model and generate the classes, then go to these EF classes and somehow manually modify them? But then would there be an issue if I needed to change the model and re-create database TSQL from the model for updates?
What's the easiest approach?
I have created a PHP web-application.
I have 3 environments: DEV, TEST, PROD.
What's a good tool / business practice for me to move my PHP web-application code from DEV to TEST to the PROD environment?
Realizing that my TEST environment still only connects to my TEST database; whereas, I need to PROD environment to connect to my PROD database. So the code is mostly the same, except that I need to change my TEST code once moved into PROD to connect to the PROD database and not TEST database.
I've heard of people taking down Apache in such away that it doesn't allow new connections and once all the existing connections are idle it simply brings down the web server.
Then people manually copy the code and then manually update the config files of the PHP application to also point to the PROD instance.
That seems terribly dangerous.
Does a best practice exists?
I have a set of Windows 2008 Server R2 SP1 Enterprise Edition virtual machines running in Hyper-V. The host server has 64GB of RAM and two SSD drives (one drive for the host OS, and the second one for the VMs).
The virtual machines are as follows:
Domain Controller: 4GB RAM
Exchange Server: 4GB RAM
Terminal Services: 50GB RAM
We use this setup for a travelling training class where users remote desktop to one of the VMs - let's call it the Terminal Services or "TS" VM - where tools such as Visual Studio are installed. The students go through some labs on the TS VMs in Visual Studio.
Overall, this setup works great. However, when users are collectively logging in for the first time, the VM really struggles to keep up while all the user profiles are created. It can take some users up to 10 minutes to login. The number varies from 30 to 40 students.
A workaround to this would be to manually remote desktop to the TS virtual machine using all the accounts to ensure that the local profile is created in advance.
I'm looking for a way to automate the first time login process on the TS virtual machine. I am envisioning iterating through the accounts in a certain Active Directory OU, and then somehow initiating a remote desktop session to the TS VM to log them in for the first time.
Are there ways to do this?
Thanks
Is it possible to make Visual Studio 2010's code completion window more like that of Eclipse (Java)?
In particular, I'd love the code completion window to give me a variable's type, and a method's return type and expected parameters, without needing to hover the highlight over that particular variable/method.
VS's code completion's little icons that indicate if something is a property, method etc are useful, but they just aren't enough.
I have created a PHP web-application.
I have 3 environments: DEV, TEST, PROD.
What's a good tool / business practice for me to move my PHP web-application code from DEV to TEST to the PROD environment?
Realizing that my TEST environment still only connects to my TEST database; whereas, I need to PROD environment to connect to my PROD database. So the code is mostly the same, except that I need to change my TEST code once moved into PROD to connect to the PROD database and not TEST database.
I've heard of people taking down Apache in such away that it doesn't allow new connections and once all the existing connections are idle it simply brings down the web server.
Then people manually copy the code and then manually update the config files of the PHP application to also point to the PROD instance.
That seems terribly dangerous.
Does a best practice exists?