Search Results

Search found 82 results on 4 pages for 'rpi awesomeness'.

Page 1/4 | 1 2 3 4  | Next Page >

  • RPi and Java Embedded GPIO: Using Java to read input

    - by hinkmond
    Now that we've learned about using Java code to control the output of the Raspberry Pi GPIO ports (by lighting up LEDs from a Java app on the RPi for now and noting in the future the same Java code can be used to drive industrial automation or medical equipment, etc.), let's move on to learn about reading input from the RPi GPIO using Java code. As before, we need to start out with the necessary hardware. For this exercise we will connect a Static Electricity Detector to the RPi GPIO port and read the value of that sensor using Java code. The circuit we'll use is from William J. Beaty and is described at this Web link. See: Static Electricity Detector He calls it an "Electric Charge" detector, which is a bit misleading. A Field Effect Transistor is subject to nearby electro-magnetic fields, such as a static charge on a nearby object, not really an electric charge. So, this sensor will detect static electricity (or ghosts if you are into paranormal activity ). Take a look at the circuit and in the next blog posts we'll step through how to connect it to the GPIO port of your RPi and then how to write Java code to access this fun sensor. Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: It all begins with hardware

    - by hinkmond
    So, you want to connect low-level peripherals (like blinky-blinky LEDs) to your Raspberry Pi and use Java Embedded technology to program it, do you? You sick foolish masochist. No, just kidding! That's awesome! You've come to the right place. I'll step you though it. And, as with many embedded projects, it all begins with hardware. So, the first thing to do is to get acquainted with the GPIO header on your RPi board. A "header" just means a thingy with a bunch of pins sticking up from it where you can connect wires. See the the red box outline in the photo. Now, there are many ways to connect to that header outlined by the red box in the photo (which the RPi folks call the P1 header). One way is to use a breakout kit like the one at Adafruit. But, we'll just use jumper wires in this example. So, to connect jumper wires to the header you need a map of where to connect which wire. That's why you need to study the pinout in the photo. That's your map for connecting wires. But, as with many things in life, it's not all that simple. RPi folks have made things a little tricky. There are two revisions of the P1 header pinout. One for older boards (RPi boards made before Sep 2012), which is called Revision 1. And, one for those fancy 512MB boards that were shipped after Sep 2012, which is called Revision 2. So, first make sure which board you have: either you have the Model A or B with 128MB or 256MB built before Sep 2012 and you need to look at the pinout for Rev. 1, or you have the Model B with 512MB and need to look at Rev. 2. That's all you need for now. More to come... Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Hooking Up Your Wires for Java

    - by hinkmond
    So, you bought your blue jumper wires, your LEDs, your resistors, your breadboard, and your fill of Fry's for the day. How do you hook this cool stuff up to write Java code to blink them LEDs? I'll step you through it. First look at that pinout diagram of the GPIO header that's on your RPi. Find the pins in the corner of your RPi board and make sure to orient it the right way. The upper left corner pin should have the characters "P1" next to it on the board. That pin next to "P1" is your Pin #1 (in the diagram). Then, you can start counting left, right, next row, left, right, next row, left, right, and so on: Pins # 1, 2, next row, 3, 4, next row, 5, 6, and so on. Take one blue jumper wire and connect to Pin # 3 (GPIO0). Connect the other end to a resistor and then the other end of the resistor into the breadboard. Each row of grouped-together holes on a breadboard are connected, so plug in the short-end of a common cathode LED (long-end of a common anode LED) into a hole that is in the same grouping as where the resistor is plugged in. Then, connect the other end of the LED back to Pin # 6 (GND) on the RPi GPIO header. Now you have your first LED connected ready for you to write some Java code to turn it on and off. (As, extra credit you can connect 7 other LEDs the same way to with one lead to Pins # 5, 7, 11, 13, 15, 19 & 21). Whew! That wasn't so bad, was it? Next blog post on this thread will have some Java source code for you to try... Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Writing Java code to blink LED

    - by hinkmond
    So, you've followed the previous steps to install Java Embedded on your Raspberry Pi ?, you went to Fry's and picked up some jumper wires, LEDs, and resistors ?, you hooked up the wires, LED, and resistor the the correct pins ?, and now you want to start programming in Java on your RPi? Yes? ???????! OK, then... Here we go. You can use the following source code to blink your first LED on your RPi using Java. In the code you can see that I'm not using any complicated gpio libraries like wiringpi or pi4j, and I'm not doing any low-level pin manipulation like you can in C. And, I'm not using python (hell no!). This is Java programming, so we keep it simple (and more readable) than those other programming languages. See: Write Java code to do this In the Java code, I'm opening up the RPi Debian Wheezy well-defined file handles to control the GPIO ports. First I'm resetting everything using the unexport/export file handles. (On the RPi, if you open the well-defined file handles and write certain ASCII text to them, you can drive your GPIO to perform certain operations. See this GPIO reference). Next, I write a "1" then "0" to the value file handle of the GPIO0 port (see the previous pinout diagram). That makes the LED blink. Then, I loop to infinity. Easy, huh? import java.io.* /* * Java Embedded Raspberry Pi GPIO app */ package jerpigpio; import java.io.FileWriter; /** * * @author hinkmond */ public class JerpiGPIO { static final String GPIO_OUT = "out"; static final String GPIO_ON = "1"; static final String GPIO_OFF = "0"; static final String GPIO_CH00="0"; /** * @param args the command line arguments */ public static void main(String[] args) { FileWriter commandFile; try { /*** Init GPIO port for output ***/ // Open file handles to GPIO port unexport and export controls FileWriter unexportFile = new FileWriter("/sys/class/gpio/unexport"); FileWriter exportFile = new FileWriter("/sys/class/gpio/export"); // Reset the port unexportFile.write(GPIO_CH00); unexportFile.flush(); // Set the port for use exportFile.write(GPIO_CH00); exportFile.flush(); // Open file handle to port input/output control FileWriter directionFile = new FileWriter("/sys/class/gpio/gpio"+GPIO_CH00+"/direction"); // Set port for output directionFile.write(GPIO_OUT); directionFile.flush(); /*--- Send commands to GPIO port ---*/ // Opne file handle to issue commands to GPIO port commandFile = new FileWriter("/sys/class/gpio/gpio"+GPIO_CH00+"/value"); // Loop forever while (true) { // Set GPIO port ON commandFile.write(GPIO_ON); commandFile.flush(); // Wait for a while java.lang.Thread.sleep(200); // Set GPIO port OFF commandFile.write(GPIO_OFF); commandFile.flush(); // Wait for a while java.lang.Thread.sleep(200); } } catch (Exception exception) { exception.printStackTrace(); } } } Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Sensor Connections for Java Enabled Interface

    - by hinkmond
    Now we're ready to connect the hardware needed to make a static electricity sensor for the Raspberry Pi and use Java code to access it through a GPIO port. First, very carefully bend the NTE312 (or MPF-102) transistor "gate" pin (see the diagram on the back of the package or refer to the pin diagram on the Web). You can see it in the inset photo on the bottom left corner. I bent the leftmost pin of the NTE312 transistor as I held the flat part toward me. That is going to be your antenna. So, connect one of the jumper wires to the bent pin. I used the dark green jumper wire (looks almost black; coiled at the bottom) in the photo. Then push the other 2 pins of the transistor into your breadboard. Connect one of the pins to Pin # 1 (3.3V) on the GPIO header of your RPi. See the diagram if you need to glance back at it. In the photo, that's the orange jumper wire. And connect the final unconnected transistor pin to Pin # 22 (GPIO25) on the RPi header. That's the blue jumper wire in my photo. For reference, connect the LED anode (long pin on a common anode LED/short pin on a common cathode LED, check your LED pin diagram) to the same breadboard hole that is connecting to Pin # 22 (same row of holes where the blue wire is connected), and connect the other pin of the LED to GROUND (row of holes that connect to the black wire in the photo). Test by blowing up a balloon, rubbing it on your hair (or your co-worker's hair, if you are hair-challenged) to statically charge it, and bringing it near your antenna (green wire in the photo). The LED should light up when it's near and go off when you pull it away. If you need more static charge, find a co-worker with really long hair, or rub the balloon on a piece of silk (which is just as good but not as fun). Next blog post is where we do some Java coding to access this sensor on your RPi. Finally, back to software! Ha! Hinkmond

    Read the article

  • Named my RPi 512MB @jerpi_bilbo

    - by hinkmond
    To keep our multiple Raspberry Pi boards apart from each other, I've now named my RPi Model B w/512MB: "jerpi_bilbo", which stands for Java Embedded Raspberry Pi - Bilbo (named after the Hobbit from the J.R.R. Tolkien stories). I also, set up a Twitter account for him. You can follow him at: @jerpi_bilbo He's self-tweeting, manual prompted so far (using Java Embedded 7.0 and twitter4j Java library). Works great! I'm setting him up to be automated self-tweeting soon, so watch for that... Here's a pointer to the open source twitter4j Java library: download here Just unzip and extract out the twitter4j-core-2.2.6.jar and put it on your Java Embedded classpath. Here's how @jerpi_bilbo uses it to Tweet with his Java Embedded runtime: import twitter4j.*; import java.io.* public final class Tweet { public static void main(String[] args) { String statusStr = null; if ((args.length 0) && (args[0] != null)) { statusStr = args[0]; } else { statusStr = new String("Hello World!"); } // Create new instance of the Twitter class Twitter twitter = new TwitterFactory().getInstance(); try { Status status = twitter.updateStatus(statusStr); System.out.println ("Successfully updated the status to: " + status.getText()); } catch (Exception e) { e.printStackTrace(); } } } That's all you need. Java Embedded rocks the RPi! And, @jerpi_bilbo is alive... Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Big Data and Java Technology

    - by hinkmond
    Java Embedded and Big Data go hand-in-hand, especially as demonstrated by prototyping on a Raspberry Pi to show how well the Java Embedded platform can perform on a small embedded device which then becomes the proof-of-concept for industrial controllers, medical equipment, networking gear or any type of sensor-connected device generating large amounts of data. The key is a fast and reliable way to access that data using Java technology. In the previous blog posts you've seen the integration of a static electricity sensor and the Raspberry Pi through the GPIO port, then accessing that data through Java Embedded code. It's important to point out how this works and why it works well with Java code. First, the version of Linux (Debian Wheezy/Raspian) that is found on the RPi has a very convenient way to access the GPIO ports through the use of Linux OS managed file handles. This is key in avoiding terrible and complex coding using register manipulation in C code, or having to program in a less elegant and clumsy procedural scripting language such as python. Instead, using Java Embedded, allows a fast way to access those GPIO ports through those same Linux file handles. Java already has a very easy to program way to access file handles with a high degree of performance that matches direct access of those file handles with the Linux OS. Using the Java API java.io.FileWriter lets us open the same file handles that the Linux OS has for accessing the GPIO ports. Then, by first resetting the ports using the unexport and export file handles, we can initialize them for easy use in a Java app. // Open file handles to GPIO port unexport and export controls FileWriter unexportFile = new FileWriter("/sys/class/gpio/unexport"); FileWriter exportFile = new FileWriter("/sys/class/gpio/export"); ... // Reset the port unexportFile.write(gpioChannel); unexportFile.flush(); // Set the port for use exportFile.write(gpioChannel); exportFile.flush(); Then, another set of file handles can be used by the Java app to control the direction of the GPIO port by writing either "in" or "out" to the direction file handle. // Open file handle to input/output direction control of port FileWriter directionFile = new FileWriter("/sys/class/gpio/gpio" + gpioChannel + "/direction"); // Set port for input directionFile.write("in"); // Or, use "out" for output directionFile.flush(); And, finally, a RandomAccessFile handle can be used with a high degree of performance on par with native C code (only milliseconds to read in data and write out data) with low overhead (unlike python) to manipulate the data going in and out on the GPIO port, while the object-oriented nature of Java programming allows for an easy way to construct complex analytic software around that data access functionality to the external world. RandomAccessFile[] raf = new RandomAccessFile[GpioChannels.length]; ... // Reset file seek pointer to read latest value of GPIO port raf[channum].seek(0); raf[channum].read(inBytes); inLine = new String(inBytes); It's Big Data from sensors and industrial/medical/networking equipment meeting complex analytical software on a small constraint device (like a Linux/ARM RPi) where Java Embedded allows you to shine as an Embedded Device Software Designer. Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Sensor Hardware for Java Enabled Interface

    - by hinkmond
    Now here's the hardware you'll need to make a Java app interface with a static charge sensor connected to your Raspberry Pi via the GPIO port. It means another Fry's run of course. That's not too bad during Christmas since you can browse all the gadget and toys while doing your shopping for sensor hardware for your RPi. Here's a your shopping list: 1 - NTE312 JFET N-channel transistor (this is in place of the MPF-102) 1 - Set of Jumper Wires 1 - LED 1 - 300 ohm resistor 1 - set of header pins Grab all that from Fry's or your local hobby electronics shop and come back here for how to connect it together. Oh, and don't go too crazy buying all the other electronic toys and gadgets that catch your eye because of the holiday displays at the store. Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Connecting LEDs

    - by hinkmond
    Next, we need some low-level peripherals to connect to the Raspberry Pi GPIO header. So, we'll do what's called a "Fry's Run" in Silicon Valley, which means we go shop at the local Fry's Electronics store for parts. In this case, we'll need some breadboard jumper wires (blue wires in photo), some LEDs, and some resistors (for the RPi GPIO, 150 ohms - 300 ohms would work for the 3.3V output of the GPIO ports). And, if you want to do other projects, you might as well by a breadboard, which is a development board with lots of holes in it. Ask a Fry's clerk for help. Or, better yet, ask the customer standing next to you in the electronics components aisle for help. (Might be faster) So, go to your local hobby electronics store, or go to Fry's if you have one close by, and come back here to the next blog post to see how to hook these parts up. Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Sensor Reading using Java Code

    - by hinkmond
    And, now to program the Java code for reading the fancy-schmancy static electricity sensor connected to your Raspberry Pi, here is the source code we'll use: First, we need to initialize ourselves... /* * Java Embedded Raspberry Pi GPIO Input app */ package jerpigpioinput; import java.io.FileWriter; import java.io.RandomAccessFile; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; /** * * @author hinkmond */ public class JerpiGPIOInput { static final String GPIO_IN = "in"; // Add which GPIO ports to read here static String[] GpioChannels = { "7" }; /** * @param args the command line arguments */ public static void main(String[] args) { try { /*** Init GPIO port(s) for input ***/ // Open file handles to GPIO port unexport and export controls FileWriter unexportFile = new FileWriter("/sys/class/gpio/unexport"); FileWriter exportFile = new FileWriter("/sys/class/gpio/export"); for (String gpioChannel : GpioChannels) { System.out.println(gpioChannel); // Reset the port unexportFile.write(gpioChannel); unexportFile.flush(); // Set the port for use exportFile.write(gpioChannel); exportFile.flush(); // Open file handle to input/output direction control of port FileWriter directionFile = new FileWriter("/sys/class/gpio/gpio" + gpioChannel + "/direction"); // Set port for input directionFile.write(GPIO_IN); directionFile.flush(); } And, next we will open up a RandomAccessFile pointer to the GPIO port. /*** Read data from each GPIO port ***/ RandomAccessFile[] raf = new RandomAccessFile[GpioChannels.length]; int sleepPeriod = 10; final int MAXBUF = 256; byte[] inBytes = new byte[MAXBUF]; String inLine; int zeroCounter = 0; // Get current timestamp with Calendar() Calendar cal; DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS"); String dateStr; // Open RandomAccessFile handle to each GPIO port for (int channum=0; channum Then, loop forever to read in the values to the console. // Loop forever while (true) { // Get current timestamp for latest event cal = Calendar.getInstance(); dateStr = dateFormat.format(cal.getTime()); // Use RandomAccessFile handle to read in GPIO port value for (int channum=0; channum Rinse, lather, and repeat... Compile this Java code on your host PC or Mac with javac from the JDK. Copy over the JAR or class file to your Raspberry Pi, "sudo -i" to become root, then start up this Java app in a shell on your RPi. That's it! You should see a "1" value get logged each time you bring a statically charged item (like a balloon you rub on the cat) near the antenna of the sensor. There you go. You've just seen how Java Embedded technology on the Raspberry Pi is an easy way to access sensors. Hinkmond

    Read the article

  • RPi and Java Embedded GPIO: Java code to blink more LEDs

    - by hinkmond
    Now, it's time to blink the other GPIO ports with the other LEDs connected to them. This is easy using Java Embedded, since the Java programming language is powerful and flexible. Embedded developers are not used to this, since the C programming language is more popular but less easy to develop in. We just need to use a dynamic Java String array to map to the pinouts of the GPIO port names from the previous diagram posted. This way we can address each "channel" with an index into that String array. static String[] GpioChannels = { "0", "1", "4", "17", "21", "22", "10", "9" }; With this new dynamic array, we can streamline the main() of this Java program to activate all the ports. /** * @param args the command line arguments */ public static void main(String[] args) { FileWriter[] commandChannels; try { /*** Init GPIO port for output ***/ // Open file handles to GPIO port unexport and export controls FileWriter unexportFile = new FileWriter("/sys/class/gpio/unexport"); FileWriter exportFile = new FileWriter("/sys/class/gpio/export"); for (String gpioChannel : GpioChannels) { System.out.println(gpioChannel); // Reset the port unexportFile.write(gpioChannel); unexportFile.flush(); // Set the port for use exportFile.write(gpioChannel); exportFile.flush(); // Open file handle to port input/output control FileWriter directionFile = new FileWriter("/sys/class/gpio/gpio" + gpioChannel + "/direction"); // Set port for output directionFile.write(GPIO_OUT); directionFile.flush(); } And, then simply add array code to where we blink the LED to make it blink all the LEDS on and off at once. /*** Send commands to GPIO port ***/ commandChannels = new FileWriter[GpioChannels.length]; for (int channum=0; channum It's easier than falling off a log... or at least easier than C programming. Hinkmond

    Read the article

  • Quickie Guide Getting Java Embedded Running on Raspberry Pi

    - by hinkmond
    Gary C. and I did a Bay Area Java User Group presentation of how to get Java Embedded running on a RPi. See: here. But, if you want the Quickie Guide on how to get Java up and running on the RPi, then follow these steps (which I'm doing right now as we speak, since I got my RPi in the mail on Monday. Woo-hoo!!!). So, follow along at home as I do the same steps here on my board... 1. Download the Win32DiskImager if you are on Windows, or use dd on a Linux PC: https://launchpad.net/win32-image-writer/0.6/0.6/+download/win32diskimager-binary.zip 2. Download the RPi Debian Wheezy image from here: http://files.velocix.com/c1410/images/debian/7/2012-08-08-wheezy-armel/2012-08-08-wheezy-armel.zip 3. Insert a blank 4GB SD Card into your Windows or Linux PC. 4. Use either Win32DiskImager or Linux dd to burn the unzipped image from #2 to the SD Card. 5. Insert the SD Card into your RPi. Connect an Ethernet cable to your RPi to your network. Connect the RPi Power Adapter. 6. The RPi will boot onto your network. Find its IP address using Windows Wireshark or Linux: sudo tcpdump -vv -ieth0 port 67 and port 68 7. ssh to your RPi: ssh <ip_addr_rpi> -l pi <Password: "raspberry"> 8. Download Java SE Embedded: http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html NOTE: First click accept, then choose the first bundle in the list: ARMv6/7 Linux - Headless EABI, VFP, SoftFP ABI, Little Endian - ejre-7u6-fcs-b24-linux-arm-vfp-client_headless-10_aug_2012.tar.gz 9. scp the bundle from #8 to your RPi: scp <ejre-bundle> pi@<ip_addr_rpi> 10. mkdir /usr/local, untar the bundle from #9 and rename (move) the ejre1.7.0_06 directory to /usr/local/java That's it! You are ready to roll with Java Embedded on your RPi. Hinkmond

    Read the article

  • Will people respect a Masters of Science in IT w/software engineering concentration from RPI?

    - by twneale
    Here's my thing: I got my undergraduate degree in political science, then a law degree. Then I figured out that I love programming and I'm pretty good at it too. It's fun and rewarding enough for me that I'd prefer to do it for a living over almost any form of pure law practice. So I'm looking at getting a masters degree to put some weight behind a possible career switch. If I actually want to develop software (web, in particular), would people in programming circles respect a master's of science in IT? Specifically, consider as an example the MS in IT from Rensselaer Polytechnic Institute (with a concentration in software engineering). Here's the home page: http://www.rpi.edu/IT/graduate/masters_program.html In particular, I mean to draw a contrast between IT as specifically contemplated by the RPI masters program (an interdisciplinary tech/business program) and other MS degrees in computer science or software engineering that focus more on the science and technical aspects. I guess I want to make sure that other programmers would respect my credentials and not consider me as different or underqualified based on the connotations of the phrase "IT". I believe RPI has an unimpeachable reputation for hard science, and the program seems excellent, but it still matters to me how people in industry would perceive it.

    Read the article

  • Oh snap! My RPi was upgraded to 512MB! Woo-hoo!

    - by hinkmond
    I ordered a Raspberry Pi Model B (256MB) over 4 months ago on backorder. When it finally came I saw it was upgraded to the new half a gig model! Woot! But, all was not perfect. Gary C. told me the shipped configuration of the new RPi models didn't have the right firmware for 512MB, and I had to upgrade the start.elf in the /boot directory to recognize all of the 512MB RAM. I did a "free" command, and sure enough saw only 240MB. Sadness. But, Gary gave me a copy of his start.elf which worked after some trail and error. For anyone ordering the new RPi Model B w/512MB, here are the steps to get you going with full 512MB RAM: sudo apt-get update --fix-missing sudo apt-get upgrade --fix-missing # NOTE: This step takes at least a couple hours on a # fast network wget https://raw.github.com/raspberrypi/firmware/\ 164b0fe2b3b56081c7510df93bc1440aebe45f7e/boot/\ arm496_start.elf sudo mv /boot/start.elf /boot/orig-start.elf sudo mv arm496_start.elf /boot/start.elf sudo reboot free total used free shared buffers cached Mem: 497768 210596 287172 0 16892 169624 -/+ buffers/cache: 24080 473688 Swap: 102396 0 102396 So of course this means... (drumroll) there is now 498MB available for the Java Embedded heap! java -Xmx400m -version java version "1.7.0_06" Java(TM) SE Embedded Runtime Environment (build 1.7.0_06-b24, headless) Java HotSpot(TM) Embedded Client VM (build 23.2-b09, mixed mode) Yeah, baby! Hinkmond

    Read the article

  • RPi and Java Embedded: Hard-Float Support is Here!!!

    - by hinkmond
    You wanted Java Embedded with Hardware Floating Point support to install on a default Raspian environment for your Raspberry Pi? Well, you just got your wish. Merry Christmas! See: Developer JDK 8 for ARM w/Hard-Float Here's a quote: The Java SE 8 Developer Preview Release for ARM including JavaFX (JDK 8) on Linux has been made available at http://jdk8.java.net. The Developer Preview is provided to the community to get feedback on the ongoing progress of the project. Developers can start developing applications using this build of Java SE 8 on an ARM device, such as the a Raspberry Pi. It's a regular JDK (Java SE 8 preview) for your Raspberry Pi, so you should note this means there is a javac (and the other typical JDK tools) available to compile your Java apps right there on the device! Woot! I'll cover step-by-step instructions how to do that in a future blog post. Stay tuned... Hinkmond

    Read the article

  • How to Stich to Image objects in Java

    - by Imran
    Hi, I have a scenario in which i`m getting a number of tiles (e.g.12) from my mapping server. Now for buffering and offline functions I need to join them all back again so that we have to deal with 1 single image object instead of 12. I ve tried to do it without JAI my code is below. package imagemerge; import java.awt.*; import java.awt.image.*; import java.awt.event.*; public class ImageSticher extends WindowAdapter { Image tile1; Image tile2; Image result; ColorModel colorModel; int width,height,widthr,heightr; //int t1,t2; int t12[]; public ImageSticher() { } public ImageSticher (Image img1,Image img2,int w,int h) { tile1=img1; tile2=img2; width=w; height=h; colorModel=ColorModel.getRGBdefault(); } public Image horizontalStich() throws Exception { widthr=width*2; heightr=height; t12=new int[widthr * heightr]; int t1[]=new int[width*height]; PixelGrabber p1 =new PixelGrabber(tile1, 0, 0, width, height, t1, 0, width); p1.grabPixels(); int t2[]=new int[width*height]; PixelGrabber p2 =new PixelGrabber(tile2, 0, 0, width, height, t1, 0, width); p2.grabPixels(); int y, x, rp, rpi; int red1, red2, redr; int green1, green2, greenr; int blue1, blue2, bluer; int alpha1, alpha2, alphar; for(y=0;y<heightr;y++) { for(x=0;x<widthr;x++) { //System.out.println(x); rpi=y*widthr+x; // index of resulting pixel; rp=0; //initializing resulting pixel System.out.println(rpi); if(x<(widthr/2)) // x is less than width , copy first tile { //System.out.println("tile1="+x); blue1 = t1[rpi] & 0x00ff; // ERROR occurs here green1=(t1[rpi] >> 8) & 0x00ff; red1=(t1[rpi] >> 16) & 0x00ff; alpha1 = (t1[rpi] >> 24) & 0x00ff; redr = (int)(red1 * 1.0); // copying red band pixel into redresult,,,,1.0 is the alpha valye redr = (redr < 0)?(0):((redr>255)?(255):(redr)); greenr = (int)(green1 * 1.0); // redr = (int)(red1 * 1.0); // greenr = (greenr < 0)?(0):((greenr>255)?(255):(greenr)); bluer = (int)(blue1 * 1.0); bluer = (bluer < 0)?(0):((bluer>255)?(255):(bluer)); alphar = 255; //resulting pixel computed rp = (((((alphar << 8) + (redr & 0x0ff)) << 8) + (greenr & 0x0ff)) << 8) + (bluer & 0x0ff); } else // index is ahead of half way...copy second tile { blue2 = t2[rpi] & 0x00ff; // blue band bit of first tile green2=(t2[rpi] >> 8) & 0x00ff; red2=(t2[rpi] >> 16) & 0x00ff; alpha2 = (t2[rpi] >> 24) & 0x00ff; redr = (int)(red2 * 1.0); // copying red band pixel into redresult,,,,1.0 is the alpha valye redr = (redr < 0)?(0):((redr>255)?(255):(redr)); greenr = (int)(green2 * 1.0); // redr = (int)(red2 * 1.0); // greenr = (greenr < 0)?(0):((greenr>255)?(255):(greenr)); bluer = (int)(blue2 * 1.0); bluer = (bluer < 0)?(0):((bluer>255)?(255):(bluer)); alphar = 255; //resulting pixel computed rp = (((((alphar << 8) + (redr & 0x0ff)) << 8) + (greenr & 0x0ff)) << 8) + (bluer & 0x0ff); } t12[rpi] = rp; // copying resulting pixel in the result int array which will be converted to image } } MemoryImageSource mis; if (t12!=null) { mis = new MemoryImageSource(widthr, heightr, colorModel, t12, 0, widthr); result = Toolkit.getDefaultToolkit().createImage(mis); return result; } return null; } } now to check the my theory Im trying to join or stich two tiles horizontaly but im getting the error : java.lang.ArrayIndexOutOfBoundsException: 90000 at imagemerge.ImageSticher.horizontalStich(ImageSticher.java:69) at imageStream.ImageStream.getImage(ImageStream.java:75) at imageStream.ImageStream.main(ImageStream.java:28) is there some kind of limitation because when stiching two images of 300 x 300 horizontally it means the resulting image will be 600 x 300 ... that would make 180000 index size but its giving error at 90000, what am I doing wrong here

    Read the article

  • Problem importing Firefox bookmarks to Chromium

    - by RPi Awesomeness
    I would like to switch from Firefox to Chromium (it seems to be faster for my system) and I have a large number of bookmarks I would like to import into Chromium. I looked at this question: Can I sync bookmarks between Firefox and Chromium? but that seemed to be specific to Firefox Sync, which I don't have. I just want to import my bookmarks from Firefox into Chromium. However, when I go to the Customize and Control button and then choose the option Import Bookmarks and Settings under the Bookmarks menu item, it gives me this: I have Firefox and Chromium as up to date as the official repositories (I believe), so I really have no clue what is going on. I have attempted to import directly from HTML, but it only imports the first set of bookmarks, nothing beyond that (where all of the bookmarks I really want are.) Can I import the JSON Firefox backup file into Chromium, or am I stuck manually entering all of these bookmarks into Chromium? Thanks!

    Read the article

  • Lubuntu Desktop messed up for logged in user, but not for guest

    - by RPi Awesomeness
    I recently upgraded my laptop from Lubuntu 12.04 to 14.04.1 and the upgrade process seemed to go fine. However, when I went to login as my normal user, I encountered an issue. The background loaded up, but none of LXDE or LXPanel showed up, leaving me with an empty desktop and nothing else except two errors. I thought that this was weird, so I just figured something had been messed up and would be fixed by a reboot. But it wasn't. I then tried logging in as guest, and it's just fine. I checked the ~/.xsession-errors file (for my main user, not guest, did it via TTY1) and this is what I got: Script for ibus started at run_im. Script for auto started at run_im. Script for default started at run_im. init: Unable to register as subreaper: Invalid argument init: lxsession main process (1649) killed by TERM signal init: Disconnected from notified D-Bus bus init: job dbus failed to stop init: job upstart-dbus-session-bridge failed to stop init: job upstart-dbus-system-bridge failed to stop init: job upstart-file-bridge failed to stop I also read the sometimes removing the ~/.Xauthority file can help, if the ownership is messed up. ls -l /home/MYUSER/.Xauthority tells me -rw------- 1 MYUSER MYUSER 60 Aug 16 09:57 /home/MYUSER/.Xauthority. Should that be root or something else, or should I try deleting that and ~/.profile. Here's what ~/.profile looks like: # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi Should I post the output of dmesg? I'll try and get a screenshot, but does anyone have any idea what could be causing the desktop (LXDE/LXPanel) not to display? EDIT I attempted removing the ~/.XAuthority file, but that didn't seem to do anything.

    Read the article

  • Unable to change Brightness Ubuntu 13.04 Toshiba Satellite A105

    - by RPi Awesomeness
    I have a Toshiba Satellite A105 s4384 running Ubuntu 13.04 and for some reason I cannot change the brightness. Neither the function keys (Fn + F6/Fn + F7) nor the settings work, and it is really bothersome, as I would like to occasionally decrease the brightness (long car trips where my battery doesn't last, etc.) Does anyone have any idea? Judging by the suggested questions this seems to be a rather prevalent issue, but none seem to have an answer! I had a similar problem with 12.04 LTS before I upgraded.

    Read the article

  • Ubuntu version on external hardrive that shows up in GRUB?

    - by RPi Awesomeness
    I was wondering, is it possible to have Ubuntu installed on an external harddrive and still have it show up in GRUB? Of course, you wouldn't be able boot the other HDD OS unless it was connected, but would this work? I googled 'external HDD OS show in GRUB' and 'have external HDD show up in GRUB' but they didn't bring up anything. Does anyone have any resources to point me to? I can see this as being useful for testing out new releases or having multiple OSs installed without having to go through the BIOS boot choice. Thanks!

    Read the article

  • Halloween: Season for Java Embedded Internet of Spooky Things (IoST) (Part 3)

    - by hinkmond
    So, let's now connect the parts together to make a Java Embedded ghost sensor using a Raspberry Pi. Grab your JFET transistor, LED light, wires, and breadboard and follow the connections on this diagram. The JFET transistor plugs into the breadboard with the flat part facing left. Then, plug in a wire to the same breadboard hole row as the top JFET lead (green in the diagram) and keep it unconnected to act as an antenna. Then, connect a wire (red) from the middle lead of the JFET transistor to Pin 1 on your RPi GPIO header. And, connect another wire (blue) from the lower lead of the JFET transistor to Pin 25 on your RPi GPIO header, then connect another (blue) wire from the lower lead of the JFET transistor to the long end of a common cathode LED, and finally connect the short end of the LED with a wire (black) to Pin 6 (ground) of the RPi GPIO header. That's it. Easy. Now test it. See: Ghost Sensor Testing Here's a video of me testing the Ghost Sensor circuit on my Raspberry Pi. We'll cover the Java SE app needed to record the ghost analytics in the next post. Hinkmond

    Read the article

  • Watch Awesome CGI Effects from ‘Game of Thrones – Season 2' Unfold in Front of Your Eyes [Video]

    - by Asian Angel
    CGI technology is pure awesomeness when it comes to adding scenic views and effects to our favorites TV shows and movies. Watch the process unfold right in front of your eyes with this terrific video that focuses on the second season of Game of Thrones! CGI VFX Breakdowns: “Game of Thrones” by Pixomondo [via Nerd Bastards] How To Create a Customized Windows 7 Installation Disc With Integrated Updates How to Get Pro Features in Windows Home Versions with Third Party Tools HTG Explains: Is ReadyBoost Worth Using?

    Read the article

  • Google I/O 2010 - Google Buzz, location, and social gaming

    Google I/O 2010 - Google Buzz, location, and social gaming Google I/O 2010 - Surf the stream: Google Buzz, location, and social gaming Social Web 201 Bob Aman, Timothy Jordan Google Buzz has a feature-rich API that allows you to do all kinds of interesting things with conversations and location. In this session we'll build a Buzz-tastic mobile game using App Engine, HTML5, and the Buzz API for social awesomeness. For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 2 0 ratings Time: 31:18 More in Science & Technology

    Read the article

  • We are Cool Oraclites : Selfie Contest Part 1 by PSG College of Technology

    - by Nadiya
    Excitement,Happiness,Fun and frolic all around.We students from PSG College of Technology Coimbatore are all set to enter a new phase in life.Crossover from Campus to Corporate,Crossover from naughtiness to professionalism.Anxiety all around,but yes we are sure our journey to awesomeness is about to begin.We are going to be a part of an Organization we dreamt off..Our dreams are taking colors and we are all set to fly.Here we come with millions of hopes and dreams all the way from PSG to Oracle .

    Read the article

1 2 3 4  | Next Page >