Alejandro G. Carlstein Ramos Mejia Blog



If you wish to create a read-only domain object that insure that no body is allowed to write to the database through your domain object, then add these even listener at the end of your domain object file:

transient beforeInsert = {
throw new RuntimeException('insert not allowed')
}

transient beforeUpdate = {
throw new RuntimeException('update not allowed')
}

transient beforeDelete = {
throw new RuntimeException('delete not allowed')
}

 

Share

Note: Remember. JavaScript is a prototype-based language.

var Module  = (function() {
    // declare private variables and/or functions
    var private_variable = "private variable content";
  
    var private_method = function(){
        console.log("private_method()");
        console.log("-> private method content");     
    }
    return {
        // declare public variables and/or functions     
        public_variable: "public variable content",
        public_method: function(){
            console.log("public_method()");
            console.log("->" + private_variable);     
        }
    };
})();
  
// Execution
console.log(Module.public_variable);
Module.public_method();
console.log("------------------------------");
console.log(Module.private_variable);
console.log(Module.private_method());
 
// Output
public variable content
public_method()
-> private variable content
------------------------------
undefined
Uncaught TypeError: Module.private_method is not a function

 

Share

In this example you will see: feffects, feffects.Tween, flash.external.ExternalInterface.

NOTIFICATION: These examples are provided for educational purposes. Using this code is under your own responsibility and risk. The code is given ‘as is’. I do not take responsibilities of how they are used.

Share

Today, I am writing the introduction of the multi-player 2D game. This is the version 06

Long time ago…
Our civilization kept growing…
Greedy ruled the world…
Resources started lacking…
And a war for them began…
At the end, the world was destroyed…
A wasteland was instead…
Life was at the border of extinction…
However, some how…
Life managed to survive…
Now, in a new world….
Were previous damage still remain …
This world shall be explored again…
A new cycle has just began…
Sound file:[
.mp3 ]
Share

This painting must be observed first at distance and later at close view.

Dancing Forest - view 1

Dancing Forest - view 1

Share

Description

Example

Version SELECT @@version
List of Users SELECT name FROM master..syslogins
Current User SELECT user; — Returns user such as “dbo”SELECT user_name(); — Returns user such as “dbo”SELECT system_user; — Returns [DOMAIN]\[USERNAME]SELECT loginame FROM master.sysprocesses WHERE spid = @@SPID;
Privileges SELECT is_srvrolemember(‘sysadmin’);
SELECT is_srvrolemember(‘securityadmin’);
SELECT is_srvrolemember(‘serveradmin’);
SELECT is_srvrolemember(‘setupadmin’);
SELECT is_srvrolemember(‘diskadmin’);
SELECT is_srvrolemember(‘bulkadmin’);
SELECT is_srvrolemember(‘dbcreator’);———————————————————-SELECT name FROM master..syslogins WHERE sysadmin = 1;
SELECT name FROM master..syslogins WHERE securityadmin = 1;
SELECT name FROM master..syslogins WHERE serveradmin = 1;
SELECT name FROM master..syslogins WHERE serveradmin = 1; — May return empty
SELECT name FROM master..syslogins WHERE setupadmin = 1; — May return empty
SELECT name FROM master..syslogins WHERE diskadmin = 1; — May return empty
SELECT name FROM master..syslogins WHERE bulkadmin = 1;
SELECT name FROM master..syslogins WHERE dbcreator = 1;
SELECT name FROM master..syslogins WHERE hasaccess = 1;
SELECT name FROM master..syslogins WHERE denylogin = 0;
SELECT name FROM master..syslogins WHERE isntname = 0;
SELECT name FROM master..syslogins WHERE isntgroup = 0;
List All Databases  SELECT name FROM master..sysdatabases;
Database by Id  SELECT DB_NAME(ID); — Where ID is 0, 1, 2, …, N
Current Database  SELECT DB_NAME();
List Columns SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name=’TABLE_NAME’); — Where TABLE_NAME is the table name on the current database
List Tables SELECT name FROM DATABASE_NAME..sysobjects WHERE xtype = ‘U’; — Where DATABASE_NAME is the database which you wish to list the tables
List Views SELECT name FROM DATABASE_NAME..sysobjects WHERE xtype = ‘V’; — Where DATABASE_NAME is the database which you wish to list the views
Hostname SELECT HOST_NAME();
Information and Location of DB file EXEC sp_helpdb DATABASE_NAME; — Where DATABASE_NAME is the name of the database
Share

In this example you will see: Heapsort algorithm.

NOTIFICATION: These examples are provided for educational purposes. Using this code is under your own responsibility and risk. The code is given ‘as is’. I do not take responsibilities of how they are used.

Share