Posts Tagged ‘Code’

Palm Pre mit Vodafone und Daten Flat

update:
ich habe eben noch mal mit Vodafone telef. aufgrund, das die änderung in wap.vodafone.de

nur GPRS empfang ergab. Und das ist auch richtigt ! Siehe http://www.vodafone.de/konfig

aber GPRS suckt ja ordentlich. Für Umts braucht man einen Vodafone Daten Tarif was ich auch hab’

also sind keine Änderungen nötig !!! Die Änderung, die unten beschrieben wird gilt nur für den Vodafone Life! Tarif !!


Ich habe mir gestern das Pre besorgt, schick schick aber ich habe Vodafone mit Datenflat bedeutet,
das man eine kleine Einstellung beim Pre vornehmen muss um nicht in die Kostenfalle zu tappen.

Aber Achtung – bitte vorher bei Vodafone anrufen und sich nach dem eigenen Tarif erkundigen.
Aber Achtung – alle änderungen die nun folgen sind auf eigene Gefahr !!

Das mini Tutorial erfordert schon fortgeschrittene Kenntnisse ansonsten könnt’s eng werden.

1. Root
Einen guten howto für den Root Zugang habe ich hier gefunden Palm Pre Root Zugang also dann erstma “bis später …”

2. APN
man muss den richtigen APN Zugangspunkt eingeben dafür habe ihr jetzt ja auch den root zugang. Also
putty öffnen und in die console

  |  copy |? 
1
cp /usr/lib/luna/CarrierNetworkSettings.db3 /media/internal

damit habt ihr die Datei CarrierNetworkSettings.db3 in einem für euch zugängliches Verzeichnis kopiert.

Jetzt einfach über den usb Modus die Datei auf euren Rechner übertragen.
Die Datei ist eigentlich eine kleine Datenbank des Typs Sqlite. Dort befinden sich die APN Zugänge.

Achtung ! – Eine Sicherungskopie der CarrierNetworkSettings.db3 anlegen. Falls was schief geht …..

Jetzt müssen wir diese Datei editieren. Ich persönlich finde den sqlite-manager am Besten !! Plattform unabhängig und klein wie Sqlite. Also installieren.

Jetzt habt ihr im FF unter Extras den sqlite-manager damit mach ihr die CarrierNetworkSettings.db3 auf dort müsst ihr unter
com_palm_data_carriernetworksettings_DataConnectionSettings mal die suche öffnen und auf das Feld APN contains web
eingeben.
apn-sql-lite-palmpre-vodafone
dort das feld web.vodafone.de mit wap.vodafone.de ersetzen und fertig.

Zur Sicherheit könnt Ihr noch die Tabelle durchsuchen ob da noch irgendwo web steht. Dies sollte nicht der Fall sein.
Mir ist von Vodafone gesagt worden, das die Flatrate nur für den APN wep gilt. Sollte man über web gehen wird’s teuer !!
Hier könnt ihr aber auch noch mit der Hotline reden über mehr Info’s bin ich auch dankbar.
!! Bitte über den Quick check im vodafone Portal mal ständig den Rechnungsstatus checken !!

So jetzt müssen wir die CarrierNetworkSettings.db3 irgendwie wieder zurück schaufeln dafür nutze ich

WebOS Quick Install

Wenn WebOS Quick Install bei euch läuft müsst ihr nur auf Tools -> Sendfile gehen und die überarbeitete db3 in die Verzeichnisse

  |  copy |? 
1
/usr/lib/luna/ 
&
  |  copy |? 
1
/var/luna/data/
kopieren.

das wars’.

Schon 24h um und keine Kosten zu sehen.

http://privatefunction.net/wp-content/plugins/sociofluid/images/digg_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/delicious_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/technorati_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/google_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/facebook_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/mixx_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/twitter_32.png

Securimage PHP Captcha AS3 Class

about1

This CAPTCHA Class uses Securimage. You can get it here

Securimage is an open-source free PHP CAPTCHA script for generating complex images and CAPTCHA codes to protect forms from spam and abuse…

show.php

  |  copy |? 
1
2
include 'securimage.php';
3
$img = new securimage();
4
$img->show();
5

To load the created image, just write an URLLoader than a Loader, that loads the URLLoader data ….

Captcha.as

 as3 |  copy |? 
01
02
 public class Captcha extends Sprite
03
 {
04
 private var _loader:URLLoader;
05
 private var _captchadata:BitmapData;
06
 private var _captcha:Bitmap;
07
 private var _cont:Sprite;
08
09
 public function Captcha()
10
 {
11
 this._cont = new Sprite();
12
 this._cont.useHandCursor = true;
13
 this._cont.buttonMode = true;
14
15
 this._loader = new URLLoader();
16
 this._loader.dataFormat = URLLoaderDataFormat.BINARY;
17
 var url:String = "show.php";
18
 var urlReq:URLRequest = new URLRequest(url);
19
20
 this._loader.addEventListener(Event.COMPLETE, completeHandler);
21
 this._loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
22
 this._loader.load(new URLRequest(url));
23
 }
24
 private function ioErrorHandler(e:IOErrorEvent):void
25
 {
26
 //SOS.alert(_e.toString());
27
 }
28
 private function completeHandler(e:Event):void 
29
 {
30
 this._loader.removeEventListener(Event.COMPLETE, completeHandler);
31
 this._loader.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
32
33
 var myLoader:Loader = new Loader();
34
 myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createCaptcha);
35
   
36
 var byteArr:ByteArray = new ByteArray();
37
 byteArr = this._loader.data;
38
39
 if(byteArr.length != 0) { myLoader.loadBytes(this._loader.data); } 
40
 else { /* SOS.alert("error"); */ }
41
 }
42
 private function createCaptcha(e:Event):void
43
 {
44
 this._captchadata = new BitmapData(175, 45, false, 0xFFFFFF); //sizes of secureimage.php ~ Line 89
45
 this._captchadata = (e.target.content).bitmapData;
46
47
 this._captcha = new Bitmap(this._captchadata, "auto", true);
48
 this._captcha.x = 920;
49
 this._captcha.y = 92;
50
 this._cont.addChild(this._captcha);
51
 this._cont.addEventListener(MouseEvent.MOUSE_DOWN , renew);
52
 this.addChildAt(this._cont,0);
53
 }
54
 private function renew(_me:MouseEvent):void
55
 {
56
 this._cont.removeChildAt(0);
57
 var url:String = "show.php?"+Math.random()*100;
58
 var urlReq:URLRequest = new URLRequest(url);
59
60
 this._loader.addEventListener(Event.COMPLETE, completeHandler);
61
 this._loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
62
 this._loader.load(new URLRequest(url));
63
64
 }
65
 }
66

I hard-coded some dimensions inside the class, and some other ugly things, so feel free to change for your needs.
But don’t forget to put the Math.random() after the URI to refresh the captcha, this can avoid caching issues.
You can see this class Working here. Click on the share Btn.

Sure, this class can be used to load nearly all types of binary image data ….

http://privatefunction.net/wp-content/plugins/sociofluid/images/digg_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/delicious_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/technorati_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/google_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/facebook_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/mixx_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/twitter_32.png

Copy to Clipboard” functionality using JavaScript and Flash

In my oppinion “copy to clipboard” buttons don’t have a real

usability benefit. The only thing they do is open new security holes.

Also the need to be updated when Browsers or Plugins change.

In the Past there was an approach using Flash, but since Player 10

this does not work any more. Sure there are new clipboard function

in Player 10 but what about the users < FP 10 ?

At the Moment there is a Js Library called Zero Clipboard which uses

Clickjacking to achieve the copy…..

http://privatefunction.net/wp-content/plugins/sociofluid/images/digg_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/delicious_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/technorati_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/google_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/facebook_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/mixx_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/twitter_32.png

Live audio visualization in flash pt I

bytearray

Just for a short overview,

I sometimes play drum and bass on parties. To improve the audience experience, I use flash to visualize the digital culture I’m living. For this, I wrote some applications in flash and air. These apps are more experiments to find out how my sound can influence visual media to generate a special atmosphere.

Sometimes some people notice what I am doing or know what is happening. Therefore, questions came up and it is difficult to have a productive conversation at a party….

So why flash?

I think the main reason was that I wanted to experiment with Flash and later on with the new features of the player 10.

So let us get started.

The first step to reach the stuff I had in mind was to grab the audio signal. I have a line-in, so let us take a look what possibilities I have in flash to use this. I found the flash.media package providing some classes to access the microphone and the sound spectrum. I found out that it was not really easy to get apply the computeSpectrum method on the microphone. So I thought. O.K. I’ll code a Java app that catches the audio signal, computes spectrum and send this data as bytearray to flash. However, this was not very cool, even having some java code, I could re use and I wanted to stay with flash.

I explored the possibilities and none of them were easy and latency efficient for my purposes. I really needed some time to find the solution and it was sooo simple !

Setup a streaming Server on your computer. My choice after some tests was Icecast2 here is a sample of my config:

  |  copy |? 
01
02
<icecast>
03
	<limits>
04
        	<sources>2</sources>
05
 <queue-size>0</queue-size>
06
 <burst-on-connect>1</burst-on-connect>
07
 <burst-size>0</burst-size> 
08
    </limits>
09
    <authentication>
10
        <source-password>hackme</source-password>
11
        <relay-password>hackme</relay-password>
12
        <admin-user>admin</admin-user>
13
        <admin-password>hackme</admin-password>
14
    </authentication>
15
 
16
    <hostname>localhost</hostname>
17
	<listen-socket>
18
<port>6666</port>
19
    </listen-socket>
20
    <fileserve>1</fileserve>
21
<paths>
22
        <logdir>./logs</logdir>
23
        <webroot>./web</webroot>
24
        <adminroot>./admin</adminroot>
25
        <alias source="/" dest="/status.xsl">
26
    </alias>
27
    <logging>
28
        <accesslog>access.log</accesslog>
29
        <errorlog>error.log</errorlog>
30
      	<loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
31
</logging></paths></icecast>

Setup a streaming client on your computer like Edcast and choose the right audio in.

When you get this programs running you will have a streaming server running under the following URL:

http://localhost:6666/stream

or if you are using shoutcast :

….. /;stream.nsv

So now, you can catch this audio stream from your flash app like this:

  |  copy |? 
1
2
this._sfx = new Sound();
3
var req:URLRequest = new URLRequest("http://localhost:6666/stream");// /;stream.nsv
4
var context:SoundLoaderContext = new SoundLoaderContext(0, false);
5
this._sfx.load(req, context);
6
this._channel = this._sfx.play();
7
SoundMixer.bufferTime=0;  // works for me locally
8

Now you can get the spectrum over an onEnterFrame Event with SoundMixer.computeSpectrum. I am going to explain this in part II

http://privatefunction.net/wp-content/plugins/sociofluid/images/digg_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/delicious_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/technorati_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/google_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/facebook_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/mixx_32.png http://privatefunction.net/wp-content/plugins/sociofluid/images/twitter_32.png
Return top

INFORMATION