Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

September 5, 2012

[SOLVED]Pull new updates for forked Github repository

Just run this in your forked git location:
$ cd github-services
$ git remote add upstream git://github.com/<user>/<repository>.git
$ git fetch upstream

Sourcehttp://stackoverflow.com/questions/3903817/pull-new-updates-for-forked-github-repository

June 8, 2012

[SOLVED] Android: Samsung Galaxy Tab 10.1 on Ubuntu

Just follow this tutorial http://forum.xda-developers.com/showthread.php?t=1077377

My 64bit RULES FILE:
ACTION!="add", GOTO="gtab_rules_end"
SUBSYSTEM!="usb|usb_device", GOTO="gtab_usb_end"

ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="685e", MODE="0777" SYMLINK+="gtab"

LABEL="gtab_usb_end"

LABEL="gtab_rules_end"

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

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

April 29, 2010

[SOLVED] Android: Using Custom Fonts


Android comes with 3 fonts (Sans, Serif, Monospace) which can be accesed using android:typeface="FONT_NAME". But most of the times you would want to use your own fonts instead of the stock ones. Android provides an "assets" folder where you can put your TTF font files and access them from within the code.



There are two ways of doing this,



1. Assign the Typeface object to TextView,



2. Paint the Typeface on screen Canvas.





Method 1 - Assigning Typeface object to TextView



public void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

TextView bauhs = null,chiller=null,broadw=null,joker=null ;
Button mag=null;

setFont(bauhs, "fonts/BAUHS93.TTF", R.id.bauhs);

setFont(broadw, "fonts/BROADW.TTF", R.id.broadw);

setFont(chiller, "fonts/CHILLER.TTF", R.id.chiller);

setFont(joker, "fonts/JOKERMAN.TTF", R.id.joker);

setFont(mag, "fonts/MAGNETOB.TTF", R.id.magneto);

}

void setFont(TextView name, String path, int res)
{
name=(TextView)findViewById(res);
Typeface font = Typeface.createFromAsset(this.getAssets(), path);

name.setTypeface(font);

}


- "Typeface" is the class for handling fonts.


- The createFromAsset() method is used to specify the font path.


font object is assigned to the TextView name



Method 2 - Drawing the font on screen canvas



@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(new FontView(this));
}

private static class FontView extends View
{
private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private Typeface mFace;

public FontView(Context context)
{
super(context);

// mFace = Typeface.createFromAsset(getContext().getAssets(),"fonts/MAGNETOB.TTF");

mPaint.setTextSize(34);
mPaint.setColor(Color.WHITE);
}

@Override
protected void onDraw(Canvas canvas)
{
canvas.drawColor(Color.BLACK);

drawFont(canvas, "fonts/BAUHS93.TTF", 50, "Bauhaus 93");

drawFont(canvas, "fonts/BROADW.TTF", 150, "Broadway");

drawFont(canvas, "fonts/CHILLER.TTF", 250, "Chiller");

drawFont(canvas, "fonts/JOKERMAN.TTF", 350, "Jokerman");

}

void drawFont(Canvas canvas, String path, int y, String name)
{
mFace = Typeface.createFromAsset(getContext().getAssets(),path);

mPaint.setTypeface(mFace);
canvas.drawText(name, 30, y, mPaint);

}
}


- We need to extend the View class to access and override the onDraw() method.



- A Paint object is created which allows us to set the font size and color.



- The TypeFace object mFace is assigned to mPaint which is drawn on screen using the drawText().



drawText() takes 3 parameters, the text to be painted, its X-Y location and the Paint object.





Note: There is a difference between arial.ttf and ARIAL.TTF . If it ARIAL.TTF in your /assets folder and arial.ttf in your code, it will not work.

So if you have set the path correct but still wondering why the font is not being displayed, check this naming.


Source: Using Custom Fonts - ModMyGPhone Wiki.

May 15, 2009

svn:externals

"This assumes that your project layout looks something like this:

project/
branch/
production/
tag/
trunk/

* In the top of your project trunk, execute the following:

svn propedit svn:externals .

* This will open an editor session. In the file opened by your editor, each line indicates a different external svn repo to pull. The first segment of the line is the directory where you want the pull to exist. The last segment is the svn repo URL to pull. You can have an optional middle argument indicating the revision to use. Some examples:
o Pull framework repo from head:

framework http://framework.zend.com/svn/framework/trunk

o Pull framework repo from revision 2616:

framework -r2616 http://framework.zend.com/svn/framework/trunk

* After saving and exiting, update the repo:

svn up

* Commit changes:

svn commit

One thing to note: any directory you specify for an svn:externals checkout should not already exist in your repository. If it does, you will get an error like the following:

svn: Working copy 'sharedproject' locked
svn: run 'svn cleanup' to remove locks
" weierophinney.net

After that add default username for svn host (because we do not have username of external repository)

  • Linux


vi ~/.ssh/config
Host svn.wn.d-o-m.org
User <svnuser>


  • Windows - set default username for <svn-host> via putty

March 20, 2009

InnoSetup - exclude files

"Specifies a list of patterns to exclude, separated by commas. This parameter cannot be combined with the external flag.

Patterns may include wildcard characters ("*" and "?"). Note that unlike the Source parameter, a simple Unix-style pattern matching routine is used for Excludes. Dots in the pattern are always significant, thus "*.*" will not exclude a file with no extension (instead, use just "*"). Also, question marks always match exactly one character, thus "?????" will not exclude files with names less than five characters long.

If a pattern starts with a backslash ("") it is matched against the start of a path name, otherwise it is matched against the end of a path name. Thus "foo" will only exclude a file named "foo" at the base of the tree. On the other hand, "foo" will exclude any file named "foo" anywhere in the tree.

The patterns may include backslashes. "foobar" will exclude both "foobar" and "subdirfoobar". "foobar" will only exclude "foobar".
Examples:

Source: "*"; Excludes: "*.~*"
Source: "*"; Excludes: "*.~*,Temp*"; Flags: recursesubdirs
" downloadatoz.com

March 19, 2009

HOWTO: Automatically get svn revisions number under windows

"The example below shows how keywords in a template file are substituted in the output file.

// Test file for SubWCRev: testfile.tmpl

char *Revision = "$WCREV$";
char *Modified = "$WCMODS?Modified:Not modified$";
char *Date = "$WCDATE$";
char *Range = "$WCRANGE$";
char *Mixed = "$WCMIXED?Mixed revision WC:Not mixed$";
char *URL = "$WCURL$";

#if $WCMODS?1:0$
#error Source is modified
#endif

// End of file

After running SubWCRev.exe path\to\workingcopy testfile.tmpl testfile.txt, the output file testfile.txt would looks like this:

// Test file for SubWCRev: testfile.txt

char *Revision = "3701";
char *Modified = "Modified";
char *Date = "2005/06/15 11:15:12";
char *Range = "3699:3701";
char *Mixed = "Mixed revision WC";
char *URL = "http://tortoisesvn.tigris.org/svn/tortoisesvn/...
trunk/src/SubWCRev";

#if 1
#error Source is modified
#endif

// End of file
" tortoisesvn.net

November 17, 2008

PERL: Snippet which traverses from root folder to sub folder inside it

"#!/usr/bin/perl
use strict;

&smash("/archive");

sub smash {
my $dir = shift;
opendir DIR,
$dir or return;
my @contents = map "$dir/$_", sort grep !/^\.\.?$/, readdir DIR;
closedir DIR;
foreach (@contents) {
next unless !-l && -d;
&smash($_);
}
}" forums.devshed.com