Author Archive

Hi,

Today I just looked again for a solution to watch flash movies (Hulu etc.) on my iPhone

Finaly I found a simple Solution that works fine as long you just like to watch, not interact, whats on your PC/Mac.

1. I installed SoundFlower http://cycling74.com/products/soundflower/ that routes Audio to another Source.

2. I downloaded “CamTwist” http://allocinit.com/index.php?title=CamTwist  where I selected a partial frame from my Desktop and set it as a new virtual WebCam.

3. I installed the App (iCam webcam video streaming) from iTunes on my iPhone and installed the server app “iCamSource” (from the same developer) on my iMac. There I selected CamTwist as Webcam Source and Soundflower as AudioDevice. (in Preferences I made Soundflower get all Audio Output)

VOILA … Every Movie I can watch on my Mac i can watch now WITH AUDIO on my iPhone :)

Hope you like it.

Chris

CGRect nextMonthButtonFrame = CGRectMake(10,10,50,50);

UIButton *nextMonthButton = [[UIButton alloc] initWithFrame:nextMonthButtonFrame];

[nextMonthButton setImage:[UIImage imageNamed:@"kal_right_arrow.png"] forState:UIControlStateNormal];

nextMonthButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;

nextMonthButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;

[nextMonthButton addTarget:self action:@selector(prevMonth) forControlEvents:UIControlEventTouchUpInside];

[calendarview addSubview:nextMonthButton];

[nextMonthButton release];

Category: xcode  Leave a Comment

Hi, Just i dont have so much time right now, here some snippets I collected for myself over the last couple of weeks


1.

Should u use Wireshark and dont get it work, try this to find the Interfaces

sudo chmod 644 /dev/bpf*


2.

MOUNT a ISO within yout MAC OSX
hdiutil mount image.iso


3.

Dump Wifi Data

sudo tcpdump -i en1 -v    // to dump all wifi data

sudo tcpdump -i en0 -v   // to dump all ethernet data


4.

Create a Screenshot programmaticly in your iPhone

IPhone screenshot

CGImageRef UIGetScreenImage();


5.

MySQL TRICK

update cdent_clients set fachcode = replace(fachcode, “kfo”, “kf”)

= replace all ‘kfo’ in fachcode into “kf”

update cdent_clients set fachcode = replace(fachcode, “.”, “,”)


6.

Convert WAV to CAF

afconvert -f caff -d LEI16@44100 -c 1 laugh3.wav laugh3.caf

CONVERT WAV TO CAF

find ./ -type f  -exec grep -l ‘hello’ {} \;


7.

set text with two different strings or chars

galaxydesc.text = [NSString stringWithFormat:@"%@ %s",   @"Actual Image: ",   picdesc   ];


8.

Make GLOBAL int or other Variables

place your wished global Variable in a external .h and import in each .m where you need

or place it in you _prefix.pch file which is imported to any .m automaticly

#ifdef __OBJC__

#import <Foundation/Foundation.h>

#import <UIKit/UIKit.h>

extern int firsttime;

#endif

important  write “extern” before you declaration!

Than in each .m just declare it as usual with example

int firsttime = 0;


9.
Draw Image in your View

NSString* imageFileName = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@”redarea.png”];

CGDataProviderRef provider = CGDataProviderCreateWithFilename([imageFileName UTF8String]);

CGImageRef image = CGImageCreateWithPNGDataProvider(provider, NULL, true, kCGRenderingIntentDefault);

CGDataProviderRelease(provider);

// Draw image

CGContextSaveGState(context);

CGContextTranslateCTM(context, 0, 320);  // this is to rotate the image if it is upside down

CGContextScaleCTM(context, 1.0, -1.0);    // part II of rotation

CGContextDrawImage(context, CGRectMake(0, 0, 480, 320), image);

CGContextRestoreGState(context);

CGImageRelease(image);


10.
DISABLE SLEEP MODE

- (void)applicationDidFinishLaunching:(UIApplication *)application {

// Disable Sleep Mode

application.idleTimerDisabled = YES;

// Override point for customization after application launch

[window makeKeyAndVisible];

}


11.
Debugging with NSLOG

int myNumber = 3;

NSString *myText = @”Dog”;

NSLog(“My number is %i and my text is %@.”, myNumber,myText);

While

%i, %d signed integer

%u unsigned integer

%f float

%@ object


12.

//Change Status Bar Orientation

[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;

//Activity Indicator in Status Bar

[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;  // or YES

//Show or Hide Status Bar

[self.navigationController setNavigationBarHidden:TRUE animated:NO];  // or NO to Hide

or in Case [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];


13.
//Paint a Line in a View

- (void)drawRect:(CGRect)rect {

// Paint LINE

CGContextRef context = UIGraphicsGetCurrentContext();

CGContextSetLineWidth(context, 2.0);

UIColor *color= [UIColor blueColor];

CGContextSetStrokeColorWithColor(context, color.CGColor);

CGContextMoveToPoint(context, 10.0,10.0 );

CGContextAddLineToPoint(context, a,100.0);

CGContextStrokePath(context);

}


14.
//Place a Text in a View

- (void)drawRect:(CGRect)rect {

// Set Text

CGAffineTransform xform = CGAffineTransformMake(1.0,  0.0,0.0, -1.0,0.0,  0.0);

CGContextSelectFont(context, “Arial”, 24, kCGEncodingMacRoman);

CGContextSetTextMatrix(context, xform);

//CGContextSetTextDrawingMode(context, kCGTextFill);

CGContextSetRGBFillColor(context, 0, 0, 0, 1);

CGContextShowTextAtPoint(context, a,21, text, strlen(text)-1);

//[color release];

}


15.
//Update your drawRect by Timer

Set a Time Call in your Startup:

[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(onTimer) userInfo:nil repeats:YES];

-(void) onTimer {

// Code what you like to update. For example:  a++;

[self setNeedsDisplay];

}


Hi,

thanks to Mike from http://www.71squared.com

I go finaly OpenAL playing a Sound on my iPhone :)

I am not a big writer as usual so just see the Code

You may find a full functional XCode Demo (its on 3.2.2)
on my HP: http://2t4u.com/playopenal.zip

I added also a small function: checkSoundWithKeyPlaying(soundID)

Just look at the Source and when you start your Project
look into your CONSOLE !! to see if the Sound is still playing or not!

Enjoy and Thanks to Mike for the Base.

Greets
Chris

Category: xcode  Leave a Comment

Simple RSS Reader

function getrssdata($rssx,$item_strip)

{

$rsslength = strlen ($rssx);

$title_start=strpos($item_strip,”<”.$rssx.”>”);

$title_end=strpos($item_strip,”</”.$rssx.”>”);

$title_length=$title_end+$rsslength+3-$title_start;

$title=substr($item_strip, $title_start+$rsslength+2, $title_length-(($rsslength*2)+5));

return trim($title);

}

function readrss($rssfile)

{

global $fldID, $fldCountry, $fldCountryIndex;

$array=file_get_contents($rssfile);

$i=0; $counti=0;

while ($i!=1) {

$item_start=strpos($array,”<rec>”);

if ($item_start===false) {

$i=1;

}

else

{

$item_end=strpos($array,”</rec>”);

$item_length=$item_end+6-$item_start;

$item_strip=substr($array,$item_start,$item_length);

$fldID[$counti]           = getrssdata(“fldID”,$item_strip);

$fldCountry[$counti]      = getrssdata(“fldCountry”,$item_strip);

$fldCountryIndex[$counti] = getrssdata(“fldCountryIndex”,$item_strip);

$array=substr($array,$item_end+6); $counti++;

}

}

}

//———————————————————————————

readrss (“http://xxx.xx/myxml.xml”);

$arr_size = count ($fldID);

echo “Centers found: “.$arr_size.”<br><br>”;

function getrssdata($rssx,$item_strip)
{
$rsslength = strlen ($rssx);
$title_start=strpos($item_strip,”<”.$rssx.”>”);
$title_end=strpos($item_strip,”</”.$rssx.”>”);
$title_length=$title_end+$rsslength+3-$title_start;
$title=substr($item_strip, $title_start+$rsslength+2, $title_length-(($rsslength*2)+5));
return trim($title);
}
function readrss($rssfile)
{
global $fldID, $fldCountry, $fldCountryIndex, $fldCity, $fldCityAlias, $fldHost, $fldStreet, $fldcode,
$fldCityLocation, $fldTelefon, $fldTelefon2, $fldTelefon3, $fldFax, $fldHandy, $fldHandy2,
$fldDWBEmail, $fldForwardEmail, $fldURL, $fldFounded, $fldLongitude, $fldLatitude, $fldTyp;
$array=file_get_contents($rssfile);
$i=0; $counti=0;
while ($i!=1) {
$item_start=strpos($array,”<rec>”);
if ($item_start===false) {
$i=1;
}
else
{
$item_end=strpos($array,”</rec>”);
$item_length=$item_end+6-$item_start;
$item_strip=substr($array,$item_start,$item_length);
$fldID[$counti]           = getrssdata(“fldID”,$item_strip);
$fldCountry[$counti]      = getrssdata(“fldCountry”,$item_strip);
$fldCountryIndex[$counti] = getrssdata(“fldCountryIndex”,$item_strip);
$fldCity[$counti] = getrssdata(“fldCity”,$item_strip);
$fldCityAlias[$counti] = getrssdata(“fldCityAlias”,$item_strip);
$fldHost[$counti] = getrssdata(“fldHost”,$item_strip);
$fldStreet[$counti] = getrssdata(“fldStreet”,$item_strip);
$fldcode[$counti] = getrssdata(“fldcode”,$item_strip);
$fldCityLocation[$counti] = getrssdata(“fldCityLocation”,$item_strip);
$fldTelefon[$counti] = getrssdata(“fldTelefon”,$item_strip);
$fldTelefon2[$counti] = getrssdata(“fldTelefon2″,$item_strip);
$fldTelefon3[$counti] = getrssdata(“fldTelefon3″,$item_strip);
$fldFax[$counti] = getrssdata(“fldFax”,$item_strip);
$fldHandy[$counti] = getrssdata(“fldHandy”,$item_strip);
$fldHandy2[$counti] = getrssdata(“fldHandy2″,$item_strip);
$fldDWBEmail[$counti] = getrssdata(“fldDWBEmail”,$item_strip);
$fldForwardEmail[$counti] = getrssdata(“fldForwardEmail”,$item_strip);
$fldURL[$counti] = getrssdata(“fldURL”,$item_strip);
$fldFounded[$counti] = getrssdata(“fldFounded”,$item_strip);
$fldLongitude[$counti] = getrssdata(“fldLongitude”,$item_strip);
$fldLatitude[$counti] = getrssdata(“fldLatitude”,$item_strip);
$fldTyp[$counti] = getrssdata(“fldTyp”,$item_strip);
$array=substr($array,$item_end+6); $counti++;
}
}
}
//———————————————————————————
//readrss (“http://www.kagyu.net/xml2.asp”);
//$arr_size = count ($fldID);
//echo “Worldwide Centers found: “.$arr_size.”<br><br>”;
Category: php  Leave a Comment

My little App “Chat World” for Android and iPhone came quiet successful in the last weeks. Over 20.000 Users already used it and more and more are coming.

I had to upgrad my servers, because it came so much load.

Now the next Step: “Chat World II”, I am already developing on.

It will include:

- Private Profil
- Your personal picture
- Selecting and hiding Chatters
- many other features that come in my mind while working on :)

In the next Days you will be able to pre-register.

Should u dont know “Chat World”, you may search in your Android Market and iTunes Market for iPhone.

Hear you soon.

Yours Chris

Hi, you may like to copy whole folders from one server to another.

as long your both server support ssh you should try

scp -r username1@xxx.xxx.xxx.xxx:/home/folderorg username2@yyy.yyy.yyy.yyy:/home/folderdest

its very fast, because you dont have to copy the files to your local pc first.

Just replace username1 with the username from your first server
and xxx.xxx with the IP from your original server

and username2 with the username from your first server
and yyy.yyy with the IP from your destination server

you may also login to your original server and just do
scp -r  /home/folderorg  username2@yyy.yyy.yyy.yyy:/home/destfolder

have fun

Category: coding  Leave a Comment

Today I just would like to share with you the incredible artwork from
Erik Johansson . He makes the photos himself and work on them with photoshop.

erik-johansson-4

More from his work you find at his Homepage:

http://www.alltelleringet.com/

After one month in beautiful Sinai I am back in romania. We started to prepare the house for winter and so all walls get an additional isolation.

Now winter can come and we stay warm inside. Instead of freezing our body and conservating it for the future generations

18
Sep

I was reading about cartoonme.com and just came interested to try that service.

Here is the result for 3.50€ after 72hrs

(i just faded my original pic with 20%, i thought that looks even better)
.. .ok, that doesnt matter should u dont like my face at all :)

cartoonme2