Search Results

Search found 69 results on 3 pages for 'koning baard'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Syncing an iPod or iPhone with Cocoa

    - by Koning Baard XIV
    I'm creating an iTunes clone in Cocoa (don't ask why, it's not evil) and I want to be able to sync my iPod with it. This means: music, photos, videos and podcasts. I couldn't really find anything, since Google only shows articles about iPod touch and iPhone programming, but I'm actually creating a desktop application for Mac OS X, and I also want to be able to sync click-wheel iPods. Is there an API or should I read and write directly to the USB port? Can anyone help me? Thanks

    Read the article

  • Let the user choose what type of document to open

    - by Koning Baard XIV
    I'm creating an NSDocument application, with two document types: Website and Webservice. This is in my Info.plist: <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>Website</string> <key>CFBundleTypeExtensions</key> <array> <string>website</string> </array> <key>LSTypeIsPackage</key> <true/> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSHandlerRank</key> <string>Default</string> <key>NSDocumentClass</key> <string>AWWebSite</string> </dict> <dict> <key>CFBundleTypeName</key> <string>Web Service</string> <key>CFBundleTypeExtensions</key> <array> <string>webservice</string> </array> <key>LSTypeIsPackage</key> <true/> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSHandlerRank</key> <string>Default</string> <key>NSDocumentClass</key> <string>AWWebService</string> </dict> </array> Now, whenever the user opens the application, selects the 'New' item from the menubar, or clicks the Dock icon while there are no open windows, I want to show a window with two options, each for one of the document types. Can anyone help me with this? Thanks

    Read the article

  • Usernames are evil. How can I make Restful Authentication only require an email address and password

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    As the title says: how can I use the Restful Authentication Plugin with Ruby on Rails. When I want to create a new user, it requires me to set the (wrong-named, confusing field) login (= username), email address and password. However, I want, like Facebook does, to require the user to enter only an email address and password, not a username. People will also login with this email address. Can anyone help me?

    Read the article

  • Creating simple waveforms with CoreAudio

    - by Koning Baard
    I am new to CoreAudio, and I would like to output a simple sine wave and square wave with a given frequency and amplitude through the speakers using CA. I don't want to use sound files as I want to synthesize the sound. What do I need to do this? And can you give me an example or tutorial? Thanks.

    Read the article

  • Basic image resizing in Ruby on Rails

    - by Koning Baard XIV
    I'm creating a little photo sharing site for our home's intranet, and I have an upload feature, which uploads the photo at original size into the database. However, I also want to save the photo in four other sizes: W=1024, W=512, W=256 and W=128, but only the sizes smaller than the original size (e.g. if the original width is 511, only generate 256 and 128). How can I implement this? I already have this code to upload the photo: pic.rb <-- model def image_file=(input_data) self.filename = input_data.original_filename self.content_type = input_data.content_type.chomp self.binary_data = input_data.read # here it should generate the smaller sizes #+and save them to self.binary_data_1024, etc... end new.rb <-- view <h1>New pic</h1> <% form_for(@pic, :html => {:multipart => true}) do |f| %> <%= f.error_messages %> <p> <%= f.label :title %><br /> <%= f.text_field :title %> </p> <p> <%= f.label :description %><br /> <%= f.text_field :description %> </p> <p> <%= f.label :image_file %><br /> <%= f.file_field :image_file %> </p> <p> <%= f.submit 'Create' %> </p> <% end %> <%= link_to 'Back', pics_path %> Thanks

    Read the article

  • How to make a small engine like Wolfram|Alpha?

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    Lets say I have three models/tables: operating_systems, words, and programming_languages: # operating_systems name:string created_by:string family:string Windows Microsoft MS-DOS Mac OS X Apple UNIX Linux Linus Torvalds UNIX UNIX AT&T UNIX # words word:string defenitions:string window (serialized hash of defenitions) hello (serialized hash of defenitions) UNIX (serialized hash of defenitions) # programming_languages name:string created_by:string example_code:text C++ Bjarne Stroustrup #include <iostream> etc... HelloWorld Jeff Skeet h AnotherOne Jon Atwood imports 'SORULEZ.cs' etc... When a user searches hello, the system shows the defenitions of 'hello'. This is relatively easy to implement. However, when a user searches UNIX, the engine must choose: word or operating_system. Also, when a user searches windows (small letter 'w'), the engine chooses word, but should also show Assuming 'windows' is a word. Use as an <a href="etc..">operating system</a> instead. Can anyone point me in the right direction with parsing and choosing the topic of the search query? Thanks. Note: it doesn't need to be able to perform calculations as WA can do.

    Read the article

  • Dashcode newbie question: Change a button's label programmatically

    - by Koning Baard XIV
    Hi all! I'm new to Mac OS X Dashboard developement. Now, I have a button with id b_start. When that button is clicked, I want the label of the button to change to "Round". Now I have tried these, but none of them work: document.getElementById("b_start").label = "Round"; document.getElementById("b_start").text = "Round"; document.getElementById("b_start").innerText = "Round"; document.getElementById("b_start").object.setValue("Round"); document.getElementById("b_start").value = "Round"; Does anyone how I can change the button's label? Thanks in advance.

    Read the article

  • How do I add a static library target that compiles before an application compiles in Xcode?

    - by Koning Baard XIV
    I'm creating a static library in C++. The static library itself links to nothing. To test the static library, I'm creating a test program in C++ (you know, with a main function). Now, I want that whenever I click Build in Xcode, it compiles the static library first, then compiles the test program and link that test program to the static library, like this: # The steps indicate the order Xcode should compile it # (Step 1) Static Library <----------. | (Step 2) Test Program -------> Standard Library Also, the test program should use the header files of the static library. Can anyone explain me how to configure this in Xcode? Thanks

    Read the article

  • Solve math question in PHP

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    The user can enter a math problem like 5 + 654, 6 ^ 24, 2!, sqrt(543), log(54), sin 5, sin(50). After some reformatting (e.g. change sin 5 into sin(5)), and doing an eval, PHP gives me the right result. However, this is quite unsafe. Can anyone point me in the right direction parsing and solving a math question like the examples above, which is safe? Thanks.

    Read the article

  • Solving a math problem/expression, which is a string, in PHP

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    The user can enter a math problem (expression) like 5 + 654, 6 ^ 24, 2!, sqrt(543), log(54), sin 5, sin(50). After some reformatting (e.g. change sin 5 into sin(5)), and doing an eval, PHP gives me the right result: $problem = "5 + 5324"; eval("$result = " . $problem); echo $problem . " = " . $result; However, this is quite unsafe: /* If you read this, please, plz don't be stupid and DO NOT EXECUTE this code!!!!! */ $problem = "shell_exec('rm -rf /')"; eval("$result = " . $problem); /* Nukes system */ echo $problem . " = " . $result; Can anyone point me in the right direction parsing and solving a math question like the examples above, which is safe? Thanks.

    Read the article

  • Running a shellscript from a C++ application and check if it succeeds

    - by Koning Baard
    I am creating an interpreter for my extension to HQ9+, which has the following extra command called V: V: Interpretes the code as Lua, Brainfuck, INTERCAL, Ruby, ShellScript, Perl, Python, PHP in that order, and if even one error has occoured, run the HQ9+-ABC code again most of them have libraries, BF and INTERCAL can be interpreted without a library, but the problem lies in ShellScript. How can I run a shellscript from my C++ application ( =the HQ9+-ABC interpreter) and when it's done, get the error code (0 = succeded, all others = failed)? So something like this: system(".tempshellscript738319939474"); if(errcode != 0) { (rerun code); } can anyone help me? Thanks

    Read the article

  • std::cin >> *aa results in a bus error

    - by Koning Baard XIV
    I have this a class called PPString: PPString.h #ifndef __CPP_PPString #define __CPP_PPString #include "PPObject.h" class PPString : public PPObject { char *stringValue[]; public: char *pointerToCharString(); void setCharString(char *charString[]); void setCharString(const char charString[]); }; #endif PPString.cpp #include "PPString.h" char *PPString::pointerToCharString() { return *stringValue; } void PPString::setCharString(char *charString[]) { *stringValue = *charString; } void PPString::setCharString(const char charString[]) { *stringValue = (char *)charString; } I'm trying to set the stringValue using std::cin: main.cpp PPString myString; myString.setCharString("LOLZ"); std::cout << myString.pointerToCharString() << std::endl; char *aa[1000]; std::cin >> *aa; myString.setCharString(aa); std::cout << myString.pointerToCharString() << std::endl; The first one, which uses a const char works, but the second one, with a char doesn't, and I get this output: copy and paste from STDOUT LOLZ im entering a string now... Bus error where the second line is what I entered, followed by pressing the return key. Can anyone help me fixing this? Thanks...

    Read the article

  • Usernames are evil. How can I make Restful Authentication only require a username and password, inst

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    As the title sais: How can I use the Restful Authentication Plugin with Ruby on Rails. When I want to create a new user, it requires me a (wrong-named, confusing field) login (= username), email address and password. However, I want, like Facebook does, only require the user to enter an email address and password, not a username. People will also login with this email address. Can anyone help me?

    Read the article

  • How do I use AFAssistantPane?

    - by Koning Baard
    I have searched my entire Mac for ibplugin to find the QTKit IBPlugin, but I also came accros a plugin which adds AFAssistantPane to IB. I did a Google-search but Google has no results for it. So, does anyone know how I can use this AFAssistantPane? Thanks Update: I noted that this is in a private framework (that's why it is not documented).

    Read the article

  • Comparing an [NSURL path] to an NSString doesn't work

    - by Koning Baard XIV
    I have this code: NSLog([url path]); if([url path] == @"/connect/login_success.html") { NSLog("IT WORKZ"); } When I run my application, do the login etc... my console says: 2010-05-04 23:49:57.297 Framebook Test Application[8069:a0f] /connect/login_success.html But it should also print IT WORKZ to the console, which it does not. Can anyone help me? Thanks.

    Read the article

  • How can I write a power function myself?

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    Since I was 12, I was always wondering how I can make a function which calculates the power (e.g. 23) myself. In most languages these are included in the standard library, mostly as pow(double x, double y), but how can I write it myself? I was thinking about for loops, but it think my brain got in a loop (when I wanted to do a power with a non-integer exponent, like 54.5 or negatives 2-21) and I went crazy ;) So, how can I write a function which calculates the power of a real number? Thanks

    Read the article

  • Making a circular NSSlide look and behave like in GarageBand

    - by Koning Baard
    I am new to drawing with Cocoa, and I am making some software which will have sliders similar to these found in GarageBand: These look beautiful and can be controld by moving the mouse up and down. Can you help me with customizing NSSliders by subclassing them, so I can make them look and behave exactly as in GarageBand? Thanks. I have one image for the knob which should be rotated as they do not need to be in 3D .

    Read the article

  • Haml::SyntaxError in Static#home?

    - by Koning Baard
    I have this Haml: #index-header %h1 Supersonic Mac Software. %p Some motto %h1 Our Software %p Which will once becoume your's .third-column %h2 Product 1 %p LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL .third-column %h2 Product 2 %p LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL .third-column %h2 Product 3 %p LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL And I get this error: Haml::SyntaxError in Static#home Showing app/views/static/home.html.haml where line #5 raised: Illegal nesting: content can't be both given on the same line as %h1 and nested within it. What am I doing wrong? Thanks.

    Read the article

  • How can I make Rails work when it is installed as a gem in Ubuntu?

    - by Koning WWWWWWWWWWWWWWWWWWWWWWW
    I have installed Ruby on Rails in Ubuntu 10.04: $ sudo gem install rails $ echo $PATH prints: /home/koningbaard/.gem/ruby/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games But when I run $ rails --version, BASH tells me that rails is not currenly installed, and that I can install it with apt-get, which I don't want (I want it installed through gem). Can anyone help me where I can find it and how I can add it to my PATH? Thanks

    Read the article

  • When do you use a circular slider/knob in a good user interface?

    - by Koning Baard
    As I am familiar with some synthesizers, I often user real life circular sliders (e.g. to control the master volume), also called knobs. Like this one: Sometimes I also find these controls in virtual applications (yes I like extreme minimalism =P): But most of them are irritating, confusing or just wrong, and simple sliders could be used instead, making the UI much better. What are the advantages of circular sliders like the one in the screenshot above? And when do you use them? Thanks

    Read the article

< Previous Page | 1 2 3  | Next Page >