Pages

Monday, October 27, 2008

Google Chrome Clone Browser SRWare Iron 0.2.152.0



Whole blogospear was buzzing with the launch of Google Chrome Browser. However Google entering into Browser war was totally unexpected, it has created ditch like feeling after supporting open source Firefox and now launching its own browser.

There are several concern raised with Google Chrome Browser, one biggest concern among chrome users is Google Chrome Privacy Policy. With this privacy policy, Google gets enough power to get smallest details like which user is surfing what.

Google Chrome Browser is based on Chromium-Source which is open source project, SRWare has used this open source Chromium to build Iron browser which is a clone of Google Chrome and emulates exactly same features like Google Chrome.

Iron browser has disabled following tracking features

Client id – every Google Chrome Browser has unique client id to track users surfing habits, Google Suggest, Timestamp of installation, URL tracker, RLZ tracking, Chrome Updater Alternet Error Page and Error Reporting.

Another good thing about Iron Browser is, it uses latest version of Webkit 525.19.

from: http://www.blogsdna.com/1035/free-download-google-chrome-clone-browser-srware-iron-021520-installer.htm






DOWNLOAD Iron Browser, the Google Chrome Clone

DOWNLOAD PORTABLE Iron Browser, the Google Chrome Clone

DOWNLOAD SOURCE CODE for Iron Browser, the Google Chrome Clone 1 2 3 4


Sunday, October 26, 2008

Intro to MS Access DAO and ADO


Objectives
At the end of this section you should understand the terms
  • RecordSource
  • Recordset
  • RecordsetClone
and how you can work with the underlying data of a form (read only) using the RecordsetClone and the use of the debug window.

Reading

In the Access 2003 help file read the entries for
  • RecordsetClone
  • RecordSource
  • Recordset (DAO)
  • Bookmark
  • Me object
  • FindFirst, FindNext, FindLast, FindPrevious methods
Balter
  • Balter pages 684 - 700 DAO Recordset properties and methods, the RecordsetClone property and Bookmarks, 721 - 724 using the immediate window
  • (for Access 2000 Balter pages 468-482 DAO Recordset properties and methods, the RecordsetClone property, Bookmarks page 501-2 immediate window)

Introduction - DAO and ADO

Background Reading (for interest only)

Balter pages 672 - 684
( Access 2000 Balter pages 430 - 468 Jennings Chapter 27, pages 1032 - 1082 )

Commentary

Microsoft currently provide two different ways of accessing data (strictly interface definitions), Data Access Objects (DAO) and ActiveX Data Objects (ADO). DAO was the only model in Visual Basic up to VB5 and in Access up to Access 97. With VB6 and from Access 2000, Microsoft have made both DAO and ADO available.

Microsoft have also made it clear that their intention is to move to ADO exclusively in the long term. Certain important products/environments such as ASP scripting using VB Script only support ADO and anyone planning to use Microsoft products long term should learn the use of ADO.

As stated below, a database created in Access 2003 uses DAO by default as does a database created in Access 97 but Access2000 uses ADO. So the default in the databases we have used so far, which were converted from Access 97.

For this reason, and because it is a bit simpler, the rest of this module will use DAO objects and methods to be consistent with the methods on the default objects created by Access.

Very Important - References

Access 2003 is set up so that when you create a database it expects you to use DAO to access data. You can see this as follows.

If you set up a new database in Access 2003 and then open the VBA IDE (either from a Form or a new Module) and then choose Tools, References from the Toolbar, you will get a window showing the places VBA will look for definitions of language methods etc. What you will see is

Native Access 2003 references - Data Access Objects (DAO) compliant but ActiveX Data Objects (ADO) also referenced 

Access2003 references - DAO

Native Access 2000 references - ActiveX Data Objects (ADO) compliant

 

References present in databases converted from Access 97 to Access 2000 format

If you create a database in Access 97 and then convert it to Access 2000 format and then look at the references here you will see

Access 97 created references

Both the references selected and the order in which they appear are important. The ones selected will be the only ones searched and they will be searched in the order given, so you see an Access 2000 created database will only look for ADO data manipulation, while an Access 97 database converted to Access 2000 will only look for DAO! If you add extra references and these lead to duplicate definitions then the first in the list will be used, so, if you had ADO 2.1 and DAO 3.6 in that order, since both contain definitions of the OpenDatabase method for Database objects, Access 2000 would use the ADO definition even though the DAO one was there. So it is no good just adding the DAO 3.6 to the end of the list!

Note that an Access2003 created database has both the DAO and ADO libraries selected (very dangerous) which means that DAO classes will be accessed first but, if you use a class which is defined for ADO only, that class will be used. Thus, if you think you are programming using ADO then any classes which are also defined for DAO will be created as DAO objects, while classes which are unique to ADO will be created as ADO objects, leading to impenetrable bugs.

Probably it is the most sensible to deselect (untick) the reference to the data access classes you don't intend to use.

The PROJCONT (and other) databases supplied with these notes originate from Access 97 databases and so have the DAO references and will execute the DAO code.

Very Important  If you create a database in Access 2000 and you want to write DAO code in it, you must change the references from the native Access 2000 list to the native Access 97 list as shown above - otherwise you will get a series of inexplicable and meaningless error messages as Access tries to execute the commands in their ADO form! 

If you create a database in Access2003 and intend to write data access VBA, you should unselect the library for the data access objects you don't intend to use.

File format

Microsoft has implemented (at least) 3 different file formats with different compatibilities


Access 97 can develop
Access2000 can develop
Access2003 can develop
Access97 format
Yes
Can convert (both ways) but not develop
Can convert (both ways) but not develop
Access2000 format
No
Yes
Yes (can also create)
Access2002-3 format
No
No
Yes

In this module we'll try to stick to Access2000 format files compatible with both Access200 and Access2003.

Discussion

Underlying any data bound form there is a table or query which supplies the data displayed on the form. In VBA or Visual Basic terminology, this virtual table is called a Recordset. Recordsets can be free standing or, as in the case of Access forms (and Reports) properties of other objects. The contents of the Recordset are determined by the RecordSource property and you can change the Recordset by changing the Recordsource (or, as we will see later, by applying a Filter expression). You can work with a read-only copy of a Form's Recordset by referencing it's RecordsetClone property and you can perform actions (such as repositioning) on the RecordsetClone without changing the current position on the underlying data which determines what is being displayed.

If you want to match the position of the displayed data with that in the RecordsetClone, you can do this with the Bookmark properties of the two Recordsets by assigning the value of the Bookmark of the clone to Me.Bookmark (implicitly the Bookmark property of the recordset underlying the form).

The following is an extract from the Help entry for RecordsetClone. 


You can use the RecordsetClone property to refer to a form's Recordset object specified by the form's RecordSource property.

Setting

The RecordsetClone property setting is a copy of the underlying query or table specified by the form's RecordSource property. If a form is based on a query, for example, referring to the RecordsetClone property is the equivalent of cloning a Recordset object by using the same query. If you then apply a filter to the form, the Recordset object reflects the filtering. 
This property is available only by using Visual Basic and is read-only in all views. 


Practical Example

In this practical example you will see how to move through  the RecordsetClone and how to synchronise the underlying data with the operation being shown by using the Debug window.
  • Create a form based on the CUSTOMER table using the Form Wizard and call it frmCUSTOMERrecordsetclone
  • Put two buttons on the form and type into them the code below for the click events (here for Command10_Click and Command11_Click)
  • View the form and type G to show the immediate window - NB in Access 2003 the VBA IDE is a separate window and, so, the Immediate Window opens within this, not within the Access window (unlike Access 97), so you will have to swap between them to see what is going on.
  • Click each of the buttons. You will see with the first button the table data is displayed in the debug window but the data displayed is not changed while the second button displays the last row in the table after looping through the table

Option Compare Database 
Option Explicit

Private Sub Command10_Click()

With Me.RecordsetClone 
.MoveFirst 
Me.Bookmark = .Bookmark 
Do While Not .EOF 
    Debug.Print !Custno, !Customer 
    .MoveNext 
Loop 
End With

End Sub

Private Sub Command11_Click()

With Me.RecordsetClone 
.MoveFirst 
Me.Bookmark = .Bookmark

Do While Not .EOF 
    Debug.Print !Custno, !Customer 
    .MoveNext 
    If Not .EOF Then 
        Me.Bookmark = .Bookmark 
        End If 
Loop 
End With

End Sub


Commentary on Code

Command10_Click()
  • The With block sets up all the references (preceded with a .) inside the block refer to Me.RecordsetClone
  • .MoveFirst positions in the RecordsetClone at the first row
  • Me.Bookmark = .Bookmark synchronises the recordset underlying the data with the position in the RecordsetClone (ie at the first row)
  • The Do While loop executes as long as the program is not at the end of the RecordsetClone recordset (after the last row)
  • The Debug.Print prints each Customer Number and Customer name to the debug window
  • .MoveNext moves to the next row in RecordsetClone
Command11_Click()
  • Does exactly the same but synchronises the underlying data with the RecordsetClone each time through the loop, except when the RecordsetClone has gone past the last row, thus leaving the underlying data displaying the last row at the end of the loop
The form and debug immediate window will look like 

displayed formimmediate window






How to get HTML color codes

HTML colors are colors used in designing web pages, and the methods for describing and specifying those colors. Authors of web pages have a variety of options available for specifying colors for elements of web documents. Colors may be specified as an RGB triplet in hexadecimal format (a hex triplet); they may also be specified according to their common English names in some cases. Often a color tool or other graphics software is used to generate color values. (from wikipedia)

How to use Recordset Object in VBA


The benefits of Recordset Object has been explained earlier (refer http://smartcomputing123.blogspot.com/2008/10/why-you-should-use-recordsets-and.html  ). 

Read http://msdn.microsoft.com/en-us/library/bb177501.aspx to learn the various ways of using Recordset Objects.

How to use CurrentProject object in VBA


Why You Should Use Recordsets and Object Orientation in VBA Instead of Arrays


When I starting working with VBA 4 years ago arrays were my best friends, they’re easy to use, easy to understand, and getting data to / from an Excel sheet is a piece of cake as cell (0, 1) can map nicely to array position 0, 1. However I’ve developed the opinion that arrays should be avoided in favour of other forms of data lists / collections.

What’s Wrong With Arrays
It’s not that arrays are particularly wrong, it’s more that in comparison to the alternatives they’re limited and frustrating to use and support;

·         Size declaration – You have to declare how big you’re array is going to be, even if you don’t know yet. This is a key limitation regardless of the fact you can ‘re-declare’ to increase the size.

·         No in-built sorting / filters / search functions. An array is an array, it doesn’t have any methods associated with it. It doesn’t even have it’s only object type.

·         It can only hold strings, numeric values, characters etc.

·         Moving through an array is arduous with large amounts of data and there’s no standard ‘structure’ an array must take (I can declare a 0 based array, a co-worker may declare a 1 based array, and there’s no standard slot for each piece of information etc)

 
So What are the Alternatives?
 
ADODB.RECORDSETS
Instead of using arrays to store string and numerical values I’ve recently been using ADODB.recordsets (recordsets).

Recordsets are slightly more object oriented than arrays, as in essence they are collections of record objects, although they can be manipulated without even using or referring to the record object.

Benefits of Recordsets:
·         No size declaration, you can type myRecordset.AddNew to create a new record and populate it with values.

·         You define fields to specify what data is where, instead of having to remember which position in the array the address is you can just move to a record and use myRecordset.Fields(“myField”).value to retrieve it.

·         You also don’t have to iterate through a recordset to output the contents to a worksheet:

‘ Move to the beginning of the recordset

myRecordset.MoveFirst
‘output the contents to a worksheet starting at cell A1

someWorksheet.Range(“A1”).value = myRecordset.GetRows()

·         They have inbuilt search functions

·         They’re easier to iterate over if you need to, or you can do bulk updates

·         The list goes on....

There are of course limitations to recordsets, they’re frustrating to work out at times, and can be counter intuitive, but I’ve found the benefits of having a more structured set of data are fantastic.

Add Microsoft ActiveX Data Objects Library 2.8 to your VBA references and have a play.

OBJECTS AND COLLECTIONS
If you’ve declared a customer object and given that customer properties such as FirstName, LastName and CustomerID there’s no confusion on how to find that information.

If you combine that benefit with the use of the Collection object you make your code so much easier to understand, use and support.

Collections and object lists figure more in strongly typed object oriented languages such as C# than in VBA, but we can still take advantage of VBA’s generic collection object.

Dim c as New Collection
The more you object orient your code in VBA the more you’ll use collections, and the easier your life will become, you won’t have to pass around huge arrays and remember between procedures which attribute is where, as you’ll have strongly typed objects to work from and the re-use and quality of your code will vastly improve.

Overall object orientation is the best path to take for storing data, however, even the use of recordsets can drastically improve the speed, reliability, supportability and expandability of your code.


How to use App.Path in VBA

App.Path only works in Visual Basic, not VBA [Visual Basic for applications]. Use CurrentProject keyword for VBA.

CurrentProject object refers to the project for the current Microsoft Access project (.adp) or Access database (.mdb).

Getting the location to the current database using Access 2000/2002/2003...

'returns the database file name
CurrentProject.Name

'returns the database path
CurrentProject.Path 

'returns the database path and the file name
CurrentProject.FullName 

Getting the location to the current database using Access 97...

'returns the database file name
Dir(CurrentDb.Name) 

'returns the database path
Left(CurrentDb.Name,Len(CurrentDb.Name)-Len(Dir(CurrentDb.Name))) 

'returns the database path and the file name
CurrentDb.Name

'returns the directory that Access [msaccess.exe] is installed in
(SysCmd(acSysCmdAccessDir))

Thursday, October 23, 2008

10 Tips to Study Smart and Save Time

I recently got my marks back from University. My grade point average was a 4.2 out of a possible 4.5, resting between an A and a perfect A+. In itself, this isn’t an incredible achievement. But I managed to do this while spending only a fraction of the time studying than many of the people I knew.

Is it just natural talent? Perhaps. I’ve always had a knack for understanding concepts and learning new ideas. But I also believe the way I learned the information played a role. Instead of cramming last minute or memorizing details, I try to organize information in a way that makes it easier to recall.

This strategy of organization I label holistic learning. Holistic learning is simply the process of organizing information into webs, that interconnect ideas. Instead of forcing ideas into your skull, you focus on the relationships between information. Linking ideas together to see the whole, instead of just the parts.

Building an Understanding

Learning is a process similar to building a house. You aren’t fed the complete picture. Limitations on communication prevent the instantaneous transmission of knowledge. Instead you listen to lectures, read textbooks and take painstaking notes to try and comprehend a subject.

You are fed building supplies, bricks, mortar and glass. It is up to you to assemble the building. Unfortunately, most learning strategies fall into two basic types:

Memorization - Instead of building anything you simply stare at each brick for several minutes trying to record its position.
Formulas - This is the equivalent to being blind, fumbling around a new house. You can’t see the building itself but you learn to come up with simple rules to avoid walking into walls.
There is nothing particularly wrong with either of these strategies, assuming they aren’t your entire strategy. The human brain isn’t a computer so it can’t memorize infinite sums of knowledge without some form of structure. And formulas no longer work if the questions they are designed to solve change scope.

Learning Holistically

The alternative strategy is to focus on actually using the information you have to build something. This involves linking concepts together and compressing information so it fits in the bigger picture. Here are some ideas to get started:

Metaphor - Metaphors can allow you to quickly organize information by comparing a complex idea to a simple one. When you find relationships between information, come up with analogies to increase your understanding. Compare neurons with waves on a string. Make metaphors comparing parts of a brain with sections of your computer.
Use All Your Senses - Abstract ideas are difficult to memorize because they are far removed from our senses. Shift them closer by coming up with vivid pictures, feelings and images that relate information together. When I learned how to do a determinant of a matrix, I remembered the pattern by visualizing my hands moving through the numbers, one adding and one subtracting.
Teach It - Find someone who doesn’t understand the topic and teach it to them. This exercise forces you to organize. Spending five minutes explaining a concept can save you an hour of combined studying for the same effect.
Leave No Islands - When you read through a textbook, every piece of information should connect with something else you have learned. Fast learners do this automatically, but if you leave islands of information, you won’t be able to reach them during a test.
Test Your Mobility - A good way to know you haven’t linked enough is that you can’t move between concepts. Open up a word document and start explaining the subject you are working with. If you can’t jump between sections, referencing one idea to help explain another, you won’t be able to think through the connections during a test.
Find Patterns - Look for patterns in information. Information becomes easier to organize if you can identify broader patterns that are similar across different topics. The way a neuron fires has similarities to “if” statements in programming languages.
Build a Large Foundation - Reading lots and having a general understanding of many topics gives you a lot more flexibility in finding patterns and metaphors in new topics. The more you already know, the easier it is to learn.
Don’t Force - I don’t spend much time studying before exams. Forcing information during the last few days is incredibly inefficient. Instead try to slowly interlink ideas as they come to you so studying becomes a quick recap rather than a first attempt at learning.
Build Models - Models are simple concepts that aren’t true by themselves, but are useful for describing abstract ideas. Crystallizing one particular mental image or experience can create a model you can reference when trying to understand. When I was trying to tackle the concept of subspaces, I visualized a blue background with a red plane going through it. This isn’t an entirely accurate representation of what a subspace is, but it created a workable image for future ideas.
Learning is in Your Head - Having beautiful notes and a perfectly highlighted textbook doesn’t matter if you don’t understand the information in it. Your only goal is to understand the information so it will stick with you for assignments, tests and life. Don’t be afraid to get messy when scrawling out ideas on paper and connecting them in your head. Use notes and books as a medium for learning rather than an end result.

from: http://www.lifehack.org/articles/lifestyle/10-tips-to-study-smart-and-save-time.html

Stats