D3, a very powerful, low level charting package, can be difficult to start with. To create just a simple line graph can take a few hours to get off the ground. I found this site which has all a few templates to gets started: http://nvd3.org/ghpages/examples.html.
And, if you're interested in the more advanced D3 visualizations, there's always the Github gallery with some impressive examples:
https://github.com/mbostock/d3/wiki/Gallery.
Sep 12, 2013
Jul 16, 2013
Developer Application Management
Microsoft, Facebook and Google all have different URLs to manage applications.
Facebook is the easiest to remember: https://developers.facebook.com/ (Makes sense). Plus, if you're like me, I usually miss the "s" on developers, yet Facebook is smart enough to redirect me.
Microsoft and Google are both difficult to find. It's a good few minutes each time.
Google also supports the "developers" subdomain, but it presents with too much information. You'd need to know you're looking for the API console.
This will certainly save me a few minutes next time I need to open up a dev server that has a different URL yet still needs the same API access.
jQuery Isotopes
Coworker pointed this out today, jQuery Isotopes. Looks interesting - a bit of eye candy. I'm not sure if I would put this on a website (using their homepage example), but it has a bit of promise for some other purposes. Something I'll keep in mind for future layouts.
Ubuntu Linux Items
Turns out installing items on Ubuntu is extremely easy. The following items turned out to be useful tips (if not also the "proper" way to install additional items).
For PHP, to install additional modules, it's also a "sudo apt-get install php" command. Press the tab key "tab out, as it were, and it will show you the additional items that can be installed.
For Apache, to enable additional modules, instead of modifying the httpd.conf file, the files are separated out into separate directories. Use the "a2enmod" (presumably it's the 'Apache2 enable module' command.
I'm working on getting Ubuntu running Symfony and connecting to the Azure SQL Server database - this is turning out to be quite the challenge. After that nut is cracked, or when I crack and install MySQL instead (using apt-get), I'll post the results here to save the next person some work.
For PHP, to install additional modules, it's also a "sudo apt-get install php" command. Press the tab key "tab out, as it were, and it will show you the additional items that can be installed.
For Apache, to enable additional modules, instead of modifying the httpd.conf file, the files are separated out into separate directories. Use the "a2enmod" (presumably it's the 'Apache2 enable module' command.
I'm working on getting Ubuntu running Symfony and connecting to the Azure SQL Server database - this is turning out to be quite the challenge. After that nut is cracked, or when I crack and install MySQL instead (using apt-get), I'll post the results here to save the next person some work.
Jun 17, 2013
Composer and IIS
When running composer on a site hosted by IIS, the permissions of downloaded files aren't correct. The IIS user is not added, which means all of those packages you just downloaded cannot be used by your application. Fret not, there is a simple command to recursively update permissions (a la chmod, chgrp for linux).
icacls ./ /grant:r IUSR:"(OI)(CI)"F /t /inheritance:e
This took a bit of time to start and finish, but when it was completed, everything was good to go.
icacls ./ /grant:r IUSR:"(OI)(CI)"F /t /inheritance:e
This took a bit of time to start and finish, but when it was completed, everything was good to go.
Jun 3, 2013
Updating Group File Permissions
From the command line:
chmod -R g+w *
This will give recursive group write access to everything. This is useful for me when my Apache is run under one user and my text editor is running under a different user (e.g. the user I logged in as). This will ensure both users, provided they're in the same group, will be able to edit the file.
May 15, 2013
XDebug
So - followed the steps to paste the phpinfo() output into the following webpage: http://xdebug.org/wizard.php. Pasted the instructions, followed the step where it said "add the following line to php.ini".
Few notes:
Few notes:
- XDebug needs the full path.
- The link above will say to just add zend_extension="path to dir". That is wrong. It needs to be the full path, including the directory, to the xdebug dll.
Apr 10, 2013
WAMP MySQL Data File Location
Took me a few minutes to realize the default location for MySQL installation is under C:\wamp\bin\mysql\mysql5.5.20\data, whereas I was expecting it to be located under the C:\ProgramFiles\MySQL\ folder.
Mar 22, 2013
Creating SSL Certificates
Needed to do a bit of searching on the exact steps to create a ".cer" certificate. The default ssl-keygen will generate public and private keys, but this isn't enough for some applications. Some need a signed X509 certificate, which involves a couple extra steps. Note, because the certificate will not be signed by a trusted certificate authority, your browser/application may throw a fit and complain the certificate has errors. If that's the case, you can purchase an actual certificate from Verisign (very expen$ive) or from GoDaddy or some other lesser priced Certificate Authority your computer trusts. (Note, you could become your own certificate authority if you have complete control over the machines using your certificate. In which case, you can sign your own certificates and the browsers/apps will never complain).
Okay - let's get started. The following steps worked for me, and since I'll forget them, I've written them down as I'll likely need them again in the future.
First, run the ssh-keygen tool.
cachedmemory>ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cachedmemory/.ssh/id_rsa):
(Press Enter to accept the default location)
Enter passphrase (empty for no passphrase):
(Enter a passphrase if you like - it's more secure if you do)
Enter same passphrase again:
Your identification has been saved in /home/cachedmemory/.ssh/id_rsa.
Your public key has been saved in /home/cachedmemory/.ssh/id_rsa.pub.
The key fingerprint is:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx cachedmemory@localhost
The key's randomart image is:
You should have two files created in the default folder: id_rsa and id_rsa.pub. These are your private and public keys. Woo hoo!
Okay - lets get cracking on generating that certificate things like browsers use, the X509 certificate.
cachedmemory> cd .ssh
cachedmemory> openssl req -new -x509 -key id_rsa -out unsigned-cert.csr -days 1095
(Enter whatever values you feel are necessary.)
You now have a .csr file you can use. All set!
Mar 7, 2013
Mar 1, 2013
InputStream vs. InputStreamReader
Came across this lovely gem. When reading a binary stream in Java, don't use an InputStreamReader. The issue I ran into is when casting a read() into a byte, the value wasn't always what it should be. Luckily when I ran the checksum it failed, otherwise I problably would have never realized this. Reading the start of each packet was working, as did reading the expected number of bytes after the start of the packet. "Works" is a loose term, it was returning data, just not what I expected.
Feb 25, 2013
Android Database
Seems the process to import an Android database isn't as simple as just dropping a SQLite database into your project. If the database doesn't reside in the "/data/data/<project name>/" directory, Android may have issues reading the database correctly. In addition, the primary key column names need to be "_id". Finally, there needs to be a table in the database that has some additional metadata:
What needs to be determined is how this will work in locales outside en_US.
Final thought is in regards to file size. It seems if you don't give the database a specific file extension, Android prior to 2.3 will not decompress assets in your APK if it is larger than 1MB. The 300k word dictionary looks to be about 6MB, so this would fall under that restriction. I'd have to rename it to something like "mp3", so that the android packaging tool will not try to compress it.
Note, copying the database over to the "/data/data" may only be necessary if the database is intended to be written - if the database is read-only, this may not be necessary. I'll need to investigate this further.
Helpful resources:
CREATE TABLE "android_metadata" ("locale" TEXT DEFAULT 'en_US')
INSERT INTO "android_metadata" VALUES ('en_US')
What needs to be determined is how this will work in locales outside en_US.
Final thought is in regards to file size. It seems if you don't give the database a specific file extension, Android prior to 2.3 will not decompress assets in your APK if it is larger than 1MB. The 300k word dictionary looks to be about 6MB, so this would fall under that restriction. I'd have to rename it to something like "mp3", so that the android packaging tool will not try to compress it.
Note, copying the database over to the "/data/data" may only be necessary if the database is intended to be written - if the database is read-only, this may not be necessary. I'll need to investigate this further.
Helpful resources:
- Description of the asset size limit.
- Thread on Stack Overflow on using existing SQLite databases in an Android app.
Feb 22, 2013
SQLite Foray
In getting started with using Android and local storage, the simplest and most recommended approach is to use the SQLite database. This is the same technology used for HTML5 local storage and has been around for quite awhile.
I was curious about the performance, so I ran a simple test: Query 280k text records (inserted via alphabetical order).
Before I get to the results, here is a tool to avoid that I used: SQLite Database Browser. The reasons are simple:
The best tool I was able to find, which is also free, is SQLite Studio. The website looks a bit sketch. Maybe that's how they roll in Poland, or maybe after they steal my credit card information by installing a keyboard sniffer, they'll be able to give it a facelift.
Before I get to the results, here is a tool to avoid that I used: SQLite Database Browser. The reasons are simple:
- It freezes on you if the syntax is invalid.
- Importing 260k+ records was going to take over an hour (compared to less than 5 seconds with the tool I ended up with)
The best tool I was able to find, which is also free, is SQLite Studio. The website looks a bit sketch. Maybe that's how they roll in Poland, or maybe after they steal my credit card information by installing a keyboard sniffer, they'll be able to give it a facelift.
Managed DNS
The idea of having this blog on Blogger with a name such as "ofieldstest" didn't sit so well with me, especially since I have a few years of my domain name paid for, sitting without a control panel, on bluehost.com. In looking around, what I found out I needed was a way to have someone else manage my DNS for me, since bluehost refuses (unless you want to pay for hosting, which I don't). Alas, there is a way to accomplish this. In essence, you'll need someone who has their own name server to host your DNS records for you.
I found the following, although there may be others.
- GoDaddy offers a service called Off-Site DNS, that allows you to manage DNS for a host registered with a different registrar (in my case, BlueHost).
- Seems NoIP will do something similar for free, although I haven't created an account and haven't confirmed this.
The only thing left now is to fix what is called a "naked domain", e.g. "http://favpix.com" (missing the "www."). I'll need to dig around some more to see how I can address this. Blogger did say "redirect all http://favpix.com/ requests to http://www.favpix.com", but as of now, that doesn't seem to be working.
In all, it took maybe an hour to track this information down including the email to BlueHost to confirm there was no way for me to manage the CNAMEs myself using their nameservers.
A better Android Crash reporting framework?
Haven't had time to dig into the details (the android apps I've published haven't crashed on me), so I cannot say with certainty this is worthwhile. The tool called Android Crash Reporting Application, or ACRA, (grab it on Github here https://github.com/ACRA/acra) does pretty much what the name says. It supposedly offers more details about the crash than what Google will provide by default. It'll post it to a Google Docs document. Not sure about the performance impact (does it wrap all of the code in a huge try/catch statement or does it read from a crash report).
More digging required.
More digging required.
JD GUI
Came across this gem. Rather than fire up eclipse (although it's running most of the time anyway), if you need to quickly view the decompiled java source, there's a free tool called JD-GUI. It's fairly small, offers search capabilities and is very fast. It accepts a class file or a jar file, which is very convenient.
Grab a copy here: http://java.decompiler.free.fr/?q=jdgui
Grab a copy here: http://java.decompiler.free.fr/?q=jdgui
Actionbar Sherlock
Came across this nifty library for Android. This will enable the elegant tab/icon UI present in Jelly Bean on older devices as far back as API v7(Android 2.x - which is over 99% of devices).
As of this posting, only 13% of Android devices are on Jelly Bean - which means dropping in this library to support Android 2.x device will help your app stand out from the pack.
Resources:
As of this posting, only 13% of Android devices are on Jelly Bean - which means dropping in this library to support Android 2.x device will help your app stand out from the pack.
Resources:
- Actionbar Sherlock http://actionbarsherlock.com/
- Android Usage by API Level: http://developer.android.com/about/dashboards/index.html
- Download on Github https://github.com/JakeWharton/ActionBarSherlock
First Post - Getting Started
First post of the new blog. Looks similar to Google Docs. Would like to know how to add a thumbnail - presumably dragging and dropping will work.
Subscribe to:
Posts (Atom)