Wednesday, February 29, 2012

Crystal report, A generic error occurred in GDI+

one day, some app server has the error to render the asp.net Crystal report. It’s a server side problem, So run a debug and attach to the server side w3wp. turn on unhandled exception.

mdbg> ca ex
mdbg> a 2876
[p#:0, t#:75] mdbg> g
STOP: Exception thrown
Exception=System.Runtime.InteropServices.ExternalException
        _className=<null>
        _exceptionMethod=<null>
        _exceptionMethodString=<null>
        _message="A generic error occurred in GDI+."
        _data=<null>
        _innerException=<null>
        _helpURL=<null>
        _stackTrace=array [20]
        _watsonBuckets=<null>
        _stackTraceString=<null>
        _remoteStackTraceString=<null>
        _remoteStackIndex=0
        _dynamicMethods=<null>
        _HResult=-2147467259
        _source=<null>
        _xptrs=0
        _xcode=-532462766
        _ipForWatsonBuckets=2066954414
        _safeSerializationManager=System.Runtime.Serialization.SafeSerializatio
Manager
IP: 210 @ System.Drawing.Image.Save - MAPPING_APPROXIMATE
[p#:0, t#:75] mdbg> w
Thread [#:75]
*0. System.Drawing.Image.Save (source line information unavailable)
1. System.Drawing.Image.Save (source line information unavailable)
2. CrystalDecisions.Web.HtmlReportRender.ImageObjectRender.SaveImage (source l
ne information unavailable)


then keep going, you will find the foder there, it’s the cr engine which trys to save some file locally.
image

then Just check this temp folder to see whether the folder is accessible? whether the app has the access. for this case,
NObody can access this folder now. so that’s the root case.

Monday, February 27, 2012

Cordbg for .net 4.0

I have been using the Cordbg for a while, it works pretty great. just zip those 2 files and drop it to the server, you can do the production debugging.

now, some app has been switched to 4.0 , I need to get the 4.0 cordbg, googled a lot, can’t find it. and it turns on cordbg for .net 4.0 is out, the alternative is MDBG.

it’s located in  C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64
   just 3 files beside the .net fx are required to run.
image

you can do the same as cordbg, the syntax is most same. Mdbg has more enhancement.
Mdbg has more conditional breakpoint settings,
image

More support for threading and concurrent app troubleshooting.
image

So no cordbg anymore, try mdbg instead.

Friday, February 24, 2012

Install JD GUI eclipse add-in for Eclipse 3.7 timeout

Downloaded new eclipse 3.7 and try to install the new plugin JD-GUI,
image

get the following screen, and it get sucked there,
image
it keep trying different URl to download Content.jar,
the fix is cancel the installation, and uncheck the evil option “Contact all updates sites during install to find required software”
image
then the installation will go through quickly. that’s it.

Wednesday, February 22, 2012

How to: test C# Redis client sider , step by step

After install and test Redis on centos 5, now let’s write a Simple C# application to do some basis data operation.
  make sure Nuget is there, and right click your preject to add Sider to the reference.
image
,with 2 lines of Code,
image

you can also see the value from CLI
image

it also support Unicode,
image

you can pickup the encoding for the unicode in the RedisSetting option.

More syntax and API , check it out here, https://github.com/chakrit/sider

How to: install and test Redis on centos 5

Redis is a lightweight key-value data store.  in terms of the key-value support, it offers several popular data collection types. let’s test it quickly. or check it here for the real tutorial ,

Download the source code,

wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
tar xvf redis-2.4.8.tar.gz
cd redis-2.4.8
make


If you don’t have the C compiler, try yum install gcc to install the compiler. this may take a while, C has a lot libs/headers to download and update.
image
BY default, Redis pick up the port 6379, you can find it in the redis.conf setting,
image
then start the service ‘src/redis-server redis.conf’ which will run in forground by default.

you can change the settings in redis.conf by change demonize:yes, it will run in background.
you can tell the port 6379 is picked up the redis,

image

Now we can run the CLI client of redis, src/redis-cli
image

Here is the helloword test, set one key  with one value as string,
image

We also can define a TTL for this key by put a expire keyword, it will disappear in 120 seconds

image

then some other collection data types, like Hash
image
Check whether a key exists
image
get keys and values,
image

then we can use a C# app to do the same thing,

Tuesday, February 21, 2012

PhoneAccentBrush in Code

obj.BorderBrush = (Brush) App.Current.Resources["PhoneAccentBrush"];
Simple it is.

some controls of the phontext has the same way to pick up static resources
image

Monday, February 20, 2012

How to: Notepad Plus, turn off the setting of last opened files

Notepad plus is really a plus tool for developers like me, sometimes, I don’t want the tool list all the last opened files. By default , it will remember the last opened files and leave it there next time you open it. like a append only file , keep increasing , never get shrinkedSmile

image

To turn off this setting, there is no obvious setting like “disable last opened files”, but there is one option pretty unobvious.

Under [Setting] –> [Preferences..]->[MISC]

image

Also, there is another option to keep the editor only open last N files, like a fixed FIFO queue.
image

Monday, February 6, 2012

Windows Phone 7, File System browser, Isolated storage

If you want to do some cache validation, or viewing the sandbox file system of your app, here is one very great tool
http://wptools.codeplex.com/

you can use this tool to view the Filesystem on the emulator or real device. for real device, it has to connect through Zune.
image

And you can push or pull fill to and from you PC and Phone. like the Android DDM tools.

Also, you can install xap to the phone/emulator.

image

kill app, like the ps shell
image

Thursday, February 2, 2012

A super great SSH shell on windows 7, far more than Putty. Free MobaXterm

Just check this link, you will find how amazing this tool is.

http://mobaxterm.mobatek.net/

I have the features like this I used most on my windows.
just drag and drop this utility to the windows, you can do the SSH, FTP, VNC RDP to any linux server, it has the multi window support.
image

view the remote file system, drag and drop.
Plus it can run bunch of command on windows. like the sed,grep. Super!

 
Locations of visitors to this page