Category: Blog

Forcing HTTP Auth in Cocoa

I’ve got asked how to implement an forced authentication in an URLRequest in Objective-C & Cocoa. Adding the Auth Header to the Request is easy… Base64 encoding the string is more complicated, due to missing methods in Cocoa. The get this done, we need to implement our own base64 method. 1 2 3 4 5 [...]



Galton Board in ObjectiveC

Target was to build an application to simulation a “Galton Board“. Galtonsches_Brett.h 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #import   @interface Galtonsches_Brett : NSObject { @private   }   – (void)Calculate:(double)numBalls field0:(NSProgressIndicator**)field0 field1:(NSProgressIndicator**)field1 field2:(NSProgressIndicator**)field2 field3:(NSProgressIndicator**)field3 field4:(NSProgressIndicator**)field4 field5:(NSProgressIndicator**)field5;   – (int)RandomField; @end Galtonsches_Brett.m 1 2 3 [...]



dec2bin function

This Function converts a decimal number into a 8bit long binary number.   std::string dec2bin(int dec) { int size = 8; bool bin[size]; int counter = size-1;   if (dec > 255) { return "Maximal 255"; }   // init the array for(int i = size; i >= 0; i–) { bin[i] = false; } [...]



sqrt() Function

This is the way sqrt works… Why do i have to code this by my own? const float EPSILON = 1e-6;   float working = val; float diff = 0; float keep = 0; float result = 0; int counter = 0;   do { result = (keep + working) / 2; //std::cout << "("<<keep<<"+"<<working<<") [...]



Ultimate Project Status

I’ve just commited the version 0.1.1 of the Ultimate ProjectStatus Plugin for WordPress. With this Plugin you can show the status of all of your projects extremly cool on your website. For more information and the download go to the official WordPress Plugin Site.



CoreData Model Migration

If you are working on your project in XCode you will mostly use CoreData to handle the whole Data stuff. For this you designed a DataModel. Especially in the beginning of your project you need to change Attributes etc. very often in your DataModel. After changing something in your DataModel and build the project you [...]



Coding Section of Zero-One is online

This Site is the coding playground of Zero-One. The founders of Zero-One are also students at the KTSI, Switzerland. During the work in Zero-One and KTIS a lot of coding knowledge is flooding our brains. code.zero-one.ch is the central pod of collecting…