Recently I had to have a few MRIs done. Many times in an MRI more than one view of the body is taken. Most DICOM software will allow you to compare two series and will show lines indicate where each view is on the different image. If you have moved, even 1mm, in the MRI machine these numbers will not match up, making visualization a little difficult with the lines off.
To solve this, I wrote a ruby script. Point it to a folder full of DICOM files and it will allow you to apply an offset to the image plane in a series. You can then visually match features and apply an offset to have a more accurate view of where you are looking at in the body.
When you back up or save emails, one format of doing so is in plain text. The attachment to emails are then stored as base64 encoded data in the file. I wrote this script to find known signatures of emails in base64 attachments and write the images out to the disk.
Simply pass it in the file name you want to read from, or it will read from stdin. This just goes to show Ruby still has very high performance, on my system it was processing a test file at 50+ MB/sec. Full code after the break.
Suppose you have a .7z file, and the archive is “corrupt”. If it is not corrupt, but missing the end of the archive you will get an error. Here is how you can recover at least some of the data from that.
First step is to take the bad file and see how long the archive is supposed to be. The header has a pointer to the end header in it. At offset 0x0C in the start header is the offset of the end header, stored in 8 bytes. The next 8 bytes is the length of the end header, which means the end of the file.
Now that you know how big the file was supposed to be, you can recover all of the data that you have but all of the files will be concatenated together. You don’t know the length of any of them, or even how many separate files there are. The important thing though is that you can extract the data. (more…)
I myself am not much of a Windows developer. I have messed around with winapi code a while ago, and some VB.net course in college, but otherwise have developed in other environments. This may change shortly with this new Windows 10 IoT that has been released. Especially seeing that it has Python and Node.js support, I am excited to see if I can try it out.
I recently came across an article, Writing a Primitive Debugger. It goes through what a debugger does and the basics of how one functions. I was reminded of a debugger I created for Rhomobile’s Rhodes applications.
There are some key differences between the two. As mentioned in the linked article, a debugger needs a few basic functions to be useful. My goal was to have a useful debugger that could stop at a breakpoint, inspect variables, and execute arbitrary Ruby commands. I had read an article about using GDB to debug Ruby and started initially with that approach. At this point, I really wasn’t writing a debugger but a UI for GDB and Ruby. This worked great when running on the iPhone simulator which runs as a process on the local machine, but did not work on mobile devices or any other platform other than the iPhone simulator.
My approach to this was to work at a little higher level. One interesting feature I had come across in Ruby is set_trace_func. When set, the execution steps of the Ruby VM also trigger your trace function. While this does significantly slow the program down, it allows you to accomplish nearly everything you need to do for a debugger. I adapted this to allow debugging of the application via a TCP connection. I may go into detail later, but you can see the original code that I wrote for this here. It has since been expanded to the full debugger that is being used today, adding complexity and integration with an existing IDE.
When working on a development project, there are often tasks or features that are common for that type of project. For example, a website may need user management, or a batch processing system needs a queuing system. One thing you should always keep in mind is to not reinvent the wheel.
There are many libraries available depending on the choice of language and environment. Ruby has a plethora of gems that tackle almost everything imaginable. Python has pip which is very similar to ruby gems. Before you decide to roll your own implementation from scratch, you should always take some time and see what is available. You may be able to find a package that fits your needs and can be reused saving valuable development time.
Here’s an easy twist on omelets. Preheat the oven to 350° F. Halve an avocado, remove the pit, and scoop out some of the green flesh. Break an egg into a bowl and carefully place the yolk in an avocado half, followed by the white (there might not be enough room for all of it). Repeat with the other half. Make sure to season and add your own toppings before baking for 15 to 20 minutes.
After nearly 8 years in mobile development and related work, I am moving on. My passion is for development and while I have many skills in other areas like System Administration, QA, and Support Management, I find that writing code is what really makes me happy.
I have recently joined Monetize Solutions as a Sr. Product and Monetization Engineer working on advanced monetization products. Basically we are creating products that will work with our customers raw data and provide meaningful information that directly affects bottom line revenue. This could mean determining the optimal product inventory configuration or the right cross sell relevant recommendation given the time of year, location demographics, geography, historical sales profile buying behavior, and social sentiment.
I am looking forward to getting back into full time development, and I am excited to be creating products that have direct positive impacts for our customers.