Monday, October 30, 2006

BLOG: Things to know about Windows Vista

Windows Vista wont be long before the final release is sent to the manufacturing. There are five versions: Business, Enterprise, Home Basic, Home Premium, and Ultimate.

Computer scan http://www.microsoft.com/windowsvista/getready/upgradeadvisor/default.mspx. needs DVD R/W and Video card (TV output/ TV Tuner card to watch TV on computer).

1. Vista image usually 2G and expand 5GB.
2. Vista supports Low right user which logon without administrator privilege. UAC (User access control). And BitLocker full-volume encryption.

3. Componentized OS. Security updates /Language packs /Drivers are components.
4. No I386, No text mode installation.
5. Boot.ini is history. Bootmgr /BCDedit.exe You can boot windows XP and vista either way.
6. Settings are configured in XML. You can use Windows System Image Manager and User State Migration Tool to manage Vista.

7. HAL Hardware abstraction Layer. You can create Windows PE 2.0 (Preinstall Environment).
8. Windows PE rules. Peimg.exe
9. WIM is the file based image. It supports multiple images per file.
10. Deployment is language neutral.

Security in Vista:

1. Security Centre
2. Windows Firewall
3. Windows Update
4. Windows Defender scan for spyware and other potentially unwanted software.
5. internet options
6. parent control (setup parent controls for any user; view activity reports).
7. Bitlocker driver encryption.

BLOG: Things to know in Vista

Windows Vista won’t be long before the final release is sent to the manufacturing. There are five versions: Business, Enterprise, Home Basic, Home Premium, and Ultimate.

Computer scan http://www.microsoft.com/windowsvista/getready/upgradeadvisor/default.mspx. needs DVD R/W and Video card (TV output/ TV Tuner card to watch TV on computer).

1. Vista image usually 2G and expand 5GB.
2. Vista supports “Low right” user which logon without administrator privilege. UAC (User access control). And BitLocker™ full-volume encryption.
3. Componentized OS. Security updates /Language packs /Drivers are components.
4. No I386, No text mode installation.
5. Boot.ini is history. “Bootmgr” /”BCDedit.exe” You can boot windows XP and vista either way.
6. Settings are configured in XML. You can use “Windows System Image Manager” and “User State Migration Tool” to manage Vista.
7. HAL – Hardware abstraction Layer. You can create Windows PE 2.0 (Preinstall Environment).
8. Windows PE rules. – Peimg.exe
9. WIM is the file based image. It supports multiple images per file.
10. Deployment is language neutral.

Security in Vista:
1. Security Centre
2. Windows Firewall
3. Windows Update
4. Windows Defender – scan for spyware and other potentially unwanted software.
5. internet options
6. parent control (setup parent controls for any user; view activity reports).
Bitlocker driver encryption.

Friday, October 27, 2006

BLOG: FF2 vs IE7

Today downloaded both and installed both. Both are impressive. There are a few Add-Ons which impressed me. https://addons.mozilla.org/firefox/recommended/ .  CoolIris preview - which auto load the page when you hover the links. Clipmarks is pretty good. Yoono give you more interesting related sites. Foxmarks keep a sync your favorites with server.

 

IE7 is pretty impressive as well and you can put add-ons as well. I found it is pretty sneaky. But clipmarks doesnt support the IE7 now. IE7 has many really cool features, such as RSS page. FlashGet is a surprise. You can set google as search provider. And the one I like most the research which could provide you with an easy way to look up word.

I also installed PowerToy of windows XP which provide a bunch of stuff for XP. The one I like most is the ClearType tuning which makes the text much readable in the screen. IE7 has this as well. It has a very powerful calculator and conversion. You can make slideshow HTML as well.

BLOG: Mustang improvement on CLASSPATH


1. Classpath support Mustang
java -classpath .;jars\*  oom.CheckOOMError

2. OutOfMemeory Error now have stack trace
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:45)
        at java.lang.StringBuilder.<init>(StringBuilder.java:80)
        at oom.CheckOOMError.main(checkOOMError.java:12)

Thursday, October 26, 2006

BLOG: Jetty redirect the root to target application

If you are using Jetty, you will find that there is not very convenient not to have the default context. Therefore, you have to overcome the root context in jetty to use your own target context.

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Make https://server/ redirect to https://server/targetApp/ -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Call name="addContext">
<Arg>
<New class="org.mortbay.http.HttpContext">
<Set name="ContextPath">/</Set>
<Call name="addHandler">
<Arg>
<New class="org.mortbay.http.handler.ForwardHandler">
<Set name="RootForward">/targetApp</Set>
<Call name="addForward">
<Arg>/favicon.ico</Arg>
<Arg>/targetApp/images/favicon.ico</Arg>
</Call>
</New>
</Arg>
</Call>
<Call name="addHandler">
<Arg>
<New class="targetApp.server.util.jetty.RedirectHandler" />
</Arg>
</Call>
</New>
</Arg>
</Call>

public class RedirectHandler implements org.mortbay.http.HttpHandler
{
public void handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse httpResponse) throws HttpException, IOException
{
httpResponse.sendRedirect( "/targetApp" );
httpRequest.setHandled( true );
}
}

BLOG: Spring IDE

This is a really handy. Eclipse plug-in Spring IDE provides the following features. I enjoy Spring more and more.

· Project nature which supports a list of Spring bean config files and sets of bean config files (aka beans config sets)

· Incremental builder which validates all modified Spring bean config files defined in a Spring project
· View which displays a tree with all Spring projects and their Spring bean config files
· Image decorator which decorates all Spring projects, their bean config files and all Java classes which are used as bean classes

· Graph which shows all beans (and their relationships) defined in a single config file or a config set
· XML editor for Spring beans configuration files
· Extension of Eclipse's search facility to search for beans defined in the BeansCoreModel
· Wizard for creating a new Spring project

BLOG: Berteig Consulting Student Support (ScrumMaster)

You can download many useful tools and documentations related SCRUM from here.

http://finance.groups.yahoo.com/group/bci_student_support/files/

Monday, October 16, 2006

BLOG: Extract a resource from Jar file

Sometime we want to ship our product in one jar file. This is a practical solution where we can extract out the resource into a temporary file. In my specific project, I need to extract a dll out of the jar file and run the JNI call against with it.

public void extractFile(ClassLoader classLoader, String resName, File targetFile) throws IOException {

FileOutputStream fos = new FileOutputStream(targetFile);

URL url = classLoader.getResource(resName);

if (url == null) {

throw new IOException();

}

InputStream is = url.openStream();

byte[] c = new byte[BUF_LEN];

int i = 1;

while (i != -1) {

i = is.read(c, 0, BUF_LEN);

if (i > 0) {

fos.write(c, 0, i);

}

}

fos.flush();

fos.close();

}

Tony

Tuesday, October 10, 2006

BLOG: TSQL

All the following examples are in database Pubs. You can use Use database; or Select db_name(); to determine whether you are in the database.

select au_fname+ + au_lname, city + , + state + +zip from authors
select title_id, price from titles where price between 10 and 20
select au_lname, state from authors where state in ('CA','KS','MI','UT')
select au_fname, au_lname from authors where au_fname like 'M%'
select au_fname, au_lname from authors where au_fname like 'M_'
select notes from titles where notes like '%@%%' escape '@'
select au_lname, au_fname from authors where au_lname like '[LMS]%'
select au_lname, au_fname from authors where au_lname like '[A-Z][a-z][a-z][a-z]'
select title_id, titles from titles where title like '%[Ww][Ii][Tt][Hh][Oo][Uu][Tt]%'
select * from authors where au_fname like '[^ ] [^ ] [^ ] [^ ]'
select * from authors where state <> 'CA' might be written in select * from authors where state != 'CA'
select au_fname,au_lname from authors order by au_lname,au_fname
select distinct type from titles group by type order by 1 desc,
Aliases can reside in “select” or “from”.
select * from titles where royalty = null
select pub_id,sum(advance) from titles group by pub_id having sum(advance) > 10000
select title_id,type,price from titles where type like '%cook%' compute avg(price)
select title_id, type, price from titles where type like '%cook%' order by type compute avg(price) by type
select title_id,type,price from titles where type in ('business','mod_cook') order by type compute sum(price) by type compute sum(price)

select * from authors where state = 'CA' union select * from authors where state = 'MA'
select sum(qty) from stores,sales where stores.stor_id = sales.stor_id and state = 'CA'
select stores.stor_id,stor_name, ord_num, qty from stores,sales where stores.stor_id *= sales.stor_id
Dont try to use full outer join. Your DBA will be very angry about the full outer join because it might produce A x B rows of output.


Sub Query (Non-correlated or Correlated). Most of subqueries you can write them as join.

          select [distinct] select_list

          from table_list

          where {expression {[not] in comparison [anyall]}[not] exists}

          (select [distinct] subquery_select_list from table_list where conditions)

          [group by group_by_list]

          [having conditions]

          [order by order_by_list]

· Temp table: session temp tables preceeded by a # ex: #authors. Global temp tables ##authors which must be dropped explicitly. (SELECT INTO). You can also create an empty table by using SELECT INTO where 1=2.

· Views are nothing more than a name for a select statement that is stored in the database.
· create table people (SSN char(11) not null constraint chk_ssn check (SSN like '[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]', low int, high, constraint chk_low_high check (LowQty <= HighQty))

· constraint constraint_name] references ref_table [ref_column] / [constraint constraint_name] foreign key (column [{,column}…]) references ref_table [(column [{, column}…])]

· select convert(varchar(8),pubdate,2) from titles where title_id = 'MC3026' (2 yy.mm.dd 3 dd/mm/yy 4 dd.mm.yy 5 dd-mm-yy 102 yyyy.mm.dd 103 dd/mm/yyyy 104 dd.mm.yyyy 105 dd-mm-yyyy).

· Local variables: declare @myvar int select @myvar = 42. Global Variables @@error @@identity @@rowcount @@version @@max_connections @@servername

· The ANSI standard defines four level of isolation for transactions @@isolation
· Level 0 allows dirty reads (You can see data that has been changed, but not necessarily committed, by another user (DEFAULT)

· Level 1 prevents dirty reads
· Level 2 prevents non-repeatable reads
· Level 3 prevents phantom reads
· begin tran; rollback tran; commit tran
· rollback {transaction tran work} savepoint_name @@transtate
· if @@error != 0
· Use the holdlock/noholdlock to override an isolation level setting
· Cursor Example

          declare mycursor cursor for select title from titles for read only

          declare @title_name varchar(80)

          open mycursor

          while @@fetch_status = 0

          begin

          fetch mycursor into @title_name

          end

          close mycursor

          deallocate mycursor

· Stored Procedure Example

          create procedure proc_name

          (@parameter datatype = default

          [,@parameter datatype output]

          [,@parameter datatype…])

          as

          SQL batch

          return

· Trigger Example (SPECIAL TABLE: inserted, deleted)

          create trigger trigger_name on table_name

          for {insert update delete}

          [,{insert update delete}]…

          as

          SQL statements

· A column or local variable of uniqueidentifier data type can be initialized to a value in the following ways:
o By using the NEWID function.
o By converting from a string constant in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, in which each x is a hexadecimal digit in the range 0-9 or a-f. For example, 6F9619FF-8B86-D011-B42D-00C04FC964FF is a valid uniqueidentifier value.

o Comparison operators can be used with uniqueidentifier values. However, ordering is not implemented by comparing the bit patterns of the two values. The only operations that can be performed against a uniqueidentifier value are comparisons (=, <>, <, >, <=, >=) and checking for NULL (IS NULL and IS NOT NULL). No other arithmetic operators can be used. All column constraints and properties, except IDENTITY, can be used on the uniqueidentifier data type.

Tony

Monday, October 02, 2006

BLOG: XenoCode

.NET assemblies contain allot of imformation, so much so that it is very easy for someone to reproduce the original source code of the application. Information such as method names, types, member variables and method names can “easily” be extracted from the assembly. Have a look at Reflector (http://www.aisto.com/roeder/dotnet/), it is a class browser for .NET components.

XenoCode

This product helps to protected your .NET assembly from reverse engineering, tampering, decompiliation and even goes as far as to optimize your binaries.

http://www.xenocode.com/

http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=404

Tony

BLOG: jCIFS -The Java CIFS Client Library

The Java CIFS Client Library

jcifs-krb5-1.2.9 released / Kerberos Authentication Support
posted by Mike, Sep 13, 2006
This package is stock jcifs-1.2.9 modified to support Kerberos 5 / SPNEGO extended security
authentication. Please note that this has no impact on the HTTP Filter which still only supports NTLM.

1. How do I do NTLM HTTP authentication (a.k.a Single Sign On) for my website?
2. Does jCIFS support NTLMv2?
3. Why is java.net.URL throwing unknown protocol: smb Exceptions?
4. I'm getting these UnknownHostExceptions right from the start. What am I doing wrong?
5. Why do I get these "Network is unreachable" IOExceptions?
6. How can I authenticate arbitrary user credentials from an application or web clients against an NT domain?


http://jcifs.samba.org/

Tony

BLOG: Deliver Your Java Application in One-JAR!

Deliver Your Java Application in One-JAR!

      $ jar -tf myapp.jar

      META-INF/MANIFEST.MF

      lib/a.jar

      lib/b.jar

main/main.jar

The manifest contains a Main-Class setting to launch our application, and entries for the supporting JAR files a.jar and b.jar.

      Manifest-Version: 1.0

      Class-Path: main/main.jar lib/a.jar lib/b.jar

      Main-Class: com.main.Main


However, if file system is not defined, you will get errors. What about using the 'jar:' protocol in the Class-Path entry? This doesn't work either. It appears that the JAR loader only supports file-based URLS. Which is where One-JAR comes in.

      $ jar -tf one-jar-boot.jar

      META-INF/MANIFEST.MF

      com/simontuffs/onejar/Boot.class

      com/simontuffs/onejar/Handler$1.class

      com/simontuffs/onejar/Handler.class

      com/simontuffs/onejar/JarClassLoader$ByteCode.class

      com/simontuffs/onejar/JarClassLoader.class

      boot-manifest.mf

There is also a pre-built manifest file called boot-manifest.mf. To complete the One-JAR deployment process, create a suitable directory and expand this file into it, then update the myapp.jar file as follows:

      $ mkdir boot

      $ cd boot

      $ jar -xvf ../one-jar-boot.jar

      $ jar -uvfm ../myapp.jar boot-manifest.mf .

-Done-jar.info: info

-Done-jar.verbose: VERBOSE

Notice how the JarClassLoader keeps track of where classes came from: for example the com.a.A class is contained inside the lib/a.jar file inside myapp.jar.

At this stage you should be asking "How does One-JAR decide which is the main class?". The conventional way would be to have a manifest attribute in the top-level JAR file myapp.jar and require this to be edited before the final jar was assembled. But this is all unnecessary: One-JAR simply looks for a jar file inside the main sub-directory of the composite JAR file myapp.jar, and provided that that JAR file has a Main-Class manifest attribute, it will be used as the main entry point. This allows an existing main-class JAR file to be bundled inside a One-JAR archive without further modification!

http://one-jar.sourceforge.net/

Be A Developer That Uses AI

Developers will not be replaced by AI, they'll be replaced by developers that use AI. Generative AI tools are revolutionizing the way de...