I've been using http://codeformatter.blogspot.com/
Tuesday, June 18, 2013
apt-get install gives 403 Forbidden on Ubuntu 12.04 LTS EC2 Instance
I was unable to use apt-get install to install nginx on a fresh Ubuntu 12.04 LTS EC2 instance. Apt-get was returning 403 Forbidden for the ec2 ubuntu connections.
The error looked like:
The solution was to run update on apt-get
For more details, see: https://bugs.launchpad.net/ubuntu/+bug/987182
The error looked like:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx-common nginx-full
Suggested packages:
libgd-tools
The following NEW packages will be installed:
libgd2-noxpm libjpeg-turbo8 libjpeg8 libxslt1.1 nginx nginx-common nginx-full
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 403 kB/882 kB of archives.
After this operation, 2,691 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/universe nginx-common all 1.1.19-1ubuntu0.1
403 Forbidden
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/universe nginx-full amd64 1.1.19-1ubuntu0.1
403 Forbidden
Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/universe nginx all 1.1.19-1ubuntu0.1
403 Forbidden
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/nginx/nginx-common_1.1.19-1ubuntu0.1_all.deb 403 Forbidden
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/nginx/nginx-full_1.1.19-1ubuntu0.1_amd64.deb 403 Forbidden
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/n/nginx/nginx_1.1.19-1ubuntu0.1_all.deb 403 Forbidden
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The solution was to run update on apt-get
sudo apt-get update
For more details, see: https://bugs.launchpad.net/ubuntu/+bug/987182
Thursday, November 15, 2012
Productivity Power Tools for Visual Studio 2012 - Syntax Error Highlights
Visual Studio 2012 doesn't have this feature by default, but it is really easy to add.
Go to Tools -> Extensions and Updates
Select the Online tab, and search for "productivity."
Select Productivity Power Tools and choose Download.
![]() |
| Visual Studio Productivity Power Tools Install |
Restart Visual Studio. Now errors will be highlighted in the scroll bar.
![]() |
| Visual Studio Productivity Power Tools - Error Highlighting |
Thursday, August 4, 2011
XML, XSD with Java and JAXB
Reference: http://www.oracle.com/technetwork/articles/javase/index-140168.html
JAXB is part of the JDK, so you shouldn't have to install anything if you already have the JDK installed.
Process Summary:
1. Make xsd file.
2. Compile it using JAXB compiler to create a java files.
3. Compile java files using a java compiler like javac.
4. Create a jar file from the .class files created.
3. Import jar file.
4. Create XML that complies with xsd.
5. Load xml into parent object from jar file.
6. Start using the object
NOTE: Compiler doesn't recognize whitespace notations in xsd file, so xml file must be careful about whitespace regardless of what the xsd indicates
STEP 0:
Make an xsd file.
Given an XML file, we use a Microsoft tool, XSD.exe to generate an XSD (XML Schema) from it.
From the command line, run:
xsd.exe myFile.xml
This will generate myFile.xsd.
STEP 1:
Using JAXB compiler example:
xjc -p myClass.jaxb myClass.xsd
This creates a directory structure of myClass/jaxb/*.java where all the java files are
STEP 2:
Compile example:
javac myClass/jaxb/*.java -d .
(NOTE: the . at the end is the output directory)
STEP 3:
Jar it example:
jar -cf myClass.jar ./myClass/jaxb/*.class
STEP 4:
First make sure to add your jar that you just compiled and import it, as well as importing javax.xml.bind.*; (or specifically what you need)
Now you ready to code. Example below:
//add package name
JAXBContext jc = JAXBContext.newInstance("myClass.jaxb");
//creating this allows a xml file to be mapped to an object
Unmarshaller unmarshaller = jc.createUnmarshaller();
//map to one of the objects that you compiled above
MyClass obj = (MyClass)
unmarshaller.unmarshal(new File( "myClass.xml"));
Tuesday, July 12, 2011
Deploying MT4j Application Java Executable
First we tried just exporting using eclipse, but we ran into errors with "UnsatisfiedLinkError" referencing "no jogl found" under java.library.path.
Next we tried building a FatJar using the Fat Jar Eclipse Plugin located at fjep.sourceforge.net, and able to be downloaded via eclipse from http://kurucz-grafika.de/fatjar . This yielded similar results, however.
To attempt to remedy this, we copied all of the files referencing gluegen and jogl into the java\jdk\jre\lib\ext directory, which removed the UnsatisfiedLinkError for jogl but popped up with another for Win7Touch . After migrating all files we could find referencing that to the ext folder as well, including some that probably had nothing to do with it, we were still at the same error. Not only was this getting messy, but it was getting us nowhere and would be annoying to set up via batch when deploying on a new pc.
Next, we elected to try moving all relevant files into the JAR (.dlls, .jnilibs, basically everything referencing jogl and win7) into the JAR itself, but this didn't fix any errors.
After hunting around on the forums some more in the morning, we found that one solution was to place all of these files in the same directory, on the same level as the jar file, but not *IN* it. This yielded success.
End result: To make the executable jar file run when using mt4j, move all .dlls, .so's, and *.jnilib's into the same directory as the jar, as well as any pictures or sounds your JAR needs to run properly. For us, the relevant .so's and libraries and such were as follows:
gluegen-rt.dll
jogl.dll
jogl_awt.dll
jogl_cg.dll
libgluegen-rt.jnilib
libgluegen-rt.so
libGlulogicMT.jnilib
libjogl.jnilib
libjogl.so
libjogl_awt.jnilib
libjogl_awt.so
libjogl_cg.so
ManyMouse.dll
ManyMouse.so
Win7Touch.dll
Win7Touch64.dll
Thursday, July 7, 2011
MT4j on Android Tablets
You'll need mt4j-core and mt4j-android from:
http://mt4j.googlecode.com/svn/branches/new/
There is also a test app.
To get it to run you will need to link to the Processing core library
for Android, which is here:
http://processing.googlecode.com/svn/trunk/processing/android/core/
You will need to modify the Processing core:
----- MODIFY ----
therion_> if you can try to set clearcolor to true in the
defaultsetttings() method in pgraphicsandroid3d
[5:54 PM] it didn't crash with an exception, though - the
bg flashed on and off really fast, on touch it would stay the bg
color, then on release it would flash
[5:54 PM] i mean clearColorBuffer
[5:55 PM] oh ok
[5:55 PM] but it didnt crash :p
[5:55 PM] trying clearColorBuffer = true; ...
[5:56 PM] it runs! :)
--- END MODIFY ---
http://wiki.processing.org/w/Android
http://mt4j.googlecode.com/
There is also a test app.
To get it to run you will need to link to the Processing core library
for Android, which is here:
http://processing.googlecode.
You will need to modify the Processing core:
----- MODIFY ----
therion_> if you can try to set clearcolor to true in the
defaultsetttings() method in pgraphicsandroid3d
[5:54 PM]
bg flashed on and off really fast, on touch it would stay the bg
color, then on release it would flash
[5:54 PM]
[5:55 PM]
[5:55 PM]
[5:55 PM]
[5:56 PM]
--- END MODIFY ---
http://wiki.processing.org/w/
Newsflash... Reddit is like 9 people
For some reason, it always seemed like Reddit had to be this huge company of programmers and systems administrators or something... it seemed that way in my mind. When I saw their new office space -- I realized I have more programmers sitting in MY office space.
http://blog.reddit.com/2011/07/its-time-for-us-to-pack-up-and-move-on.html
This is somehow empowering for me.
http://blog.reddit.com/2011/07/its-time-for-us-to-pack-up-and-move-on.html
This is somehow empowering for me.
Subscribe to:
Posts (Atom)


