Update
After some thoughts about what to write… I found that there is little to update… Anyway, this is the front-end that displays my A* algorithm, and since github pages could only server static webpages, I havn’t added my back-end part. If you’d like to play it, go here;
Last week’s Lab of Computer Organization Theory, we are asked to implement something that is constituted of several components, so called a hierarchical design, or rather, top down design.
Anyway, what we have to do is to code serveral basic blocks, and then connect them to form a high-level design.
type and subtype
While coding, I found that, I was constantly repeating to write something like,
which is quiet ugly indeed. I was just repeating myself.
I want to spare my life, so I wonder if there is a 2-dimensional array of std_logic, then I can return to the happay days that I have in C, std_logic a[4][15].
There is quiet a lot resources online, so without many pain, I found myself the User defined types. Since what I want is an array of std_logic_vector, I wrote these,
-- alias for std_logic_vector(15 downto 0)subtype std_logic_16 isstd_logic_vector(15downto0);
-- Array type for std_logic_vectortype std_logic_ar16 isarray(naturalrange <>) of std_logic_16;
Now, I can write
a: in std_logic_ar16(3 downto 0);
The life is wonderful again! However, the VHDL is different from high-level language, the array type is different from ordinary type. If you want to declare an array, you must use array type, the same goes for nonarray type. In detail, if you want to have a single instance of std_logic_vector, you must write a: std_logic_16 , instead of a: std_logic_ar16.
That seems to be evident, however, I once thought the std_vector_array(15 downto 0) as the int [15], so I made a stupid mistake regarding std_vector_array as the int. anyway…
for generate
While I was mapping the components, the same thing happened again. Say, I have to connect 16 and gates with 16 out ports of an unit. I need to write the port map thing for 16 times…
The people created VHDL aren’t fools, they have for generate.
于是我欢心雀跃的跑到我Ubuntu下面开始编译。。。为了追求速度,用了多线程编译。没曾想,电脑太渣,只听风扇飞转,过一会机器就黑了。。。大概是CPU过热保护断电了吧,呃,Linux的桌面版对于个人用户来说还是有些渣啊。思考再三后我决定还是在虚拟机下搞这件事情,因为看到SO上有不少人说搞内核这个东西可能会”Messing up your production machine”
More Update操**的,3.16也挂了。。。不过还好3.16显示了Kernel Panic的信息,”not syncing out of memory and no killable processes”关掉虚拟机,把内存增加设置到1G就解决问题了。想必之前3.13没成功也是这个问题,但是3.13当时没有显示Kernel Panic信息。我也不清楚,还是推荐大家用3.16或者其他的稳定版本吧。
Wow, time flies. It’s already my final weekly blog post for GSoC 2014. So much fun I’ve had, Great journey indeed.
I had uploaded my final presentation this week, here. And eared a few “likes”, hoho. However, except for that, I didn’t do much work this week. Well… if you listen carefully in my presentation, you may find out that I had some issue with my throat. It’s inflammation, and it got worse after the day I uploaded the post. So anyway, I took a week-off resting.
Well, actually not just resting… my ubuntu was broken, again. So I took this chance upgraded all my stuff, including the tools that supports this blog.
However, it’s already in “documentation period”, and my project has less stress on that. The works will be done soon hopefully.
So, all in all, I had a sick week :/ , but the work will be done pretty.
Well the title should be “The 12th Week of GSoC”, if I went the usual way. Hahhhh, well, tomorrow will be the official soft pencil down date. It means, I need to stop coding, and working on perfecting documentations.
It’s really been a great unforgettable experience, It’s my first time working on a real-life project, and first time to work for a open-source community, specifically such a great community that with such a noble objective. “Write codes, save lives”!
Originally, I want to publish this blog later after I have done my final presentation. However it’s not done yet, and it’s close to the end of this week. I have to publish my weekly-blog.
Anyway, the presentation will be done in tomorrow for sure.
Well, summarize as usual.
Done
Fixed few issues, ID-48, ID-51, and working on ID-52, ID-55 now.
Done the specification work for the RESTful APIs with Elliott(Well, most works is done by him, I’m not experienced…)
Wow it’s almost close to the end of this years GSoC. So many exciting experiences, and new knowledge learnt.
The OAuth
Anyway, I’ve been working on the OAuth and the RESTful APIs this week. Yes, we used the OAuth 2.0 to achieve SSO service. As it is a widely-used protocol, it will be more easy for us to implement authorization logic for other OpenMRS apps.
And also we plan to build a OAuth based RESTful API system. So we can open the access to the OpenMRS ID, however, we have very very very little information to share. But maybe in the future the Dashboard will have more information, and become a central data storage system. Apps can store the user related information in Dashboard, and let others to access.
Well, that’s only my own vision about the far future.
So, summarize briefly as usual!
What I Have Done
Perfected the patch for ID-48, and learnt something new about the Mongoose.
Learnt the OAuth 2.0 a bit, and began to refactor the OAuth module with Mongoose.
After lots of testing and fixing, I’m proudly annoucing that the new Dashboard has been released. Check it out https://id.openmrs.org
Well, the new Newdashboard hasn’t changed so much on the outside, so you may find no much differences. Except for the email selecting part of profile page. Most the chagnges have happened in the backend. We’ve replaced the data storage to Mongo, for more possibility in the future.
However, I can’t say this upgrading is smooth. We’ve used lots of time on adapting to legacy datas. The new data model is somehow relatively easy to design and implement. But I have to change a lot for backward compatibility, and this process had spent lots of our time, about weeks.
Anyway, briefly summarize.
Done
Collaborate with Elliott to deploy the 2.0.
Fix some bugs of it.
Checked and discussed the RESTful APIs with Elliott.
Oh, another week of delay… Deployment is somehow exciting and painful.
In this week Elliott and I have tried to do a trial deployment on the staging server. However, we encountered lots of problems that delayed our schedule. Like duplicate emails we found earlier, and also updating other functional modules to adapt the new Dashboard.
I updated the Migrator, and added a verifier for verifing the correctness of the migration, then made PRs for globalnavbar and sso module. And left oauth and groups module for Elliott to work on, sorry for that, but I really don’t know how to test these two…
And after we tested the migrator separately on our own machine. Things should be fine now, we think… However, you know, another issue poped out. Last time, due to the famous heartbleed bug of OpenSSL, our people made a global password reset for all acount. Specifically, setting all accounts password as empty, as OpenLDAP won’t authenticate a user with empty password. And that is definitely a thing that I have never thought about :/
Not only this, when I was checking this issue, I found that I used wrong password hashing algo, SHA rather than SSHA. And this is because of the different slapd.conf between production server and dev machine.