Breaking compatibility

I’ve just upgraded my server to a new version of Ubuntu. The downside is that this breaks all sorts of configurations. PHP has been upgraded to version 7 , which is nice, I guess. But Nginx didn’t like it much. For some odd reason it would keep one of my sites online and process it correctly through the CGI gateway, but not the other. Due to some caching business.

I’ve taken my filteresting blog offline for the time being. since runing SVRGN will suffice for now and its probably best to focus here for now.

 

Speaking of filteresting. I recently had another realisation when it comes to compatibility. The first version of filteresting was an experiment to learn to write ruby on rails. That was on version 2.3. In the meantime version 6.0 has been released… I’ll be fair and mention that 3.x.x is still supported. But learning a modifying framework is a serious pain in the ass. As slow-moving as PHP has been over the years, I’m considering it an advantage from this point forward.

Rails is notorious/loved for its “convention over configuration” principle. Which basically means that if the developers decide to do something different in a future version of rails, you, the user, have to swallow it or create your own workaround.

Over the years this has annoyed me to no end, as updates would randomly break my compatibility to the framework I was building on. Which is complete madness.

On more than one occassion have I thought : “If only you could code websites in C”. Being too much of a noob the last time I thought that, I’ve found out in the meantime that I actually can! Passing a path through CGI and interpreting it in my own program would save me a bazillion hours of time, with no fear of the framework shattering the ground my program is standing on. C Libraries tend to be quite slow to mature. Seeing the advantage yet?

Since filteresting has been standing still for a long time, this is the path I’m thinking of taking. I can either update all of my ruby code and be done by the time the new framework is released , or write my own interpreter. Doing some regex with that and replacing tags much like the “yield” tag in RoR/HAML makes a lot of sense in my head.

 

This means that I’m contemplating picking up filteresting again, more seriously this time.  That will make this  my fourth complete rewrite. With all the experience I’ve gotten in writing OO in C# , I can make a lot of headway by programming everything in C++ and doing the design in HAML, this whole project should become feasible once again, without me learning the nitty-gritty details of Ruby or Rails.

It would also make it really fast as compared to PHP/Ruby. Nice.

 

EDIT: I still to fix the darn rewrite rules in my new webserver…just not today.

Posted in Ruby | Leave a comment

Workaround

One has to appreciate the irony that has occurred. I’ve neglected this blog once again, shortly after my last post, my blog went offline

After installing updates on my machine. The downtime lasted 2189 hours and I completely missed it in the meantime… shame on me. In my last post I wrote about not having time to read and catch up because there is so much to read and the list was only growing.

Not anymore!

I’ve travelled more and moved to a new city in the meantime, which is great, but there’s a catch. I’ll only be living here for a few months, and DSL contracts are 1 year+ all over the country. For those who catch on quick, I’m not going to pay the steep set-up fee and monthly costs if the next inhabitant is going to use most of it. Which means I’m ‘surfing the net’ my 64kbit/s GPRS connection!

This requires a shift in my internet usage, to say the least. I’m upping my caffeine intake by going to cafe’s to use wifi, and currently I’m sitting in the local public library updating all my devices and pushing some files over the wifi. But at home, I have to really intentionally use the internet, and decide what I’m going to read. Simply because loading a few pages in the background is just not feasible! I’m writing most of this at 9 PM, with a few WGET scripts running in the background, because surfing and downloading images simultaneously is not possible. Image boards? Click a link and start making some coffee…

I’ve been transported back into the 90’s , where you could actually see an image load in front of your eyes. Which is nice for a minute of nostalgia, but is now daily reality. With the average webpage having become larger than a doom install, a lot of my time is spent waiting. Navigating to a page, waiting for it to load, moving to the next, etc. etc. and then to click a link and see it download in BYTES per second

For a person whose average consumption is about 150 GBytes a month, this is a switch. I have scripts running in the background doing my downloading at night.

The upside is that I have alot of time to read and catch up on years of things I’ve missed in the meantime. Additionally, I’m coding again, both professionally (40h/week!) and for personal fun and profit.

Given the fact that I have to move again this year, we’ll see how long my good intentions last. But for now, moving has given me more time on my hands and I’m already getting bored. So far, so good.

Posted in Random | Leave a comment

Reading Resolutions

2016 will be here in a matter of hours, so a lot of people are looking back and looking forward at this point in time. There are a lot of “best of 2015” posts flying around the internet, and there is some seriously interesting stuff in there. But the thing that I’ve noticed is that I barely have any time to read those lists.

I’m a hackernews junkie and frequently read it when I log in at work and everything is still booting. Today I found this gem:

Crap, I still have a tab open in my browser at home for the best things and stuff of 2013[1] that I haven’t made it though, and I first opened it when it was posted in late 2013! I really need to devote some time to that, since I’ve bothered to make sure that tab survived for two years.  Source

I used to be this guy and had TONS of tabs open in firefox. Just starting firefox would take a minute and eat up all my memory because I was loading over 100 tabs, and I just added more and more every day. At work a colleague of mine introduced me to Pocket, and I’ve used it a lot in 2015. It keeps my tab-count down and my PC fast, because I can just save everything to pocket and read it later.

Except I don’t.

Last time I checked I had over 832 links in my Pocket account, and that’s just for this year alone! I assure you, that number is not going to go down soon.

The problem is that there’s just too much content out there. Using a search engine gets you half way to finding the good bits, but for reading the news, I still spend a lot of time filtering the stuff I want to read rather than actually reading them. Every time I’m confronted with this, I know I’m on the right track with developing filteresting. It’s just a ton of work and I’m lacking in the time/energy department. 2016 is more promising in that regard.

Filtering out the good stuff is a pain and hard to optimise, but as for optimising my reading: I’ve treated myself to a Kindle and I’ve actually finished my first book within a week. I’ve wanted to read more often for a long time, but for some reason using my iPad just wasn’t it. I was really torn between a Kobo Glo HD and a Kindle Paperwhite, but went with the latter. After testing them in the store, the Kindle was a lot more responsive, even though the Kobo Glo HD had an amazing screen and font legibility. Going low-tech really cuts out the crap and now I can use a machine solely for reading, and I’m suddenly tearing through pages. I would definitely recommend it to avid readers.

So at least I’ve made and I’m already sticking to one resolution: Reading more often. Coding, running and writing more often are also in the same list, but we’ll see. I’m off to a good start at least.

Happy new year everybody

Posted in Random | Leave a comment

Sign of life

It’s not like I’ve been neglecting this website or my projects. I just haven’t posted much…

There’s been some work on my hobby projects, and some mock-up writing to go along with that for here. But the truth is, I’ve made a far more important discovery to share.

Discipline is hard

While some of you may think ” no shit” , I’ve always been in the camp of people that said “even if you don’t like it, you just have to do some things you don’t like, so get on with it”.
And then I got a full-time job and a new perspective to go along with that. Real life has gotten in the way of pretty much every hobby I have, including but not limited to programming and running.

I always assumed that time would be the issue, but that’s simply not all there is to it. The issue is energy. After being bored 8+ hours at work, nobody has the focus to program or the energy to go for an 8 mile run. If you do, respect.  Additionally, boredom scatters my brain. I have a lot of things I want to post here, but just can’t seem to coax them in a logical form for normal people to read. Hence, incoherent posts like these…

Honestly though, this post is just a sign of life. It’s now December and I don’t dare to check when my last post was put up here. 2015 sucked; I had a legendary vacation in which I visited more countries in 3 weeks than I’d been to in total at that time, but that’s about it. The rest mainly involved being tired and waiting for cool shit to happen (spoiler alert: they don’t, unless you make them happen).

2016 Is much more promising, with a new job, a new vacation, a new appartment and hopefully more posts.

Posted in Random | Leave a comment

Oops , or “Cypress FX2 read/write quirks”

I just spent the better part of three months worth of weekends tinkering with my FPGA board. The problem there is not so much that it costs a lot of time. The problem is that I only just found out that USB REALLY doesn’t like small packets. And by small I mean bulk transferring 1 byte over the line.

I bought a ZTEX 2.13d FPGA board a few months ago, which uses the cypress FX2 chip for usb data transfer. My first idea was to just send one byte, modify that (lowercase the ascii content) and send it back. The logic is that if loopback works, read and write both works. This makes sense right? And yet this failed over and over and over again. I could either write 1 byte N times, before the fifo buffers would fill up, or not be able to write and read only the data generated device-side, but not loop it back.

After writing 1 byte, the FPGA would read it and I could do this a couple more times (as I had 4 FIFO’s) after which libusb would say 0 bytes were written. Since this is a loopback scenario, it was because the FX2 to host buffers were filled! Hence the data could not flow from the FX2 to the FPGA and the write FIFO was clogged as well. Since the FPGA could not write out, as all my reads from the FX2 chip failed when I tried to read the byte back, for reasons unknown until today.

The trick, I found out, is to instruct libusb to read 512 bytes or more from the FX2 on the side of the pc. (I.e. the size of the fifo buffer of the endpoint) Since the library returns the amount of bytes it reads anyway, you’re supposed to read equal or more than is actually in the fifo buffer on the device! This way the fx2 can flush the entire buffer and re-arm it, instead of doing who-knows-what.

 

So I pretty much feel like an idiot right now. Especially since the matrix-multiplication AND transfer sigmoid verilog code was already working, but I was stalled by not getting the data on the device. I’ve read up on a lot of verilog lately, and have gotten a more firm understanding of how things translate from software to hardware. Given how hard it is to find good verilog tutorials, I’m seriously considering writing my own, even though I’m a noob.

But for now, at least there’s progress and I can log off early this weekend (I’m serious). Next up is setting up the DDR3 RAM and block RAM to store matrices and include them in the loopback. When that works, multiplying the matrices is next and performing some element-wise operations on them. By that time my weird little hobby should be ready for some benchmarking vs my regular pc and raspberry pi. The expectancy is that I can outperform my core i7 950 at some point in terms of processing time. The lag over the usb cable does make a bottleneck though, so I need to work on pushing as many bits as possible as fast as possible to make up for it.

But for now, at least there’s progress and I can log off early this weekend.

(I’m serious)

 

Posted in FPGA | Tagged , , , | Leave a comment

Quicky

Yes, I updated/lost all my content once again. But its nothing that can’t be missed really. I’ve neglected this blog for far too long in favor of studying. And to be honest, there wasn’t much to tell anyway.

But that is almost coming to an end! I’m thinking about what to write my thesis on. I’ve had some success in testing whether I can write about Neural Networks, but that is kind of hard to sell for a Finance thesis. Too bad you can’t just tinker and get paid for it in the meantime.

Posted in Random | Leave a comment