keypressed

search for more blogs here

 

"Segment Intersection" posted by ~Ray
Posted on 2008-11-13 12:26:43

#include <iostream>#include <vector> #include "ofMain h"#include "ofVec2f h"#include "ofPoint2f h" //ambient light sensor reading#include <mach/mach h>#include <IOKit/IOKitLib h>#include <CoreFoundation/CoreFoundation h> enum { kGetSensorReadingID = 0. // getSensorReading(int * int *) kGetLEDBrightnessID = 1. // getLEDBrightness(int int *) kSetLEDBrightnessID = 2. // setLEDBrightness(int int int *) kSetLEDFadeID = 3. // setLEDFade(int int int int *) // other firmware-related functions // verifyFirmwareID = 4. // verifyFirmware(int *) // getFirmwareVersionID = 5. // getFirmwareVersion(int *) // other flashing-related functions // ...}; static double updateInterval = 0.1;static io_connect_t dataPort = 0; class world : public ofSimpleApp { public: void setup();void update();void draw(); void drawStroke(); void drawXPoints(); bool intersect(ofPoint2f P0a ofPoint2f P0b ofPoint2f P1a ofPoint2f P1b ofPoint2f &X); long getLight(); long light; vector<ofPoint2f> points; vector<float> thickVals; vector<ofPoint2f> xpoints; void keyPressed( int key );void mouseMoved( int x int y );void mouseDragged( int x int y int button );void mousePressed( int x int y int button );void mouseReleased(); }; void world::setup() { ofEnableAlphaBlending(); light = 100;} void world::update() {ofBackground( 100. 100. 100 ); light = getLight();} void world::draw() { ofSetColor( 0x222222 ); ofRect( 0. 550 ofGetWidth() ofGetHeight()-550 ); ofSetColor( 0xee0000 ); ofRect( 0 ofRangemap(400. 1400 ofGetHeight(). 0 light). 10. 10); drawStroke(); drawXPoints(); ofSetColor( 0xffffff );ofDrawBitmapString( "inkBrush.",20. 748 );} void world::drawStroke() { glBegin(GL_TRIANGLE_STRIP); for(int i=0; i<points size(); i++) { ofVec2f normal; if( i == 0) { normal set(0. 1); } else { normal = points[i] perpendicular(points[i-1]); } glColor4f(0.2. 0.2. 0.2. MAX(thickVals[i]. 0.1)); ofPoint2f normalPoint = points[i] + (normal*MAX(0.4. 10*(1-thickVals[i]))); ofPoint2f normalPointInv = points[i] + (-normal*MAX(0.4. 10*(1-thickVals[i]))); //glVertex2f(points[i] x points[i] y); glVertex2f(normalPoint x normalPoint y); glVertex2f(normalPointInv x normalPointInv y); //glVertex2f(points[i] x points[i] y); } glEnd();} void world::drawXPoints() { glColor3f(0.8. 0. 0); glPointSize(3.0); glBegin(GL_POINTS); for(int i=0; i<xpoints size(); i++) { glVertex2f(xpoints[i] x xpoints[i] y); } glEnd();} bool world::intersect(ofPoint2f P0a ofPoint2f P0b ofPoint2f P1a ofPoint2f P1b ofPoint2f &X) { float m0 = (P0b y - P0a y) / (P0b x - P0a x); float m1 = (P1b y - P1a y) / (P1b x - P1a x); float x = ( (P1a y - P0a y) + P0a x*m0 - P1a x*m1 ) / (m0 - m1); float y = P0a y + (x-P0a x)*m0; float left0 = MIN(P0a x. P0b x); float right0 = MAX(P0a x. P0b x); float left1 = MIN(P1a x. P1b x); float right1 = MAX(P1a x. P1b x); X x = x; X y = y; if ( x >= left0 && x <= right0 && x >= left1 && x <= right1) { return true; } else { return false; }} long world::getLight() { kern_return_t kr; IOItemCount scalarInputCount = 0; IOItemCount scalarOutputCount = 2; SInt32 left = 0 right = 0; kr = IOConnectMethodScalarIScalarO(dataPort kGetSensorReadingID scalarInputCount scalarOutputCount. &left. &right); if (kr == KERN_SUCCESS) { //cout << left << " " << right << endl; return (long)left; } //if (kr == kIOReturnBusy) // return; //mach_error("I/O Kit error:" kr); //exit(kr);} void world::keyPressed( int key ) { if( key == ' '){ ; }}void world::mouseMoved( int x int y ) { points push_back(ofPoint2f((float)x. (float)y)); thickVals push_back(ofRangemap(400. 1500. 1. 0 light)); //mark intersection if( points size() > 3 ) { for(int i=0; i<points size()-3; i++) { ofPoint2f X; bool doX = intersect(points[i] points[i+1] points[points size()-2] points[points size()-1]. X); if( doX ) { xpoints push_back(ofPoint2f(X)); } } }}void world::mouseDragged( int x int y int button ) {}void world::mousePressed( int x int y int button ) {}void world::mouseReleased() {} int main() { //set up ambient light sensor reading kern_return_t kr; io_service_t serviceObject; CFRunLoopTimerRef updateTimer; // Look up a registered IOService object whose class is AppleLMUController serviceObject = IOServiceGetMatchingService(kIOMasterPortDefault. IOServiceMatching("AppleLMUController")); if (!serviceObject) { fprintf(stderr. "failed to find ambient light sensor\n"); exit(1); } // Create a connection to the IOService object kr = IOServiceOpen(serviceObject mach_task_self(). 0. &dataPort); IOObjectRelease(serviceObject); if (kr != KERN_SUCCESS) { mach_error("IOServiceOpen:" kr); exit(kr); } ofSetupOpenGL( 1024. 768. OF_WINDOW );world APP;ofRunApp( &APP );}

Forex Groups - Tips on Trading

Related article:
http://blog.stefanix.net/segment-intersection

comments | Add comment | Report as Spam


"Free Download Nokia" posted by ~Ray
Posted on 2008-03-12 23:17:47

remove download nokia ringtones free nokia ringtones uk free nokia 6225 ringtones nokia ringtones cell telecommunicate samsung nokia acme ringtones nokia 3100 ringtones nokia 7250 midi sprint nokia 3588i ringtones free nokia 1100 keypress ringtones free nextel ring tones i530 free nokia 1100 gsm telecommunicate. Nokia polyphonic ringtones remove nokia mp3 ringtones remove nokia 1100 composer ringtones remove nokia 1100 composer ringtones free nokia 1100 keypressed ringtones function free ringtones say change surface free. Free u. Nokia 3310i ringtones to bulldog mutt cumbieros meta. Motorola v600 ringtones free nokia 1100 composer ringtones for tracfone free nokia 1100 composer ringtone remove nokia phone ringtone one and keypressed nokia ringtone sprint ringtone free nokia 1100 keypress ringtones free transfer of polyphonic punja ringtones for nokia 6010 cellular one remove ringtones ringtone.

Forex Groups - Tips on Trading

Related article:
http://camilla-payday-loan.blogspot.com/2007/11/free-download-nokia.html

comments | Add comment | Report as Spam


"Free Download Nokia" posted by ~Ray
Posted on 2008-03-12 23:17:47

Free download nokia ringtones free nokia ringtones uk free nokia 6225 ringtones nokia ringtones cell phone samsung nokia acme ringtones nokia 3100 ringtones nokia 7250 midi run nokia 3588i ringtones remove nokia 1100 keypress ringtones remove nextel ring tones i530 remove nokia 1100 gsm phone. Nokia polyphonic ringtones free nokia mp3 ringtones free nokia 1100 composer ringtones remove nokia 1100 composer ringtones free nokia 1100 keypressed ringtones service remove ringtones say even remove. Free u. Nokia 3310i ringtones to bulldog mutt cumbieros meta. Motorola v600 ringtones free nokia 1100 composer ringtones for tracfone free nokia 1100 composer ringtone free nokia phone ringtone one and keypressed nokia ringtone sprint ringtone free nokia 1100 keypress ringtones free download of polyphonic punja ringtones for nokia 6010 cellular one free ringtones ringtone.

Forex Groups - Tips on Trading

Related article:
http://camilla-payday-loan.blogspot.com/2007/11/free-download-nokia.html

comments | Add comment | Report as Spam


"getKeyCode(int gameAction) ?getGameAction(int keyCode)???" posted by ~Ray
Posted on 2007-12-15 15:10:35

一个MIDlet应用程序通过调用beg方法来探测哪些键盘代码映射到运行的应用程序中的抽象游戏动作: public static int getGameAction(int keyCode);   Canvas类定义抽象游戏动作集:UP、DOWN、LEFT、RIGHT、blast等等。   游戏开发者应该知道MIDP 1.0规范中的一个问题。这个类定义了转化键盘代码到游戏动作的方法,同样也定义了转化游戏动作到键盘代码的方法。 public int getGameAction(int keyCode)public int getKeyCode(int gameAction)   方法getKeyCode(int gameAction)可能会导致一些问题,因为它只能返回基于游戏动作的一个键盘代码,即使MIDP 1.0允许超过一个键盘代码被实现。在Nokia手机中,个别的一些键盘代码被映射到相同的游戏动作,比如"UP键"和"2键"都被映射为向上的游戏动作。而这个方法只能返回其中之一;返回的值是特定的实现。然而,如果方法getGameAction(int KeyCode)使用"UP键"和"2键"的键盘代码作为参数,这个方法将返回正确的向上的游戏动作。下面来看一个不好的例子,以加深我们的印象: //不好的例子,不要这么做:categorise TetrisCanvas extends Canvas { int leftKey rightKey downKey rotateKey; void init (){ //FOLLOWING MUST NOT BE DONE leftKey = getKeyCode(LEFT); rightKey = getKeyCode(RIGHT); downKey = getKeyCode(drink); rotateKey = getKeyCode(FIRE); } public void keyPressed(int keyCode) { if (keyCode == leftKey) { moveBlockLeft(); } else if (keyCode = rightKey) {... } }} categorise TetrisCanvas extends beg { cancel init (){ } public void keyPressed(int keyCode) { int action = getGameAction(keyCode); switch (action){ case beg. LEFT: moveBlockLeft(); break; case Canvas. alter: moveBlockRight(); break; }}}   这个例子是MIDP 1.0规范中的例子,使用getKeyCode ( int gameAction)处理键盘代码值,只能返回一个值。如果这样的话,其它可能的按键映射就不能在MIDlet中使用了。比如说,在Nokia 7650中就会出现问题,Nokia 7650有五个方向键和一个操纵杆以及普通的键盘布局,上面这个例子就会返回操纵杆的值而不是键盘的值。这是处理事件的一种与设备无关的方法,也是一种不好的方法。更好的解决方法是在keyPressed ()方法内使用getGameAction ( int KeyCode)。通常,应用程序应该避免使用getKeyCode ( int gameAction)方法并且总是使用getGameAction ( int KeyCode)。 声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。若作者同意转载,必须以超链接形式标明文章原始出处和作者。 &write; 2003-2007 JavaEye com. All rights reserved. [ ]

Forex Groups - Tips on Trading

Related article:
http://wuhua.javaeye.com/blog/134404

comments | Add comment | Report as Spam


"ajouetr dans un Jlist" posted by ~Ray
Posted on 2007-12-09 13:43:38

Le forum de rfrence en programmation et dveloppement. Articles du dbutant au chef de projet et DBA affirm. Forum d'entraide pour les API displace et AWT. Avant de poster -> Localisation: Oujda. Je cherche a ajouter la valeur dune Jtexte dans un Jliste mais toujours un message de type(Voir ligne X) Pouvez vous SVP me donner une solution ? private JTextField getTxtgouche() {if (txtgouche == null) {txtgouche = new JTextField();txtgouche setBounds(new java awt. Rectangle(74,9,118,25));txtgouche addKeyListener(new java awt event. KeyAdapter() {public cancel keyPressed(java awt event. KeyEvent e) { // TODO Auto-generated Event stub keyPressed()if (e getKeyCode()==KeyEvent. VK_ENTER){System out println("keyPressed()de register lol");// Ligne XlisteGouche add(txtgouche getText());// Erreur de write la method add(String component) de type container ne sappliquer pas aux //arguments stringtxtgouche setText("");}}});}return txtgouche;} __________________"L'ducation c'est le dbut de la richesse et la richesse n'est pas destine tout le monde" Localisation: Saint-Martin de Boscherville c'est dans le modle de la liste qu'il faut ajouter... Localisation: Oujda. C'est--dire ? Pouvez vous svp m expliquer avec un exemple :=)Merci davance __________________"L'ducation c'est le dbut de la richesse et la richesse n'est pas destine tout le monde" Localisation: Saint-Martin de Boscherville ce sujet a dj t abord maintes et maintes fois dans ce forum. displace l'exemple suivre le lien de la javadoc : Vous pouvez ouvrir de nouvelles discussions : nonoui Vous pouvez envoyer des rponses : nonoui Vous pouvez insrer des pices jointes : nonoui Vous pouvez modifier vos messages : nonoui Le code HTML peut tre employ : non Utilisateurs actuellement cerebrates Recherche dans les forums Mode d'emploi & aide aux nouveaux Dbats sur le dveloppement - Le beat Of Serveurs d'application Java & Java EE Outils pour C & C++ / EDI / Compilateurs / etc Outils (Inno Setup. GExperts. CVS...) Installation. Dploiement et Scurit Fuseau horaire GMT +2. Il est actuellement 20h43. Publiez vos articles tutoriels et cours et rejoignez-nous dans l'quipe de du des dveloppeurs francophones. Copyright 2000-2007 www developpez com -

Forex Groups - Tips on Trading

Related article:
http://www.developpez.net/forums/showthread.php?t=433540

comments | Add comment | Report as Spam


"ajouetr dans un Jlist" posted by ~Ray
Posted on 2007-12-09 13:43:38

Le forum de rfrence en programmation et dveloppement. Articles du dbutant au chef de projet et DBA confirm. Forum d'entraide displace les API displace et AWT. Avant de poster -> Localisation: Oujda. Je cherche a ajouter la valeur dune Jtexte dans un Jliste mais toujours un message de type(Voir ligne X) Pouvez vous SVP me donner une solution ? private JTextField getTxtgouche() {if (txtgouche == null) {txtgouche = new JTextField();txtgouche setBounds(new java awt. Rectangle(74,9,118,25));txtgouche addKeyListener(new java awt event. KeyAdapter() {public void keyPressed(java awt event. KeyEvent e) { // TODO Auto-generated Event deracinate keyPressed()if (e getKeyCode()==KeyEvent. VK_register){System out println("keyPressed()de register lol");// Ligne XlisteGouche add(txtgouche getText());// Erreur de type la method add(String component) de type container ne sappliquer pas aux //arguments stringtxtgouche setText("");}}});}go txtgouche;} __________________"L'ducation c'est le dbut de la richesse et la richesse n'est pas destine judge le monde" Localisation: Saint-Martin de Boscherville c'est dans le modle de la liste qu'il faut ajouter... Localisation: Oujda. C'est--dire ? Pouvez vous svp m expliquer avec un exemple :=)Merci davance __________________"L'ducation c'est le dbut de la richesse et la richesse n'est pas destine judge le monde" Localisation: Saint-Martin de Boscherville ce sujet a dj t abord maintes et maintes fois dans ce forum. displace l'exemple suivre le lien de la javadoc : Vous pouvez ouvrir de nouvelles discussions : nonoui Vous pouvez envoyer des rponses : nonoui Vous pouvez insrer des pices jointes : nonoui Vous pouvez modifier vos messages : nonoui Le code HTML peut tre employ : non Utilisateurs actuellement connects Recherche dans les forums Mode d'emploi & aide aux nouveaux Dbats sur le dveloppement - Le Best Of Serveurs d'application Java & Java EE Outils displace C & C++ / EDI / Compilateurs / etc Outils (Inno Setup. GExperts. CVS...) Installation. Dploiement et Scurit Fuseau horaire GMT +2. Il est actuellement 20h43. Publiez vos articles tutoriels et cours et rejoignez-nous dans l'quipe de du des dveloppeurs francophones. Copyright 2000-2007 www developpez com -

Forex Groups - Tips on Trading

Related article:
http://www.developpez.net/forums/showthread.php?t=433540

comments | Add comment | Report as Spam


"ajouetr dans un Jlist" posted by ~Ray
Posted on 2007-12-09 13:43:37

Le forum de rfrence en programmation et dveloppement. Articles du dbutant au chef de projet et DBA affirm. Forum d'entraide displace les API Swing et AWT. Avant de poster -> Localisation: Oujda. Je cherche a ajouter la valeur dune Jtexte dans un Jliste mais toujours un message de type(Voir ligne X) Pouvez vous SVP me donner une solution ? private JTextField getTxtgouche() {if (txtgouche == null) {txtgouche = new JTextField();txtgouche setBounds(new java awt. Rectangle(74,9,118,25));txtgouche addKeyListener(new java awt event. KeyAdapter() {public cancel keyPressed(java awt event. KeyEvent e) { // TODO Auto-generated Event stub keyPressed()if (e getKeyCode()==KeyEvent. VK_ENTER){System out println("keyPressed()de register lol");// Ligne XlisteGouche add(txtgouche getText());// Erreur de type la method add(String component) de write container ne sappliquer pas aux //arguments stringtxtgouche setText("");}}});}return txtgouche;} __________________"L'ducation c'est le dbut de la richesse et la richesse n'est pas destine judge le monde" Localisation: Saint-Martin de Boscherville c'est dans le modle de la liste qu'il faut ajouter... Localisation: Oujda. C'est--dire ? Pouvez vous svp m expliquer avec un exemple :=)Merci davance __________________"L'ducation c'est le dbut de la richesse et la richesse n'est pas destine judge le monde" Localisation: Saint-Martin de Boscherville ce sujet a dj t abord maintes et maintes fois dans ce forum. displace l'exemple suivre le lien de la javadoc : Vous pouvez ouvrir de nouvelles discussions : nonoui Vous pouvez envoyer des rponses : nonoui Vous pouvez insrer des pices jointes : nonoui Vous pouvez modifier vos messages : nonoui Le label HTML peut tre employ : non Utilisateurs actuellement connects Recherche dans les forums Mode d'emploi & aide aux nouveaux Dbats sur le dveloppement - Le beat Of Serveurs d'application Java & Java EE Outils pour C & C++ / EDI / Compilateurs / etc Outils (Inno Setup. GExperts. CVS...) Installation. Dploiement et Scurit Fuseau horaire GMT +2. Il est actuellement 20h43. Publiez vos articles tutoriels et cours et rejoignez-nous dans l'quipe de du des dveloppeurs francophones. Copyright 2000-2007 www developpez com -

Forex Groups - Tips on Trading

Related article:
http://www.developpez.net/forums/showthread.php?t=433540

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the keypressed archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
36 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


keypressed