March 14, 2011

[SOLVED] Chrome: Export the List of used extensions

I just wrote the Extension "Share Extensions for Google Chrome™" for exporting Extensions list in various formats. You can export BBCODE, HTML, Wiki or Text lists. With or without descriptions. Here are my extensions:

Generated: Tue, 22 Mar 2011 10:07:03 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.16

Extensions: 48
  • Clip It Good v0.1
    Save webpage clippings and images to your Picasa Web Albums.


  • Awesome Screenshot: Capture & Annotate v2.4.9.1
    Capture the whole page or any portion, annotate it with rectangles, circles, arrows, lines and text, blur sensitive info, one-click upload to share. Support PNG and shortcuts.


  • MeasureIt! v1.1.2
    Draw out a ruler that will help you get the pixel width and height of any elements on a webpage.


  • Omni Launch v0.0.0.5
    Launches apps, the quick way!


  • UserpicIt Extension v0.3
    UserpicIt Extension enables you to send images from Chrome to userpic.it with one click.


  • Transliterator v1.3
    Transliterator - Use F2 to switch to Cyrillic alphabet - translit.ru+.


  • Share Extensions v0.0.9
    Export your favorite Google Chrome™ extensions as BBCode, HTML, Wiki or text list for your Blog. Share the extensions via Twitter, Google Buzz™, Google Mail™ or add them to Google Bookmarks™ lists. Also you can directly enable/disable your extensions.


  • JSONView for Chrome™ v0.0.21
    JSONView for chrome is an extension that helps you to parse and view JSON documents


  • Add to Amazon Wish List v1.0.0.4
    Add products from any website to your Amazon Wish List


  • Screen Capture (by Google) v4.0.0
    Capture visible content of a tab, a region of a web page, or the whole page as a PNG image. Support horizontal and vertical scroll when capturing whole page, with an all new autosave capability.


  • Notifier for Stack Exchange websites v2.4.9
    Get notified of changes in reputation, responses, revisions, badges & moderator messages, on any StackExchange site


  • Open Graph Inspector v1.1.1
    Show open graph information.


  • Autocomplete = on v1.0
    Changes 'autocomplete=off' to 'autocomplete=on' in web pages, so your passwords will be remembered.


  • Facebook Disconnect v1.0.2
    Stop Facebook from tracking the webpages you go to.


  • Sight v1.6.7
    The Syntax Highlighter for Chrome


  • Edit This Cookie v0.13.5
    Edit This Cookie is a cookie manager. You can add, delete, edit, search, protect and block cookies!


  • XML Tree v1.9.1.2
    Displays XML data in a user friendly way.


  • Pendule v0.0.10
    Web developer tools for Chrome.


  • Pastebin.com v1.7
    Store text for a certain period of time with Pastebin.com the #1 paste tool since 2002


  • Social Media Monitoring v0.1.5
    Displays Twitter activity (tweets per minute, current and long-term) for user-defined keywords and geolocation (at the moment, only Twitter is supported, more services are coming soon).


  • AT_HedgehogInTheFog_v2 v3


  • Rapportive v1.2
    Making email a better place


  • Chrome Sniffer v0.2.7
    Detect web applications and javascript libraries run on browsing website.


  • Breadcrumb Navigator v1.1.0
    This extension allows you to navigate any URL in a breadcrumb-like way.


  • goo.gl URL Shortener v0.5.7
    Shorten url with goo.gl, the Google URL shortener


  • My Extensions v0.9.3.7
    Are you an extensions developer? Keep track of your Chrome extensions. Be notified for new comments, ratings and more!


  • Twitter Notifier v1.1.3
    Brings new tweet notifications to Chrome - You'll never need a desktop client again!


  • Yet Another Google Bookmarks Extension v1.9
    YAGBE - Displays Google Bookmarks in a tree. Supports nested labels, searching, sorting, creating, and managing Google Bookmarks.


  • Control Freak v1.1
    Greasemonkey-like mods, but quicker to tweak


  • Bubble Translate v1.5
    Real-Time & inline text translator from any language to yours.


  • UserpicStealer v0.0.3
    Find userpics on page and send it to userpicstealer.com.


  • Server Switcher for Chrome v0.1
    Easily switches a website between development and production webservers


  • QR Code Generator for Android Market™ on Web v0.0.4
    Generate QR Code for installing Android apps on your device while surfing web-based Android Market™ (no sign-in required)


  • HTML5 Powered v1.0
    Shows the new HTML5 logo for pages that use the HTML5 doctype


  • Delicious Bookmarks Extension (Beta) v0.998
    Delicious Bookmarks is the official Chrome extension for Delicious, the world's leading social bookmarking service.


  • Download Assistant (by Google) v4.0.0
    Download links on a web page with popular downloaders such as FlashGet, FlashGet Mini, Thunder, Mini Thunder, QQ Whirlwind, eMule, Orbit, Internet Download Manager and Free Download Manager.


  • QuizCards: World Capitals v0.985
    Use these interactive browser-based flash cards to easily learn the world capitals.


  • YSlow v3.0.0
    Make your pages faster with Yahoo!'s page performance tool


  • Feed Notifier! v1.1.0
    Get desktop notifications whenever you favorite feeds are updated.


  • Word This v2.5.3
    Create a post on your Wordpress.com or Self Hosted Wordpress Blog about the current page you're viewing


  • RSS Subscription Extension (by Google) v2.1.3
    Adds one-click subscription to your toolbar.


  • Docs PDF/PowerPoint Viewer (by Google) v3.2
    Automatically previews pdfs, powerpoint presentations, and other documents in Google Docs Viewer.


  • csscan v2.0.1
    Offers a quick overview of CSS properties to the element the mouse cursor is hovering.


  • Google Chrome to Phone Extension v2.1.3
    Google Chrome to Phone Extension enables you to send links and other information from Chrome to your Android device.


  • Google Quick Scroll v1.7
    Quick Scroll lets you jump directly to the relevant bits of a Google search result.


  • Cloud Save v1.2.2
    Save to cloud.


  • Chrome Palette v1.0
    Creates a color palette from any image. Just right-click on the image and select the 'Chrome Palette' option.


  • AdBlock v2.3.15
    The most popular Chrome extension, with over 2 million users! Blocks ads all over the web.




Disabled Extensions: 31
  • Google Translate v1.2.3.1
    This extension translates entire webpages into a language of your choice with one click. By the Google Translate team.


  • Chrome for a Cause v1.5.3
    Participate in charitable projects with the rest of the Chrome community


  • Validity v1.1.0
    Click the icon in the address bar or press Ctrl+Alt+V to validate the current page.


  • QR-Code Tag Extension v0.7.8
    Display a QR-Code tag for the current URL in the browser. The size of the generated QR-Code is adjustable.


  • Bookmark Sentry v1.6.5
    A bookmark scanner that checks for duplicate and bad links.


  • Firebug Lite for Google Chrome v1.3.1.7759
    Firebug Lite for Google Chrome, supported by the Firebug Working Group.


  • Pixlr Grabber - Screen capture/image grabbing v0.85
    Edit, Save or Share screen grabs and images


  • Webpage Screenshot v4.6.2
    Fast&Simple solution to Save & Share & Print & Edit screenshots of any webpage. Capture to PNG/JPG drawing tools, and sharing features.


  • ToCyrillic v1.2.1
    On the fly conversion from latin to cyrillic for text widgets


  • Post to Google Buzz v1.0.0.6


  • ScribeFire v1.4.3.0
    A full-featured blog editor lets you easily post to all of your blogs.


  • Google Font Previewer for Chrome v1.5
    Lets you choose a font from the Google Font directory with a few text styling options, and preview them on the current tab.


  • Picnik Extension for Chrome v1.0.7
    Capture web pages and edit images right in your browser using Picnik


  • Display Shortcuts v1.1
    Display the access keys hidden into a web page, to be used as shortcuts.


  • android2cloud v2.0.2
    A way to push content from your Android phone to your Chrome web browser.


  • Web Clipboard (by Google) v2.0
    Copy and Paste HTML and text using Google's Web Clipboard !


  • Power Twitter for Chrome v1.60
    Makes Twitter Better!


  • Chromitude v0.3.2
    An unofficial Google Latitude Checkin App for Chrome. Runs in the background.


  • Instant Image Editor v1.1
    Edit any image or background image instantly by alt + right-clicking it (ctrl on Linux)!


  • Window Resizer v1.6.0
    Resize browser window to emulate various screen resolutions


  • jsshell v3.1
    Interactive Javascript with jQuery and jLinq


  • Inline Code Finder v0.9.2
    Finds HTML elements with inline JavaScripts events, inline styling and javascript: links


  • EXIF Viewer v1.2.4
    Quick access to EXIF data of any image you view


  • Explain and Send Screenshots v3.8.3
    Capture any part of a webpage, explain it with arrows, circles, text, just like Snagit and share or send it as a link or attachment


  • The Tweet Button v0.1.4
    Share articles on websites on Twitter with The Tweet Button (created by @wrttn)


  • Chrome Editor Lite v0.9.5
    Edit HTML easily, right inside your browser.


  • Auto-Translate v1.4.1
    Automatically translate selection text by google translate


  • Auto-Reload v7.8
    Time interval page auto-reloader


  • Speed Tracer (by Google) v0.20
    Get insight into the performance of your web applications.


  • Chromkie v0.1.6
    Cookies Manager of Chrome.


  • Unofficial Google Tasks v1.5.5
    Access your Google Tasks easily with Chrome




Apps: 10
  • Entanglement v2.1.1
    Create the longest path possible and challenge your friends in the game of Entanglement.


  • GQueues v1.0.0
    A full-featured task manager for your Google Account and Google Apps account.


  • Namco Mahjong Butterfly v1.104
    Match tiles to transform caterpillars into butterflies!


  • Z-Type v1.0
    Type To Shoot Game made with ImpactJS


  • Hipmunk v1.1
    Find the flight you want in minutes using Hipmunk's agony-free flight search.


  • PHP Code Editor v0.9
    PHP Code Editor is a web based interface to edit your code.


  • Plants vs Zombies v1.0.5
    Think fast and plant faster to stem a zombie attack and save your home in this action-strategy PopCap game! - FREE TRIAL


  • GitHub Issues v1.6
    Github Issues is a full featured desktop class front end to GitHub's issues tracker


  • Vyew v4.11.0
    Beyond web conferencing -- Collaborate in a continuous meeting room, real-time or anytime: webcam, whiteboard, and doc review tools.


  • Appmator v0.0.0.2
    Quickly get your app ready for the Chrome Web Store.





Exported with Chrome Extensions Share

March 1, 2011

[SOLVED] Problems with j.mp links

Having troubles with j.mp links?

...replacing j.mp with bit.ly does the trick.

February 20, 2011

[SOLVED] GoogleDocs: How to download the spreadsheet as xls

For example you found some nice Google Docs Sheet

https://spreadsheets.google.com/pub?key=0ArURTcbhh9uWdGdTVEFFM3FadVlMUE91QVRMQ0VGaFE

and would like to save this document as Excel file. Just add at the end of the URL "&output=xls"

https://spreadsheets.google.com/pub?key=0ArURTcbhh9uWdGdTVEFFM3FadVlMUE91QVRMQ0VGaFE&output=xls

also you may like to switch into edit mode (if you have enought rights). Just replace "pub" with "ccc"
https://spreadsheets.google.com/ccc?key=0ArURTcbhh9uWdGdTVEFFM3FadVlMUE91QVRMQ0VGaFE

Source: googlesystem.blogspot.com

February 18, 2011

[SOLVED] SVN: Parse all changes by user in defined time period

Parse all changes by user in defined time period
svn log -v -r{"2011-01-01 00:00:00"}:{"2011-02-18 00:00:00"}| sed -n '/m.kupriyanov/,/-----$/ p'

Source: stackoverflow.com

February 16, 2011

February 1, 2011

[SOLVED] SQLite Single quotes in the query expression

A string constant is formed by enclosing the string in single quotes ('). A single quote within the string can be encoded by putting two single quotes in a row - as in Pascal. C-style escapes using the backslash character are not supported because they are not standard SQL


 

Source: sqlite.org.

January 23, 2011

[SOLVED] Android: Set dynamically textview height


TextView tv = (TextView) findViewById(R.id.TextView01);
final int height_in_pixels = tv.getLineCount() * tv.getLineHeight()
* getResources().getDisplayMetrics().density;
//approx height text
tv
.setHeight(height_in_pixels);

Solved: stackoverflow.com

[SOLVED] Android: Override back button


@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
   
if (keyCode == KeyEvent.KEYCODE_BACK) {
        //do some stuff

       
return true;
   
}
   
return super.onKeyDown(keyCode, event);
}

 

Source: stackoverflow.com.

January 12, 2011

[SOLVED] Android: Handling gzipped content while downloading

On file download you can check the content type and if its gzipped - unzip it on the fly:

URLConnection connection = url.openConnection();
InputStream stream = connection.getInputStream();
if ("gzip".equals(connection.getContentEncoding())) {
stream = new GZIPInputStream(stream));
}


Source: stackoverflow.com

January 9, 2011

[SOLVED] Android: Get an string array from an array.xml resource

Here you can see how to retrieve values from array.xml
Log.i("test",getImageQualityAsString(1));

array.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="image_export_list_preference">
<item>480x320</item>
<item>800x480</item>
<item>1024x768</item>
</string-array>
<string-array name="entryvalues_image_export_list_preference">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
</resources>

Function:
private String getImageQualityAsString(int sizeItem){

try {
String[] bases = getResources().getStringArray(R.array.image_export_list_preference);

return bases[sizeItem];

} catch (Exception e) {
return "";
}

}

Source: stackoverflow.com

January 4, 2011

[SOLVED] Share log via Browser

This guide assumes you have a remote server, called loghost.example.org that you are going to use to avoid any firewall issues.

First make sure you have netcat-openbsd and NOT netcat traditional installed.
sudo apt-get install netcat-openbsd

Then to ensure your system is working try the following basic netcat tip.

Now to share my logging output I run on my laptop:
tail -f /var/log/syslog | ssh loghost "nc -v -l 8000"

Now to share my log with a remote collegue, he simply runs:
curl http://loghost.example.org.org:8000

or http://loghost.example.org:8000 in a browser

Source: dabase.com

January 3, 2011

[GRAPHICS] My GTUG logo deviations

Here are some of my GTUG logo deviations (inspired by @aygul's bootcamp logo):





ASCII/HTML GTUG logo



                      ..::::..                       :::::::::::.
                 ::::::::::::::::::              :::::::::::::::::::             .COOOOOOOOOOOOOc
              ::::::::::::::::::::::::         :::::::::::::::::::::::        .OOOOOOOOOOOOOOOOOOOOC
           ::::::::::::::::CCCc:::::::::     .::::::O@@@@@@@@@@@@c::::::    .OOOOOOOOOOOOOOOOOOOOOOOOO      .ccccccccccccc:.
          :::::::::::::8@@@@@@@@@@o:::::::  .:::::::@@@@@@@@@@@@@C:::::::  OOOc:COOOOO    OOOOOOOOOOOOOc:cccccccccccccccccccccc
         ::::::::::::c@@@@@@CC8@@@@@::::::: ::::::::::::o@@@@:::::::::::::OOO   OOOOOC    OOOOOOOOOOOCccccccccccccccccccccccccccc:
        :::::::::::::@@@@@C:::::8@@@@:::::::::::::::::::o@@@@::::::::::::OOOc   OOOOOc    OOOOOOOOOCcccccccOO@@@OCccccccccccccccccc:
       ::::::::::::::@@@@@c:::::C@@@@:::::::::::::::::c:C@@@@::::::c::::oOOOc   OOOOOc    OOOOOOOOccccco@@@@@@@@@@@@occcccccccccccccc.
       ::::::::::::::@@@@@c:::::::::::::::::::::::::::::C@@@@:::::::::::COOO:   OOOOOc    OOOOOOOccccc8@@@@8OOO@@@@@@occcccccccccccccc.
      .::::::::::::::@@@@@c::::::::::::::::::::::c:::c::o@@@@:::::::::::COOO:  .OOOOOc    OOOOOOcccccO@@@@cccccc@@@@@@ccccccccccccccccc.
      .::::::::::::::@@@@@c::@@@@@@@@c::::::::::::::::::c@@@@:::::::::::oOOOc   OOOOOc    OOOOOoccccc@@@@8ccccccO@@@@@cccccccccccccccccc
       ::::::::::::::@@@@@c::@@@@@@@@::::::::::::::::::::@@@@::::c:::::: OOOc   OOOOOc    OOOOOcccccc@@@@Occcccccccccccccccccccccccccccc:
       ::::::::::::::@@@@@c:::::C@@@@::::::::  :::c:::c::@@@8::::::::::  .OOO   OOOOOc    OOOOCcccccc@@@@Occccccccccccccccccccccccccccccc
        :::::::::::::@@@@@C:::::8@@@@:::::::    .::::::::::::::::::::     .OOO           :OOOOCcccccc@@@@OccO@@@@@@@@@ccccccccccccccccccc
         :::::::::::::@@@@@@@8@@@@@@@::::::        .::::::::::::c:          COOO:      .OOOOOOCcccccc@@@@OccO@@@@@@@@@ccccccccccccccccccc
          :::::::::::::o@@@@@@@@@c@@C:::::                                    COOOOOOOOOOOOOOOOcccccc@@@@OccccccO@@@@@cccccccccccccccccc.
            ::::::::::::::::::::::::::::                                        .OOOOOOOOOOOOOOCccccc@@@@@ccccccO@@@@@cccccccccccccccccc
              ::::::::::::::::::::::::                                               .ccccccc   cccccc@@@@Occccc@@@@@@ccccccccccccccccc
                 ::::::::::::::::::                                                              cccccc@@@@@@@@@@@@@@@cccccccccccccccc
                       ......                                                                     :cccccc8@@@@@@@OC@@@ccccccccccccccc
                                                                                                    ccccccccccccccccccccccccccccccc
                                                                                                      :cccccccccccccccccccccccccc
                                                                                                         :cccccccccccccccccccc.
                                                                                                              .ccccccccc:.                            

                                                                                                                                                      


Original GTUG logo was created by @romannurik

Source: http://wiki.gtugs.org/logos

[SOLVED]Building CSS sprites with Bash & Imagemagick

If you want to automatically generate image sprites - css file just use this script
$ spriteit.sh button button '*.png'

Output:
Generating sprite file...
executing: convert button_disabled.png button_hover.png button.png button_selected.png -append button/button-sprite.png
Sprite complete! - Creating css & test output...
#1 done
#2 done
#3 done
#4 done

Complete! - 4 sprites created, css written & test page output.

Script source:
#!/bin/bash

# uses imagemagick to stich together all images in a folder and
# then writes a css file with the correct offsets along with a
# test html page for verification that its all good

if [ $# -gt 0 ]
then

if [ 'x' != 'x'$4 ]
then
ext2=.$4; # the extension to iterate over for input files
else
ext2=".png"; # the extension to iterate over for input files
fi

if [ 'x' != 'x'$3 ]
then
#ext="."$3; # the extension to iterate over for input files
ext=$3; # the extension to iterate over for input files
else
ext=".gif"; # the extension to iterate over for input files
fi

name=$1; # output will be placed in a folder named this

if [ $2 ]
then
classname=$2"-sprite";
else
classname=$1"-sprite";
fi
css="$name/$classname.css";
html="$name/test.html";

rm -fr $name;
mkdir $name;
touch $css $html;

echo "Generating sprite file...";
#echo convert *$ext -append $name/$classname$ext;
echo executing: convert $ext -append $name/$classname$ext2;
convert $ext -append $name/$classname$ext2;

echo "Sprite complete! - Creating css & test output...";

echo -e "<html>\n<head>\n\t<link rel=\"stylesheet\" href=\"`basename $css`\" />\n</head>\n<body>\n\t<h1>Sprite test page</h1>\n" >> $html

echo -e ".$classname {\n\tbackground:url('$classname$ext2') no-repeat top left; display:inline-block;\n}" >> $css;
counter=0;
offset=0;
for file in $ext
do
width=`identify -format "%[fx:w]" "$file"`;
height=`identify -format "%[fx:h]" "$file"`;
#idname=`basename "$file" $ext`;
idname=`basename "$file" $ext2`;

clean=${idname// /-}
echo ".$classname#$clean {" >> $css;
echo -e "\tbackground-position:0 -${offset}px;" >> $css;
echo -e "\twidth: ${width}px;" >> $css;
echo -e "\theight: ${height}px;\n}" >> $css;

echo -e "<a href=\"#\" class=\"$classname\" id=\"$clean\"></a>\n" >> $html;

let offset+=$height;
let counter+=1;
echo -e "\t#$counter done";
done

echo -e "<h2>Full sprite:</h2>\n<img src=\"$classname$ext2\" border=1/>" >> $html;
echo -e "</body>\n</html>" >> $html;

echo -e "\nComplete! - $counter sprites created, css written & test page output. @russenreaktor";

else

echo -e "There should be at least 1 argument!\n\tbuildSprite.sh output_folder classname input_pattern"
echo -e "\n\tbuildSprite.sh folder1 test '*.png' png"

fi

Source: jaymz.eu

[SOLVED] Save music played via browser as mp3 file

Problem: You hear nice music via your browser but you want download this music as mp3.

 

Solution: Use Freecorder - Powerful, Free Video Downloader, Audio Recorder & Converter - http://www.applian.com/freecorder4/

December 26, 2010

December 25, 2010

[SOLVED] Android: no adb on Suse linux or "???????????? no permissions"

You cant develop on your linux pc because you are getting something like this.
$ adb devices
List of devices attached
???????????? no permissions

temporary solution - to restart adb server as root
$ su
$ adb kill-server
$ adb start-server
$ adb devices

add your device to devices list.
1) check your vendor ID
$ lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 044: ID 18d1:2d66 <- this is my mobile
Bus 002 Device 004: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 002 Device 003: ID 10d5:0001 Uni Class Technology Co., Ltd

In my case , for Nexus One, it is 18d1

2) now add lines in to "/etc/udev/rules.d/51-android.rules"
$ su
$ vim /etc/udev/rules.d/51-android.rules

now paste these lines with your values
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", OWNER="%YOUR_USER%" GROUP="%YOUR_USER_GROUP%"

save your file.

now it should work...

Source: google.com

December 14, 2010

[SOLVED] Unix: search files between TIME1 and TIME2 with string 123456 in it

e.g.

TIME1 = 2010-11-02 00:00
TIME2 = 2010-11-24 00:00
SEARCHSTRING= 123456
File pattern "PATTERN1231313123.txt"

create files with right timestamps
 touch -t 11020000 /tmp/stamp_2010-11-02_0000
touch -t 11240000 /tmp/stamp_2010-11-24_0000

check your list of files if it is right
find . -regextype posix-awk  -regex '^\./PREFIX[0-9]*.txt' -newer /tmp/stamp_2010-11-02_0000 -and -not -newer /tmp/stamp_2010-11-24_0000 -ls

export your list
 find . -regextype posix-awk  -regex '^\./PREFIX[0-9]*.txt' -newer /tmp/stamp_2010-11-02_0000 -and -not -newer /tmp/stamp_2010-11-24_0000 -exec grep --color "123456" {} \; > /tmp/mydata_123456.csv

Source: serverfault.com, gnu.org

December 13, 2010

[SOLVED] Android: Multiple substitutions specified in non-positional format

Getting an error after updating to SDK 0.8
Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute? strings.xml

It happens in string files on strings with %
	"%s/%s (Linux; Android)"

You should change it to
	"%1$s/%2$s (Linux; Android)"

Source: developer.android.com

December 9, 2010

[SOLVED] PHP: Why 2 !=2 aka "never compare floating point numbers for equality"

“never compare floating point numbers for equality”.

The reason (19.6*100) !== (double)1960, is because inside a computer they are not equal.

Try this:

<?php

printf("%.15f", (19.6*100));

?>

Outputs: 1960.000000000000227 (not 1960 as somewhat expected)

If comparison is required a few options come to mind (other than BCMath):

1) Round numbers before comparison:

<?php

$sig_figs = 5;
echo (round((19.6*100), $sig_figs) !== round((double)1960, $sig_figs)) ? 'not equal' : 'equal';

?>

Outputs: equal

Source: php.net

November 23, 2010

[SOLVED] helloWorldPlugin example from LiveView SDK 1.0 does't work

No example from LiveView™ SDK 1.0 work (helloWorldPlugin).

Getting something like (mPluginId=0):
D/LiveViewPlugin(15550): Plugin registered. mPluginId: 0 isSandbox? true
D/LiveViewPlugin(15550): Plugin installation notified.
D/LiveViewPlugin(15550): Registry success!

Just add in your manifest.xml
<uses-permission android:name="com.sonyericsson.extras.liveview.permission.LIVEVIEW_API"/>

Noow works everything perfect - you got your mPluginId and can play ;)
D/LiveViewPlugin(15843): Plugin installation notified.
D/LiveViewPlugin(15843): Registry success!D/LiveViewPlugin(15843): Plugin registered. mPluginId: 161427209 isSandbox? true
D/LiveViewKupriyanovPlugin(15481): startPluginD/LiveViewKupriyanovPlugin(15481): Enter HelloWorldService.startWork.

Source: http://russenreaktor.wordpress.com/2010/11/23/solved-helloworldplugin-example-from-liveview-sdk-1-0-doest-work/

November 21, 2010

[SOLVED] How can i call Wi-Fi settings screen from my App

To start wifi settings dialog:
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

to start Settings Dialog
startActivity(new Intent(Settings.ACTION_SETTINGS));

to start any settings dialog read the reference

Source: stackoverflow.com

Reference: http://developer.android.com/reference/android/provider/Settings.html

[SOLVED] How to create Alert Dialog?

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure you want to exit?")
       .setCancelable(false)
       .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int id) {
                MyActivity.this.finish();
           }
       })
       .setNegativeButton("No", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int id) {
                dialog.cancel();
           }
       });
AlertDialog alert = builder.create();
alert.show();

Source: developer.android.com

[SOLVED] How to check internet access on Android?

You can use
Context.getSystemService(Context.CONNECTIVITY_SERVICE).getNetworkInfo(ConnectivityManager.TYPE_MOBILE)

or
Context.getSystemService(Context.CONNECTIVITY_SERVICE).getNetworkInfo(ConnectivityManager.TYPE_WIFI)

and parse the DetailedState enum of the returned NetworkInfo object

 

and don't forget to allow it the Manifest

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 

Source: stackoverflow.com

Documentation: http://developer.android.com/reference/android/net/ConnectivityManager.html

November 20, 2010

[SOLVED] Android: When the soft keyboard pops up, the EditText is invisible

Just add android:windowSoftInputMode="adjustPan" for your activity in manifest file
<activity android:name="SampleActivity" android:label="@string/app_name" android:windowSoftInputMode="adjustPan" >
...
</activity>

Source: stackoverflow.com

Documentation: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
Tutorial: http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html

November 16, 2010

[SOLVED] Android - Arrange two buttons next to each other and to center them horizontally.

Arrange two buttons next to each other and to center them horizontally.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="horizontal"
    android:background="@android:drawable/bottom_bar" android:paddingLeft="4.0dip"
    android:paddingTop="5.0dip" android:paddingRight="4.0dip"
    android:paddingBottom="1.0dip" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:layout_below="@+id/TextView01">
    <Button android:id="@+id/allow" android:layout_width="0.0dip"
        android:layout_height="fill_parent" android:text="Allow"
        android:layout_weight="1.0" />
    <Button android:id="@+id/deny" android:layout_width="0.0dip"
        android:layout_height="fill_parent" android:text="Deny"
        android:layout_weight="1.0" />
</LinearLayout>

 

Source: stackoverflow.com

November 15, 2010

November 14, 2010

GTUG Bootcamp 2010 in Munich

Here yo will get small overview of  "GTUG Bootcamp 2010 in Munich". You can also go directly to picasa gallery to comment pictures there ;) http://picasaweb.google.com/m.kupriyanov/GTUGBootcamp2010InMunich

Stuttgart GTUG [@StuGTUG] goes GTUG BootCamp in Munich #gtugbc



October 28, 2010

[SOLVED] Install LaTeX and beamer on openSUSE 11.2


zypper in texlive-latex


Add this repository and search for beamer

ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/Education/openSUSE_11.0/

October 24, 2010

[SOLVED] How do I install a Perl Module?


A) Start CPAN Shell:
# perl -MCPAN -e shell


B) Install a perl module:
At cpan> shell prompt install module using install module::Name command. For example install module called MIME::Lite:
# cpan> install MIME::Lite
Alternatively, try out the following command:
# cpan -i MIME::Lite




Source: How do I install a Perl Module?.

October 12, 2010

GAE: To python, or not to python

"To python, or not to python: that is the question: Whether 'tis nobler in the mind to suffer The strings and arrays of outrageous fortune, Or to take java against a sea of troubles, And by opposing end them?" #GAE

September 12, 2010

[SOLVED] Use github repository under windows with tortoisegit


Generate public and private ssh keys:

Just open "putty key generator" and generate (1) your key by moving your mouse on the surface.
Than wite some comment(2) and secure it with random passphrase (3).
Than save public and private key part on your file system.

Copy ssh-rsa key from "Public key for parsing into OpenSSH authorised_keys file:"- text field (you will need it for the next step)



Adding the key to your GitHub account:

Use this  tutorial http://help.github.com/msysgit-key-setup/

Use Pageant for auto authorisation:

If you dont want to put every time your ssh key password use Pageant. Just start it and add your private key



Get GitHub repository url:

Goto to desired project and copy git url from it:
For example: on http://github.com/stuttgart-gtug/help-me it will be "git@github.com:stuttgart-gtug/help-me.git"



Clone aka "Check Out" the repository:

Now create a folder on your PC and hit right mouse button on it - choose "Git Clone..."



In next dialog put the URL of git repository and choose path to your private github key you generated before.



Now push "OK" and enjoy the ride



Voilà ;)

August 26, 2010

install app to sd card in 2.2 (froyo)

-Go here
--http://developer.android.com/sdk/index.html
and get the SDK for your OS
-Once you download it, unzip it to its own folder, I put it off C:\
-Run the SDK Setup.exe
-Click available Packages, on left, I didn't know what was needed so I installed -EVERYTHING. Although I do suspect that we only need the USB driver, which is at the very bottom.
It will take forever to install.
After it's done installing, I Clicked on Installed Packages, and updated all.


Not done yet.
check that the phone is set up to allow debugging via USB (Settings⇒Applications⇒Development⇒USB debugging)
Plug in your phone
Windows will fail to install the driver.
Go in device manager and and update the newly Yellowed entry, the driver is in:
C:\android-sdk_r06-windows\android-sdk-windows\usb_driver
The driver should install

Start console: "Start"->"Run"->cmd->ENTER

> adb devices
if you see a serial number starting with an "H" that means you got things working, now do the following:
adb shell pm setInstallLocation 2

This command will push ALL apps to your sd card, to revert back to saving apps to internal memory enter in:


adb shell pm setInstallLocation 0

Source: install app to sd card in 2.2 (froyo)

July 27, 2010

[SOLVED] PHP: How upload file using cURL?


<?php
$request_url = ‘http://www.akchauhan.com/test.php’;
$post_params['name'] = urlencode(’Test User’);
$post_params['file'] =@.'demo/testfile.txt’;
$post_params['
submit'] = urlencode(’submit’);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
$result = curl_exec($ch);
curl_close($ch);
?>


Source: How upload file using cURL?.

July 18, 2010

[SOLVED]Market Slowness and Accessibility on cyanogenmod's CM6 RC1

After upgrading to the latest Cyanogen I notices, that the Android Market is quiet slow and does not show my downloaded apps in the download section. 2 Fixes to repair this:

1) Take the following source and save in file named vending_preferences.xml

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<boolean name="local_db_sync_required" value="false" />
<int name="SERVER_VERSION" value="1000" />
<string name="vending_tos_version">1.0.0</string>
<long name="MARKET_LAST_HEARTBEAT_TIMESTAMP" value="1271657433127" />
<long name="last_sync_time" value="1271659724720" />
<long name="last_tickle_id" value="1271657514775" />
<int name="reconciled_version" value="1710" />
<boolean name="metadata_paid_apps_enabled" value="true" />
<string name="vending_backup_state">vending</string>
<string name="vending_tos_version">1.0.0</string>
</map>

Now push to /data/data/com.android.vending/shared_prefs/vending_preferences.xml :

adb push vending_preferences.xml /data/data/com.android.vending/shared_prefs/vending_preferences.xml

Next you do in a terminal window (device or via adb shell):

su
cd /data/data/com.android.vending/cache
rm *
reboot

Source: MattiDroid - Mobile Blog: N1/G1: Market Slowness and Accessibility.

July 17, 2010

[SOLVED]How customize/extend/ Spinner

You will need to take control over what goes into the ListView and
Spinner. I have not experimented with these techniques on Spinner, but
on ListView, you will need to override getView() (on ArrayAdapter) or
newView() and bindView() (on CursorAdapter).
Here is a free excerpt from one of my books that demonstrates the technique:

http://commonsware.com/Android/excerpt.pdf

In your case, you would use your Typeface object to update the font used
by the TextView widgets in your rows.

In principle, you could do this via a wrapping adapter -- this would be
more reusable but a bit slower. I have an AdapterWrapper base class here:

http://github.com/commonsguy/cwac-adapter

and some projects that use it here:

http://github.com/commonsguy/cwac-endless
http://github.com/commonsguy/cwac-thumbnail


You also need to override getDropDownView().

Source: How to change the Typeface of ListView and Spinner - Android Beginners Google Groups.

July 7, 2010

[SOLVED] Edit SQLite database of your app from your PC

Very nice solution to browse and edit the SQLite database file of your app directly from your PC.

  1. Download

  2. Set right path in settings.ini

  3. start it


java -jar AndroidDBEditor.jar


Or you can create small batch file AndroidDBEditor.bat
@echo off
rem set current path
set CURRENT_PATH=%~dp0

rem replace slashes
set CURRENT_PATH=%CURRENT_PATH:\=/%

echo sqliteeditorpath=%CURRENT_PATH%sqlitebrowser.exe > settings.ini
rem start app
java -jar AndroidDBEditor.jar

Android DB Editor - troido.de its all about android.

July 1, 2010

[SOLVED] Set right permissions for svn repository


Additionally you should set umask 002 while working with a repository so that all new files will be writable by owner and group. This is made mandatory by creating a wrapper script for svn and svnserve:



mv /usr/bin/svn /usr/bin/svn.orig &&
mv /usr/bin/svnserve /usr/bin/svnserve.orig &&
cat >> /usr/bin/svn << "EOF"
#!/bin/sh
umask 002
/usr/bin/svn.orig "$@"

EOF
cat >> /usr/bin/svnserve << "EOF"
#!/bin/sh
umask 002
/usr/bin/svnserve.orig "$@"

EOF
chmod 0755 /usr/bin/svn{,serve}



Source: Running a Subversion Server.

[SOLVED] Fix default protocol (http...) association in WIndows


Setting default browser manually


You can manually set the default browser by selecting it as the the default program for individual file types and protocols, as follows:




  • Windows XP and earlier: Open the Control Panel from the Windows Start menu.

    • In Windows 2000 and earlier, or if Windows XP is using the Control Panel "Classic View": Click on "Folder Options -> File Types".

    • In Windows XP, if using the Control Panel "Category View": Click on "Performance and Maintenance". Then, click on "File Types" in the left column under the heading "See Also".



  • Windows 7 and Vista: Click the Start button, open "Default Programs" and then click "Associate a file type or protocol with a program". For detailed instructions, see the Microsoft article here for Vista or here for Windows 7. Note: On Windows Vista (or above), you may be unable to associate the HTTP HTTPS or FTP protocols with SeaMonkey because it does not appear as an available option. See this forum topic for additional information.


Assign the following protocols and file types to the browser you wish to set as default:




  • URL:HyperText Transfer Protocol (HTTP protocol)

  • URL:HyperText Transfer Protocol with Privacy (HTTPS protocol)

  • URL:File Transfer Protocol {FTP protocol)

  • HTML File

  • HTM File (optional)


In Windows XP and earlier, you can find the URL protocols listed above in File Types, under extension "N/A" or "(NONE)".




Source: Default browser - MozillaZine Knowledge Base.