Skip to main content

Posts

Showing posts from 2010

Play Low Quality Videos in Gome Flytouch

One of the common problems of Gome Flytouch is its inability to play high quality videos. Here is a trick by Kiarov for converting videos to a lower quality in order to be playable - Gome Flytouch Video Encoding Tutorial . Do not forget, you must have your tablet overclocked to 400MHz. The software used for conversion was HandBrake but you can use any converter of your choice. The converted videos work well with Meridian Player . Here’s the settings: Type: MP4 Size: 480x320 Video Bit Rate: 384 kbps Frame Rate: 25 fps Video Encoder: XVid Audio Encoder: AAC Sample Rate: 44.1 KHz Audio Bit Rate: 64 kbps

G Sensor and Camera Fix for Gome Flytouch

Some Gome Flytouch tablets have their G sensors and cameras inverted by default. There are two ways to fix these. 1. If you’re creating your own firmware, it’s better to include the fix right on the scriptcmd file. For the G sensor, add this line: setenv gsensor_axis 0,-1,1,1,2,1 and for the camera: setenv camera_rotate 270 2. If you had your device rooted, just execute the commands above on any Android terminal as root.

Gome Flytouch Android Tablet

Gome Flytouch Model: generic Manufacturer: generic Device: generic Product: generic Brand: generic CPI ABI: armeabi Kernel Version: 2.6.29-00236-g4f8dbbb-dirty howayhuo@szmce12(MontaVista) Build No: Donut.eng.howayhuo.20100910.134417 Release: 1.6 SDK: 4 Processor: ARM926EJ-S rev 5 (v5l) BogoMIPS: 174.48 Features: swp half thumb fastmult edsp java CPU Implementer: 0x41 CPU Architecture: 5TEJ CPU Variant: 0x0 CPU Part: 0x926 CPU Revision: 5 Hardware: WMT Revision:0000 Serial: 000000000000000 Type: Touchscreen Tablet Materials: Plastic Colors: White Camera: 0.3 Megapixel Screen: 7" Resistive Touchscreen at 800*480(16:9) CPU: VIA WM8505 (350MHz) RAM: 256MB DDR2 Flash ROM:2GB Expansion Memory: SD/SDHC/MMC up to 32GB Network Connectivity: WiFi or Ethernet (RJ45) Sensors: Accelerometer (supports rotation) Vibration: Yes Battery Capacity: 2400mah Ports: USB 2.0 Host /USB 2.0 Device Port/3.5 mm Headphone Jack Sound: Internal Microphone and Speakers If you are buying from the Ph...

My Android Splash Screen

I just want to share my Android Splash Screen. Credit goes to the original artist. I just modified some part of it. If you have an 800x480 pad, make sure your bitmap is 24-bit and of course the resolution must be 800x480.

update.sh for Android

After scriptcmd (previous blog post), the next to be called is the update.sh script. The script will setup the file system, data partition, cache partition, and user space. It will install BusyBox for you. height=22 pointX=30 pointY=100 SDCARD=/mnt/mmcblk0p1 string="Good luck!" echo $string gui-echo $pointX $pointY "$string" if [ -x /mnt/mmcblk0/script/update.sh ] ; then SDCARD=/mnt/mmcblk0 fi if [ -f ${SDCARD}/script/android_fs.tar ] ; then string="Updating file system..." echo $string gui-echo $pointX $pointY "$string" else string="--- File not found - script/android_fs.tar" echo $string gui-echo $pointX $pointY "$string" pointY=$(($pointY + $height + $height)) string="Failed updating file system!" echo $string gui-echo $pointX $pointY "$string" exit 0 fi # FILE SYSTEM SETUP pointY=$(($pointY + $height + $height)) string="Cleaning up file...

scriptcmd for Android

Here’s my script for updating the Android firmware. This script must contain the correct file header for your processor. setenv BMP_ADR 3c00000 fatload mmc 0 $(BMP_ADR) script/hint1_en.bmp setenv lcdparam 1,30000,8,800,480,48,40,40,3,29,13 setenv pwmparam 0,45,1040,1040 setenv LCDC_FB f900000 lcdinit logo show -1 0 textout 30 80 "Android update will start after 8 seconds..." ffff00 sleep 1 textout 30 80 "Android update will start after 7 seconds..." ffff00 sleep 1 textout 30 80 "Android update will start after 6 seconds..." ffff00 sleep 1 textout 30 80 "Android update will start after 5 seconds..." ffff00 sleep 1 textout 30 80 "Android update will start after 4 seconds..." ffff00 sleep 1 textout 30 80 "Android update will start after 3 seconds..." ffff00 sleep 1 textout 30 80 "Android update will start after 2 seconds..." ffff00 sleep 1 textout 30 80 "Android update will start after 1 second..." ffff...

Android ASCII Art

G G GG GG G G GG GG GG GGGGGGGGGGGGG GG GGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGG GGGGGGGGGGGGGGGGG GGGGGG GGGGGG GGGGGGGGGGGGGGG GGGGGG GGGGGGG GGGGGGGGGGGGGGG GGGGGGG GGGGGGGG GGGGGGGGGGGGGGGGG GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GG GGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGG GGGGGGG GGGGGGGG...

Active Directory with JXplorer

For folks who do not read the manual. If you encounter this error using JXplorer: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece] Do not use your login name. Use your full name instead.

On an obsolete road

I have already forgotten these things. 1. Inner join versus outer join 2. Simple select statement for getting the max value of a column + another column 3. Definition of Object Oriented programming 4. Exact figure of the limitation of HTTP GET. 5. Differences between GET and POST. 6. The default method of an HTML form when submitted. I have made time to review them. Here they are. 1. Inner join will return matched results between two tables while outer join will return all regardless if there is a match or none between the two tables. Here’s a good article by Jeff Atwood, A Visual Explanation of SQL Joins . 2. Given a table Person with two columns, Name and Age. To get the eldest, SELECT Name, Age FROM Person WHERE Age = max(Age); 3. Object oriented programming is a programming paradigm that uses objects. These objects consist of fields, methods and their interaction. 4. 256 characters. 5. Given the size limit of GET, POST is used to overcome that. POST is used if ...

HTML5 Web SQL Database

HTML5 has a bunch of cool APIs. In one of my previous posts, I have written a simple demonstration of the Web Storage JavaScript API. In this post I will be showing another demonstration, the Web SQL Database JavaScript API. What is so fascinating about these APIs is they are “crash-safe.” Now you can lessen the load of your web servers and perform SQL tasks like, sorting, joining, etc. on the client side. Click [here] for the demonstration.

Removing while Iterating a Collection in Java

Let us say you have a list and you want to remove items while iterating through it if a certain condition satisfies. for (Object object : listOfObjects) { if (isConditionSatisfied) { listOfObjects.remove(object); } } What is wrong with this code above? Try it and you will get this, Exception in thread "main" java.util.ConcurrentModificationException You might want to do this instead, Iterator<Object> iterator = listOfObjects.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); if (isConditionSatisfied) { iterator.remove(); } } Have a nice day.

HTML5 Web Storage

Here is a simple demonstration of HTML5’s Web Storage. The code is quite straightforward. One thing to experiment is after entering any string and hitting save, try closing the browser entirely and opening it again visiting the same page to see if the data persisted. Click [here] for the demonstration.

Just for fun!

It has been a while since I have written something about Javascript. You need to copy and paste this to your browser’s address bar to see how it works. javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("a"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top= (Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',50); void(0); Enjoy!

Performance of null checks in Java

Which one is faster? a == null or null == a ? This is the method of the former. public static boolean firstNullCheck(Object a) { if (a == null) { return true; } return false; } and the method of the latter. public static boolean secondNullCheck(Object a) { if (null == a) { return true; } return false; } Here’s the disassembly of the former. public static boolean firstNullCheck(java.lang.Object); Code: 0: aload_0 1: ifnonnull 6 4: iconst_1 5: ireturn 6: iconst_0 7: ireturn and the disassembly of the latter. public static boolean secondNullCheck(java.lang.Object); Code: 0: aconst_null 1: aload_0 2: if_acmpne 7 5: iconst_1 6: ireturn 7: iconst_0 8: ireturn The former saves you a bytecode. Anyone who can explain further since I am not sure whether if_acmpne is faster than ifnonnull ?

Google over SSL

If you do not want your search queries to be compromised, use Google SSL . However, there is one thing I discovered though, if you click on a cached link, it’s not encrypted, it goes back to HTTP from HTTPS making the protected search useless. Just be aware.

Importance of daily meetings

Why are daily meetings important? Yes I know what you are thinking, to check if the schedule is on target, to spot showstoppers, roadblocks and whatnots. But aside from those, there are things that make daily meetings rewarding. Let’s face it, some people (including me) find it hard oftentimes to achieve a certain level of focus at work especially when multitasking is inevitable. Meetings will remind us of our commitments infront of our peers. Since most of us will be ashamed of not making any progress, it will trigger ourselves to do something about it. In my opinion, having daily meetings typically before the shift starts will help a lot of peers suffering from bad habits - procrastination. It is one way of invigorating those who have not found their way out yet. “Keep each other in the zone, what are teammates for?”

Google Search Operators

There is great power here. I know most of you are not taking advantage of these operators. 1. + (plus) - this will yield search results ordered by the number of occurrences of the specified word 2. - (dash) - this will yield search results that do not contain the specified word 3. " " (double quotes) - this will yield search results containing the exact word specified 4. . (dot) - is a wildcard representing a single character 5. * (asterisk) - is a wildcard representing a single word 6. | - traditional OR operator 7. site: - search within a specified domain 8. intitle: - this will search for the 1st specified word in page titles and the 2nd specified word in the text 9. allintitle: - this will search for texts in page titles only 10. inurl: - this will search for URLs containing the specified word 11. allinurl: - this will search for texts in URLs only 12. filetype: - this will search for texts containing files of the specified extension and the specified word 1...

Gmail Search Operators

These operators will give you more precise search results. 1. from: - mails from the name of the sender 2. to: - mails sent/to be sent to to the recipient 3. subject: - search mails containing the specified words in the subject 4. OR - traditional OR operator 5. - (dash or hyphen) - exclude messages containing the specified words 6. label: - search messages by label 7. has:attachment - search mails with attachments 8. filename: - search mails by filename of the attachments 9. " " (double quotes) - traditional operator for filtering exact specified words 10. () - used for grouping search expressions 11. in:anywhere - search for mails anywhere in your account 12. in:inbox - search for mails in your inbox 13. in:trash - search for mails in your trash folder 14. in:spam - search for mails in your spam folder 15. is:starred - search for starred mails 16. is:unread - search for unread mails 17. is:read - search for read mails 18. cc: - search mails that were ca...

Endianness of Java

In Java, multibyte data items or streams are stored in big endian order. Using Java to write bytes directly to the wire will require byte-order transformation if the recipient talks in little endian. The same is true if you are reading directly from the wire from a sender who talks in little endian. If you are using a byte array wrapped in ByteBuffer, byte[] data = new byte[] { 12, 19, 83, 05, -05, 55, -55 }; ByteBuffer byteBuffer = ByteBuffer.wrap(data); Transforming from big endian to little endian is easy, byteBuffer.order(java.nio.ByteOrder.LITTLE_ENDIAN); If you are unsure of the endianness of the underlying platform, just invoke the native order method. java.nio.ByteOrder.nativeOrder(); Aside from streams, operands in classes that are above 1 byte in size are in big endian order.

Java Lambda Expressions / Closures

Lambda expressions are just (anonymous) functions. f(x) = x can be expressed as x→x f(x, y) = x*x + y*y can be expressed as x, y→x*x + y*y In simple Java terms, 1. Return an int 23 with a void argument int j = { => 23 }.invoke(); 2. Closure with 1 argument, convert 23 kilograms to pounds double j = { double kilograms => kilograms*2.2D }.invoke(23); 3. Closure with 2 arguments, get the sum of the 2 squares int squareSum = { int x, int y => (x*x) + (y*y) }.invoke(2,3); 4. Closure returning an instance and invoking an instance method { new RocketLauncher() }.invoke().fire(); Every time a closure is created at compile time, an interface is automatically created for each expression having an invoke method with a signature depending on the number of arguments, then an anonymous subclass of this interface is constructed. Enjoy!