package Pomodorium
{
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
public class Logger {
public static function Write(s:String): void {
var file:File = File.applicationStorageDirectory.resolvePath('pomodorium.log');
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.APPEND);
fileStream.writeUTFBytes("\n"+s);
fileStream.close();
}
}
}
Monday
air logging framework
Thursday
the connection was interrupted
I was working on moving certificates from one server to another,
and when I was doing that over exporting certificates as .SST file I was getting
"The connection was interrupted" error .
I order to fix it I have to export certificates on-by-one as PFX file from another server and import
them on new one.
After this problem has been fixed.
Wednesday
UnicodeDecodeError: 'ascii' codec can't decode byte
import sys
reload(sys)
sys.setdefaultencoding("latin1")
create certificate for iis
1.Downloaded and installed The IIS 6.0 Resource Kit Tools:
http://support.microsoft.com/kb/840671
download link :http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499
2.Created certificate by
C:\Program Files\IIS Resources\SelfSSL\SelfSSL.exe /N:CN=www.mysite.com /V:1000
3.Go to IIS Manager , add certificate for virtual server you will see certificate you have created in a list.
linq Ilist select
var accountTransactions = from dataObject in objectsDataContext.AccountTransactions
where
(dataObject.TransactionId == transactionID || dataObject.ParentId == transactionID) &&
dataObject.StatusId != deletedStatus
select new InvoiceRecord
{
TransactionId = dataObject.TransactionId,
Amount = dataObject.TotalAmountDue,
InvoiceDueDate = dataObject.DueDate,
Tax = dataObject.Tax ?? 0,
AdditionalGracePeriod = dataObject.AdditionalGracePeriod,
StatusId = dataObject.StatusId,
RecordStatus = (int) ScopeRecordStatus.Active
,
paymentApplicableTransaction = (from pats in dataObject.BillingTransactionDetails
where pats.StatusId != deletedStatus
select new PaymentApplicableTransaction
{
AccountTransactionId =
pats.AccountTransactionId
,
BillingTransactionId =
pats.BillingTransactionId
}).OfType<IPaymentApplicableTransaction>()
.ToList()
};
Monday
csharp binary operators sample
public enum EnumInvoiceFlags
{
LateFeeApplied = 1,
DelinquencyApplied = 2,
Unfreezed = 4
}
applying masks:
invoice.Flags = invoice.Flags | (int)EnumInvoiceFlags.DelinquencyApplied; checking if mask has specific value:
if ((invoice.Flags & (int)EnumInvoiceFlags.DelinquencyApplied) != (int)EnumInvoiceFlags.DelinquencyApplied)
vb.net Teleric Recurrence rule parser with boolean operations
Dim RecRule8 As RecurrenceRule = Nothing
If RecurrenceRule.TryParse(dtSchedule.Rows(0)("RecurrenceRule").ToString(), RecRule8) Then
Dim days As RecurrenceDay = RecRule8.Pattern.DaysOfWeekMask
chkWeekDays.Items(0).Selected = ((days And RecurrenceDay.Sunday) = RecurrenceDay.Sunday)
chkWeekDays.Items(1).Selected = ((days And RecurrenceDay.Monday) = RecurrenceDay.Monday)
chkWeekDays.Items(2).Selected = ((days And RecurrenceDay.Tuesday) = RecurrenceDay.Tuesday)
chkWeekDays.Items(3).Selected = ((days And RecurrenceDay.Wednesday) = RecurrenceDay.Wednesday)
chkWeekDays.Items(4).Selected = ((days And RecurrenceDay.Thursday) = RecurrenceDay.Thursday)
chkWeekDays.Items(5).Selected = ((days And RecurrenceDay.Friday) = RecurrenceDay.Friday)
chkWeekDays.Items(6).Selected = ((days And RecurrenceDay.Saturday) = RecurrenceDay.Saturday)
End If
Tuesday
"Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive."
It is recommended that you use Visual Studio to perform the tasks that are required in order to upgrade. If you do not use Visual Studio to perform the upgrade automatically, you must manually edit the Web.config file and must manually associate the application in IIS with the .NET Framework version 4.
Typically the procedures covered in this topic are sufficient for upgrading a Web application, because later versions of the .NET Framework are designed to be backward compatible with earlier versions. However, you should also look in the readme documentation for breaking changes. The behavior of a component that was developed for an earlier version of the .NET Framework might have changed in the newer version of the .NET Framework.
Do not upgrade an IIS application if it has nested applications within it that target earlier versions of the .NET Framework. If an IIS application that targets the .NET Framework 3.5 or earlier is nested within an IIS application that targets the .NET Framework 4, the compiler might report errors when it compiles the nested application. This is because Web.config files inherit settings from files that are higher in the configuration file hierarchy. The .NET Framework 4 is backward compatible; therefore, a nested Web application that targets the .NET Framework 4 can inherit settings from Web.config files that are for earlier versions. But earlier versions of the .NET Framework are not forward compatible; therefore, they cannot inherit settings from a .NET Framework 4 Web.config file. |
To upgrade an application by using Visual Studio
Open the Web site or project in Visual Studio.
If a Visual Studio Conversion Wizard welcome dialog box appears, click Next.
This wizard appears when you open a Web Application Project or a solution. It does not appear when you open a Web Site project that is not in a solution.
If you are converting a project, in the Visual Studio Conversion Wizard, select backup options and click Next in the Choose Whether to Create a Backup dialog box.
Visual Studio upgrades your project file to the Visual Studio 2010 format. If you are upgrading a solution instead of an individual project, Visual Studio upgrades the solution file to the Visual Studio 2010 format.
If you are converting a project, in the Visual Studio Conversion Wizard, click Next in the Ready to Convert dialog box.
If you are opening the Web project on a computer that does not have the .NET Framework 3.5 installed, in the Project Target Framework Not Installed dialog box, select Retarget the project to .NET Framework 4 and click OK.
If you are opening the Web project on a computer that does have the .NET Framework 3.5 installed, in the Web Site targeting older .NET Framework Found dialog box, clear the check box if you do not want to upgrade all Web sites or projects in a solution.
In the dialog box, click Yes.
Visual Studio updates the Web.config file. The changes that are made to the Web.config file are listed in the procedure later in this topic that explains how to update the Web.config file manually. Visual Studio does not update comments. Therefore, after the conversion, the Web.config file might contain comments that reference earlier versions of the .NET Framework.
Visual Studio automatically sets the controlRenderingCompatibilityVersion attribute of the pages element to 3.5. You can remove this setting in order to take advantage of XHTML and accessibility improvements in ASP.NET 4. For more information, see the procedure later in this topic that explains how to update the Web.config file manually.
If you are converting a project, in the Visual Studio Conversion Wizard, click Close in the Conversion Complete dialog box.
If the project is not a local IIS project, associate its IIS application with the Visual Studio when it is deployed to IIS. For more information, see the procedure later in this topic that corresponds to the version of IIS that you are using.
If the IIS application is associated with the .NET Framework 2.0, the site will not work. ASP.NET will generate errors that indicate that the targetFramework attribute is unrecognized.
If the project is a local IIS project and the IIS version is 6.0, associate its IIS application with the Visual Studio by following the procedure later in this topic for IIS 6.0.
If the project is a local IIS project, Visual Studio automatically performs this association. It assigns the application to the first available application pool for the .NET Framework version 4. If no application pool exists, Visual Studio creates one.
Note
By default, the IIS 6.0 Metabase API that Visual Studio uses to assign and create application pools is not available in Windows Vista or Windows 7. To make it available, enable IIS 6 Metabase Compatibility Layer in the Windows Control Panel by selecting Programs and Features and Turn Windows Features On or Off. The following illustration shows the Windows Features dialog box.
If the project includes code that accesses the HttpBrowserCapabilities object (in the HttpRequest.Browser property), test the code to make sure that it works as expected.
The browser definition files that provide information to the HttpBrowserCapabilities object were changed in ASP.NET 4, and the changes are not backward compatible with earlier versions of ASP.NET. If you discover a problem and prefer not to change your code to accommodate the ASP.NET 4 changes, you can copy the ASP.NET 3.5 browser definition files from the ASP.NET 3.5 Browsers folder of a computer that has ASP.NET 3.5 installed to the ASP.NET 4 Browsers folder. The Browsers folder for a version of ASP.NET can be found in the following location:
%SystemRoot%\Microsoft.NET\Framework\versionNumber\Config\Browsers
After you copy the browser definition files, you must run the aspnet_regbrowsers.exe tool. For more information, see ASP.NET Web Server Controls and Browser Capabilities.
To manually upgrade an application's Web.config file from the .NET Framework 3.5 to the .NET Framework 4
Make sure that the application currently targets ASP.NET 3.5.
Note
This topic explains how to convert a Web.config file from the .NET Framework 3.5 to the .NET Framework 4. To upgrade a Web application that is earlier than the .NET Framework 3.5, you must first convert the application to the .NET Framework 3.5. For more information, see Converting to ASP.NET 3.5.
Open the Web.config file in the application root.
In the configSections section, remove the sectionGroup element that is named "system.web.extensions".
In the system.web section, in the compilation collection, remove every add element that refers to an assembly of the .NET Framework.
Framework assemblies generally begin with "System.". Typically these have Version=3.5.0.0 in the assembly attribute. However, some assembly entries that have the 3.5.0.0 version number might refer to assemblies that were installed as part of add-on releases, or to custom assemblies. Do not delete these. If the Web.config file contains any of these references, you must investigate them individually to determine whether a later version is available and whether the version reference must be changed.
Add a targetFramework attribute to the compilation element in the system.web section, as shown in the following example:
In the opening tag for the pages section, add a controlRenderingCompatibility attribute, as shown in the following example:
Many ASP.NET 4 controls render HTML that is compliant with XHTML and accessibility standards. However, the Web site that you are converting might have CSS rules or client script that will not work correctly if Web pages change the way they render HTML. If you want to take advantage of the control rendering enhancements in ASP.NET 4, you can omit this attribute. For more information, see ControlRenderingCompatibilityVersion.
In the system.codedom section, in the compilers collection, remove the compiler elements for c# and vb.
Delete everything between the system.webserver section start and end tags, but leave the tags themselves.
Delete everything between the runtime section start and end tags, but leave the tags themselves.
If you have customized the Web.config file, and if any customizations refer to custom assemblies or classes, make sure that the assemblies or classes are compatible with the .NET Framework version 4.
The following example shows an example Web.config file for a simple Web application that was converted from the .NET Framework version 3.5 to the .NET Framework version 4.
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="NorthwindConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" targetFramework="4.0">
<assemblies>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5"/></system.web>
<system.codedom>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
</system.webServer>
</configuration>
To associate an IIS application with the .NET Framework 4 in IIS 7.0
In Windows, start Inetmgr.
In the Connections pane, expand the server node and then click Application Pools.
On the Application Pools page, select the application pool that contains the application that you want to change.
In the Actions pane, click View Applications.
Select the application whose application pool hat you want to change and then click Change Application Pool in the Actions pane.
In the Select Application Pool dialog box, select an application pool that is associated with .NET Framework version 4 from the Application pool list, and then click OK.
To associate an IIS application with the .NET Framework 4 in IIS 6.0
Register a scriptmap for the application that associates it with the .NET Framework version that you want to run the application under.
For information about how to update scriptmaps for an ASP.NET application, see ASP.NET IIS Registration Tool (Aspnet_regiis.exe). For more information about IIS configuration in IIS 6.0, see Setting Application Mappings in IIS 6.0 (IIS 6.0).
Thursday
linq grouping (groupby subset enumeration)
var grpOrderedFirstLetter = empList.GroupBy(employees =>
new String(employees.FName[0], 1)).OrderBy(employees =>
employees.Key.ToString());;
foreach (var employee in grpOrderedFirstLetter)
{
Console.WriteLine("\n'Employees having First Letter {0}':",
employee.Key.ToString());
foreach (var empl in employee)
{
Console.WriteLine(empl.FName);
}
}
Wednesday
rotate table word
1.Copy your entire table and just paste it into Excel.
2.Select your table IN EXCEL and copy it. There is a good reason for copying it again, but in Excel.
3.Go to a different sheet (or scroll down further so that you have a clean space) and select a cell (like A1)
4.Go to the Edit menu --> Paste Special and click on the box beside "Transpose" and press OK.
5.Your entire table has been turned 90 degrees!
6.Copy the whole thing and paste it back into Word.
Thursday
actionscript save to file and read file
package Package {
import flash.display.Sprite;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.net.registerClassAlias;
import flash.text.StaticText;
import flash.utils.ByteArray;
public class Storage
{
public static function writeObjectToFile(gh:GameChar, fname:String):void
{
var file:File = File.applicationStorageDirectory.resolvePath(fname);
registerClassAlias("Pomodorium.GameChar", GameChar);
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.WRITE);
fileStream.writeObject(gh);
fileStream.close();
}
public static function readObjectFromFile(fname:String):GameChar
{
var file:File = File.applicationStorageDirectory.resolvePath(fname);
//trace(file.nativePath);
var ret:*;
if(file.exists) {
//trace("exists!");
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.READ);
ret = fileStream.readObject() as GameChar;
fileStream.close();
}
return ret;
}
public static function Load(): GameChar
{
return readObjectFromFile('file1') as GameChar;
}
public static function Save(g:GameChar): void
{
writeObjectToFile(g,'file1');
}
}}
Wednesday
javascript find string in string
var s = "foo";
alert(s.indexOf("oo") != -1);
https://developer.mozilla.org/en/Core%5FJavaScript%5F1.5%5FReference/Objects/String/indexOf
Thursday
tf diff format
$>tf diff /format:unified <myfile>
iphone applications source code
2. Colloquy – Порт известного Mac IRС клиента на iPhone. (itunes link) (source code)
3. Diceshaker — Симулятор броска кубиков (дайсов) для фанатов ролевых игр. (itunes link) (source code)
4. Doom Classic — Классический 3Д-шутер.(itunes link) (source code) (build instructions)
5. Freshbooks – Приложение, которое позволяет использовать веб-сервис Freshbooksдля выставления счетов прямо с вашего iPhone. (itunes link) (source code)
6. Gorillas – Классчиеская игра наподобии Вормсов/Танчиков. ИспользуетCocos2D. (itunes link) (source code)
7. Last.fm –Приложение позволяющее использовать персональные радиоканалы сервиса Last.fm(itunes link) (source code)
8. Mobilesynth — Моно синтезатор для iPhone(itunes link) (source code)
9. Molecules – Приложение позволяет просматривать 3Д модели молекул и управлять ими касаниями экрана. (itunes link) (source code)
10. Mover – Приложение, которое позволяет перемещать данные между двумя различными iTouch устройствами (itunes link) (source code)
11. Natsulion — Простенький твиттер клиент. (itunes link) (source code)
12. NowPlaying – Позволяет вам получать местные афиши и смотреть критику идущих показов с сайтов RottenTomatoes и Metacritic (itunes link) (source code)
13. Packlog – iPhone — клиент для популярного сервиса BackPak. (itunes link) (source code)
14. PocketFlix – Приложение позволяет осуществлять поиск и управлять своим аккаунтом в сервисе Netflix. (itunes link) (source code)
15. Sci-15 HPCalc – Инженерный научный калькулятор. (itunes link) (source code)
16. Task Coach – Приложение для управления временем и задачами. (itunes link) (source code)
17. Tubestatus – Расписание лондонских электричек. (itunes link) (source code)
18. Tweejump – Игра-попрыгушка вдохновленная твиттером и игрой Icy Tower. Использует Cocos2D.(itunes link) (source code)
19. Tweetero – Простенький твиттер — клиент с поддержкой загрузки изображений. (itunes link) (source code)
20. Twitterfon – Супер быстрый твиттер клиент (itunes link) (source code)
21. Wikihow – Ридер для популярной вики. (itunes link) (source code available by e-mail from support@wikihow.com)
22. Wordpress – Официальный клиент для движка WordPress. (itunes link) (source code)
23. YourRights – Карманный справочник по вашим правам.(itunes link) (source code)
Update
24. BookShelf — читалка электронных книг для iTouch — устройств. (itunes link) (source code)
25. iOctocat — клиент для популярного хостинга исхоного кода GitHub (itunes link) (source code)
26. Eponyms — база данных медицинских эпонимов (itunes link) (source code)
27. MobileTerminal — терминал для iphone/ipod touch (source code)
28. MobileStudio — несколько продуктов одной компании:
- MobileTextEdit — Текстовый редактор;
- MobilePreview — Просмотрщик фото/картинок;
- Mobile-RSS — RSS Клиент;
- MobileTetrominos — игра типа тетриса;
- MobileFinder – менеджер файлов.
29. iPhone offline map — картографическое приложение для itouch — устройств с возможностью работы с картами в режиме отключения от сети. (source code)
30. iPhone-wireless — сканер wifi-сетей, обещают скоро поддержку так же GSM-вышек и bluetooth — точек. (source code)
31. Waze — программа навигации для iphone, необычная тем, что вы не только пользуетесь картами сервиса, но и сами создаете карту своими поездками закрывая «белые» пятна сервиса и получая бонусные очки. (itunes link) (source code)
32. AppsAmuck — подборка простеньких приложений с исходным кодом для начинающих азработчиков, просто кликните на иконку приложения и следуйте инструкциям.
33. Siphone — бесплатное VoIP — приложение с минималистичным функционалом, использует популярную библитеку pjsip
34. OmniFrameworks — набор инструментов от OmniGroup с открытым кодом для разработки под iPhone и Mac
35. iRdesktop — RDP клиент для iPhone OS. (source code) (itunes link),
36. Battle For Wesnoth – Фентезийная тактическая пошаговая RPG доступная для нескольких платформ ранее, а теперь и для iPhone/iPad. (itunes link) (source code)
37. Artifice – Логическая игра в которой вам необходимо достичь противоположного конца экрана передвигая коробки на своем пути. Использует Cocos2D. (itunes link) (source code)
38. Countitout -Приложение для ведения счета. (itunes link) (source code)
39. Ecological Footprint - Приложение для подсчета вашей экологической эффективности (itunes link) (source code)
40. Fosdem — Приложение календарь для конференции Fosdem(itunes link) (source code)
41. Go Go Lotto –Приложение для генерации билетов Лото (itunes link) (source code)
42. iStrobe -Приложение которое превращает вспышку iPhone 4 в страбоскоп(itunes link) (source code)
43. PlainNote — Простой текстовый редактор (itunes link) (source code)
44. Puff Puff – Красивая игрушка в подводном мире, использует Cocos2D и OpenFeint. (itunes link) (source code)
45. reMail – Емейл клиет с очень быстрым поиском по почте, удален из AppStore, исходные коды доступны. (source code)
46. RobotFindsKitten – Порт классической ASCII — игрушки. (itunes link) (source code)
47. SpaceBubble – Космическая игра, использующая Core Grafics и акселерометр телефона. (itunes link) (source code)
48. Star3Map – Приложение дополненной реальности для поиска созвездий на звездном небе. (itunes link) (source code)
49. Tux Rider – Порт популярной 3Д игры Tux Racer. (itunes link) (source code)
50. Tweetee – Расширенная версия твиттер-клиента Natsulion.(itunes link) (source code)
51. ViralFire — Приложение, в котором вам надо выступать в качестве клетки крови и бороться с вирусами. (itunes link) (source code)
52. Wolfenstein 3D Classic Platinum – Классическая 3д стрелялка. (itunes link) (source code)
53. Xpilot – Классическая игрушка — аркадный шутер. (itunes link) (source code)
54. ZBar –Сканнер баркодов с исходными кодами. (itunes link) (source code)
Читайте так же обзор библиотек с открытым кодом для iphone/ipod touch и обзор игровых движков для этих платформ.
sites that sells
http://akvis.com/en/index.php - photo processing
http://www.facebook.com/MP3TagEditor
http://aquatra.com :
http://automatic-password.com/
Backup Expert - http://backup-expert.com/
Disk Data Recovery - http://data-remedy.com/
DVD Blaster - http://dvd-blaster.com/
File Data Recovery - http://data-cure.com/
FTP Auto Sync - http://ftp-auto-sync.com/
MP3 Tag Editor - http://mp3-tag.com/
Remote Desktop Control - http://remote-desktop-control.com/
Windows Mail Saver - http://windows-mail-saver.com/
http://cssmenutools.com
CSSMenuTools helps to add elegant css menus and widgets to websites without hand coding and javascript/css knowledge.
Dreamweaver extensions:
Accordion Menu Advancer
http://cssmenutools.com/accordion-menu-advancer-dreamweaver/
Horizontal Menu Advancer
http://cssmenutools.com/horizontal-menu-advancer-dreamweaver/
Vertical Menu Advancer
http://cssmenutools.com/vertical-menu-advancer-dreamweaver/
Lightbox Advancer
http://cssmenutools.com/lightbox-advancer-dreamweaver/
ExpressionWeb add-ins:
Accordion Menu Advancer
http://cssmenutools.com/accordion-menu-advancer-expression-web/
Horizontal Menu Advancer
http://cssmenutools.com/horizontal-menu-advancer-expression-web/
Vertical Menu Advancer
http://cssmenutools.com/vertical-menu-advancer-expression/
Lightbox Advancer
http://cssmenutools.com/lightbox-advancer-expression-web/
Website:
http://www.helpsmith.com
Company Overview:
Innovative help authoring tool allowing you to create CHM HTML Help files, Web Help, Printed Manuals, and PDF documents from the same source help project.
Facebook Page:
http://www.facebook.com/HelpSmith
http://www.magicintuition.com/
http://www.djsoft.net/
http://www.techno-sys.com/order.aspx
http://www.softorbits.com/actions/ChristmasPhoto2010.HTML
http://www.watermarkfactory.com/order.HTML
http://music-scanning.com/
get country by ip
IP вычислить принадлежность посетителя к стране.
Wednesday
best online button generation
генератор цветовой гаммы для сайта:
http://www.colorjack.com/
вот еще по кнопкам:
http://www.freshgenerator.com/
или вот:
http://www.mycoolbutton.com/
генерилка background-а:
http://www.bgpatterns.com/
background в стиле web 2.0
http://www.stripegenerator.
вот еще бэджики, может, пригодится,
http://www.web20badges.com/
генерация закгругленных блоков через CSS
http://www.neuroticweb.com/
Tuesday
asp.net calling codebehind from JavaScript
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
Monday
as3 syntax reference
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 |
here is powershell script on how to get list of files from changesets associated with one tfs task
$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...
-
2010-11-24 Update: Please download latest version of Pidgin , that has this problem fixed , no additional steps required. Here are 3 ways to...
-
Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring...
-
$z = Import-Csv zerotrac.csv $nums = Import-Csv allleetcode.csv $md =@{} #converting one csv into hashmap for quicker search foreac...