HOME - WEBDESIGN / IPHONE APP - ALL IN VAIN - PICTURES - FORUM - DEVELOPEMENT - MYSPACE - TWITTER - YOUTUBE - CATEGORIES - Login/Registration - RSS

Countdown bis zum Greenfield 2011:


PL/SQL script which removes all data from all tables of a database


in Development,Scripts @ 16:00 am 9. September 2011
Comments: 0

I spent quite a bit of time today, because I needed something that removes all data from my oracle 11.0 database. I didn’t want to perform a drop command, as the tables should stay there. I tried it with the truncate command which failed because of the constraints.

This script disables all constraints, performs truncate commands on each table and re-enables the constraints. It’s generic and should work out of the box, that means you don’t have to change anything. Make sure that you run it as database user and not as sys user, otherwise it will fuck up the content of your tables :)

/******************************************************************************
   NAME:        
                clean_stm_database.sql
   PURPOSE:    
                This script first disables all constraints on all tables. In
                the second step, all data is being truncated on all tables.
                Last but not least, all constraints are re-enabled
   INSTRUCTIONS:
                Run this script as database user (e.g. STM_T)
   REVISIONS:
   Ver          Date          Author            Description
   ———    ———-    —————   ——————————-
   1.0.0        09.09.2011    Patrick Breiter   draft version
******************************************************************************/

rem DROP procedure clean_database;
SET serveroutput ON;

CREATE OR REPLACE procedure clean_database
AS
  table_name            varchar2(255);
  enabled_constraint    varchar2(255);
  disabled_constraint   varchar2(255);

BEGIN

  dbms_output.enable(1000000);
 
  – this loop disables all constraints in every table
  FOR c IN
  (SELECT c.owner, c.table_name, c.constraint_name
   FROM user_constraints c, user_tables t
   WHERE c.table_name = t.table_name
   AND c.STATUS = ‘ENABLED’
   ORDER BY c.constraint_type DESC)
  LOOP
    disabled_constraint:=c.constraint_name;
    dbms_utility.exec_ddl_statement(‘alter table ‘ || c.owner || ‘.’ || c.table_name || ‘ disable constraint ‘ || c.constraint_name);
    dbms_output.put_line(‘disabled: ‘ || disabled_constraint);
  END LOOP;

  – this loop truncates all data from every table
  FOR tab IN (SELECT table_name FROM user_tables ORDER BY table_name DESC)
  loop
    table_name:=tab.table_name;
    execute immediate ‘truncate table ‘|| table_name;
    dbms_output.put_line(‘truncated: ‘ || table_name);
  end loop;
 
  – this loop re-enables all constraints on all tables
  FOR c IN
  (SELECT c.owner, c.table_name, c.constraint_name
   FROM user_constraints c, user_tables t
   WHERE c.table_name = t.table_name
   AND c.STATUS = ‘DISABLED’
   ORDER BY c.constraint_type)
  LOOP
    enabled_constraint:=c.constraint_name;
    dbms_utility.exec_ddl_statement(‘alter table ‘ || c.owner || ‘.’ || c.table_name || ‘ enable constraint ‘ || c.constraint_name);
    dbms_output.put_line(‘re-enabled: ‘ || disabled_constraint);
  END LOOP;

END;
/

execute clean_database;

An Twitter senden, Geposted von Pädde


Änderungen seit facts 1.0.0


in Apps,Development,iPhone @ 14:43 am 3. Juni 2011
Comments: 0

Facts 1.3.1:
- Fehlerbehebung: “Next”-Button funktionierte nach Update nicht mehr.

Facts 1.3.0:
+ Zufallsgenerator –> via Einstellungen aktivieren.
+ Wenn Facts wegen ihrer Länge nicht auf Facebook gepostet werden können, wird es angezeigt.
+ Neue Animation, wenn Gerät geschüttelt wird und neuen Fact lädt.

Facts 1.2.0:
+ Suchfunktion für Favoriten
+ Alle Facts können nun in einer eigenen Tabelle gelesen werden. Suche in allen Facts
+ Andere Benachrichtigung, wenn ein Fact entfavorisiert wird in der Detail Ansicht
+ Weitere kleinere Fehlerbehebungen (Angepasste Schriftart beim lesen von Favoriten)
+ 85 neue Facts
+ Drastische Performance Verbesserung
+ Verbessertes Memory Management

Facts 1.1.0:
+ Facebook Integration!
+ Neue Icons!
+ Schüttle dein Gerät, um den nächsten Fact zu laden
+ Volle Retina Display Unterstützung
+ Verkleinertes Installationspacket
+ Neues Start Bild
+ Einige Fehler Behebungen
+ Dialog wird nun länger angezeigt, wenn ein Favorit hinzugefügt oder entfernt wird.
+ Neue Icons, wenn Favoriten hinzugefügt oder entfernt werden.

An Twitter senden, Geposted von Pädde


facts iPhone app


in Allgemeines,Apple,Apps,Bekanntgabe,Code,Development,Review,XCode @ 21:53 am 6. Mai 2011
Comments: 0

So, ich habe eine neue iPhone Applikation am start mit dem Namen “Facts”.

Als ich mit dem iPhone Programmieren begonnen habe, wollte ich eine Applikation erstellen, mit der man Zugriff auf Tausende von Fakten rund ums Leben hat. Ich habe begonnen überall im Internet solche Facts zu suchen und habe bis heute über 2900 zusammen.

Ich werde nun einige Screenshots zeigen und die App kurz erklären:

Der Willkommensscreen sieht wie folgt aus. Die interne Facts Datenbank wird überprüft.

Der Hauptscreen der App sieht so aus. Hier kann man den Fact lesen und mit den Vor- und Zurückknöpfen navigieren. Desweiteren gibt es eine Favoriten Funktion, welche den jetztigen Fact zu den Favoriten legt. Dafür muss man auf den Stern klicken. Wenn der Fact in der Vergangenheit schon einmal gelesen wurde, dann wird das angezeigt. Somit weisst du immer, ob du alte Facts liest, die du schon kennst. Schüttle dein Gerät um zum nächsten Fact zu gelangen.


Klicke hier, um die ganze Review zu lesen.
(weiterlesen…)

An Twitter senden, Geposted von Pädde


how to dismiss keyboard in uitextview


in Allgemeines,Anleitung,Development,How-To,iPhone,Tutorial @ 16:02 am 15. März 2011
Comments: 0

In my iPhone application I had a UITextView and I wanted to allow the user to insert text and submit it. The problem was that the keyboard didn’t disappear when you clicked on return or done. I searched quite a bit and found this working solution:

In your controller .h file:

@interface YourController : UIViewController  {
IBOutlet UITextView *textView;
}

In your controller.m file:

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
NSLog(@"called");
if([text isEqualToString:@"\n"]) {
[textView resignFirstResponder];
return NO;
}
return YES;
}

This function gets called every time you insert a character. If you click on Return/Finish/Whatever, the keyboard will be dismissed.
If it doesnt work, open Interface Builder and map your UITextView with the Files owner and assign delegate. Put your comments into the comment section.


An Twitter senden, Geposted von Pädde


stackoverflow


in Service @ 10:59 am 9. März 2011
Comments: 0

For programmers it’s quite important to get help from more experienced users. As none of my friends are programmers, I have to search the internet for any solutions. Since a while I am using stackoverflow. That’s a website where you can ask a particular question and most likely you will get an answer/solution. Based on your reputation, your willingness to support other users, you can collect badget and your reputation increases.


profile for dooonot at Stack Overflow, Q&A for professional and enthusiast programmers

I love this website and will hopefully be able to answer some questions in the future ;)


An Twitter senden, Geposted von Pädde


apple wireless keyboard unboxing and installing


One week ago I bought the Apple Cinema Display 27 Inch and I used my old cabled keyboard from Apple. This keyboard was like 2 years old and the “T” key didn’t work properly :) So I decided to go to the next Apple Store to buy the wireless keyboard.


(weiterlesen…)

An Twitter senden, Geposted von Pädde


sqlite3 umlauts/special character problem


When you are developing an iPhone application, you will most likely have to use an internal database to store your data. I also needed a database for my Facts iPhone application. As the app contains german words, it also contains umlauts and special characters like äöü and all this stuff that is not present in the english language. However, I was not able to support these special characters although I used UTF8 encryption in my application.

To create the database, I used the following commands in terminal:

cd Desktop
mkdir FactsDatabase
cd FactsDatabase
sqlite3 facts.sqlite

Now you will see the sqlite command prompt which only accepts sql commands from now on. This is where I have created my database, and inserted some facts:

// create table
create table facts(id integer primary key, fact text, isFavorite varchar(5), alreadyRead varchar(5));

// fill database with facts
sqlite3 facts.sqlite “INSERT INTO facts(fact, isFavorite, alreadyRead) values(‘Täglich werden 12 Neugeborene den falschen Eltern gegeben.’, ‘no’,'no’);”

Now if you do it like this, the special characters won’t show up in your application. After some hours of trying I tried to use run my sqlite commands in a shell script. I had to rearrange the commands to fit like this:

# drop exising table
sqlite3 facts.sqlite “drop table facts;”

# create database
sqlite3 facts.sqlite “create table facts(id integer primary key, fact text, isFavorite varchar(5), alreadyRead varchar(5));”

# fill database with facts
sqlite3 facts.sqlite “INSERT INTO facts(fact, isFavorite, alreadyRead) values(‘Täglich werden 12 Neugeborene den falschen Eltern gegeben.’, ‘no’,'no’);”

Save it as database.sh and in terminal, give it the rights to execute: chmod+x database.sh, and then run it with ./database.sh
If you do it like this, the special characters are finally in the database and will show up in your application. To be honest, I have no idea why it only works with this workaround. It costed me quite a bit of time. Anyway, hope that helps anyone. If you have questions, use the comment section. Cheers.


An Twitter senden, Geposted von Pädde


all in vain iphone applikation


in Apple,Apps,Bekanntgabe,Code,Computer,Design,Development,iPhone,iPod Touch,XCode @ 13:42 am 26. Februar 2011
Comments: 0

Heute wurde meine 2. iPhone Applikation von Apple frei gegeben. Die Applikation beschäftigt sich mit meiner Band All in Vain. Hier ein kurzer Einblick, was Ihr mit der App so anstellen könnt:

All in Vain ist eine junge, aufstrebende Punkrock/Alternative Band von Luzern (Schweiz). Diese Applikation bietet Zugriff auf alle wichtigen Daten rund um die Band.

Einige der Features im Überblick:

- Alles über All in Vain
- Bandmembers einzeln vorgestellt (Details, Fotos, Equipment, Hobbies, etc).
- Eine Media-Rubrik mit unveröffentlichen Demo Aufnahmen, welche nur mit dieser iPhone App gehört werden können!
- Schau dir Bilder der Band und Ihren Projekten an (inkl. All in Vain Groupie Pics, Demo Session, Rock Night Sursee). Sobald neue Bilder verfügbar sind, werden sie automatisch uf deinem iPhone geladen.
- Normal Display und iPhone 4 Retina Display Support.
- RSS Feed, welcher dir alle Beiträge von www.allinvain.ch auf einen Blick präsentiert. Schüttle dein iPhone oder zieh mit dem Finger über die Tabelle um die Feeds zu aktualisieren.
- Tour/Konzert Übersicht –> somit weisst du immer, wo die nächsten Konzerte stattfinden werden. Nebst Konzertdaten siehst du auf einer Maps Karte direkt, wo sich die Location befindet.
- Direkten Zugriff auf “All in Vain”-Channels wie Facebook, Twitter und Youtube!
- All in Vain Sponsoring Übersicht.
- Ordne die Tab Icons an wie’s dir am Besten passt. Sie können im ‘Mehr’-Menu verändert werden.
- Dank Apples Push Notifications bist du immer auf dem neusten Stand. (Neue Websiten Einträge, neue Tourdaten, Allgemeine Informationen).

Funktionen, die bald kommen werden:
- Werde ein Groupie von der Band oder von einzelnen Mitgliedern.
- Songtexte.

Für diese Applikation braucht es eine Internetverbindung (Bilder, RSS Feeds, Tourdaten, Songs, Verschiedene Channels).

Zum Schluss noch einige Bilder und der Link zur Applikation im iTunes Store:

An Twitter senden, Geposted von Pädde


Xcode Debugger has exited with error code 45


in Anleitung,Computer,Cydia,Development,iPhone,Macbook Pro,XCode @ 16:16 am 14. Februar 2011
Comments: 0

I jailbroke my iPhone some days ago with the GreenPois0n Tool and installed all my stuff. When I was using my iPhone for Developing I found out that the debugger always exited with error status code 45. First I thought it was a problem with my app but then I tried with a non-jailbroken iPhone 3GS and it worked without errors. I debugged the output code and found out that the “PhotoAlbums+” application which gives you the ability to create photo folders crashed all the time. I uninstalled this app from Cydia and now I can continue with development. Just as information if someone has the same problem :)


An Twitter senden, Geposted von Pädde


17.12.2010 – Neue Artikel von China!


in Allgemeines,China,iPhone,iPod Touch @ 13:33 am 17. Dezember 2010
Comments: 1

Heute kam eine neue Lieferung aus Hong Kong. Es gibt neue Sachen zum verkaufen:

  • - 5x iPhone Kabel 1 Meter Weiss (je 5.-)
  • - iPhone 4 Autoscheiben Halterung (10.-)
  • - 2x 1 Meter HTC Micro USB Aufladekabel (je 5.-)
  • - 1x iPhone 4 Sportarmband (5.-)

Meldet euch auf doonot [at] doonot [dot] com um die Sachen zu reservieren oder zu bestellen. Postversand ist möglich und kostet meist nicht mehr als 1.-

An Twitter senden, Geposted von Pädde


Nächste Seite »