Eurostat
Thursday, 30 April 2009
Monday, 9 March 2009
How to serialize ADODB.Recordset in order to use it with WCF
It is easy to find that, unfortunately, ADODB.Recordset cannot be posted from client to server using WCF. The reason is simple: it is not serializable. The following code allows you to overcome this problem.
1. Without having to serialize using xml, so sufficiently increase the size of data flow in WCF.
2. Without having to convert it into Datatable - you will have quite a perfomnce problem converting it back from a DataTable to ADODB.Recordset in case on the client you (somekind old code) like to consume still ADODB.Recordset
This sample is written using VB.Net and implementing in any other language should be straight forward
'Imaging that rs is a ADODB.Recordset already existing in your code
Dim ret() As Byte
Dim aStr As Object = CreateObject("ADODB.Stream")
rs.Save(aStr, 0) ' 0 is ADODB.PersistFormatEnum.adPersistADTG)
Return aStr.Read(aStr.Size)
Dim binFormat = New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
Dim oStream As New System.IO.MemoryStream()
binFormat.Serialize(oStream, rs)
oStream.Flush()
oStream.Position = 0
ret = oStream.ToArray() ' now ret is the byte array and you can post it via WCF
On the client side the following code as an example can be used. Imagine that QueryBypassAsByte is the function that returns the earlier formed byte array over the WCF call
Dim res() As Byte = proxy.QueryBypassAsByte()
Dim oStr As New ADODB.Stream()
'' read back into the stream...
Dim resRecordset As New ADODB.Recordset()
oStr.Open(System.Reflection.Missing.Value, ADODB.ConnectModeEnum.adModeUnknown, ADODB.StreamOpenOptionsEnum.adOpenStreamUnspecified, "", "")
oStr.Type = ADODB.StreamTypeEnum.adTypeBinary
oStr.Write(res)
oStr.Position = 0
resRecordset.Open(oStr, System.Reflection.Missing.Value, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, -1)
Now the resRecordset object contains ADODB.Recordset and you can either consume it or pass it further into any old code.
Labels:
Experience,
Software development
Saturday, 17 January 2009
Moving toward PhD title: Conferences - posters
Some conferences do position posters as an official participations in the conference with an article, while other as an un-official. The difference between those is – whether the article will still be included into the conference proceeding or not. If it will be included then it is treated as an article when the author has no right to talk loudly about it unless somebody asks. Otherwise it is a way for students to communicate the work and discuss, but it will not count for the PhD requirement to have x articles published, and so is not worth to accept the invitation in majour cases. Notice that sometimes those are printed in a local proceeding. Therefore you should be very careful if your work is accepted to the conference as a poster and find out in advance what it means from the publication point of view and then check with your supervisor whether it counts or not for your PhD articles requirement.
There are different ways to compile a poster. Mostly posters are prepared by authors in a classical way as a A1 or A2 size paper that contains a composition showing the logical flow of the paper from introduction to the conclusion. Some authors doesn’t bother to produce something creative picture and just put on the poster a set of slides they would show if they are allowed to present the work as a talk. Minor number of authors will just print out A4 pages and put them instead of A1 having printing out nothing more than the text of the article.
There are some examples from ICEIS’08 conference.
Labels:
Experience,
Science,
University
Saturday, 10 January 2009
Moving toward PhD title: Been stupefied (the third and last part)
- Postpone your work for some time and switch the type of activity – go for a walk, start building a house or garden. Here you hope that your brain will recharge after some time and you will be able to use it again later … after it was cleaned from all details you never actually needed. Once the light will turn on again in the brain and will do even more than you did so far.
The biggest disadvantage is – lost time. Besides you can loose the taste for the research and find more useful to deal with the current work task, friends and family on the constant base instead of PhD activities. - Leave you ideas for a while and start researching others. For example to read recent articles from your or neighbour topic hoping to get from there something, that could either be useful for you or even will give you a new, inspiring idea.
The biggest disadvantage in those approaches is sufficiently decreased productivity and general tiredness that will definitely follow the no-ideas period As soon as you are not concentrated on the topic you find attractive, you will think that it is boring and is not worth to spend your time at all. Especially if you read others articles and struggle to understand the point in these papers. The reason is very simple – your body try to recover from pressure you put on it in the past by routing available resources on other type of activities or just on rest. Generally it is good as you must relax for certain time, but there is a danger to loose a taste of research, forget how interesting it as it is much more boring without details when you look at it from a huge distance.
Labels:
Experience,
Science,
University
Saturday, 3 January 2009
Moving toward PhD title: Been stupefied II
First of all you can communicate to supervisor the current status of the work and articles. Sometimes supervisor can help just by asking “right” questions pushing you in the certain direction or way of thinking highlighting the point where you did something incorrectly or incompletely
Secondly s/he can show you new ways, directions, which are obvious for him/her. Notice that you should not afraid that if the idea is produced by supervisor, then it is no longer yours and you will be just a „work force” evolving others thoughts. The truth is: each research is a lot of work and certainly much more just one sentence said once. It is different hypothesises, proves, collecting statistical information or measuring some process, solving local problems and so forth. In other words it is all that your supervisor has neither time to do nor intentions to do. S/he has a lot of own ideas, which s/he is fond of.
Finally it will allow you just to talk the problem out and probably you will find new ideas and solutions just properly formulating your thoughts in front of some superior person.
Labels:
Experience,
Science,
University
Monday, 29 December 2008
Friday, 26 December 2008
Moving toward PhD title: Been stupefied I
Such problems are quite common and experienced by most scientists during certain periods of their life. What you desperately need in such case is to obtain (somehow) a new point of view on the problem you deal with in your PhD thesis. The best way to get it is to communicate the problem to somebody else. This person can be your supervisor (why else you need him / her :)? ) or another student probably having the same problem and so a lot of time to talk about whatever you would like to talk about.
Labels:
Experience,
Science,
University
Subscribe to:
Posts (Atom)