Posted by Tatyana at 12 January 2012

Category: Dev, Java

Well, maybe not in theory, but in practice – definitely.

Test-drive development is a way to program where you write an automated unit test that fails first, the you write code and check that the test runs ok. Brilliant theory for an ideal world (doesn’t exist). In practice however it is very seldom that you as a programmer have a full and clear understanding of what is it you are gonna do.

Of course I’m not talking about cases where you need to calculate the result of 2+2. Sure you can write a test case here, it’s rather easy.

And here comes a hard reality where you come to the real place, f.ex. a bank that needs a new program. And here you are with a task that states smth like this “Create a form that have these and these fields and calculates that and that”. You begin with a test case? You are right! That’s what happens if you do this: you kill several days in trying to understand how you build this test case, what fields you need to fill inn to calculate some result. If you’ll try to check a more specific result then you need several extra days to find a person who maybe knows how the value must be calculated.

Because it is very seldom in the real world that programmers work together with persons who both know and can explain to the programmer how the things should be done. Simply because those persons do not exist.

So you wrote the test and now you need to write a calculation algorithm… Hmm, how the hell do we do that? We start building it and magic happens! The algorithm that can calculate the value need all totally different input values then those you’ve written in you test case… Ouch! It happened again?

At the end you’ve used double time to write the code and update you test case in parallel plus the time you’ve killed on the test at the beginning.

So why is it so popular to talk about it and constantly try to use it? Do not know. You need to write test cases when you program difficult logic. That is the fact. But doing it FIRST? It’s just a waste of time and killing of enthusiasm. You won’t be clever and you’ll not write better code if you kill time with the test first.

What really needs to be done before you start programming is to draw a solution.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 1 October 2011

Category: App

Tags: , ,

All right!

image

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by Tatyana at 20 September 2011

Category: Dev, strips

Silly: Hi guys!
Silly: Here is the specification of you new task!
SPEC: We want a “Calculate” button that calculates when you push it.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 9 September 2011

Category: c++, Dev

Tags: , ,

Extract the sources to some folder, open the command prompt and go to that directory.

Then enter following commands…

> bootstrap.sh
> bjam.exe --toolset=msvc --link=static --runtime-link=static --build-type=complete stage
VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by Tatyana at 5 September 2011

Category: Dev, Java, Tip

To see all the sqls that your application do during execution, insert the following property in your test xml property file:

<bean id="sessionFactory"
		class="my.class.MyEntitySessionFactory">
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.show_sql">true</prop>
			</props>
		</property>
		<property name="dataSource" ref="dbDataSource" />
</bean>
VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by Tatyana at 4 September 2011

Category: Dev, Java, strips

Core: How do I make Hibernate to not to retreive all objects at the same time?
Mag: Do i lazy.
Silly: Yeah, don’t work too hard!

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by Tatyana at 3 September 2011

Category: Dev, strips

Core: I HATE tests!
Tester: What?
Mag: He said he HATES TESTERS.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 2 September 2011

Category: Dev

Tags: , , , ,

If you’ve upgraded Perl on your Gentoo box to 5.12, and tries to reemerge ImageMagick, you might get this error:

Could not find a typemap for C type 'Image::Magick' in Magick.xs, line 2404
make[3]: *** [Magick.c] Error 1
make[3]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0/PerlMagick'
make[2]: *** [install-exec-perl] Error 2
make[2]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0'
make: *** [install] Error 2
 * ERROR: media-gfx/imagemagick-6.7.1.0 failed (install phase):
 *   emake failed
 *
 * If you need support, post the output of 'emerge --info =media-gfx/imagemagick-6.7.1.0',
 * the complete build log and the output of 'emerge -pqv =media-gfx/imagemagick-6.7.1.0'.
 * The complete build log is located at '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/temp/environment'.
 * S: '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/work/ImageMagick-6.7.1-0'

>>> Failed to emerge media-gfx/imagemagick-6.7.1.0, Log file:

>>>  '/var/tmp/portage/media-gfx/imagemagick-6.7.1.0/temp/build.log'

Reemerge with:

 # USE="-perl" emerge -av imagemagick

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-gfx/imagemagick-6.7.1.0  USE="bzip2 corefonts cxx jpeg openmp png tiff truetype xml zlib -X -autotrace -djvu -fftw -fontconfig -fpx -graphviz -gs -hdri -jbig -jpeg2k -lcms -lqr -lzma -opencl -openexr -perl -q32 -q64 -q8 -raw -static-libs -svg -webp -wmf" 0 kB

Total: 1 package (1 new), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] 

After some minutes:

>>> Recording media-gfx/imagemagick in "world" favorites file...
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

You might also want to update /etc/portage/package.use with “media-gfx/imagemagick -perl” if you don’t need Perl with ImageMagick.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by Tatyana at 31 August 2011

Category: Dev, Java, Tip

/** @deprecated this one must be resolved differently */
@Deprecated
public void setModeChange()
{
   this.mode = Mode.CHANGE;
}
VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 31 July 2011

Category: Uncategorized

Shamelessy copied from Fog Creek software.

A programmer is most productive with a quiet private office, a great computer, unlimited beverages, an ambient temperature between 68 and 72 degrees (F), no glare on the screen, a chair that’s so comfortable you don’t feel it, an administrator that brings them their mail and orders manuals and books, a system administrator who makes the Internet as available as oxygen, a tester to find the bugs they just can’t see, a graphic designer to make their screens beautiful, a team of marketing people to make the masses want their products, a team of sales people to make sure the masses can get these products, some patient tech support saints who help customers get the product working and help the programmers understand what problems are generating the tech support calls, and about a dozen other support and administrative functions…

It’s such nice words about us programmers :) .

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share