Thursday, August 29, 2013
Saturday, August 10, 2013
Programming languages used in most popular websites
Programming languages used in most popular websites
Front end all use JavaScript.
Back end, still these main stream languages: C/C++, Java, PHP, .NET. Also some Python, Perl, Ruby, Scala etc.
Front end all use JavaScript.
Back end, still these main stream languages: C/C++, Java, PHP, .NET. Also some Python, Perl, Ruby, Scala etc.
Tuesday, July 16, 2013
Break captcha in Chinese
Most captchas are in English/numbers.
Here is an interesting video on how to break captchas in Chinese. The key is this writing recognition site http://www.nciku.com/. This is a nice site to help learning Chinese.
Here the Chinese character is not skewed, so it's easy to draw it. It'll be harder if the characters are skewed.
But ultimately, to make it safer, captcha better incorporate some semantic meaning, like asking for an answer to a question with culture background, instead of just typing the character.
Here is an interesting video on how to break captchas in Chinese. The key is this writing recognition site http://www.nciku.com/. This is a nice site to help learning Chinese.
Here the Chinese character is not skewed, so it's easy to draw it. It'll be harder if the characters are skewed.
But ultimately, to make it safer, captcha better incorporate some semantic meaning, like asking for an answer to a question with culture background, instead of just typing the character.
Essential PHP security
Essential PHP security. By Chris Shflett. 2006.
Nice book. Basic rules can apply to sites built in other languages.
Nice book. Basic rules can apply to sites built in other languages.
ADO.NET 4 Database Programming 2010
Murach's ADO.NET 4 Database Programming with VB 2010, 4th Edition. By Anne Boehm, Ged Mead.
- ADO.NET connection types: sql, ole, odbc
- ADO.NET objects: Connection --> command --> 1) data reader, 2) data adaptor --> dataset, binding.
- Stored procedures and parameters
- Transaction. Begin, Commit, Rollback, Savepoint
- GridView/DetailsView: add/edit/delete, select/multi-select, paging. Can implement these myself.
- XML
- LINQ: to: xml/sql/entity/dataset/objects
- Entity Framework
- ADO.NET connection types: sql, ole, odbc
- ADO.NET objects: Connection --> command --> 1) data reader, 2) data adaptor --> dataset, binding.
- Stored procedures and parameters
- Transaction. Begin, Commit, Rollback, Savepoint
- GridView/DetailsView: add/edit/delete, select/multi-select, paging. Can implement these myself.
- XML
- LINQ: to: xml/sql/entity/dataset/objects
- Entity Framework
Tuesday, July 9, 2013
Visual C# 2008/2012. By John Sharp
p.151. Nullable type.
int i = null; // wrong
int? i = null; // right
p.152. ref, out (must assign value in method).
Need to declare variable as ref/out at both calling site and function definition.
p.176. Class & Struct
struct class
type value reference
live on stack heap
can declare default ctor? no yes
after declare ctor, default ctor auto-created? yes no
automatic initialize fields? no yes
can initialize instance fields at declaration? no yes
- Collection:
- Hashtable
- SortedList - sorted hash table (RB tree?)
p.207. Parameter Arrays. - variable param list.
- void func(params int[] a) {...}
p.217. CH 12. Inheritance
- new, virtual, override, hiding/overriding, protected.
- extension methods?
- public, protected, private, internal, protected internal
- internal: Internal types or members are accessible only within files in the same assembly,
- protected v.s. protected internal:
- protected; derived types may access the member.
- protected internal; only derived types or types within the same assembly can access that member,
so they need to be in the same Dynamic Link Library or an executable file.
p.239. Interface, Abstract class, Sealed class.
- interface => virtual => override => sealed
p.274. Property, get/set
p.295. CH 16. Indexer?
p.311. delegate, event
p.333. CH 18. Generics.
Queue myQ = new Queue();
p.371. LINQ. Language Integrated Query
- LINQ, DLINQ, XLINQ.
- Linq is a programming model that introduces queries as a first-class concept into any Microsoft .NET language
- DLinq (Linq to SQL) is an extension to Linq that allows querying a database and do object-relational mapping.
- XLinq (Linq to XML) is an extension to Linq that allows querying/creating/transforming XML documents.
- After ASP.NET 4.0, emphasis is on Entity Framework, which replaces LINQ.
- Linq v.s. Entity Framework. (some explanation)
- LINQ to SQL only supports 1 to 1 mapping of database tables, views, sprocs and functions available in Microsoft SQL Server. It's a great API to use for quick data access construction to relatively well designed SQL Server databases. LINQ2SQL was first released with C# 3.0 and .Net Framework 3.5.
- LINQ to Entities (ADO.Net Entity Framework) is an ORM (Object Relational Mapper) API which allows for a broad definition of object domain models and their relationships to many different ADO.Net data providers. As such, you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc. ADO.Net Framework was released with the .Net Framework 3.5 SP1.
p.420. XAML. Extensible Application Markup Language.
- WPF - XAML - define interface by XML(XAML), independent from application logic.
p.523. DLINQ. Based on ADO.NET. Data LINQ.
p.557. PART VI. Build web app.
- ASP.NET server control
- HTML control (runat="server")
- theme
- web forms validation controls.
p.623. Web service
- REST: request by specifically formatted URL
- SOAP: request by XML message.
int i = null; // wrong
int? i = null; // right
p.152. ref, out (must assign value in method).
Need to declare variable as ref/out at both calling site and function definition.
p.176. Class & Struct
struct class
type value reference
live on stack heap
can declare default ctor? no yes
after declare ctor, default ctor auto-created? yes no
automatic initialize fields? no yes
can initialize instance fields at declaration? no yes
- Collection:
- Hashtable
- SortedList - sorted hash table (RB tree?)
p.207. Parameter Arrays. - variable param list.
- void func(params int[] a) {...}
p.217. CH 12. Inheritance
- new, virtual, override, hiding/overriding, protected.
- extension methods?
- public, protected, private, internal, protected internal
- internal: Internal types or members are accessible only within files in the same assembly,
- protected v.s. protected internal:
- protected; derived types may access the member.
- protected internal; only derived types or types within the same assembly can access that member,
so they need to be in the same Dynamic Link Library or an executable file.
p.239. Interface, Abstract class, Sealed class.
- interface => virtual => override => sealed
p.274. Property, get/set
p.295. CH 16. Indexer?
p.311. delegate, event
p.333. CH 18. Generics.
Queue
p.371. LINQ. Language Integrated Query
- LINQ, DLINQ, XLINQ.
- Linq is a programming model that introduces queries as a first-class concept into any Microsoft .NET language
- DLinq (Linq to SQL) is an extension to Linq that allows querying a database and do object-relational mapping.
- XLinq (Linq to XML) is an extension to Linq that allows querying/creating/transforming XML documents.
- After ASP.NET 4.0, emphasis is on Entity Framework, which replaces LINQ.
- Linq v.s. Entity Framework. (some explanation)
- LINQ to SQL only supports 1 to 1 mapping of database tables, views, sprocs and functions available in Microsoft SQL Server. It's a great API to use for quick data access construction to relatively well designed SQL Server databases. LINQ2SQL was first released with C# 3.0 and .Net Framework 3.5.
- LINQ to Entities (ADO.Net Entity Framework) is an ORM (Object Relational Mapper) API which allows for a broad definition of object domain models and their relationships to many different ADO.Net data providers. As such, you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc. ADO.Net Framework was released with the .Net Framework 3.5 SP1.
p.420. XAML. Extensible Application Markup Language.
- WPF - XAML - define interface by XML(XAML), independent from application logic.
p.523. DLINQ. Based on ADO.NET. Data LINQ.
p.557. PART VI. Build web app.
- ASP.NET server control
- HTML control (runat="server")
- theme
- web forms validation controls.
p.623. Web service
- REST: request by specifically formatted URL
- SOAP: request by XML message.
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2026
(36)
-
▼
June
(19)
- C10K to C10M: from thread-per-connection model to ...
- Benchmark server performance
- Application server for php, python, java, node.js,...
- Application server for C++, Go and Rust
- Nginx as reverse proxy and load balancer
- Infrastructure running: nginx, apache, php, python...
- Flow chart of nginx+apache+uvcorn infrastructure
- Flow chart of apache+uvcorn infrastructure
- Uvicorn and Gunicorn
- What's deadsnakes PPA
- What's the optional lsb-core package
- Codex known logging bug
- Daemonsize a service
- Train text to image model, to generate images of c...
- Train a model based on OpenAI API
- Open port 8080 for WebSocket
- Add websocket support on Bluehost Ubuntu VPS for D...
- Install Claude Code on ubuntu VPS of Bluehost
- Install PostgreSQL on Mac
-
▼
June
(19)