Thursday

iphone applications source code

1. ABC 123 – Простенькая игра на развитие памяти. ИспользуетCocos2D. (itunes link) (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 несколько продуктов одной компании:


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

Есть такая штука - http://www.maxmind.com/app/api , которая позволяет по
IP вычислить принадлежность посетителя к стране.

Wednesday

best online button generation

http://jirox.net/AsButtonGen/
генератор цветовой гаммы для сайта:
http://www.colorjack.com/
вот еще по кнопкам:
http://www.freshgenerator.com/
или вот:
http://www.mycoolbutton.com/
генерилка background-а:
http://www.bgpatterns.com/
background в стиле web 2.0

http://www.stripegenerator.com/
вот еще бэджики, может, пригодится,
http://www.web20badges.com/
генерация закгругленных блоков через CSS
http://www.neuroticweb.com/recursos/css-rounded-box/

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,

local: declared within a method or a block



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.

Boolean, int, uint, Number, String



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 =

new int[4];




int quarterResults[]={25,33,56,84};





var quarterResults:Array

=new Array();


or


var quarterResults:Array=[];



var quarterResults:Array=

[25, 33, 56, 84];


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”,

“Mary”);


friends.put(“best”,

“Bill”);


friends.put(“bad”,

“Masha”);



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["good"]=”Mary”;


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”);

var myObj:Object = new cls();



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



Thursday

progstudios webcontrols dll

I had problem with legacy application, it has an old progstudios Combobox and it wasn't working propely.So in order to setup this it's required :

1.drop webctrl_client folder to your server root, it's requiresting it like /webctrl_client/progstudios/1_2/

2.Add add ProgStudios.HttpHandlers to IIS http handlers.

For some reason IIS under Win7 ignore this line from web.config

<httpHandlers>
<add verb="*" path="client_script.aspx" type="ProgStudios.HttpHandlers.ClientScriptHandler, ProgStudios.WebControls" />
</httpHandlers>

so I added it manually :

Wednesday

Законы Мерфи для программистов.

  • Любая работающая программа уже устарела.
  • Любая программа обходится дороже и требует больше времени, чем казалось в начале.
  • Если программа полезна, ее обязательно переделывают.
  • Если программа бесполезна, ее тщательно документируют.
  • Любая программа в конце концов занимает всю доступную память.   
  • Cложность программы обычно растет до тех пор, пока не превысит способности программиста, призванного ее поддерживать.
  • Если утилиты, испытанные при инсталяции, работают идеально, все остальные функции будут работать не верно.
  • Если входной редактор спроектирован так, чтобы исключить неверный ввод, найдется изобретательный идиот, который изыщет метод ввести разрушительную команду.
  • Невежество — единственный язык, которым владеют все программисты.
  • Увеличение численности программистов, работающих над проектом, увеличивает сроки его выполнения.
  • Небрежно спланированный проект требует в 3 раза больше времени, чем ожидалось, а тщательно спланированный — только в 2.
  • В программе всегда есть еще одна ошибка.
  • Невозможно создать программу с полной защитой от дураков, ибо дураки крайне изобретательны.
  • Если все идет хорошо, вас вскоре ждут серьезные осложнения.
  • Если дела идут хуже некуда, вскоре выяснится, что это не так.
  • Если кажется, что все в порядке, вы просто что-то просмотрели.   
  • Вы всегда найдете еще одну ошибку, если еще раз загляните в свою программу.
  • Терминал работает лучше, если его включить в сеть.
  • Если все не работает, читайте документацию.
  • Если вам не понятно какое-то слово в технической документации, игнорируйте его, смысл от этого не пострадает.
  • Не важно, много ли вы работаете, вы все равно работаете недостаточно.
  • То, чего вы не делаете, всегда важнее того, что вы делаете.
  • Всегда оставляйте место для объяснения того, почему ваша программа работает не так как планировалось.
  • Не существует ничего невозможного для человека, который не собирается ничего делать сам.
  • Если бы строители сооружали здания также, как программисты пишут свои программы, первый же дятел разрушил бы человеческую цивилизацию.
  • Программисты действуют рационально, лишь тогда, когда другие способы исчерпаны.
  • Friday

    sql convert date format

    CONVERT ( data_type [ ( length ) ] , expression [ , style ] )

    --T-sql convert datetime function example usage code to format date mm-dd-yyyy

    SELECT CONVERT(nvarchar(30),getdate(),110)

    Sunday

    fibonacci sequence


    0  
    1  
    1  
    2  
    3  
    5  
    8  
    13  
    21  
    34  
    55  
    89  
    144  
    233  
    377  
    610  
    987  
    1597  
    2584  
    4181  
    6765  
    10946  
    17711  
    28657  
    46368  
    75025  
    121393  
    196418  
    317811  
    514229  
    832040  
    1346269  
    2178309  
    3524578  
    5702887  
    9227465  
    14930352  
    24157817  
    39088169  
    63245986  
    102334155  
    165580141  
    267914296  
    433494437  
    701408733  
    1134903170  
    1836311903  
    2971215073  
    4807526976  
    7778742049  

    golden ratio in gui version









































    basewidthheigh
    00.00.0
    500309.0186.0
    1000618.0372.0
    1500927.0558.0
    20001236.0744.0
    25001545.0930.0
    30001854.01116.0
    35002163.01302.0
    40002472.01488.0
    45002781.01674.0
    50003090.01860.0
    55003399.02046.0
    60003708.02232.0
    65004017.02418.0
    70004326.02604.0
    75004635.02790.0
    80004944.02976.0
    85005253.03162.0
    90005562.03348.0
    95005871.03534.0
    100006180.03720.0
    105006489.03906.0
    110006798.04092.0
    115007107.04278.0
    120007416.04464.0
    125007725.04650.0
    130008034.04836.0
    135008343.05022.0
    140008652.05208.0
    145008961.05394.0
    150009270.05580.0
    155009579.05766.0
    160009888.05952.0
    1650010197.06138.0
    1700010506.06324.0
    1750010815.06510.0

    Friday

    robokill stats

    Оргазационные моменты сьели кучу времени - делали втроем(code,art,designer) все РедШторм игры. Первую часть, как я уже говорил - сделали за 20 дней, и это был почти-клон Робокилла. Над остальными работали кое-как кое-когда - от 2 до 4 месяцев в сумме. Сегодня выпустили 4ую часть - 'Red Storm Defense', которая наконец-то не клон ничего! =) своя, собственная игра, в моем любимом сеттинге - Геройском Товер Дефенсе.




    а теперь самое вкусное - факты и статистика:

    9m+ gameplays.


    Реклама принесла 5k$+, Микротранзакции - 4k$+, Лицензии- 9k$, iPhone - 1k$, итого около 20k$. Самый играемый домен - ВКОНТАКТЕ! на нем даже заработалось несколько тысяч голосов.



    Немного о Микротранзакциях- большинство продаж было на NinjaKiwi, Mochiads, Elite-Games.Net и это примерно 50% от всех продаж. География - 55% из US+Germany+UK+Canada. Если кто в танке - это English+French+German языковые группы.



    Об iPhone - все тяжко здесь - особенно с первой игрой, не хитовой. iPad версия ждет аппрува, Дефенс в разработке, кстати он выйдет с шейдерами=)

    Wednesday

    UnicodeDecodeError: 'ascii' codec can't decode byte in position

    possible solution will be to eliminate non-ascii characters, here is function in python

    import string
    def n(self,myStr):
    return filter(lambda x: x in string.printable, myStr)

    sqlite3.OperationalError: Could not decode to UTF-8 column

    to get rid of this error add following line after opening connection:


    db_connection = sqlite.connect('my.db')
    db_connection.text_factory = str


    more about connections objects

    Thursday

    The certificate for omega.contacts.msn.com could not be validated. The certificate chain presented is invalid.


    2010-11-24 Update: Please download latest version of Pidgin, that has this problem fixed , no additional steps required.


    Here are 3 ways to fix this error:
    sorted from easier to harder,solution #1 works in most cases .
    If it doesn't you can try solution #2 or solution #3 , this will fix problem for sure.

    solution #1(easiest, try it first )

    remove file :
    c:\Documents and Settings\[your-username]\Application Data\.purple\certificates\x509\tls_peers\contacts.msn.com

    In Win 7 the path is: C:\Users\[UserID]\AppData\Roaming\.purple\certificates\x509\tls_peers

    or for linux :
    ~.purple/certificates/x509/tls_peers/contacts.msn.com
    and Pidgin will load latest certificate.

    Update: it also can be fixed by deleting certificate from Pidgin menu Tools/Certificate.


    Solution #2: (if #1 is not working)

    a.Download this file,

    b. delete the .txt extension, so that you end up with omega.contacts.msn.com only,

    c. copy the file to your c:\Documents and Settings\[your-
    username]\Application Data\.purple\certificates\x509\tls_peers
    folder


    Solution #3: (similar to solution #2 but importing certificate directly from omega.contacts.msn.com)

    a. open https://omega.contacts.msn.com/

    b. On the URL bar, click on the security lock (usually just in front of the URL). Click on the certificate information.

    c. Go to the Detail tab and click the “Export” button. Save the file as “omega.contacts.msn.com” (without the quotes).




    d. Copy and paste this file to
    “/home/your-username/.purple/certificates/x509/tls_peers/omega.contacts.msn.com”. When prompted, select “Replace” to replace the existing file.That’s it. Open your Pidgin and the SSL certificate error will be gone.

    Friday

    The element has invalid child element. List of possible elements expected: .

    Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring'.

    To fix this XSD problem:
    Theory:

    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>


    changed code

       
    <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>

    Monday

    how to keep ssh tunnel alive

    To keep ssh session alive Create ssh_config file in your home folder with this line:
            
    ServerAliveInterval 5

    This will keep ssh alive and open.

    remote logoff user windows

    1.Use quser command to load list of sessions

      
    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


    2.Logoff session you need:
      
    C:>logooff 2


    focus popup window

    it can be done by this line : if (window.focus) { newwindow.focus() }
    Here is an example:
      
    <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>


    Thursday

    Wednesday

    msbuild release configuration

    to build release from command line:
     msbuild  buildsrc\Test\Test.sln   /p:Configuration=Release 

    Wednesday

    C# bind dropdown to enum

    For example we have enumeration Enum1 and want to bind ddEnum1.
    here is how to do it in directly into html page , when GetEnum1 is function in codebehing , that will be getting SelectedValue for every record object (passign by parameter)
         
    <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>


    here is how to do it in codebehind
           
    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);
    }



    Monday

    This application has failed to start because vcl60.bpl was not found.


    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'

    more...

    Tuesday

    linq "in" exisits


    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;

    details

    mercurial source control visual studio

    HgSccPackage - Mercurial Source Control Plugin for Microsoft Visual Studio 2008/2010

    VisualHG - Mercurial Source Control Plugin for Microsoft Visual Studio 2005, 2008 and 2010

    more...

    Tuesday

    C# shuffle list


    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;
    }
    }

    more...

    Manage Stored User Names and Passwords

    To manage stored user names and passwords, follow these steps:
  • Log on to the computer as the user whose account you want to change.
  • Click Start, and then click Control Panel.
  • In Control Panel, click User Accounts under Pick a category to open the User Accounts dialog box.
  • Open the Stored User Names and Passwords dialog box; to do so, use the appropriate method:
    • If you log on with a limited account:
      1. Under Related Tasks, click Manage my network passwords.
    • If you log on with an account with administrative privileges:
      1. Under or pick an account to change, click your user account to open the What do you want to change about your account? dialog box.
      2. Under Related Tasks, click the Manage my network passwords.


    A list of stored user names and passwords similar to the following example is displayed:


    more...
  • Friday

    ASP.NET Editable grid

    aspx page:
     
    <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>



    Code behind:
      
    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();
    }


    more...

    imagemagic add text to image

    rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...