1.add this to javascript __doPostback('GetPage', 'myargument1');
2.Then in OnLoad event I can add:
If Request.Form("__EVENTTARGET") = "GetPage" Then
MyFunction1(Request.Form("__EVENTARGUMENT")) 'myargument1 will be passed to MyFunction1
End If
If Request.Form("__EVENTTARGET") = "GetPage" Then
MyFunction1(Request.Form("__EVENTARGUMENT")) 'myargument1 will be passed to MyFunction1
End If
Concept/Language Construct | Java 5.0 | ActionScript 3.0 |
Class library packaging | .jar | .swc |
Inheritance | class Employee extends Person{ | class Employee extends Person{ |
Variable declaration and initialization | String firstName=”John”; Date shipDate=new Date(); int i; int a, b=10; double salary; | var firstName:String=”John”; var shipDate:Date=new Date(); var i:int; var a:int, b:int=10; var salary:Number; |
Undeclared variables | n/a | It’s an equivalent to the wild card type notation *. If you declare a variable but do not specify its type, the * type will apply. A default value: undefined var myVar:*; |
Variable scopes | block: declared within curly braces, member: declared on the class level no global variables | No block scope: the minimal scope is a function local: declared within a function member: declared on the class level If a variable is declared outside of any function or class definition, it has global scope. |
Strings | Immutable, store sequences of two-byte Unicode characters | Immutable, store sequences of two-byte Unicode characters |
Terminating statements with semicolons | A must | If you write one statement per line you can omit it. |
Strict equality operator | n/a | === for strict non-equality use !== |
Constant qualifier | The keyword final final int STATE=”NY”; | The keyword const const STATE:int =”NY”; |
Type checking | Static (checked at compile time) | Dynamic (checked at run-time) and static (it’s so called ‘strict mode’, which is default in Flex Builder) |
Type check operator | instanceof | is – checks data type, i.e. if (myVar is String){ The is operator is a replacement of older instanceof |
The as operator | n/a | Similar to is operator, but returns not Boolean, but the result of expression: var orderId:String=”123”; var orderIdN:Number=orderId as Number; trace(orderIdN);//prints 123 |
Primitives | byte, int, long, float, double,short, boolean, char | all primitives in ActionScript are objects. The following lines are equivalent; var age:int = 25; var age:int = new int(25); |
Complex types | n/a | Array, Date, Error, Function, RegExp, XML, and XMLList |
Array declaration and instantiation | int quarterResults[]; quarterResults = int quarterResults[]={25,33,56,84}; | var quarterResults:Array or var quarterResults:Array=[]; var quarterResults:Array= AS3 also has associative arrays that uses named elements instead of numeric indexes (similar to Hashtable). |
The top class in the inheritance tree | Object | Object |
Casting syntax: cast the class Object to Person: | Person p=(Person) myObject; | var p:Person= Person(myObject); or var p:Person= myObject as Person; |
upcasting | class Xyz extends Abc{} Abc myObj = new Xyz(); | class Xyz extends Abc{} var myObj:Abc=new Xyz(); |
Un-typed variable | n/a | var myObject:* var myObject: |
packages | package com.xyz; class myClass { | package com.xyz{ class myClass{ } ActionScript packages can include not only classes, but separate functions as well |
Class access levels | public, private, protected if none is specified, classes have package access level | public, private, protected if none is specified, classes have internal access level (similar to package access level in Java) |
Custom access levels: namespaces | n/a | Similar to XML namespaces. namespace abc; abc function myCalc(){} or abc::myCalc(){} use namespace abc ; |
Console output | System.out.println(); | // in debug mode only trace(); |
imports | import com.abc.*; import com.abc.MyClass; | import com.abc.*; import com.abc.MyClass; packages must be imported even if the class names are fully qualified in the code. |
Unordered key-value pairs | Hashtable, Map Hashtable friends = new Hashtable(); friends.put(“good”, friends.put(“best”, friends.put(“bad”, String bestFriend= friends.get(“best”); // bestFriend is Bill | Associative Arrays Allows referencing its elements by names instead of indexes. var friends:Array=new Array(); friends["best"]=”Bill”; friends["bad"]=”Masha”; var bestFriend:String= friends[“best”] friends.best=”Alex”; Another syntax: var car:Object = {make:”Toyota”, model:”Camry”}; trace (car["make"], car.model); // Output: Toyota Camry |
Hoisting | n/a | Compiler moves all variable declarations to the top of the function, so you can use a variable name even before it’s been explicitly declared in the code. |
Instantiation objects from classes | Customer cmr = new Customer(); Class cls = Class.forName(“Customer”); Object myObj= cls.newInstance(); | var cmr:Customer = new Customer(); var cls:Class = flash.util.getClassByName(“Customer”); |
Private classes | private class myClass{ | There is no private classes in AS3. |
Private constructors | Supported. Typical use: singleton classes. | Not available. Implementation of private constructors is postponed as they are not the part of the ECMAScript standard yet. To create a Singleton, use public static getInstance(), which sets a private flag instanceExists after the first instantiation. Check this flag in the public constructor, and if instanceExists==true, throw an error. |
Class and file names | A file can have multiple class declarations, but only one of them can be public, and the file must have the same name as this class. | A file can have multiple class declarations, but only one of them can be placed inside the package declaration, and the file must have the same name as this class. |
What can be placed in a package | Classes and interfaces | Classes, interfaces, variables, functions, namespaces, and executable statements. |
Dynamic classes (define an object that can be altered at runtime by adding or changing properties and methods). | n/a | dynamic class Person { var name:String; } //Dynamically add a variable // and a function var p:Person = new Person(); p.name=”Joe”; p.age=25; p.printMe = function () { trace (p.name, p.age); } p.printMe(); // Joe 25 |
function closures | n/a. Closure is a proposed addition to Java 7. | myButton.addEventListener(“click”, myMethod); A closure is an object that represents a snapshot of a function with its lexical context (variable’s values, objects in the scope). A function closure can be passed as an argument and executed without being a part of any object |
Abstract classes | supported | n/a |
Function overriding | supported | Supported. You must use the override qualifier |
Function overloading | supported | Not supported. |
Interfaces | class A implements B{ interfaces can contain method declarations and final variables. | class A implements B{ interfaces can contain only function declarations. |
Exception handling | Keywords: try, catch, throw, finally, throws Uncaught exceptions are propagated to the calling method. | Keywords: try, catch, throw, finally A method does not have to declare exceptions. Can throw not only Error objects, but also numbers: throw 25.3; Flash Player terminates the script in case of uncaught exception. |
Regular expressions | Supported | Supported |
<httpHandlers>
<add verb="*" path="client_script.aspx" type="ProgStudios.HttpHandlers.ClientScriptHandler, ProgStudios.WebControls" />
</httpHandlers>
| base | width | heigh |
| 0 | 0.0 | 0.0 |
| 500 | 309.0 | 186.0 |
| 1000 | 618.0 | 372.0 |
| 1500 | 927.0 | 558.0 |
| 2000 | 1236.0 | 744.0 |
| 2500 | 1545.0 | 930.0 |
| 3000 | 1854.0 | 1116.0 |
| 3500 | 2163.0 | 1302.0 |
| 4000 | 2472.0 | 1488.0 |
| 4500 | 2781.0 | 1674.0 |
| 5000 | 3090.0 | 1860.0 |
| 5500 | 3399.0 | 2046.0 |
| 6000 | 3708.0 | 2232.0 |
| 6500 | 4017.0 | 2418.0 |
| 7000 | 4326.0 | 2604.0 |
| 7500 | 4635.0 | 2790.0 |
| 8000 | 4944.0 | 2976.0 |
| 8500 | 5253.0 | 3162.0 |
| 9000 | 5562.0 | 3348.0 |
| 9500 | 5871.0 | 3534.0 |
| 10000 | 6180.0 | 3720.0 |
| 10500 | 6489.0 | 3906.0 |
| 11000 | 6798.0 | 4092.0 |
| 11500 | 7107.0 | 4278.0 |
| 12000 | 7416.0 | 4464.0 |
| 12500 | 7725.0 | 4650.0 |
| 13000 | 8034.0 | 4836.0 |
| 13500 | 8343.0 | 5022.0 |
| 14000 | 8652.0 | 5208.0 |
| 14500 | 8961.0 | 5394.0 |
| 15000 | 9270.0 | 5580.0 |
| 15500 | 9579.0 | 5766.0 |
| 16000 | 9888.0 | 5952.0 |
| 16500 | 10197.0 | 6138.0 |
| 17000 | 10506.0 | 6324.0 |
| 17500 | 10815.0 | 6510.0 |
а теперь самое вкусное - факты и статистика:
9m+ gameplays.
Реклама принесла 5k$+, Микротранзакции - 4k$+, Лицензии- 9k$, iPhone - 1k$, итого около 20k$. Самый играемый домен - ВКОНТАКТЕ! на нем даже заработалось несколько тысяч голосов.
Немного о Микротранзакциях- большинство продаж было на NinjaKiwi, Mochiads, Elite-Games.Net и это примерно 50% от всех продаж. География - 55% из US+Germany+UK+Canada. Если кто в танке - это English+French+German языковые группы.
Об iPhone - все тяжко здесь - особенно с первой игрой, не хитовой. iPad версия ждет аппрува, Дефенс в разработке, кстати он выйдет с шейдерами=)
import string
def n(self,myStr):
return filter(lambda x: x in string.printable, myStr)
db_connection = sqlite.connect('my.db')
db_connection.text_factory = str


XSD gives 3 indicators: <xs:all>, <xs:sequence>, and <xs:choice>.
xs:all allows the specified child elements to appear (or not) in any order in the containing element... except they can only appear once.
xs:sequence requires the specified child elements to appear in the order they are given
and xs:choice requires that only one of the specified child elements appears, but it can appear any number of times.
so I just changed tag from <xs:sequence> to <xs:all> and it fixed problem.
orginal code
<xs:element name="Requirement" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string" minOccurs="0" />
<xs:element name="Duration" type="xs:int" minOccurs="0" />
<xs:element name="Occurring" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Schedule" minOccurs="0">
<xs:complexType>
<xs:all>
<xs:element name="Name" type="xs:string" minOccurs="0" />
<xs:element name="Duration" type="xs:int" minOccurs="0" />
<xs:element name="Occurring" type="xs:int" minOccurs="0" />
</xs:all>
</xs:complexType>
</xs:element>
ServerAliveInterval 5
C:>quser
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
johndoe ica-tcp#966 10 Active 7 7/31/2008 3:04 PM
averagejoe ica-tcp#969 1 Active 9 7/31/2008 3:30 PM
C:>logooff 2
<script type="text/javascript">
function OpenNote(noteid,t) {
var w1 = 550;
var h1 = 500;
var left = window.screenLeft + (screen.width / 2) - w1; //
var top = window.screenTop + (screen.height / 2) - h1; //
var newwindow = window.open('TransactionsNotes.aspx?i=<%=AccountTransactionId%>&u=<%=UserId%>&n=' + noteid + "&t=" + t, '_note_', 'top=' + top + ',left=' + left + ',width=' + w1 + ',height=' + h1 + ',location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no');
if (window.focus) { newwindow.focus() }
}
</script>

msbuild buildsrc\Test\Test.sln /p:Configuration=Release
<asp:TemplateField HeaderText="Type" ItemStyle-Width="5%" ItemStyle-Wrap=False HeaderStyle-HorizontalAlign=Center HeaderStyle-Wrap=False ItemStyle-HorizontalAlign=Center>
<ItemTemplate>
<asp:DropDownList id="typeDropDown" runat="server" Width='150'
DataSource="<%# Enum.GetNames(typeof(myEnum1)) %>"
SelectedValue='<%# GetEnum1(Container.DataItem) %>'
OnInit="InitDropDown" />
</ItemTemplate>
</asp:TemplateField>
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
ddEnum1.DataSource = Enum.GetNames(typeof(Enum1));
ddEnum1.DataBind();
}
}
private void ddEnum1_SelectedIndexChanged(object sender, System.EventArgs e)
{
Enum1 selectedEnum1 = (Enum1)Enum.Parse(ddEnum1.SelectedValue);
}
Easiest way for C++ Builder 6.0:
Project/Options:
Compiler tab: Click 'Release'
Packages tab:
Un-check 'Bulid with runtime packages'
Linker tab:
Uncheck the first 3 items under 'Linking'
var itemQuery = from cartItems in db.SalesOrderDetails
where cartItems.SalesOrderID == 75144
select cartItems.ProductID;
var myProducts = from p in db.Products
where itemQuery.Contains(p.ProductID)
select p;
public void Shuffle<T>(List<T> list)
{
Random rng = new Random();
int n = list.Count;
while (n > 1)
{
n--;
int k = rng.Next(n + 1);
T value = list[k];
list[k] = list[n];
list[n] = value;
}
}
<div style="overflow:auto;height:150px;border-width:1px;">
<asp:DataGrid ID="ScheduledPaymentAdjustmentDataGrid" CssClass="TableWithGrayBorders" Runat="server"
AutoGenerateColumns="False"
Width="200" BorderStyle="None"
HeaderStyle-CssClass="TableWithGrayBordersHeader" ShowFooter=true
HeaderStyle-HorizontalAlign="Center" DataKeyField="sID"
OnItemCommand="ItemsGrid_Command"
>
<Columns>
<asp:TemplateColumn HeaderText="Profile" ItemStyle-Width="5%" ItemStyle-Wrap=False
HeaderStyle-HorizontalAlign=Center HeaderStyle-Wrap=False ItemStyle-HorizontalAlign=Center>
<ItemTemplate>
<img src="../images/spacer.gif" width=2>
<asp:DropDownList id="ProfileDropDown" runat="server" Width='150'
DataSource="<%# GetProfiles() %>"
DataValueField="id" DataTextField="name"
SelectedValue='<%# GetProFileId(DataBinder.Eval(Container.DataItem, "sID")) %>'
/>
<img src="../images/spacer.gif" width=2>
</ItemTemplate>
<FooterTemplate>
<img src="../images/spacer.gif" width=2>
<asp:DropDownList id="ProfileDropDown" runat="server" Width='150' BackColor="LightGreen"
DataSource="<%# GetProfiles() %>"
DataValueField="id" DataTextField="name"
SelectedValue='<%# GetProFileId(DataBinder.Eval(Container.DataItem, "sID")) %>'
/>
<img src="../images/spacer.gif" width=2>
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Amount" ItemStyle-Width="5%" ItemStyle-Wrap=False
HeaderStyle-HorizontalAlign=Center HeaderStyle-Wrap=False ItemStyle-HorizontalAlign=Center>
<ItemTemplate>
<img src="../images/spacer.gif" width=2>
<asp:TextBox ID="AmountTextBox" runat="server" Text='<%# string.Format("{0:0.00}",DataBinder.Eval(Container.DataItem, "dAmount")) %>' Width='70' MaxLength="8" />
<img src="../images/spacer.gif" width=2>
</ItemTemplate>
<FooterTemplate>
<img src="../images/spacer.gif" width=2>
<asp:TextBox ID="AmountTextBox" runat="server" BackColor="LightGreen" Text='<%# string.Format("{0:0.00}",DataBinder.Eval(Container.DataItem, "dAmount")) %>' Width='70' MaxLength="8" />
<img src="../images/spacer.gif" width=2>
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="" ItemStyle-Width="1%" ItemStyle-Wrap=False
HeaderStyle-HorizontalAlign=Center HeaderStyle-Wrap=False ItemStyle-HorizontalAlign=Center>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" Runat="server" CommandName="Delete" ImageUrl ='../images/delete_icon.gif' CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID")%>' />
</ItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="ImageButton2" Runat="server" ImageUrl='../images/bullet_add.png' CommandName="new" />
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
public void SaveScheduledPaymentAdjustmentDataGridChanges()
{
List<InvoiceDetailsRowView> lst = ((List<InvoiceDetailsRowView>)ScheduledPaymentAdjustmentDataGridSource);
Hashtable H = new Hashtable(lst.Count);
bool changed = false;
foreach (InvoiceDetailsRowView i in lst)
{
H.Add(i.sID,i);
}
foreach (DataGridItem dataGridItem in ScheduledPaymentAdjustmentDataGrid.Items)
{
string key =(string) ScheduledPaymentAdjustmentDataGrid.DataKeys[dataGridItem.ItemIndex];
UpdateInvoiceDetailsRowViewWithCells((InvoiceDetailsRowView)H[key], dataGridItem.Cells);
}
ScheduledPaymentAdjustmentDataGridSource = lst;
}
public void UpdateInvoiceDetailsRowViewWithCells(InvoiceDetailsRowView i,TableCellCollection Cells )
{
TextBox date = (TextBox)Cells[2].FindControl("DateTextBox");
TextBox Note = (TextBox)Cells[3].FindControl("NoteTextBox");
TextBox amount = (TextBox)Cells[1].FindControl("AmountTextBox");
DropDownList dd = (DropDownList)Cells[0].FindControl("ProfileDropDown");
decimal am;
assert.IsTrue(decimal.TryParse(amount.Text, out am), iam+" " +amount.Text);
assert.IsTrue(am > 0, iam + " " + amount.Text);
i.NoteText = Note.Text;
i.dAmount = am;
i.TXNDate = date.Text;
i.ProfileID = int.Parse(dd.SelectedValue);
}
public void ItemsGrid_Command(Object sender, DataGridCommandEventArgs e)
{
RunSafe(Process_Command,new object[]{e});
}
public void Process_Command(params object[] p)
{
DataGridCommandEventArgs e =(DataGridCommandEventArgs) p[0];
switch (e.CommandName)
{
case "Delete":
SaveScheduledPaymentAdjustmentDataGridChanges();
DeleteSP((string)ScheduledPaymentAdjustmentDataGrid.DataKeys[e.Item.ItemIndex]);
break;
case "new":
SaveScheduledPaymentAdjustmentDataGridChanges();
InvoiceDetailsRowView i= new InvoiceDetailsRowView();
UpdateInvoiceDetailsRowViewWithCells(i, ((System.Web.UI.WebControls.TableRow) (e.Item)).Cells);
i.status = EnumRecordStatus.added;
i.sID = Guid.NewGuid().ToString();
List<InvoiceDetailsRowView> lst = ((List<InvoiceDetailsRowView>)ScheduledPaymentAdjustmentDataGridSource);
lst.Add(i);
ScheduledPaymentAdjustmentDataGridSource = lst;
ScheduledPaymentAdjustmentDataGridBind();
break;
}
GetTotalInBills();
}
SELECT *
FROM AccountTransactions AS inv
INNER JOIN [Accounts basic] a2 ON inv.AccountId = a2.ID
JOIN ( SELECT *
FROM ( SELECT *,
ROW_NUMBER() OVER ( PARTITION BY AccountTransactionId ORDER BY ProcessDate ) AS RowId
FROM dbo.BillingTransactions
) Tmp
WHERE RowId = 1
) b ON inv.TransactionId = b.AccountTransactionId
SELECT *
INTO new_table_name [IN externaldatabase]
FROM old_tablename
UPDATE
Sales_Import
SET
AccountNumber = RAN.AccountNumber
FROM
Sales_Import SI
INNER JOIN
RetrieveAccountNumber RAN
ON
SI.LeadID = RAN.LeadID
<script language='javascript'>
function getDropdownSelectedValue()
{
var e = document.getElementById("<%=MyDropDown.ClientID%>");
var chain= e.options[e.selectedIndex].value;
return chain;
}
</script>
| Switch to Inbox. | CTRL+SHIFT+I |
| Switch to Outbox. | CTRL+SHIFT+O |
| Choose the account from which to send a message. | CTRL+TAB (with focus on the To box) and then TAB to the Accounts button |
| Check names. | CTRL+K |
| Send. | ALT+S |
| Reply to a message. | CTRL+R |
| Reply all to a message. | CTRL+SHIFT+R |
| Forward a message. | CTRL+F |
| Mark a message as not junk. | CTRL+ ALT+J |
| Display blocked external content (in a message). | CTRL+SHIFT+I |
| Post to a folder. | CTRL+ SHIFT+S |
| Apply Normal style. | CTRL+SHIFT+N |
| Check for new messages. | CTRL+M or F9 |
| Go to the previous message. | UP ARROW |
| Go to the next message. | DOWN ARROW |
| Create a new message (when in Mail). | CTRL+N |
| Create a new message (from any Outlook view). | CTRL+SHIFT+M |
| Open a received message. | CTRL+O |
| Open the Address Book. | CTRL+SHIFT+B |
| Convert an HTML or RTF message to plain text. | CTRL+SHIFT+O |
| Add a Quick Flag to an unopened message. | INSERT |
| Display the Flag for Follow Up dialog box. | CTRL+SHIFT+G |
| Mark as read. | CTRL+Q |
| Mark as unread. | CTRL+U |
| Show the menu to download pictures, change automatic download settings, or add a sender to the Safe Senders List. | CTRL+SHIFT+W |
| Find or replace. | F4 |
| Find next. | SHIFT+F4 |
| Send. | CTRL+ENTER |
| Print. | CTRL+P |
| Forward. | CTRL+F |
| Forward as attachment. | CTRL+ALT+F |
| Show the properties for the selected item. | ALT+ENTER |
| Mark for Download. | CTRL+ALT+M |
| Clear Mark for Download. | CTRL+ALT+U |
| Display Send/Receive progress. | CTRL+B (when a Send/Receive is in progress) |
<add key="ConnectionString" value="server=sql-server1\qa,1362;database=db1;user id=u1;password=MyPassword;Trusted_Connection=no"/>
to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...