Home
» Archives for 2011
Um, I haven't touch this Blog for a while... So... just a case study.
Usually, I use FTP to find available files to update my mobile application. However,I have a client who doesn't want to install FTP but they have web server.
Therefore, I use the traditional way to update the application, "Make a http query"...
It is pretty simple to use HttpWebRequest and HttpWebResponse to validate the version. If the server returns a file link, then I download it and install it.
You can make a HttpWebRequest (http://yourwebsite/?version=1.0.2.0) to find available update. If server [...]
I remember a while ago that I needed to enable the vibration for a client's application.
So I googled a bit and found the similar codes like below...
And today, I found some people are looking for this solution on MSDN...
So I decided to post it in C# and hope it will give some people a heads up...
///
/// This function plays the specified vibration.
///
/// Must be 0
/// Must be NULL
/// A Boolean value that indicates whether the song
/// should be repeated. If this parameter is equal to TRUE, it will refer to [...]
Pooh~~~ I haven't organised the blog page for ages... Well, not many clicks~~~
Anyway, I tried to check emails at home with Ubuntu and found out the Evolution could not connect to our Exchange 2007 server. I found out it works well when I am in the office or VPN connection is on. Um... I think that will be my new task to find out what causes this... Or... If any one reads this post, I would appreciated some comments or suggestions for this issue. [...]
Hey... here is another one for everybody... As the standard paging toolbar of ExtJs 4 does not have function to change the page size of the data store, so I make a simple plugin for the paging toolbar. I believe there are many examples if you Google it, but just another sample to share though...
/**
* Ext.ux.grid.PageSize
*/
Ext.define('Ext.ux.grid.PageSize', {
extend : 'Ext.form.field.ComboBox',
alias : 'plugin.pagesize',
beforeText : 'Show',
afterText : 'rows/page',
mode : 'local',
displayField: 'text',
valueField : 'value', [...]
Recently, I was trying to update our internal system from ExtJs 3 to version 4. Well, I think many V3 plugins are needed to be updated. So I was a bit busy on that... Anyway, I am going to share a bit of code which is the dynamic grid for ExtJs 4. As the sample from Erhan Abay is for ExtJs 3, so I made a few changes for ExtJs 4.
/**
* Ext.ux.grid.DynamicGridPanel
*/
Ext.define('Ext.ux.grid.DynamicGridPanel', {
extend: 'Ext.grid.GridPanel',
alias: 'widget.dynamicgrid',
/**
* initialising the components
*/
initComponent: function(){
/** [...]
Today, I was trying to connect to our VPN with Ubuntu 11.04 and found out that was not working. Well, after a bit searches on Google, I found out there are some points of VPN settings that I needed to change.
Username should be domain\username.
Do not fill out domain in the VPN configuration.
Under the advanced option make sure you tick "Use Point-to-Point encryption (MPPE)" option. (see above screenshot) [...]
I was trying to setup my laptop with Ubuntu 10.10. Well, so far, most of applications and devices are working as expected. However, the microphone with Gmail Chat is pretty much a pain.
First of all, I found this link and installed the pavucontrol and changed the settings to Microphone 2. Well, it works with Skype but not with Gmail Chat. The Gmail Chat driver auto adjusts volume so it all went back to the default settings again... WTF...
Anyway... keep fighting on it at the moment... Has anyone had this problem and resolved it? [...]
Well, this is long way back when I was a rookie to develop Windows Mobile applications with C#.
I believe there are some people want to sync the device date/time with their web server as the device date/time somehow doesn't tick correctly after certain days. So first of all, you should have a look the SetSystemTime function as you need a SYSTEMTIME structure to pass the value to SetSystemTime function.
We start to P/Invoke the SetSystemTime method.
[DllImport("coredll.dll", SetLastError = true)]
private static extern bool SetSystemTime(ref SYSTEMTIME time);
Create the SYSTEMTIME [...]
When I deploy the application to customers, I like to wrap all cabs in one as it would be much easier. For example, .NETCF and SQLCE. If the device is new, the .NETCF or SQLCE needs to be installed prior running my application. Thanks for CeSetupDriver and here. They helped me a lot to deploy the application with the way I want. However, I don't want to prompt user every time that the .NETCF or SQLCE has already installed. So I come up with a checking method to validate that the application has already installed and skip to next cab installation. All you need to do is passing [...]
It was a while ago to play the colours in .NETCF. The case was drawing darker or lighter colour when user clicks my custom design buttons. Well, I believe it would be much easier to change the colour by its original colour. So I came up with two methods to extend the existing System.Drawing.Color object. These two methods can be found similar over the Internet. So, I have to thank all the developers in the Internet...
public static Color GetColorDarker(this Color color, double factor)
{
// The factor value value cannot be greater than 1 or smaller than 0.
// Otherwise [...]
Today, I was trying to install the Android SDK to my laptop and got "JDK not found on Installing Android SDK"... Well, I was a bit confused as I have installed the latest JDK.
So, I decided to google it. Most of results are for 64bit OS but I use 32bit Windows 7. Well, then I pressed "Back" button and then pressed "Next" again in the initialization page. Ha... It allows me to install it then...
I believe the installer caches the previous data if you haven't installed the JDK. Well, good to know that is easy to fix this installation issue... [...]
I just tried to write a function to validate URL address. Well, as usual, I've done some researches on Google and not many efficient and satisfy solutions. However, I've got a solution which is using Regex in C# to validate a URL and it seems a acceptable method to test the URL input.
public static bool IsValidUrl(this string url)
{
string strRegex = "^(https?://)"
+ "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" // user@
+ @"(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP- 10.0.0.1
+ "|" // allows either IP or domain
+ @"([0-9a-z_!~*'()-]+\.)*" [...]
Today I was think how to optimize the drawing string method on my library... so far I worked out this... However I still couldn't workout how to really wrap long string within the sentence...
Any help?
public static string[] WrapString(this Graphics gx, Font font, string text, float maxWidth, bool wrap)
{
// find if actual max text width is smaller than max width or maxWidth is smaller than zero or wrap is set to false
if (gx.MeasureString(text, font).Width < maxWidth || maxWidth <= 0 || !wrap)
{
return text.Split(new char[] { '\n' });
}
int [...]
Popular Posts
-
Recently, I was trying to update our internal system from ExtJs 3 to version 4. Well, I think many V3 plugins are needed to be updated...
-
Today, I was trying to connect to our VPN with Ubuntu 11.04 and found out that was not working. Well, after a bit searches on Google,...
-
Do you use your own domain name with Blogger? Do you place " Blogger's Stats Widget " on your page? Or do you regularly chec...
-
I have been developing some projects with ExtJs for a while and also created some plubg-ins and extensions for these projects. Recently, I...
-
I have visited many blog sites and most of them have " Related Posts " or " You may also like - " section for...
Categories
Coding
(
17
)
Tips
(
11
)
Javascript
(
8
)
C#
(
6
)
ExtJs
(
6
)
NETCF
(
5
)
Windows Mobile
(
5
)
Blogger
(
4
)
PHP
(
4
)
Linux
(
3
)
MySQL
(
3
)
Ubuntu
(
3
)
Android
(
2
)
Apache
(
2
)
CSS
(
2
)
Html
(
2
)
Minify
(
2
)
jQuery
(
2
)
Agile
(
1
)
C++
(
1
)
Exchange
(
1
)
Gimp
(
1
)
Life
(
1
)
Mac
(
1
)
Scrum
(
1
)
Buy me a cuppa
Thank you for visiting my blog.
If you'd like to support me,
you can buy me a cuppa.
If you'd like to support me,
you can buy me a cuppa.