Vector Thrusting in Ferrari

Ok, the post title is misleading, just so that my absurd effort sounds cool. What I did was make a fat matchstick-vector-ferrari-fan. I know, sheesh.


This is a gross devaluation of Illustrator's capabilities, and also of my potential. ;) I used to think that the pen tool was a pain, but then I saw this really old video on youtube, in which John Warnock demonstrated the capabilities of one of the earliest versions of Illustrator, and the ease with which he used it caught my fancy. As you can see, I have caught on!

More vector art thrusting its way through to you in the future!

Labels: , ,

Posted by Vivek at 2:58 PM | 1 comments | links to this post read on

Error Code: 0xC0150002 : The application failed to initialize properly. Click on Ok to terminate the application.

I was in the process of making a few changes to a DLL, and whenever I ran the application on any machine other than mine with this new DLL, I got the message : "Error Code: 0xC0150002 : The application failed to initialize properly. Click on Ok to terminate the application.". Now, this error message isn't very nicely documented, even by Microsoft. In fact, their website claims this error is caused because of some Office 2003 -WinXP Pro combination. My error has nothing to do with that.

I eventually found a pointer at one of the forums (due credit, but I can't find the website anymore!). So how to fix it. Do this:
Open both the old DLL that works, and the new DLL you made that refuses to port onto another computer in Visual Studio. Expand the tree and see the Manifest Version. Are they different? Voila! (Assuming they are ofcourse). The problem is that when your runtime MS DLL's (msvcrt family) belong to a VS installation other than yours, your new manifest embedded in the new DLL is unable to use them, hence the crash.

Solution? Recompile the DLL on a machine with the same manifest/VS version. Try again.

Hope this helps!

Labels: , ,

Posted by Vivek at 12:25 PM | 0 comments | links to this post read on

Tech Ouch!

Pain...!!
How ruthless. I will never ever Bank with db in by life!
btw, this is the first document I am embedding from Adobe Share. Some of my previous posts describe the python methods to connect to this site. Here I showcase what it is really capable of. Flash and PDF together!.

Labels: , , ,

Posted by Vivek at 6:04 PM | 0 comments | links to this post read on

Connecting to Adobe Share using Python V2

In the previous post about Python and Adobe Share, I explained the very basic step of communicating with the Share server and obtaining a Authorization token. The next step is to use this authorization token to start a session with the Share server. Lets start with the basics again, no explanations this time.

1. Get the AuthToken
import time, md5, httplib2, xml.dom.minidom, sys
shared = "085960468662212c21417dce2e1XXXXX"
calltime = str(int(time.time()))
datastring = "POST /webservices/api/v1/auth/ apikey=fdc464509d733be99c30c6ccfacXXXXX calltime=" + calltime
sig = (md5.new(datastring+shared).hexdigest())
url = "https://api.share.adobe.com/webservices/api/v1/auth/?apikey=fdc464509d733be99c30c6ccfacXXXXX&calltime="+calltime +"&sig=" + sig
bodydata = '<request><username>vkapoor@adobe.com</username><password>XXXXX</password></request>'
http = httplib2.Http()
response, content = http.request(url , method='POST', body=bodydata)
Doc = xml.dom.minidom.parseString(content)
L = Doc.getElementsByTagName("authtoken")
authToken = str((L[0].childNodes)[0].data)


2. At the end of this, authToken should have the Authorization Token. Now use this to start a new session.

calltime = str(int(time.time()))
datastring = "POST /webservices/api/v1/sessions/ apikey=fdc464509d733be99c30c6ccfacXXXXX calltime=" + calltime
sig = (md5.new(datastring+shared).hexdigest())
url = "https://api.share.adobe.com/webservices/api/v1/sessions/?apikey=fdc464509d733be99c30c6ccfacXXXXX&calltime="+calltime +"&sig=" + sig
bodydata = '<request><authtoken>'+ authToken + '</authtoken></request>'
response, content = http.request(url , method='POST', body=bodydata)
Doc = xml.dom.minidom.parseString(content)
L = Doc.getElementsByTagName("sessionid")
sessionid = str((L[0].childNodes)[0].data)
L = Doc.getElementsByTagName("secret")
secret = str((L[0].childNodes)[0].data)
L = Doc.getElementsByTagName("name")
name = str((L[0].childNodes)[0].data)
L = Doc.getElementsByTagName("level")
level = str((L[0].childNodes)[0].data)

3. At the end of this, some relevant data, such as the SessionID, the new shared secret and other information is available in variables such as sessionid, secret, name, level etc. Other information can be extracted conveniently using XML methods.
Now, let us do something productive. Starting a session has no meaning if you can't do anything. So, just to prove that you can, I'll write a snippet that will list the contents of the root directory. Here goes..

calltime = str(int(time.time()))
datastring = "GET /webservices/api/v1/dc/ apikey=fdc464509d733be99c30c6ccfacXXXXX calltime=" + calltime + " sessionid=" + sessionid
sig = (md5.new(datastring+secret).hexdigest())
url = "https://api.share.adobe.com/webservices/api/v1/dc/?apikey=fdc464509d733be99c30c6ccfacXXXXX&calltime="+calltime +"&sessionid=" + sessionid + "&sig=" + sig
response, content = http.request(url , method='GET')


4.Parse the variable content in order to get relevant information. If all goes well, it should have a list of files, or rather a tree of files in the root of your Share account.

Notice that we recalculate the calltime before each new action. The Share server is ok as long as the calltimes are non decreasing. Also, in the last part, i.e. the directory listing, we use the new shared secret which is unique to a session.

This should get you started. I have used the Query String methods for all of these examples. I have reason to believe that if the Header methods are handled correctly, they should work too. I was not able to get the Header techniques to work, and I especially had doubts about the multipart upload techniques for uploading files. If anyone figures this out, I'd like to glance at the code.

I personally however gave up on using Python, and used the Java API provided by Adobe instead. That works like a dream to say the least, but I'd like to get this working too. Help!

Labels: , ,

Posted by Vivek at 5:42 PM | 1 comments | links to this post read on

Ubuntu over Windows XP!!

Installing linux on your machinge can be a difficult decision for most wanna-feel-like-geeks, especially when the laptop in question is owned not by them, but by their employer, and has elaborate encryption technologies in place at the BIOS level to prevent loss of information in case the laptop is lost. Yes, I'm not talking of a general dilemma, but of my predicament.

Enter Microsoft Virtual PC. This sounded interesting. So much so that I initially tried installing the latest releases of Fedora and Ubuntu on it, without much luck. There weren't many articles on how to do this either. All the help I got was either for Ubuntu 6.06 or Fedora 5. So after a while I gave up.

Yesterday I decided to lower my expectations and install the older version of Ubuntu Linux. It was a rather easy install, and most of my hardware worked like a dream. I had to manually install the soundcard, but the network and display were working fine anyway.

I can't wait for someone to hack Leopard enough so that I can go ahead and install that too.. That will surely be fun. But till then, take a look at these lovely screenshots. This blog post is being written inside Ubuntu by the way, but I will eventually have to add the windows screen shot from windows itself, because I still haven't figured out the host system access from within the virtual machine.

Next stop, VMWare.

AHA!! The advantage of having 2 machines is that I could save on the non host and use the "Windows Share" connection from Ubuntu to access the screenshot. This thing is a dream. I remember the first time I tried to use Samba on Mandrake, I almost wanted to kill myself!


From within Ubuntu



From Windows XP

So, entirely from within Ubuntu. My very first post :) And may I add, that I even saw a bit of Cheeni Kum on Ubuntu Today.. Funny things can bring excitement back in life!

Labels:

Posted by Vivek at 12:39 PM | 1 comments | links to this post read on

My Photo
Name: Vivek Kapoor
Location: Delhi, India

I'm just another face in the crowd. I have the same dreams as every other engineer in the country, the same lifestyle, the same aspirations. Yet, we all feel we are so different. Maybe we are, but we do little to prove it. We do little to live by our convictions, to share our thoughts. I'm trying to do a million things at once. Thinking about my future is more a habit than a hobby, and running an e-commerce website my present biggest obsession. Yet, on paper, I'm just another software professional like so many others.. doing a 11-5 (yeah, lovely timings) job. This blog is testimony to the fact that I may not get very far, like millions of others, but still, I'm different, and hopefully, I'll get around to proving myself.