Archive for category technology
New Session Cookie Created on Every Page Refresh in CodeIgniter
Posted by Randy in Linux Stuff, Programming, technology, Web Development on May 7, 2012
CodeIgniter's way of handling session data is slick, and I use it a lot. However on my current project, I went overboard on my configuration changes and accidentally caused a problem that had me scratching my head for a few minutes. I noticed that session data wasn't persisting and that my sessions table (I opted for database storage of my session data) was filling up with new rows of session data every time I reloaded a page in my project. This prevented my login functionality from working.
The solution to my problem was a configuration detail. I had set $config['cookie_domain'] to the domain name I will eventually use for the site. CodeIgniter didn't like this because my development environment is not on that domain. So it was creating new cookie/session data every time I loaded a page. The problem made sense after I thought about it for a bit. I remembered that I had set a few extra settings in the config, and sure enough, that was the winner.
The problem can happen when other settings are incorrect as well. So pay close attention to those settings, and look there first if you notice that sessions are being created on every page load.
Clickbank Analytic Software
Posted by Randy in Internet, Internet Money, Programming, technology, Web Development on April 21, 2012
There's a site called cb-analytics.com which has always been a great resource for information on Clickbank products. However, I've always found the site hard to navigate and I wanted a site that showed some of the "hot" clickbank products. So, I've written a site called cbniches.com which I hope will rectify these issues.
The site shows all the latest products in each category and shows gravity and earnings per sale. It also has a graph for each product to show gravity over time. I think this will be pretty helpful to affiliate markets looking for new products to promote on Clickbank. Check it out at http://cbniches.com. I wrote it with the latest version of my LavaPHP framework, another product I've been developing as open source. LavaPHP can be found on github, but it's still in early development.
How to play a Bluray movie in Debian Testing
Posted by Randy in Movies, technology, Uncategorized on March 23, 2012
This HOWTO will probably work in Debian Squeeze, but the system I used was running Wheezy. Hopefully this HOWTO won't be necessary long, but until then, it's a very good way to watch blurays on your Linux system. This will also work for Mac and Windows, with some changes, but this is strictly a Debian Testing HOWTO.
There are various ways to do what we need to do. Some require you to rip the bluray first and then watch the resulting MKV. I found that this took 15 minutes or so on my 8-core system. However, there is another method which uses a program called makemkv and pipes the output to VLC using a network stream. I found this method on the web but found that some of the links were screwed up, so I couldn't use it directly. After some searching, I found the script I was looking for and edited it slightly. For your convenience, I'm rewriting the HOWTO and including the files all here.
First of all, create a folder called makemkv in your home directory. You can use a different location if you prefer but for simplicity we'll put it in our home directory.
mkdir ~/makemkv
Change into that directory and grab two zipped tarballs from the makemkv author. Then extract them.
cd ~/makemkv wget http://www.makemkv.com/download/makemkv_v1.7.2_bin.tar.gz wget http://www.makemkv.com/download/makemkv_v1.7.2_oss.tar.gz tar xvf makemkv_v1.7.2_bin.tar.gz tar xvf makemkv_v1.7.2_oss.tar.gz
Yes you need both the bin and the src.
Make sure you have some dependencies.
sudo apt-get install build-essential libc6-dev libssl-dev libgl1-mesa-dev libqt4-dev curl vlc
In other HOWTOs, the curl dependency isn't mentioned. You need curl for the script we will download later.
Next compile and installed the two packages.
cd makemkv_v1.6.12_oss make -f makefile.linux sudo make -f makefile.linux install cd ../makemkv_v1.6.12_bin make -f makefile.linux sudo make -f makefile.linux install
Finally download and run playBluRay.sh. I gzipped it so the site wouldn't complain about the file type. Just gunzip it and execute it.
It will run makemkvcon to decrypt the bluray and setup a stream on port 51000 of your computer. Then it will start vlc using the network stream. It may take a few moments to load it all.
Note that sometimes a bluray won't play correctly even with this method or you may see a behind the scenes segment before the movie. I had this problem on my Rambo bluray.
Marte Engine TextEntity setColor()
Posted by Randy in Java, Programming, technology, Uncategorized on March 2, 2012
I've been focusing on learning Java game development over the last couple of weeks. I've found that lwjgl, Slick2d, and Marte Engine are great libraries to help with the basic game functionality. In fact, they take a lot of the work out of it and leave you to focus on the game design itself. For instance, the Marte engine comes with a great resource manager class that helps keep up with images, sounds, and spritesheets for your game. Marte also has some good classes which extend Slick2D's Entity class which can be very useful.
The one I'm going to focus on is TextEntity, which is great for adding text to the screen. However, I was unable to change the text color for the text directly using the setColor() method from the Entity class, which is inherited by TextEntity. There's not a lot of documentation for either Slick2D or Marte, so I wasn't exactly sure if I was missing something or if I had found a problem with the class.
Fixing the problem is rather simple. I created a new class called MyText and copied everything over from the TextEntity class. I could have extended it, but instead I wanted a new class which extends Entity directly. Then I changed the code in the render() method as such:
1 2 3 4 5 6 7 8 9 10 11 | public void render(GameContainer container, Graphics g) throws SlickException { if (font == null) { font = container.getDefaultFont(); this.calculateHitBox(); } g.setFont(font); if (text != null) { g.setColor(this.getColor()); g.drawString(text, x, y); } } |
I then added a new constructor that takes a color as the fifth parameter:
1 2 3 4 5 6 | public MyText(float x, float y, Font font, String text, Color color) { super(x,y); this.setColor(color); this.font = font; this.setText(text); } |
This gave me the functionality I was after. This change basically just sets the graphics object color property to the Entity's color property, which is exactly how I thought it should have worked to begin with.
If there's a better way to accomplish this, let me know. I'm only intermediate with Java.
Edwin Jagger DE89 Review
Posted by Randy in Boring Stuff, Hardware, technology on January 27, 2012
I've written about my experience with double-edge safety razors in the past, but I felt that I should write another post detailing the advantages of the safety razor over the popular multi-bladed razors of today. You could chalk it up to growing old, but I've realized that a lot of the technology of the past was superior to the modern technology. This is especially true when it comes to razors.
Shaving is one of those fascinating things for the young. I remember wondering what it was like to shave when I was a kid. It seemed like fun. As far back as I can remember, my dad used an electric razor. So, when I grew up, that was what I first tried. Electric razors are great when you first buy them. They don't shave as close as other methods but they are at least simple. I found that after a few uses, they more or less just ripped the hairs out rather than cutting them. They also require lots of cleaning and make a mess.
So I switched to Gillette Sensors. This was one of the first multi-bladed razors, and I liked the results. I would get ingrown hairs and slight irritation, but I was younger then and it didn't bother me that much.
Then I started losing my hair, and I promised myself at an early age that if I ever started going bald that I would help the process along and just start shaving my head. So I started shaving myhead. My hair is very thin on top now but the sides are still rather thick, which makes shaving difficult in those areas at times.
The problem with shaving your head is that ingrown hairs suck on your head. So that problem became a major issue for me. I started reading around and found that the cause of the ingrown hairs was the type of razor I was using.
Multi-bladed razors were advertised as having the ability to raise the hair up before cutting it. This process causes the hair to be cut below the top of the skin. When the hair grows back, it can sometimes grown back into the skin at an angle, especially in areas where the grain of the hair goes in various directions. I have this problem on the back and front of my neck. If I let these hairs grow out, I would have an areas of curly hair.
So I switched to a double-edged safety razor back in September, and I've had great results.
Advantages
Safety razors are good solid tools. The one I bought is chrome and very solid. It is a Edwin Jagger DE89. It is the first and probably the only safety razor I'll ever buy. I bought it, a bar of shaving soap, 100 blades, and a badger hair brush for around $50. That sounds like a high price for a razor, but I've not had to spend another dime on shaving equipment since then and I won't have to buy anything for at least another year. The soap lasts a long time and costs $1.00 a bar. I'm still using the same bar after more than four months. I've only used around 20 blades or so. One hundred blades costs around $9. I still have a lot of blades and they should last me another year or two. Ten bucks for enough blades to last you over a year is awesome, especially if you've ever bought a 4-pack of MachIII or Fusion blades. So cost is a major advantage with the double-edge.
Another advantage is the shaving experience. I take my time. I pay close attention to the shaving process, and it's relaxing. To me, it turned shaving from a chore into a rewarding activity. I lather up my face, make a single pass with the grain, wash it off, lather again, make another pass against the grain, wash it off, and then do the same thing for my head. I get a super close shave.
I also don't have a problem with ingrown hairs like I used to. I rarely cut myself. There was one occasion when I was shaving my upper lip sideways and ended up cutting my lip a bit, but that was my fault. I don't shave my upper lip very often, and normally keep a Van Dyck. So I wasn't very used to shaving there. Other than that, I get very little nicks from shaving with a double edge. The main thing is to keep your face wet, your razor wet, add lots of lather, and don't press on the razor. Also, take your time.
Disadvantages
"Take your time" leads me to the one and only disadvantage of shaving with a double-edge razor. It takes longer. Shaving with a multi-bladed razor is really fast. With a double-edge you need to take your time and concentrate on what you are doing more. Some people won't like this, but I very much enjoy the added time. I usually take around 10 - 15 minutes to shave my face and head. I always finish it off with an aftershave lotion (non-alcohol-based).
Conclusion
Like old keyboards, old razors are just better than their modern equivalents. You don't have to buy an old razor though. There are plenty of manufacturers still making double-edge razors. The Edwin Jagger DE89 was the razor I selected after much shopping online, and I have been very pleased with it. The weight makes it feel like a knife through butter when you first shave with it. You may be used to pressing down with a Mach III or Fusion razor. With the Edwin Jagger it'll feel like you are just letting it cut the hair for you at first. I was very happy with it from the beginning, and it hasn't let me down since. I strong recommend it. There are many good double-edge razors on the market, but I know you can't go wrong with the Edwin Jagger DE89.
Best Godaddy Alternative Registrar
Posted by Randy in Internet, Internet Money, Networking, technology, Web Development on January 27, 2012
Many of you may be die-hard GoDaddy users. GoDaddy's support of the SOPA has led many people to start looking for a new registrar, including myself. After a boycott, GoDaddy broke away from its support of SOPA. However, their initial support for the legislation was enough to turn me away. I do not plan to do any further business with them and will be slowly migrating my existing sites over to another registrar as time goes by.
In my search for a GoDaddy alternative, I found that I really like NameCheap.com. They offer good rates on domain transfers and registration. I also like their control panel much better than GoDaddy. They don't have as much up-selling going on when you register a domain. I always found that annoying about GoDaddy. I also didn't care for GoDaddy's domain manager. Once, I tried out GoDaddy's Windows hosting as well. It was terrible. So if you are looking for a viable alternative to GoDaddy, you should definitely give NameCheap.com a try.
Rosewill RK-9000 Review 2
Posted by Randy in Hardware, technology on January 26, 2012
After a day of using the RK-9000, I can say that it is definitely the best keyboard I've ever typed on. The couple of problems I had with it in part 1 of my review have cleared up. There have been no more issues with sticking keys, and I've gotten used to the smaller keyboard size. The smaller size has actually increased my typing dexterity and speed.
I've been using http://typeracer.com to calculate my overall WPM speed. I started our around 58, which is a bit low for me. Since then, I've brought my average typing speed up to around 75wpm which is about the same as my Unicomp average. However, I've spiked on some races with 89wpm, and it's not uncommon for me to hit over 80wpm in a race. This is faster than my Unicomp speeds. I think the speeds will gradually increase as I become more accustomed to using the RK-9000.
Overall, this may be the best $100 my sister has ever spent on me. The keyboard is an absolute joy.
Big Brother Google
Posted by Randy in Internet Money, technology, Uncategorized on January 25, 2012
1984 came and went, and it turned out that Orwell's version of the future didn't come to pass, at least on the date he foretold. Privacy is a huge issue on the internet and sometimes there's a grey line when it comes with gathering user data. Google recently announced that it will be consolidating all the data it tracks about you across all of its products. It does this with the best intentions, both for you and for itself, but this can be a dangerous power that I'm not sure I trust Google with.
It isn't that I have anything against Google or that I have anything to hide myself. However, Google having this amount of data can be very hazardous with our government in the state that it's in. There's way too many tyrannical laws being passed through Congress these days. The government has given itself way too much power and we're just waiting around for the executive to be elected that will make full use of this power.
Google's data collection may be great for their ad revenue plans, but the chance of the government deciding that it wants access to any or all of that data is what upsets me. Google should reconsider the amount of data it retains from it's users. This is essential to eliminating the "big brother" factor.
Rosewill RK-9000 Review 1
Posted by Randy in Hardware, Reviews, technology on January 25, 2012
Well, as promised, I will be reviewing the Rosewill RK-9000 mechanical keyboard. However, I will be doing the review in multiple parts. This is the initial review of the keyboard.
I just received it via UPS and I was too excited to video the unboxing. So, I'll not be doing that. Let's start with the pros of this keyboard.
Pros
This is perhaps the best keyboard I've ever typed on. If not the best, then it's right up there with my Unicomp Endurapro and my friend Lynn's WASD keyboard. The Cherry MX blue switches are very nice. This is the first keyboard I've owned with blue switches. They are responsive and loud. I wanted a quieter keyboard, but much of the loudness of this keyboard comes from bottoming out. It's actually relatively quiet if you learn to not bottom out. I find that the hardest key for me to not bottom out is the space bar, and it's very loud when bottoming out.
The keyboard is slightly smaller than my Unicomp, which places the keys closer together. This will be listed as a con as well, but I should point out that it will probably make the keyboard a bit faster to type on. It actually has a real good action for my hands. I find that I don't have to stretch my fingers nearly as far to type on it. So this is both a pro and a con. The con being that I have to get used to it.
The overall action of the keys is very pleasing. They are light compared to my Unicomp, and they require less of a keypress distance. I'm going to spend a lot of time practicing to not bottom out the keys. There's a very noticeable difference in the sound, when they aren't bottoming out. I'm usually a very powerful typer. My uncle commented that I sounded like I was going to push the keys through the bottom of his laptop, when I was working on it. If you are forceful with your typing, the blue switches will be a good switch on which to practice lighter typing.
The LED lock indicators on this keyboard are a nice blue color and are easy to see. The keyboard is 100% mechanical, unlike the Corsair Vengeance K90 which uses rubber dome keys for the F keys, the macro G keys, and the group of keys right above the arrow keys (insert, home, page up, etc).
The font used for the lettering on this keyboard is very pleasant. The letters are largish. The bracket keys are very distinct. For a programmer this is actually important. The square braces have a wider look than most keyboards. This makes it easy to distinguish them from the normal parenthesis keys. However, most programmers know where these keys are located, so it's not really a big deal. I just thought it was nice that you could tell what the keys are better.
The red metal base plate is a nice touch. It adds contrast to the keyboard and makes a rather dull keyboard actually look unique. The detachable mini USB cord is a nice touch as well. As an aside, I think that it would be awesome if this keyboard could function as a wireless bluetooth device and charge through the detachable USB cable, similar to a PS3 controller. I would love to see this as an option for a keyboard, but I've not seen one yet. The USB cable is very sturdy. Rosewill ships these keyboards with both a USB and a PS2 cable, both connect to the same mini USB port on the keyboard. I connected mine via PS2 because I wanted to try out the full NKRO (n-key rollover) of the keyboard. This means that every key on the keyboard can be pressed at once, and it will send to the OS. This keyboard does, in fact, have NKRO, and it works very well.
The normal keyboard height adjustment feet (or legs, can't remember the term) on the bottom are perfect. Some people have suggested that these are too short, but I find their height to be perfect for my typing. In fact, I've often found that most keyboards are too low when the feet are collapsed and too high when they are extended. This keyboard seems to have been built with the sweet spot in mind. I love it.
Typing on this keyboard is a dream. I've been coming up with new things to say in this post just so I can type on it more. It's giving me a nice chance to check it out. It's not all good though, as I'm about to point out.
Cons
There are at least two things about this keyboard that I didn't care for right away, but both of these issues may go away with time.
First of all, the keys are closer together than I'm used to, as I describe earlier. The ctrl, win, and alt keys are smaller than usual, especially the ctrl key. This places these keys in an abnormal position for me. I'm sure I'll soon get used to them, but this has presented a problem with alt + tab. I have a problem getting my left thumb over to the alt key without looking. Like I said, this keyboard is a little bit smaller than your normal keyboard.
Lastly, I've had a couple of incidents with stuck keys. The "A" key and the "T" both have stuck, once each. I was unable to replicate the issue, and I think that it's just a case of the switches getting broke in. I'll report more about this issue in a later review, but I don't think this is going to be an ongoing thing. I've been using the keyboard for about two hours now and that's only happened those two times. Plus, that only happened within the first 10 minutes of typing on it.
Conclusion
This is by far a better keyboard than many higher priced keyboards. I returned a Corsair Vengeance K90 to get this keyboard, and I'm glad I did. The K90 had a nice back light on the keys and some very well designed media keys, but the macro software was lacking which made the macro keys a terrible "feature", and there were other issues that I wrote about in my review of that keyboard. This keyboard is more like what I was looking for. It's a joy to type on and it just works. It doesn't have extras like a back light or media keys, but it makes up for that in build quality and performance. Since I'm going to be using this keyboard in Linux primarily later on anyway, I can say that the media keys aren't that big of a deal. I usually set up keyboard shortcuts in Linux that perform the volume, play, and pause functions. The main thing I wanted was a good quality keyboard, and this is definitely it. If you are coming from a rubber dome keyboard, this will feel completely different. It will take a day or two to get fully used to it, but after that, you won't turn back. These things are a dream to type on.