In the past to learn programming languages, we need to study from books, teachers, static website. However, today, we have a interactive website that can teach us online interactively to make us visualize how programming languages work. It's a lot easier than the past. Visit Codeacademy to start practice yourself :D
Pages
Profile
|
|
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time.
Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more... |
Wednesday, October 17, 2012
Saturday, September 29, 2012
Getting Start Windows Azure
Today, Cloud services are heavily used in many companies, which can reduce the expenses in term of hardware maintenance includes scalability problem. For the well known cloud service providers may be Amazon, Google, and Microsoft. In this post I've got Windows Azure information i.e. first step of setting up Windows Azure, and its architecture.
For the step by step setting up Windows Azure, you can go to this link: http://blogs.technet.com/b/blainbar/archive/2012/09/10/step-by-step-setting-up-windows-azure-for-the-first-time-and-creating-a-vm-role-of-windows-server-2012-on-microsoft-s-public-cloud.aspx.
Another one is a link exploring cloud architecture: http://msdn.microsoft.com/en-us/magazine/hh852589.aspx.
In short, Windows Azure provides 3 types of cloud services as follows: IaaS, PaaS, SaaS while Amazon provide cloud service in the level of IaaS, and provide PaaS in Google.
Labels:
Cloud Computing,
Windows,
Windows Azure
Thursday, September 27, 2012
HTML5 Gaming with CreateJS
Nowadays, the JavaScript technology has moved very fast, which is now we can use it to create some games. CreateJS is a library set that consists of EaseJS, TweenJS, SoundJS, PreloadJS to do element controls, animation, sound, and resources management. It is under MIT license, so it is free to use.
The following link is a example to create a simple game using CreateJS: http://blogs.msdn.com/b/davrous/archive/2012/03/16/html5-gaming-animating-sprites-in-canvas-with-easeljs.aspx.
Download CreateJS and try it here.
The following link is a example to create a simple game using CreateJS: http://blogs.msdn.com/b/davrous/archive/2012/03/16/html5-gaming-animating-sprites-in-canvas-with-easeljs.aspx.
Download CreateJS and try it here.
Labels:
HTML5,
Internet Technology,
JavaScript,
Programming
Thursday, September 20, 2012
Disrupt University 1st round - 4 days workshop (TH)
The following links are about the first round of Disrupt University: Bringing Silicon Valley to Thailand brief story (in Thai contents). Personally, I had a chance to attend 2nd round of this workshop, however, due to some reasons I can't join to the course and rejected the acceptation.
- http://ojazzy.tumblr.com/post/27252524215/disrupt-university-1
- http://ojazzy.tumblr.com/post/27836116803/disrupt-university-2
- http://ojazzy.tumblr.com/post/28342886884/disrupt-university-3
- http://ojazzy.tumblr.com/post/28986929903/disrupt-university-day-4
For who don't know what Disrupt University is you can visit: http://disruptuniversity.com/.
Thursday, September 13, 2012
Get Dynamic Image in string format from Post Ajax Services
Instead of loading images via provided links, we can send images directly, and request it from ajax post channel. In order to do that, first covert image into array of bytes, then transform them into string base 64.
For example:
For the client side, just write ajax post method, after get data insert image element into somewhere on a page.
For example:
P.S. This example use ASP.NET MVC 3 for the server side, and use jQuery in the client side.
For example:
public JsonResult GetImage(string chartname)
{
var chart = new Chart();
chart.ChartAreas.Add(new ChartArea());
var series = new Series(chartname);
series.ChartType = SeriesChartType.Line;
series.Points.AddXY(1, 1);
series.Points.AddXY(2, 2);
series.Points.AddXY(3, 3);
chart.Series.Add(series);
string result = null;
byte[] bytes = null;
using (MemoryStream stream = new MemoryStream())
{
chart.SaveImage(stream, ChartImageFormat.Png);
bytes = stream.ToArray();
result = Convert.ToBase64String(bytes);
}
return Json(result);
}
This example will convert chart image into PNG binary file format then convert to string base 64 before return.For the client side, just write ajax post method, after get data insert image element into somewhere on a page.
For example:
<!DOCTYPE html>
<html>
<head>
<title>Image Service Index</title>
<script type="text/javascript">
function load() {
$.ajax({
type: "POST",
data: { "chartname": "ImageServiceTest" },
url: "@Url.Action("GetImage", "ImageService")",
dataType: "json",
success: function (response) {
var chartDivId = $('#imageContent');
// Response message will be json format if we use json as a data type
$(chartDivId).html('<img src="data:image/png;base64,' + response + '" />');
},
error: function (ex) {
debugger;
alert(ex.status);
}
});
}
window.onload = load;
</script>
</head>
<body>
<div id="imageContent">
</div>
</body>
</html>
You can download full example here.
P.S. This example use ASP.NET MVC 3 for the server side, and use jQuery in the client side.
Labels:
C#,
Internet Technology,
MVC,
Programming
Setting Router (DD-WRT) as a client in unbridged mode
This a a Linksys router (DD-WRT), I just borrowed to configure it as a client hahaha. I mean config this router to connect main router ( has WAN) via wireless network, then make computers and client router connect together via LAN.
To set it up do as follows:
- Change router mode (in wireless tab) to client mode, and set SSID to be the same as main router's SSID.
- In wireless security tab (sub tab), set security mode and password to be the same as main router's also.
- In security tab, disable firewall because it will make your setting become harder to be set. You can configure later if you want to.
- In setup tab, change connection type to Automatic Configuration - DHCP, and disable STP.
- Change router IP, which is different from main router IP. e.g. if your main router IP is 192.168.1.*, you can change a client router IP to 192.168.2.*. Next, use the same subnet mask.
- Check at Use DNSMasq for DHCP.
- Check at use DNSMasq for DNS.
- Check at DHCP-Authoritative.
- Set other stuffs if necessary.
Labels:
Network
Tuesday, September 11, 2012
Auto Mouse Move in C#
In .NET platform, it allows us to access a cursor of the mouse, and intercept accessibility from external environment (user input). It's quite easy to do so, just import "System.Windows.Forms", then play with Cursor class using static property "Cursor.Position". The property Position is from "System.Drawing" so you need to import this too in order to play with cursor position. The following code is an example program:
public static void Main()
{
// Move cursor to (100, 100)
Cursor.Position = new Point(100, 100);
}
Download full example program here.
Labels:
C#,
Programming,
Windows
Friday, September 7, 2012
Let's create own Evolutionary Optimization Algorithms (C#)
This post is just the same as the previous post. It's about basic algorithms in AI to solve optimization problems. In this post, I read from the same writer as previous post. He described how do we implement evolutionary algorithms and a program structure in the following link: http://msdn.microsoft.com/en-us/magazine/jj133825.aspx.
Labels:
AI,
C#,
Programming
Let's create own Neuron Networks (C#)
It's a kind of fun to create own Neuron Networks. To review a school age lol (in AI class), take a look at http://msdn.microsoft.com/en-us/magazine/hh975375.aspx. He described very clear and detailed. You can follow him to create your own :D.
The following page is a preview page that I just referred above:
Labels:
AI,
C#,
Programming
Wednesday, September 5, 2012
How to Implement IDisposable correctly
Before getting to know how to implement IDisposable, must has some basic about .NET system first.
Unmanaged Code, which means the code developed outside .NET Framework is known as unmanaged code. It's not run under CLR (Common Language Runtime) such as C++ can be used to write such applications , for examples, access low level functions of the operating system. It offers the powerful features that managed code does not, and might damaging as well. Unmanaged code can be unmanged source code and unmanaged compile code, and
unmanged code is execute with the help of wrapper classes, and caution is required (doesn't be executed by CLR). It will be compiled into machine code and executed by the OS directly.
Managed Code is the code that targets to common language runtime which is under foundation of .NET Framework. Managed Code will supply necessary things for CLR to provides services such as memory management, cross-language integration, handling security, lifetime control of objects, in short, it will look after your applications. All code based on IL (Intermediate Language) executes as managed code.
Garbage Collector will clean unused resources automatically, but can still call it explicitly. It will do finalizer in destructor of each object. The process of cleaning resources are done in a finalizer thread not a main thread.
Unmanaged Resources falls into two categories:
Unmanaged Resources falls into two categories:
- Resources that are wrapped in a managed class (ie Bitmap, Font etc) but still need Dispose to be called to clean them up property.
- Resources that you allocated that are representations of native resources (ie device contexts that need to be released)
The propose of using dispose is we want to free both kinds of unmanged resources. Note that for the first kind of unmanged resources, the garbage collector will take care of them when it have to clean them up. We only need to focus about true native resources that we have allocated (in case we have).
Subscribe to:
Posts (Atom)