One-stroke Handwriting for Upper Letters

Here is a proposal of one-stroke handwriting of upper letters in English, for machine reading. There was existing one-stroke handwriting for lower letters, but not for upper letters. The red spot is the starting point. The direction of the stroke indeed is the part of the design for in-time reorganization by the machine. This proposal also considered the possible confusion with the lower letters as well as numbers.



This proposal is made by this blogger.


How to Speed up Slow Computer

This article is for lay people to speed up the computer. You can do all of these steps or any of them. Start from easiest and most effective. If restart of computer required, don’t do it until all steps you selected have finished.

1. Killing some unnecessary running processes to speed up immediately. 3 minutes. However, if you do any of following step 7, Limit how many programs run at startup, please skip this because it is a duplicated effort. Start Task Manager, click tab Applications. End all tasks you are currently not in use. Then click tab Processes. Any processes from Acrobat, Ebay, Google are unnecessary; end these processes.

2. Run Windows Performance troubleshooter. 3 minute. Click the Start button, and then click Control Panel. In the search box, type troubleshooter, and then click Troubleshooting. Under System and Security, click Check for performance issues.

3. Turn off visual effects. 3 minutes. Open Performance Information and Tools by clicking the Start button, and then clicking Control Panel. In the search box, type Performance Information and Tools, and then, in the list of results, click Performance Information and Tools. Click Adjust visual effects.  If you're prompted for an administrator password or confirmation, type the password or provide confirmation. Click the Visual Effects tab, click Adjust for best performance, and then click OK. (For a less drastic option, select Let Windows choose what’s best for my computer.)

4. Set virtual memory page size. 3 minutes. Click the Start button, and then click Control Panel. Click advanced system settings in Control panel. In Advanced tab, in Performance pace, click Settings. In Performance Options window, click Advanced tab, in Virtual memory pane, click Changing. If number of Recommended is equal or larger than Currently allocated, do nothing. Else, unclick Automatically manage paging file size for all drivers, click Custom size. Put number of Recommended at Initial box, and double of that at Maximum box. Click Set then Ok, then Apply then Ok, then Ok again.

5. Enable Superfetch service. 3 minutes. May need to restart your computer. Run services.msc > double-click on the Superfetch service > set Startup type to enabled then Start the service.

6. Turn off indexing service. 30 minutes. In Windows Explorer, select drives one by one, Right click the mouse, select Properties. In pop-up window, in General Tab, at bottom unselect Allow files on this drive to have contents indexed in addition to file properties.

7. Limit how many programs run at startup. 30 minutes. Need to restart your computer. Run msconfig, in System Configuration, click tab Startup. Only Antivirus service like Avira Free Antivirus, Battery Management, Energy Management, Power Management, Synaptics Pointing Device Drive are necessary. Anything from Adobe, APSDeamon, Egis, Fax, Google, HomeGroup, IP Helper, Java, Manufacturer software like Acre Dell HP IBM Lenovo, Microsoft Security Client, mwlDeamon, Network Access Protection Agent, Offline Files, OOTag, ooVoo, Parental Controls, QuickTime, RealPlayer, Smart Card, SuiteTray, Tablet PC Input Service, Trillian, Winamp, Windows Media are unnecessary.

8. Uninstall unnecessary software. This may also help to remove hidden spyware. Say, 30 minutes. Need to restart your computer. Uninstall following software Symantec (Install other antivirus software instead), all kind of browser’s toolbar, Your PC manufacturers pack new computers with programs you didn't order and might not want.

9. Disable all add-ons in all browsers. 30 minutes including googling.

10. Remove all cookies. 30 minutes including googling.

11. Clean up old files. Say, 2 hours. Open Windows Explorer, right click any hard driver, in General tab, click Disk Cleanup. It would take 2 hours for system to scan. After that, select all files to be cleaned up.

12. Defragment hard disk. Say, 3 hours. Open Windows Explorer, right click any hard driver, click tab Tools, click Defragmentation. Then start to defragment.

13. Check for viruses and spyware. Say, 6 hours. If you have not already installed the antivirus software, install then. The best free software are Windows Security Essential and Avira.

14. Clean up computer. Say, 10 hours. Need to restart your computer. Open Windows Explorer, right click any hard driver, click tab Tools, in Error-checking pane, click Checking now. In new small window, click all options and start it. You may need to restart computer to enable it.

15. Dedicate an old USB flash memory (between 250MB to 32GB, larger is better) for Readyboost, 3 minutes. Insert USD, in AutoPlay select Speed up my system – using Windows Readyboost. Use it all times.

Table Name and Column Name as Parameters in MS Access


No, you can’t use table name and column name as parameters in MS Access, unfortunately.

Here is a solution: Use a uniformed names and structures in your automations, and copy your table into a temp table with a uniformed name. After process, you copy back and overwrite the temp table to its original table name. Reasonable labour work load.

Error Massage: “Operation must use an updateable query"


In MS Access, sometimes this error massage with error number 2950 may be a problem. It might be permission issue (see http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error), or an update from issue from joined table. For later, try following method to see if it does work:

UPDATE table SET field = 3
WHERE keyfield IN(SELECT keyfield FROM query)
;

It also can be caused by calculation within the UPDATE query. In this case, the best possible solution is to calculate before save into a temp table, then to join that temp table to get the calculated result.

Add Sequence Number to an Existing Table in MS Access


Add series number to an existing table can be done by following method:

SELECT t.myDate, (
    SELECT Count(*)
    FROM myTable AS s
    WHERE t.myDate <= s.myDate) as myRank
FROM myTable AS t

However, if it does not work for you, try following option:

Alter Table Temp_SequenceChange Add Column SequenceNo AutoIncrement;


Cope With Deleted Records Recovery Issue in MS Access


MS Access does not have functionality to recover or UNDO or UNDELETE deleted records. It is easy to lose data when you mistakenly forget put () between AND and OR in WHERE clauses. There are several options to cope with it, for instance creates trail tables or backup whole database regularly. Here is another option which might be easier, better and more practicable:

1. Centralize all DELETE queries into one for better management purpose with unique query name. Since MS Access does not allow table and column name as parameters, this DELETE query will be hard coded every time when you try to delete any record.

2. Never run this query directly.

3. Put this DELETE as part of a Macro.

4. Within the Macro, before the DELETE query, put some backup queries for the table you are working with or all related key tables. The simplest way to code backup query is:

SELECT *
INTO BackupTable1
FROM WorkingTable
;

Thus, you only backup table before the deletion and can be recovered once you find the fatal mistake. You can only backup one copy only since the table name in Macro cannot be changed. Another stupidity of Microsoft.

Q&A: SQL Server

Checklist for Analyzing Slow-Running Queries?
# Use SQL Server Profiler to help identify the slow query or queries. For more information. Use the sys.dm_exec_query_stats and sys.dm_exec_requests dynamic management views to find similar queries that collectively consume a large number of resources.
# How do I analyze the performance of a slow-running query? After you have identified the slow-running query or queries, you can further analyze query performance by producing a Showplan, which can be a text, XML, or graphical representation of the query execution plan that the query optimizer generates. (You can produce a Showplan using Transact-SQL SET options, SQL Server Management Studio, or SQL Server Profiler.)
# Are suitable indexes available? Would adding one or more indexes improve query performance?
# Are there any data or index hot spots? Consider using disk striping. Disk striping can be implemented by using RAID (redundant array of independent disks) level 0, where data is distributed across multiple disk drives.
# Is the query optimizer provided with the best opportunity to optimize a complex query?
# If you have a large volume of data, do you need to partition it? Data manageability is the main benefit of partitioning, but if your tables and indexes on them are partitioned similarly, partitioning can also improve query performance. For more information, see Understanding Partitioning and Tuning the Physical Database Design.

Q&A: Visual Basic 6

What is module?
variables and functions that are used throughout your program and on different forms can be stored in modules so that not to rewrite again each time the variables and functions when you need them in a form.

What is namespace?
A namespace is a collection of different classes. All VB applications are developed using classes from the .NET System namespace. The namespace with all the built-in VB functionality is the System namespace. All other namespaces are based on this System namespace. Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries.For example, the .NET Framework defines the ListBox class in the System.Windows.Forms namespace.

What is Lambda Expression?
A lambda expression is a function or subroutine without a name that can be used wherever a delegate is valid. Lambda expressions can be functions or subroutines and can be single-line or multi-line. You can pass values from the current scope to a lambda expression.

What is delegate?
A delegate is a form of object-oriented function pointer that allows a function to be invoked indirectly by way of a reference to the function. Delegates can be used to hook up event handlers and pass a procedure from one procedure to another. Delegates are objects that refer to methods. They are sometimes described as type-safe function pointers because they are similar to function pointers used in other programming languages. But unlike function pointers, Visual Basic delegates are a reference type based on the class System.Delegate. Delegates can reference both shared methods — methods that can be called without a specific instance of a class — and instance methods.

What is interface?
Interfaces define the properties, methods, and events that classes can implement. Interfaces allow you to define features as small groups of closely related properties, methods, and events; this reduces compatibility problems because you can develop enhanced implementations for your interfaces without jeopardizing existing code. You can add new features at any time by developing additional interfaces and implementations. There are several other reasons why you might want to use interfaces instead of class inheritance:
* Interfaces are better suited to situations in which your applications require many possibly unrelated object types to provide certain functionality.
* Interfaces are more flexible than base classes because you can define a single implementation that can implement multiple interfaces.
* Interfaces are better in situations in which you do not have to inherit implementation from a base class.
* Interfaces are useful when you cannot use class inheritance. For example, structures cannot inherit from classes, but they can implement interfaces.

What is assembly?
An assembly is the building block of a .NET application. It is a self describing collection of code, resources, and metadata (data about data, example, name, size, version of a file is metadata about that file). An Assembly is a complied and versioned collection of code and metadata that forms an atomic functional unit. Assemblies take the form of a dynamic link library (.dll) file or executable program file (.exe) but they differ as they contain the information found in a type library and the information about everything else needed to use an application or component. All .NET programs are constructed from these Assemblies. Assemblies are made of two parts: manifest, contains information about what is contained within the assembly and modules, internal files of IL code which are ready to run. When programming, we don't directly deal with assemblies as the CLR and the .NET framework takes care of that behind the scenes. The assembly file is visible in the Solution Explorer window of the project.

Tutorial: Visual Basic 6.0



http://www.vb6.us/:
Getting to know the VB6 IDE
Visual Basic & ADO Tutorial
Using ADO and stored procedures

Tutorial: C#

http://www.dotnetspider.com/tutorials/DotNet-Tutorial-271.aspx

ADO.NET


ADO.NET is the data access model that comes with the .NET Framework. ADO.NET provides the classes required to communicate with any database source (including Oracle, Sybase, Microsoft Access, Xml, and even text files).

DataAccess Providers in .NET


ADO.NET comes with few providers, including:
  • OleDb
  • SqlClient

    There are other providers available, but we are not including them here as this tutorial is meant for beginners! When you want them, search for ADO.NET providers in Google or MSDN

    Microsoft made the SQL Server. So they gave a separate provider, specifically made for SQL Server. We can use the OleDb provider for all other database sources including MS Access, Oracle, Sybase etc. There is a separate provider available for Oracle.

    A DATA PROVIDER is a set of classes that can be used to access, retrieve and manipulate data from the databases.

    Both OleDb and SqlClient has its own set of classes, but they have the same concepts. We would like to classify the classes into two broad categories (this is not a microsoft classification, anyway!)

  • Classes for communicate with database
  • Classes for holding/manipulating data

    The job of first category of classes is to communicate with database and send or retrieve data from the database. The second category of the classes will be used as a carrier of data.

    Classes for communicating with database


    The Connection, Command, DataReader, and DataAdapter
    objects are the core elements of the ADO.NET provider model.

    Each provider may have classes equivalent to above objects. The name of the classes vary slightly to represent the provider type appropriately.

    Depending on the type of database you work on, you will have to choose either OleDb or SqlClient (or, some other provider) objects. Since all our samples use MS Access database, we will be using OleDb objects in all the samples. If you like to use SqlServer, you just need to replace the OleDb objects with the equivalent SqlClient objects.

    Classes for holding data

    The following are the main classes used to hold data in Ado.NET:

  • DataSet
  • DataTable
  • DataRow

  • A DataSet is an in-memory representation of the database.
  • DataSet contains DataTables (and more...)
  • DataTable represents a database table
  • DataTable contains DataRows (and more...)
  • A DataRow represents a record in a database table.
  • DataRow is a collection of all fields in a record.

    We can use the DataAdapter or DataReader to populate data in DataSet. Once we populate data from database, we can loop through all Tables in the DataSet and through each record in each Table.

    On the first look, this may look bit confusing, but once you understand the concept and get familiar with the Ado.NET classes, you will appreciate the power and flexibility of Ado.NET.


    http://www.dotnetspider.com/tutorials/DotNet-Tutorial-281.aspx
  • Q&A: Oracle Basic

    How to make a procedure private?
    Don't declare it in package specification.

    What is ref cursor?
    It is cursor variable like a pointer in C. can point to any query. Used to pass data set between program units.
    http://www.oracle-base.com/articles/misc/UsingRefCursorsToReturnRecordsets.php

    When a ref cursor open, who use and close this ref cursor?
    The program unit who receive the data set will use and close the cursor, it may be other packages or front end code or Reporting tools.

    What is an autonomous transaction?
    Autonomous transaction is the transaction initiated by another transaction. The key point is it allows the separate commit/rollback transactions.

    What are two exceptions to be careful of when using a select INTO statement?
    1. When records not return, it would generate NOT_DATA_FOUND Found error message.
    2. TOO_NAMY_ROWS can be another problem.

    What is %type? What are the advantages of using this over datatypes?
    %type means matching the date type of original data source. It can make sure there would be no problem with date type matching issue. On other hand, if declare an own datatype, when source data by chance is different from this declaration, there would be a data type consistence issue.

    In PL/SQL how can you test that an update statement updated no rows?
    SQL%ROWCOUNT can be used to test for this purpose.

    Give examples of collections in oracle and their differences?
    # Index-by tables, also known as associative arrays, let you look up elements using arbitrary numbers and strings for subscript values. (They are similar to hash tables in other programming languages.)
    # Nested tables hold an arbitrary number of elements. They use sequential numbers as subscripts. You can define equivalent SQL types, allowing nested tables to be stored in database tables and manipulated through SQL.
    # Varrays (short for variable-size arrays) hold a fixed number of elements (although you can change the number of elements at runtime). They use sequential numbers as subscripts. You can define equivalent SQL types, allowing varrays to be stored in database tables. They can be stored and retrieved through SQL, but with less flexibility than nested tables.

    Have you used Bulk Collection? If yes then:"Why is bulk collection more efficient"?
    Without bulk collection, every single row would request PL/SQL server to call SQL server one by one. By using bulk collection, say 5000 in a patch, the PL/SQL server will call SQL server for every 5000 rows. This can be very efficient.

    What is the difference between a function and a procedure?
    1. Functions are normally used for computations where as procedures are normally used for executing business logic.
    2. Function is mainly used in the case where it must return 1 value, which can be scalar value or table or table values. Where as a procedure may not return a value (except through out parameter). If procedure mistakenly called, is returns always integer zero.
    3. Procedure can call in another project but function work in same project.
    4. We can't have any DDL, DML and TLC command inside a function, if that function is called from a SQL query as a UDF(user defined function). But if the function is not called from SQL query then we can have all transactional statement(DDL, DML and TLC) inside a function. Procedure can not be called from the SQL statements.

    When a procedure within a package (containting multiple procedures) is called, what will get loaded into memory, the whole package or just the procedure?
    Whole package will be loaded into memory.

    How many triggers exist?
    Trigger Types
    A DML trigger is fired by a DML statement, a DDL trigger is fired by a DDL statement, a DELETE trigger is fired by a DELETE statement, and so on. An INSTEAD OF trigger is a DML trigger that is defined on a view (not a table). The database fires the INSTEAD OF trigger instead of executing the triggering DML statement.
    A system trigger is defined on a schema or the database. A trigger defined on a schema fires for each event associated with the owner of the schema (the current user). A trigger defined on a database fires for each event associated with all users.
    A simple trigger can fire at exactly one of the following timing points:
    •Before the triggering statement executes
    •After the triggering statement executes
    •Before each row that the triggering statement affects
    •After each row that the triggering statement affects
    A compound trigger can fire at more than one timing point. Compound triggers make it easier to program an approach where you want the actions you implement for the various timing points to share common data.

    How to know if index is being used?
    One can use the index monitoring feature to check if indexes are used by an application or not. When the MONITORING USAGE property is set for an index, one can query the v$object_usage to see if the index is being used or not. Here is an example: SELECT table_name, index_name, monitoring, used FROM v$object_usage;

    Q&A: Database Basic

    Normal DB is under which normal form?
    3rd normal form, but sometimes for better performance, can be in 2nd normal form.

    What is difference between TRUNCATE, DELETE and DROP commands?
    DELETE
    The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it. Note that this operation will cause all DELETE triggers on the table to fire.
    TRUNCATE
    TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.
    DROP
    The DROP command removes a table from the database. All the tables' rows, indexes and privileges will also be removed. No DML triggers will be fired. The operation cannot be rolled back.
    DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command. Therefore DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back.

    What is difference between UNION and UNION ALL?
    The Oracle SQL UNION differs from the Oracle UNION ALL primarily because it does not filter out duplicitous rows. The UNION SQL operator returns only the unique rows that appear in either result, while the UNION ALL operator returns all rows in both queries, including duplicate rows.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:21547067945222

    What is Cross Join?
    CROSS JOIN returns the Cartesian product of rows from tables in the join. In other words, it will produce rows which combine each row from the first table with each row from the second table. CROSS JOIN serves function as Inner Join if WHERE clause had been added. Vice versa, if INNER JOIN without WHERE clause, it is a cross join.

    How to stop a process?
    Using KILL command.
    http://en.wikipedia.org/wiki/Kill_%28command%29

    What is the difference between Inner Join and Outer Join?

    Q&A: Oracle Performane Tuning

    Why using globe temp table (GTT)?
    Faster, improve performance.
    http://www.dba-oracle.com/t_temporary_tables_sql.htm
    http://www.dba-oracle.com/t_sql_rewrite_temporary_tables.htm

    What is the difference between 'on commit preserve rows' and 'on commit delete rows' for GTT?
    The ON COMMIT PRESERVE ROWS makes this a session based temporary table. rows will stay in this table until a logoff.
    The ON COMMIT DELETE ROWS makes this a transaction based temp table. When you commit -- the rows disappear.
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::NO::P11_QUESTION_ID:48812348054

    What is explain plan and how to read it?
    It tells you how oracle processes the query. Read it form inner right to outer left.
    http://www.oracle-base.com/articles/8i/ExplainPlanUsage.php
    http://www.orafaq.com/node/1420

    Why use bulk collect?
    Improve performance.
    http://www.dba-oracle.com/t_oracle_bulk_collect.htm

    Last Weekday n In T-SQL

    T-SQL query:

    SELECT DATEADD(D, n-DATEPART(DW, GETDATE()), DATEDIFF(DD, 0, GETDATE()))

    can be used to get last weekday n in T-SQL. Following is the value of parameter n:







































    At Least Hours AgoMonTueWedThuFriSatSun
    023-3-2-101
    242-4-3-2-101
    48-5-4-3-2-101
    The result is that weekday at 0:00:00 timestamp.

    However, if this is to be used as parameter in SSRS, it would be:

    =DATEADD("D", n-WEEKDAY(TODAY())), TODAY())

    This is because the syntax are different in parameter of SSRS and T-SQL.

    Many people would prefer predict in T-SQL as follows:

    WHERE PERIOD >= STARTDATE AND PERIOD < ENDDATE

    However, in day-to-day life, people prefer both dates be to inclusive. In this case, the predict should be:

    WHERE PERIOD >= STARTDATE AND PERIOD <= ENDDATE

    Therefore, the n parameter should be changed accordingly.


    http://weblogs.sqlteam.com/jhermiz/archive/2007/08/15/60289.aspx

    Schedule a Job in SQL Server Management Studio

    To create and attach a schedule to a job

    1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
    2. Expand SQL Server Agent, expand Jobs, right-click the job you want to schedule, and click Properties.
    3. Select the Schedules page, and then click New.
    4. In the Name box, type a name for the new schedule.
    5. Clear the Enabled check box if you do not want the schedule to take effect immediately following its creation.
    6. For Schedule Type, select one of the following:

    * Click Start automatically when SQL Server Agent starts to start the job when the SQL Server Agent service is started.
    * Click Start whenever the CPUs become idle to start the job when the CPUs reach an idle condition.
    * Click Recurring if you want a schedule to run repeatedly. To set the recurring schedule, complete the Frequency, Daily Frequency, and Duration groups on the dialog.
    * Click One time if you want the schedule to run only once. To set the One time schedule, complete the One-time occurrence group on the dialog.

    To attach a schedule to a job

    1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
    2. Expand SQL Server Agent, expand Jobs, right-click the job that you want to schedule, and click Properties.
    3. Select the Schedules page, and then click Pick.
    4. Select the schedule that you want to attach, and then click OK.
    5. In the Job Properties dialog box, double-click the attached schedule.
    6. Verify that Start date is set correctly. If it is not, set the date when you want for the schedule to start, and then click OK.
    7. In the Job Properties dialog box, click OK.

    Where is SQL Server Agent? By default, it is tuned off.

    To start the SQL Server Agent service

    1.On the Start menu, point to All Programs, point to Microsoft SQL Server 2008 R2, point to Configuration Tools, and then click SQL Server Configuration Manager.
    2.In SQL Server Configuration Manager, expand Services, and then click SQL Agent.
    3.In the results pane, right-click any instance, and then click Start. A green arrow on the icon next to the SQL Server Agent and on the toolbar indicates that SQL Server Agent started successfully.
    4.Click OK.

    Can't do it? You might be using express version. Only in full version you can turn it on.


    http://technet.microsoft.com/en-us/library/ms191439.aspx
    http://msdn.microsoft.com/en-us/library/ms191454.aspx

    CAST Varchar To Integer in T-SQL

    CAST(CASE WHEN ISNUMERIC(variab)=1 THEN variab ELSE 0 END AS INT)

    This changes all non numeric string to 0 when deal with not so cleaned data.

    In SQL Query, How to Compare Across Different Rows

    In SQL query, it is easy to compare values in different columns for same row. However, when compare value at column_A of Row 1 to the values at column_B of Rows 2 to 3, it would be hard. Sure, you always can write the cursor to process rows one by one. Here is a quick way: INNER JOIN this table by itself, you would get following rows: New row 1 = old row 1 and 1 New row 2 = old row 1 and 2 New row 3 = old row 1 and 3 New row 4 = old row 2 and 1 New row 5 = old row 2 and 2 New row 6 = old row 2 and 3 New row 7 = old row 3 and 1 New row 8 = old row 3 and 2 New row 9 = old row 3 and 3 Now you will be able to compare column_A and column_B at new rows 2 to 3, which is what you want. Just remember to eliminate row 1 and row 4 to 9.

    Labels