simple singularities

simple and clean mssql full-backup script

Filed under: programming — fri13th April 24, 2010 @ 7:27 pm

open the sql query and execute this code for backup

BACKUP DATABASE dbname TO DISK='C:\dbbackup\backupfile.bak'

and load it from another server!

USE master
GO
DROP DATABASE dbname
GO
RESTORE DATABASE dbname FROM DISK='C:\dbbackup\backupfile.bak'

very simple, isn’t it? also there are many and many other backup options worth for check.

there are some critical bug(?) in cygwin. if you upload some files using cygwin’s ssh protocol, the files’s permission are -rwx—— by default, it causes operation system error. so you have to change the permission to -rwxrwxrwx. not only db backup file, even just a plain asp file can’t be opened. so don’t miss it.

struts 2 ’s no result problem

Filed under: java, programming — fri13th April 8, 2010 @ 9:47 pm

i stucked on some mysterious error today. i made some xml config in struts.xml, it’s very simple one and there’s nothing wrong as far as i knew

<action name="someurl" class="someAction" method="list" >
	<result>/WEB-INF/pages/someurl.jsp</result>
</action>

and i got this error

Could not find action or result
No result defined for action com.fri13th.SomeAction and result input

of course i checked and checked all the parameters again. there was no mistake at all.. so why it didn’t work?

then i make another class and check again. it works fine. so what the difference was? the only difference was annotated validation in front of class definition. i deleted some validation code and it worked fine..

i’m too tired today, must go to bed early than usual..

ie6 overflow and scroll bar bug

Filed under: programming — fri13th November 19, 2009 @ 6:32 pm

if some content i.e. image is bigger than contents pane i.e. div, ie6 doesn’t show it right. it just cut and show only half of image. wtf..

so i find the solution, or maybe this is also ie6’s bug?

just add this to the css properties of the cropped image.

position:relative;

and this doesn’t solve the whole problem.

the scroll bar is set to show div’s width and and no scrollbar for image..

so i add this line

position:relative;
zoom:1;

and problem solved.. you can check the final result from my another gourmet and photo blog here

Microsoft PowerShell 2.0 RC with Ruby & vi

Filed under: programming — fri13th October 17, 2009 @ 4:23 pm

i didn’t notice that PowerShell which is bundled in Windows7, can also be installed in WIndows XP SP3. and i googled and knew RC version is available now. so why not give a try?

you can download the rc version here
https://connect.microsoft.com/windowsmanagement/Downloads

after install, you need to permit script execution

Set-ExecutionPolicy RemoteSigned

and install ruby and vi, which vendor you like :-)
i prefer this ruby distribution
http://rubyinstaller.org/

vi has many variation, so i can’t choose one. anyway gvim might be a good idea..
http://www.vim.org/download.php#pc

and you need to setup the vi path.

modify or create below file

%userprofile%¥My Documents¥WindowsPowerShell¥Microsoft.PowerShell_profile.ps1

and add this line

Set-Alias vi 'path/to/vi.exe'

that’s all! you can do many convenient script jobs in Windows XP!

unalz in mac

Filed under: apple, programming — fri13th September 17, 2009 @ 12:03 pm

alzip format alz is the most wierd compression format, widely spread in korea. it’s some kind of disaster, why i have to use alz? only one thing good is it can split big files into pieces.

i usually use winrar in windows, but for alz format i have to install another one, like panzip. it’s the most thing i don’t like, so.. i found some good solution

download unalz from this link

http://www.kippler.com/win/unalz/

the usage is very simple

make posix
sudo mv unalz /usr/bin

actually unalz is included in port, but not compiled well in my snow leopard

sudo port install unalz

will show some error, please someone fix this issue ;-)

IETester

Filed under: programming — fri13th February 19, 2009 @ 9:30 am

it was very painful to install new virtual machine for just testing site in ie6. so IETester is really good for me.

http://www.my-debugbar.com/wiki/IETester/HomePage

i eventually ignore ie 5.5. but not ie6.. i wish windows 7 will be spreaded. really ie6 sucks.

use resource bundle outside of Action in struts 2

Filed under: java, programming — fri13th January 17, 2009 @ 3:17 pm

i have to generate some logs in struts 2 framework. i know the action classes include resource bundle feature by just using getText() method. but i can’t find how i use resource bundle outside of Action classes. just google it and get no reasult.

i didn’t give up and download xwork2.0.7. (yes, xwork!) struts2.0.x source doesn’t contain old xwork code. and finally found some classes about that. DefaultTextProvider and LocalizedTextUtil. DefaultTextProvider is just a wrapper of LocalizedTextUtil.

1
2
TextProvider textProvider = DefaultTextProvider.INSTANCE;
log.info(textProvider.getText("some.property"));

i have to use Locale.US for logging. so…

1
LocalizedTextUtil.findDefaultText("some.property", Locale.US)

struts 2 has many good features but lacks of manual.. anyway, we can do what we want. if you don’t care about reading sources.. good luck to you

jQuery & script.aculo.us conflict problem

Filed under: javascript, programming — fri13th December 10, 2008 @ 9:41 pm

in jQuery’s official site, they say jQuery has no conflict with major library.. yeah, that may be right.. i believed it and implement in my prototype and script.aculo.us environment.

when i test class selector jQuery(“.myClass”), it doesn’t simply work, id selector works fine..
jQuery.noConflict() has useless in this case.. and i tested my code and there was no error at all..

so i disabled script.aculo.us after few hour’s labor, it works like a charm..
the program was only 10 or so minutes to finish, but i spent full afternoon for this issue..

it’s very curious.. because of jQuery’s nature, it isn’t easy at all to make a conflict like this..
but there is one in reality..

i couldn’t find about conflict reporting in jQuery.. so be careful to select and combine
javascript libraries.

mac, leopard, java 6, eclipse, intellij idea

Filed under: apple, programming — fri13th October 31, 2008 @ 2:38 pm

yesterday, i updated my mac and found 64 bit java 6 was included in this update.
it wasn’t default so i change the setting manually below /System/Library/…

and suddenly intelllij idea didn’t work.. and i found intellij use 1.5 by default.
and change it to 1.6 may not work right..

so i tried eclipse 3.4. but there was no 64bit java support eclipse for mac.

a bit frustrating.. so i reverted the change..
maybe i have to wait the next os, snow leopard, when the java 6 becomes default.

anyway, i made another java 6 directory and set JAVA_HOME there..
it works.. and intellij idea rus smoothly by using system default setting..
that’s enough to me..

jquery problem: click event not fired in ff3, ubuntu

Filed under: firefox, javascript, programming — fri13th September 11, 2008 @ 12:26 pm

i turned off cookie and test as if ff is mobile browser.
and at the same mode, i develop some web page.

then jquery’s click event doesn’t work. i don’t know why it does..
so i turned on cookie and my js program works fine.
and that’s all.. there are too many mysteries in the browser.

Next Page >>>