Showing posts with label Experience. Show all posts
Showing posts with label Experience. Show all posts

Saturday, 12 December 2009

Fair rate for .Net devs outsourcing functionality development: Estonia and USA case

How would you answer the following question "What is a fair rate for .Net devs (per hour or per man-day) in Estonia and USA if a project lasts circa 2 months?" Comment: that is an amount one company would pay to another company, so the last one will have to pay all taxes. We are not talking about a salary that devs would get into their bank accounts. Moreover here we are talking here about one-time work. Not a long-term cooperation or stable income for the dev company.

Obviously the answer depends on the involved devs level. An experience from our company when we had the maximum number of developers – abilities of devs to generate correct code were varying circa 3-15 times, i.e. one dev was able to produce a code in one day, while another will do the same code in 3 man-days or even 3 man-weeks.
It also depends on time-frame. The faster result should be delivered the more costly it will be to produce. If there is no rush, then professional consultants will not be involved, so the price will drop sufficiently.

What answeres do we have at the moment?

1. quote " I work in a startup. Think 1-3 person teams who release v1.0 in 4-6 months. In this scenario, $5k or $10k goes a long way towards bringing a product to fruition. $10k can pay for a senior offshore developer ($15/hour) full-time for 4 months (so 120$ man-day)"

My comment: seems that „indian universal devs' are involved here – sometimes they even offer to write a code solving NP != P problem in a week :)


2. USA – well it depends on the dev level - from 50 to 75$ an hour (s 400-600$ a day), but sometimes miracles happen also by having 120-180$ an hour.

3. My friends recently did a project of 40 man-days. For a company they have very good relationship with. The cost was 2500 ЕЕК per day - so 240$ per day. The price was fixed for functions which were estimated including risks, so I would rate it as 240 - 320$ per day in other cases. An important fact – it was outsourced so, that the work-force was involved basing on a free schedule, so they could work on the main workplace doing extra when they willing to spent their time on it (although a deadline was also set).

4. It used to be 500-800 EEK an hour in Estonia some time ago. Not sure how much it is at the moment. Here I talk about highly qualified devs. You can find a student for 100EEK as well, but obviously the quality will be different as well as the time required to build the desired functionality. So here we get again circa 400-600$ per day.

5. Europe company got a rate from my friends - 500$ per day. They are a bit in rush, so they easily accepted that.

.. what answeres do you know? Could you share those with us?

Friday, 11 December 2009

WCF: limits

Today I have lost a half of the day trying to understand a problem occurring when a .Net client was communicating to a server talking via WCF - when the posted byte array size was over circa 2MB.

Both client and server looked to be fine in term of limits:

Client
moWsHttpBinding = New WSHttpBinding(System.ServiceModel.SecurityMode.None) moWsHttpBinding.MaxReceivedMessageSize = Integer.MaxValue
moWsHttpBinding.ReaderQuotas.MaxArrayLength = Integer.MaxValue
moWsHttpBinding.ReaderQuotas.MaxStringContentLength = Integer.MaxValue
moWsHttpBinding.MessageEncoding = WSMessageEncoding.Mtom
moWsHttpBinding.ReaderQuotas.MaxBytesPerRead = Integer.MaxValue
moWsHttpBinding.ReaderQuotas.MaxNameTableCharCount = Integer.MaxValue
moWsHttpBinding.UseDefaultWebProxy = False
moWsHttpBinding.BypassProxyOnLocal = True
moWsHttpBinding.ReceiveTimeout = New TimeSpan(20, 0, 0)
moWsHttpBinding.SendTimeout = New TimeSpan(20, 0, 0)


Server (from web config - omitting a lot of detals on how they are bounded)
<wsHttpBinding>
<binding name="NoneBind" messageEncoding="Mtom" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

<security mode="None" />

</binding>
</wsHttpBinding>


... and as usually a solution was simple and laid outside of this code (and actually well known for me from asp.net development experience): you have to add into web.config something like:
<system.web>
<httpRuntime maxRequestLength="131072"/>
</system.web>

to increase the limit to circa 128MB.



which makes me wonder why remaining binding settings disallow to overcome this simple general one.

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.

Saturday, 17 January 2009

Moving toward PhD title: Conferences - posters

There are different ways to participate in conferences and one of those is presenting the work as a so called poster. In the general meaning, the poster is a printing material that can be attached to a wall and can be either textual or graphical or mixed. In our case posters are mainly papers that were not accepted to the conference main stream (as a presentation), but which still have a chance to appear on the conference. The main idea of posters is to give a high-level overview of the work. Those are normally printed out by authors and posted to special transportable walls in conference halls. Each conference attendee, walking in halls can have it read and get introduction into the work. Normally the authors should also be presented somewhere close to the poster so everybody interested in the work can discuss it in more details.

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.

Saturday, 10 January 2009

Moving toward PhD title: Been stupefied (the third and last part)

Several posts ago we started to discuss what should you do to break down from been stupefied working on PhD thesis or articles. In addition to communicating the problem to friends or your supervisor you can also:


  1. 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.


  2. 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.

Saturday, 3 January 2009

Moving toward PhD title: Been stupefied II

In the last post we discussed that it is advisable to discuss a problem, you deal with, with somebody else in case you just cannot think of any good way to progress your work further. Actually such discussion with your supervisor is very useful because of a set of reasons. Notice that supervisor mostly means superior, i.e. having a lot of experience and therefore a constant communication will surely accelerate your progress moving toward the desired goal.

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.

Friday, 26 December 2008

Moving toward PhD title: Been stupefied I

Normally, the process of writing of PhD work/articles is well-balanced and rapid, but sometimes a certain problem occurs when you have no ideas how to evolve the work further. You just cannot think of any good ideas and this lasts quite a long time – a week or a month. It seems that all ideas left you head and promised never return back and the best thing you can do is to apply to some none-intellectual type of work. It is especially sad since you had a lot of good ideas just 10 minutes ago .... and now you can park a truck or two into the completely empty garage called „your brain”.

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.

Saturday, 20 December 2008

Moving toward PhD title: Advices from my supervisor

Been a PhD students, I got once an advice from my supervisor – have a special notes book into which you can write all ideas you get.

  • It will let you return to some ideas you had in the past in case you hadn’t time to develop it until now;

  • It gives a history of research, o you can track down all you did recently and so see your own progress and therefore find efficiency of your work. If you are not working well then you can even limit you own pocket money :)

  • It will give you a visibility of how an idea evolved and what stages it passed. You will see how you arrived to one or another decision and follow the logic you probably already forgot. Moreover it will show all turning points and probably find out how it can be developed from those in other directions.


PS: Obviously you can use any other gadgets instead of pen and paper, but I don’t see any good computer systems at the moment that could allow you to fix ideas quickly, efficiently, in any place you are at the moment.

Saturday, 13 December 2008

Moving toward PhD title: Where conferences are held?

There are two typical place where a conference is held: either in a university or in a congress center. The first place is mostly chosen because it is either free of charge or very cheap having the entire infrastructure you need to organise a conference: auditoriums, projects, chairs, WiFi and so forth. All this is built for students, i.e. is already paid either by state or by students and can be just consumed. Besides science activities aligns well to university positioning itself as a “science center”. The only and the largest disadvantage – infrastructure is heavily used by students and therefore is not in good conditions. Therefore some conferences would prefer to use congress centers, which have the same equipment, but the equipment is much newer and modern. Unfortunately the price is also increased, but that is the amount you have to pay for ensuring the certain level of service for attendees.

Sunday, 30 November 2008

Moving toward PhD title: Keep pushing II

The other problem preventing students from moving efficiently towards the goal is an „illness” of concentrating on some kind particular idea that results in producing constantly the same result in a sort of cycle and permanent attempts to push it into different conferences. Like a donkey travelling always toward a carrot been fixed a meter from his nose.

It is useful to fix all ideas somewhere (for example in the old way on a paper) after you have generated those and then attempt to distance from it by asking yourself “what else can be invented?” This will allow you continue thinking as we need to generate a bunch of ideas rather than stop and concentrate on one (which can be potentially wrong or incomplete). In the worst case (you were not able to imagine anything better) you can always return to the fixed idea and continue developing it.

Generating ideas, it is important to invent alternative solutions one after another as long as you got a creative thinking flow. If new ideas don’t popup in your mind by themselves any longer you could use the basic mathematical combinatorial search approach to find new: each topic can be evolved by either a deeper research of different parameters of it or widened by replacing some properties of it / applying the topic to new subjects.

Tuesday, 25 November 2008

Moving toward PhD title: Keep pushing I

One of the most important principles you have to follow working on the PhD thesis – „you should rapidly move the work towards the finish stage (in our case to defence date)”. Practically this topic splits into two. First of all you should permanently invest time into PhD work by writing articles, working on main PhD thesis, reading other authors etc. Secondly you should avoid freezing and waiting for something (like a princess waiting for her prince in a tower).

A requirement to work on articles/work constantly without freezing means that you should not overestimate your geniality (or brightness of what you have done so far) and permanently try to improve it, solve in a better way, find new applications or effects. Quite a common mistake that make majour number of students is submitting an article into a conference and waiting until the decision will be issued. Knowing that the author notification deadline could be up to 3 month after the submission deadline it will mean a lot of time that they simple loose as cannot concentrate of other contributions waiting for reviewers opinion on their latest finding. Moreover, if the work will be accepted then it will prolong the negative effect until the conference finish date, which is 3-4 month later once again.

I especially highlight this problem here, as this text is designed a lot for those that will try to achieve PhD rank in parallel with working somewhere and so it is very easy to switch from working on PhD to the main job tasks been reluctant since „the work is done, lets wait for the answer”. The same holds if you switch to your family rapidly forgetting about PhD activities.
PS: If you are not able to concentrate on new results and contribute efficiently into articles writing, then read at least others authors articles as those could give a lot of new ideas to you and increase your professional level, which is easily visible in your articles.

Tuesday, 18 November 2008

Participating in conferences: Why should you go to the conference after the article is accepted.

At the first glance (may be after you have presented your work once on the conference) it looks like the most correct answer is: THERE IS NO REASONS to go. Fortunately there are still some benefits of visiting conferences and the answer is correct just at the first glance – therefore lets discuss some disappointing moments first.

There are a set of reasons why you can be dissatisfied after your first conference and if you do not understand those in advance (read accept those) you are likely to set expectations too high and disappoint been on site.
First of all, it is likely that the audience of your wonderful presentation (on which you spent several days preparing it) will be just 3 or 4 persons including the session chair. The reason is very simple: results of your work are likely to be interesting for somebody only after this or similar problem will occur in his/her practice, not in advance. Therefore you will rather get references on your article later, when somebody will be searching Internet trying to solve the problem than immediately after you have presented the work on the conference.

Besides it is very hard to understand talks on site been unaware in advance about the specific (narrow) topics of those. Therefore majour part of conference’ participants will prefer to read articles after the conference from the conference proceeding, do it slowly and may be several times. All this decreases your talk potential guests list a lot and sometimes the only persons presented in the auditorium are presenters of other articles within the same session.

Secondly you are a young researcher so people are likely to visit „stars” presentations instead of yours.

Finally, having limited connections to other conference attendees and been the young researcher it is hard to find yourself in any conversations in conference halls and therefore you are likely to feel yourself as a not very welcomed quest.

Despite all of earlier stated problems there are still good reasons to go

Minor:
  • you still could get very interesting points from your auditorium and those could be so crucial that will completely change your work.
  • You can still attend other talks trying to follow basic ideas as sometimes presentation gives much more than article as some people can make really good presentations.


Majour:
  • Conference policy is likely to state that the proceeding will include the work only if it is presented. Although some proceedings are published in advance, some are still not. Besides conference organisers could consider “not show” fact during the next year rejecting your article by default.



PS: Sometimes too high expectations are motivated by PhD students supervisors defining clear goals on publishing articles and having not said anything specific on visiting conferences. Therefore students are left alone and start to imagine something that doesn’t align to the reality at all.

Tuesday, 11 November 2008

Moving toward PhD title: Stress

I don’t want to look like a person positioning himself as a teacher knowing everything and therefore having rights to talk about whatever item. At the same time I would like to talk here about our attitude to failures. An ability to overcome any kind of stress working on doctor work is a key success factor. It is well known that stress produces illness and vice versa. The sick person has restricted abilities to move towards the goal. Probably s/he starts to rush, make wrong decisions, is not able to concentrate on open problems and finally have a limited ability to progress the work.

The first type of stress occurring for students working on PhD thesis is rejections of their articles submitted to conferences. Every student is one hundred percents sure that his/her work is brilliant. The huge amount of efforts and times s/he spent on writing this article just increases his/her believe that this must be rewarded and reviewers will definitely see the geniality of ideas. Unfortunately even for post-docs the acceptance rate for their work is just 50% in average – but they are already skilled and accepted as professionals.

Clearly the majour reason of a stress here - too high expectations. Many students consider each attempt to pass the reviewing process like the last chance to survive and take the reject decision too seriously and personally.

As I pointed earlier you should accept that there are very different reviewers. Moreover you should let them have their own opinion and accept this opinion can easily differ from yours. Consider each reject as an opportunity rather than failure - I have seen cases when an article rejected on very weak conferences have been finally accepted for a serious one. Basically it just indicates that either reviewers were not qualified enough or topics of those conferences were not inline with the main topic of the article.

Summarising, I'd like to give some advices on how to overcome this problem
1. Don’t set expectations too high. You are just studying (although you are not the first year student any longer). Therefore just forget about the article submission after it is posted to the conference – accept internally from the beginning that it will be rejected. It will let you continue working on your doctor work main topics instead of been frozen waiting for an answer. That is a way to decrease stress on rejection and produce some extra happy moments if the article will be finally accepted.
2. Consider the rejection decision as a possibility to improve the work further. Some conferences do post reviewers opinion showing why they disliked the work. Unfortunately ost of those explanations are redicolous as reviewers don’t borther wrtting a good text having rejected the work, but some still could have good points.
3. Don’t forget that the best way not to fail is do nothing, but it also never will lead you to the desired goal. Keep pushing and you will be rewarded.

Friday, 7 November 2008

Moving toward PhD title: Conferences - participation

Any conference is not just a crowd of abstract individuals with mad eyes talking randomly. It is a well-organized event with own, internal rules and practices. Here we describe the conference participation process using ICEIS'08 conference as an example.

Any conference starts for you from a registration desk, which is usually opened from an evening before the conference first day and until the conference last minute. Registration is held in the conference main location, which is either a hotel/conference center or a university. As the desk is constantly open some authors will prefer to appear in the very last minute before the talk (and sometimes it means just the last day of the conference).

The registration process is designed to
1. Inform organisers that you are here (arrived) so
- they will know how many papers are likely to be presented / missed in each session in advance
- the participant can declare that his/her mandatory participation in the conference is fulfilled.

2. Distribute to participants the proceeding (that is the most important book for students as proceedings should be presented to the committee before defending PhD thesis to prove that you fulfilled the published articles requirement) and other conference materials including schedule of sessions, an invoice (which should be presented to the organization funding the visit after you are back). As a rule of thumbs the package includes a pen(cil), a notes book and a bag to make all those gadgets portable.

Usually the entire information on the conference - schedules, changes in it, sessions time and place including names of authors presenting papers in each is located somewhere on the wall in the conference hall or close to the registration desk. The most valuable information is when and where talks are held. It is advisable to check in prior whether your talk is scheduled, does it scheduled to the time you expect it to be in and how you can find the room. Follow the plan or signs and check that you know for sure where your room is located, check it (size, equipment etc) – all that can affect how you organise your talk, where you will have to stand during it etc.

Additionally you will find in halls a set of portable walls (stands) where posters are presented. Notice that they can are also scheduled - for a certain period of time. Authors should post them on the wall no earlier that the start time and organisers will collect them from walls after the finish time, so other posters can be made available.

All talks are divided into plenary talks and ordinal. Plenary talks are given in big rooms by starts or super-stars in computer science (or particular topic of it).

All other talks are clustered into sessions – each hosts 4-6 individuals presentations of 15-30 minutes each, including 5-10 minutes for questions and answers. Sessions are normally organised in parallel in smaller rooms all over the building. Each small room is equipped with a projector, laptop and a big screen. Normally there is a rule that presenters should appear at least 15 minutes before the session starts in order to load their presentation into the conference laptop or ensure that their laptop can be used and is compatible with the projector, and report to the session chair that they are here. Notice that although conference laptops always have either MS Power Point (or some other software used to present the work accordingly to information organisers post on the conference page), sometimes it is not compatible with your version and so organisers will allow you to use your own with a version you know exactly will play slides correctly.
Besides it is always advisable to spent some seconds before the presentation standing on the presenter place (position) to get used the role, check what you can or cannot do (for example how you should walk during the presentation in order to avoid crossing the projecting picture). Btw: one professor told me once that you should stay on the right side from the screen (on the left side from the auditorium perspective).

Traditionally the conference fee includes lunches, so attendees could save time and communicate to each other behind one table instead of loosing the time looking for a good place to eat close to the conference location. If you have no friends or colleges participating in the conference then such lunches will be a perfect way to find contacts or improve relations. That is why quite big tables are normally used instead of small ones. Such lunches are offering very different kind of food, so each standard requirement is satisfied. Besides, those lunches can be a perfect way to try and test the local food.

Finally there are coffee breaks each 4-5 hours (i.e. 2-3 times a day), so between sessions you can recharge. Traditionally tea, coffee or some sort of juice is offered, with cakes or sweets. It can be a standard cake or something specific for this region (I have even seen conferences serving beer – you can imagine it was somewhere in Germany).

Tuesday, 4 November 2008

Locking customers (loyalty prison)

Joel have written a very interesting article where he describes and interprets one novel approach in the business handling customers.

A short introduction into the article located below:
A typical situation for customers of one café is a long line occurring each morning. Once at the morning customers suddenly discovered a new person working for this cafe, who was walking along the line and was collecting orders and transferring them by the phone to the service (and pay) desk.

At the first glance the primary idea of introducing such position is to optimise orders input flow and so optimise service (production of what will be ordered). In reality, here we dealt with a type of product that cannot be really produced in advance in batch and therefore such pre-ordering doesn’t really make sense especially if it is collected from the end of a long line.

Joel states that the only reason of this was to lock customers into this place – earlier it was rather easy to walk out if you see the long line r you waited a bit and then decided to go into other place (may be less suitable for you, but without such lines). Now, a lot of people will rather stay in the line after their order was picked as see it as an ethical obligation to pay for it as it is already in the production (and so they will wait nearly independently of the line size).

In the summary the author offers to think where else such method can be applied to lock the customer into this company service primary in your personal business or even ordinal life.

Saturday, 1 November 2008

How to close (hide) a popup window produced by createPopup

Imagine a situation that you would like to build a menu and therefore you are using createPopup. Now you would like to model something like a menu in MS Excel 2007 where you have a multiple choice and therefore you have to have a button on the menu to be pressed when the selection is complete.

Traditionally the sub-window produced by createPopup will be closed if you press somewhere else. The same will happen if you trigger an action from that window like post back. Unfortunately none of those cases is acceptable for our scenario. The close() method called within that menu-window will produce a dialog asking whether the user would really like to close that window (which is not good for a menu).

Comment: the trivial search in Internet mostly give references to sites talking about popups produced by window.open

The following code should do the trick.

The menu will be produced on clicking on the first row/column cell of the table. The menu contains a combo and a button. The menu is produced by the test function: notice onclick="test(closeAction)" code calling it. Here we also pass as a parameter function that will be closing this window.
Now, in the test function we do
1. Produces the popup using createPopup
2. Assigns the closing function to the button onclick method
3. Store the reference on the popup in this window variable

The close action function consumes this variable and calls hide() .


<html>
<script language="javascript">
var mpopup

function test(clickEv)
{
var wnd= window.createPopup();
wnd.document.body.style.border="solid black 1px";
wnd.document.body.innerHTML="<select><option>a<option>b</select>
<br/><input id="'a1'" type="\">";
wnd.document.getElementById("a1").attachEvent("onclick",clickEv);

wnd.show(150,150,200,50,document.body);
mpopup=wnd;
}

function closeAction()
{
mpopup.hide()
}
</script>

<body>
<table>
<tr><th onclick="test(closeAction)">1kasdkjshd</th>
<th>1kasdkjshd</th><th>1kasdkjshd</th><th>1kasdkjshd</th>
<th>1kasdkjshd</th><th>1kasdkjshd</th><th>1kasdkjshd</th>
</tr><tr>
<td>1kasdkjshd</td><td>1kasdkjshd</td><td>1kasdkjshd</td>
<td>1kasdkjshd</td><td>1kasdkjshd</td><td>1kasdkjshd</td>
</tr><tr>
<td>1kasdkjshd</td><td>1kasdkjshd</td><td>1kasdkjshd</td>
<td>1kasdkjshd</td><td>1kasdkjshd</td><td>1kasdkjshd</td>
</tr></table>
</body> </html>


PS: It is useful to know that you can access objects from such popup window on the main document by using the following reference: parent.document.
getElementById('xxx')
,
where xxx is an id of the object you are accessing

Friday, 10 October 2008

Co-working - rules

Co-working is an interesting trend in the modern life. Once I will return to this topic, but now I just would like to share rules of such community hoping that they will not blame me for stealing their content: my intention is just to show how such community live by publishing the minimal law they figured out for themselves as a typical way to organise such groups:

GROUND RULEZ for Citizen Space

  • we reserve the right to refuse service to anyone. if a key holder asks you to leave, you need to skedaddle
  • no bittorrent, no pr0n
  • clean up your garbage and recycle (blue bins are recycling, dude)
  • you break it, you buy it
  • coworking is an extreme sport, don’t sue us if you break a blood vessel in your forehead dealing with windows, apple’s DRM, or anything else
  • don’t be a dIck

Tuesday, 26 August 2008

Working with customers

Resently I have read a very interesting article written by Joel and so would like to share it with you in case you will find it to be useful: How Hard Could It Be?: Good System, Bad System.

Friday, 15 August 2008

How to add (replace) a row (tr) or a cell (td) withouth using innerHTML in IE

There is one well know restriction in MS browser called IE that makes developers life very much harder than they actually would like to have : it is not possible to add or change a row context using innerHTML property. A lot of architectural changes were done to work around this restriction and also was quite a head-ache in the project I am working on.

Fortunately I recently discovered very interesting and usefull post explaining why it is so and, what is much more important, describing a workaround that exists!! Very much appreciate to such persons!

Here is a small example demonstrating how this works.. you can go to any w3schools.com test environment, paste the code published below and see how it works)

<head>
<script type="text/javascript">
function change()
{
var temp=document.getElementById('3')
temp.innerHTML="<table><tr id='8'><td>qqq2</td><td>3qqq</td></tr></table>"

var rrr=document.getElementById('8')
var tb = document.getElementById('2');

tb.parentNode.replaceChild(rrr, tb);

}

function add()
{
var temp=document.getElementById('3')
temp.innerHTML="<table><tr id='8'><td>qqq2</td><td>3qqq</td></tr></table>"

var rrr=document.getElementById('8')
var tb = document.getElementById('2');

tb.parentNode.insertBefore(rrr, tb);
}
</script>
</head>

<body>
Choose one or another operation (cannot use both in this demo) <br /><input type="button" onclick="add()" value="Add">
<input type="button" onclick="change()" value="Change">
<table id="22" border=1>
<tr id="1"><td>2</td><td>3</td></tr>
<tr id="2"><td>2</td><td>3</td></tr>
</table>

<span id="3" style='visibility:hidden'></span>

</body>

</html>

Notice that you don't have to go need to know what is the parent of the element to be replaced or try to obtain a parent first and then find a right position of the child. It is enough to have a reference to the item to be replaced and then just get it parent by tb.parentNode and provide the element to be replaced as the function parameter (replaceChild).

Tuesday, 13 May 2008

GPS Navigators

An interesting post in case somebody wonders which GPS to buy. Here is at least one person who is happy about his choice:

The Mainstreaming of GPS