Daily Archives

Articles indexed Friday April 2 2010

Page 23/105 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Cocoa nextEventMatchingMask not receiving NSMouseMoved event

    - by Jonny
    Hello, I created a local event loop and showed up a borderless window (derived from NSPanel), I found in the event loop there's no NSMouseMoved event received, although I can receive Mouse button down/up events. What should I do to get the NSMouseMoved events? I found making the float window as key window can receive the NSMouseMoved events, but I don't want to change key window. And it appears this is possible, because I found after clicking the test App Icon in System Dock Bar, I can receive the mousemoved events, and the key window/mainwindow are unchanged. Here's the my test code: (Create a Cocoa App project names FloatWindowTest, and put a button to link it with the onClick: IBAction). Thanks in advance! -Jonny #import "FloatWindowTestAppDelegate.h" @interface FloatWindow : NSPanel @end @interface FloatWindowContentView : NSView @end @implementation FloatWindowTestAppDelegate @synthesize window; - (void)delayedAction:(id)sender { // What does this function do? // 1. create a float window // 2. create a local event loop // 3. print out the events got from nextEventMatchingMask. // 4. send it to float window. // What is the problem? // In local event loop, althrough the event mask has set NSMouseMovedMask // there's no mouse moved messages received. // FloatWindow* floatWindow = [[FloatWindow alloc] init]; NSEvent* event = [NSApp currentEvent]; NSPoint screenOrigin = [[self window] convertBaseToScreen:[event locationInWindow]]; [floatWindow setFrameTopLeftPoint:screenOrigin]; [floatWindow orderFront:nil]; //Making the float window as Key window will work, however //change active window is not anticipated. //[floatWindow makeKeyAndOrderFront:nil]; BOOL done = NO; while (!done) { NSAutoreleasePool* pool = [NSAutoreleasePool new]; NSUInteger eventMask = NSLeftMouseDownMask| NSLeftMouseUpMask| NSMouseMovedMask| NSMouseEnteredMask| NSMouseExitedMask| NSLeftMouseDraggedMask; NSEvent* event = [NSApp nextEventMatchingMask:eventMask untilDate:[NSDate distantFuture] inMode:NSDefaultRunLoopMode dequeue:YES]; //why I cannot get NSMouseMoved event?? NSLog(@"new event %@", [event description]); [floatWindow sendEvent:event]; [pool drain]; } [floatWindow release]; return; } -(IBAction)onClick:(id)sender { //Tried to postpone the local event loop //after return from button's mouse tracking loop. //but not fixes this problem. [[NSRunLoop currentRunLoop] performSelector:@selector(delayedAction:) target:self argument:nil order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]]; } @end @implementation FloatWindow - (id)init { NSRect contentRect = NSMakeRect(200,300,200,300); self = [super initWithContentRect:contentRect styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:YES]; if (self) { [self setLevel:NSFloatingWindowLevel]; NSRect frameRect = [self frameRectForContentRect:contentRect]; NSView* view = [[[FloatWindowContentView alloc] initWithFrame:frameRect] autorelease]; [self setContentView:view]; [self setAcceptsMouseMovedEvents:YES]; [self setIgnoresMouseEvents:NO]; } return self; } - (BOOL)becomesKeyOnlyIfNeeded { return YES; } - (void)becomeMainWindow { NSLog(@"becomeMainWindow"); [super becomeMainWindow]; } - (void)becomeKeyWindow { NSLog(@"becomeKeyWindow"); [super becomeKeyWindow]; } @end @implementation FloatWindowContentView - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { return YES; } - (BOOL)acceptsFirstResponder { return YES; } - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { NSTrackingArea* area; area = [[NSTrackingArea alloc] initWithRect:frameRect options:NSTrackingActiveAlways| NSTrackingMouseMoved| NSTrackingMouseEnteredAndExited owner:self userInfo:nil]; [self addTrackingArea:area]; [area release]; } return self; } - (void)drawRect:(NSRect)rect { [[NSColor redColor] set]; NSRectFill([self bounds]); } - (BOOL)becomeFirstResponder { NSLog(@"becomeFirstResponder"); return [super becomeFirstResponder]; } @end

    Read the article

  • GPT Partitioning help!!

    - by iamairborne
    Hi, I have a GPT partitioned portable HDD which is not being detected by Windows XP and a non working CD Drive.Can I download and use Ubuntu to boot from and access the data? Or is there some other way?

    Read the article

  • Add a Scrollable Multi-Row Bookmarks Toolbar to Firefox

    - by Asian Angel
    If you keep a lot of bookmarks available in your Bookmarks Toolbar then you know that accessing some of them is not as easy as you would like. Now you can simplify the access process with the Multirow Bookmarks Toolbar for Firefox. Before As you can see it has not taken long to fill up our “Bookmarks Toolbar” and use of the drop-down list is required. If you do not keep too many bookmarks in the “Bookmarks Toolbar” then that may not be a bad thing but what if you have a very large number of bookmarks there? Multirow Bookmarks Toolbar in Action As soon as you have installed the extension and restarted Firefox you will see the default three rows display. If you are not worried about UI space then you are good to go. Those of you who like keeping the UI space to a minimum will want to have a look at this next part… You are not locked into a “three rows setup” with this extension. If you are ok with two rows then you can select for that in the “Options” and and enjoy a mini scrollbar on the right side. For our example we still had easy access to all three rows. Two rows still too much? Not a problem. Set the number of rows for one only in the “Options” and still enjoy that scrolling goodness. If you do select for one row only do not panic when you do not see a scrollbar…it is still there. Hold your mouse over where the scrollbar is shown in the image above and use your middle mouse button to scroll through the multiple rows. You can see the transition between the second and third rows on our browser here… Nice, huh? Options The “Options” are extremely easy to work with…just enable/disable the extension here and set the number of rows that you want visible. Conclusion While the Multirow Bookmarks Toolbar extension may not seem like much at first glance it does provide some nice flexibility for your “Bookmarks Toolbar”. You can save space and access your bookmarks easily without those drop-down lists. If you are looking for another great way to make the best use of the space available in your “Bookmarks Toolbar” then be sure to read our article on the Smart Bookmarks Bar extension for Firefox here. Links Download the Multirow Bookmarks Toolbar extension (Mozilla Add-ons) Similar Articles Productive Geek Tips Reduce Your Bookmarks Toolbar to a Toolbar ButtonConserve Space in Firefox by Combining ToolbarsAdd the Bookmarks Menu to Your Bookmarks Toolbar with Bookmarks UI ConsolidatorAdd a Vertical Bookmarks Toolbar to FirefoxCondense the Bookmarks in the Firefox Bookmarks Toolbar TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Dark Side of the Moon (8-bit) Norwegian Life If Web Browsers Were Modes of Transportation Google Translate (for animals) Out of 100 Tweeters Roadkill’s Scan Port scans for open ports

    Read the article

  • Poor Transparency on Images

    - by KyleStew
    I am having problems getting transparency to work well on an ImageView. The images at (http://img265.imageshack.us/img265/6233/whatn.png) were screen captured from a Droid (hdpi). The top image I made in Photoshop and left the background white. The bottom image is the same image with the background transparent and the layout's color (white) shows through. Whenever I have transparent backgrounds in images it dithers shadows like this. Also, it only happens on hdpi devices, on my G1 (mdpi) it looks just fine. What is going on? How can I make the bottom image look as good as the top one?

    Read the article

  • wrapp a function whose parameters are out type pointer to structure using swig

    - by pierr
    I have following function : typedef struct tagT{ int a ; int b ; }Point; int lib_a_f_5(Point *out_t) { out_t->a = 20; out_t->b = 30; return 0; } How should I direct the SWIG to generate the correct code for ruby (or lua)? When putting following statement to the interface file : %apply SWIGTYPE Point* {Point *out_t}; I got a warning : liba.i:7: Warning(453): Can't apply (Point *OUTPUT). No typemaps are defined. Did i need to write a typemap? How should I do it?

    Read the article

  • Require help in Writing Query

    - by harigm
    The following image have been uploaded to show what I am trying to do and what I wanted out of it Can any one help me write the Query to get the results what I want Please check the following SELECT * FROM KPT WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM khata_header WHERE DIV_ID = 3 and RECORD_STATUS = 0) and CHALLAN_NO > 42646 The above is the query I have written and I have got the following result set ID CHALLAN_NO PROPERTY_ID SITE_NO TOTAL_AMOUNT ----- ------------- -------------- ------------------- --------------- 1242 42757 3103010141 296 595 1243 63743 3204190257 483 594 1244 63743 3204190257 483 594 1334 43395 3217010223 1088 576 1421 524210 3320050416 (null) (null) 1422 524210 3320050416 (null) (null) 1560 564355 3320021408 (null) (null) 1870 516292 3320040420 (null) (null) 1940 68357 3217100104 139 1153 1941 68357 3217100104 139 1153 2002 56256 3320100733 511 4430 2003 56256 3320100733 511 4430 2004 66488 3217040869 293 3094 2005 66488 3217040869 293 3094 2016 64571 3217040374 (null) (null) 2036 523122 3320020352 (null) (null) 2039 65682 3217040021 273 919 In my resultset, I am getting the PropertyId repeated, since there are multilple entries, How Can I know How many have been repeated What are those Property Id which have repeated more than 2 times. Little Back ground about the tables are PROPERTY_ID is the FK in the KPT PROPERTY_ID is the PK in KH I am writing a subquery to get the Result, so I am stuck I dont know how to get my results Please help

    Read the article

  • Migrating schema and SP from informix to mysql

    - by zombiegx
    We need to redo a database in MySQL that has been already done on Informix, is there a way to migrate not only the schema, but the stored procedures as well? Thanks. We have a client whom we built a web application that uses an Informix database. Now the client wants to be able to implement the same software but on multiple closed networks (like 20). Doing this using Informix would be very expensive (20 licences X_X). So the best approach is to redo the database on something like MySQL. The application was done using Flex, .Net (using ODBC) and Informix.

    Read the article

  • Hashtable is that fast

    - by Costa
    Hi s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]. Is the hash function of the java string, I assume the rest of languages is similar or close to this implementation. If we have hash-Table and a list of 50 elements. each element is 7 chars ABCDEF1, ABCDEF2, ABCDEF3..... ABCDEFn If each bucket of hashtable contains 5 strings (I think this function will make it one string per bucket, but let us assume it is 5). If we call col.Contains("ABCDEFn"); // will do 6 comparisons and discover the difference on the 7th. The hash-table will take around 70 operations (multiplication and additions) to get the hashcode and to compare with 5 strings in bucket. and BANG it found. For list it will take around 300 comparisons to find it. for the case that there is only 10 elements, the list will take around 70 operations but the Hashtable will take around 50 operations. and note that hashtable operations are more time consuming (it is multiplications). I conclude that HybirdDictionary in .Net probably is the best choice for that most cases that require Hashtable with unknown size, because it will let me use a list till the list becomes more than 10 elements. still need something like HashSet rather than a Dictionary of keys and values, I wonder why there is no HybirdSet!! So what do u think? Thanks

    Read the article

  • Difference between "machine hardware" and "hardware platform"

    - by Adil
    My Linux machine reports "uname -a" outputs as below:- [root@tom i386]# uname -a Linux tom 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux [root@tom i386]# As per man page of uname, the entries "i686 i686 i386" denotes:- machine hardware name (i686) processor type (i686) hardware platform (i386) Additional info: [root@tom i386]# cat /proc/cpuinfo <snip> vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU 5148 @ 2.33GHz stepping : 6 cpu MHz : 2328.038 cache size : 4096 KB </snip>

    Read the article

  • Consuming RSS Feed In PHP

    - by mrduclaw
    I'm trying to use an RSS feed from my blog on the news section on another site. Everything seems to be working fine until I use something like an ellipsis on my blog. The expected output is: One more time…less fail Although this is no joking matter… The actual output is: One more time?less fail Although this is no joking matter… The problem is that ? should be a .... The code I'm using is the same for the first line (the blog title) and the second line (the blog contents) and that code is: $a = utf8_decode($a); print("$a"); Where $a is the string from the RSS feed. Can anyone point in the right direction why that code would work correctly for the body (second line) and not for the title (first line)? Or suggest a better way to do this? Thanks!

    Read the article

  • Android: "Edit Source Lookup Path...".

    - by user307480
    I am developing on a Mac with Eclipse and have the skeleton for an app that implements the standard framework callbacks (onCreate, onDestroy, onPause, etc..). When I set breakpoints in the callbacks the debugger stops and displays a tab that says "ActivityThread.performLaunchActivity(ActivityThread $ActivityRecord,Intent)line:2477" and in the tab page body there is some red text that says "Source not found" and a button that says "Edit Source Lookup Path...". I have tried adding several paths via "Edit Source Lookup Path..." but can't see to find the one Eclipse is looking for. Can anyone point me in the right direction?

    Read the article

  • How to set locale default_url_options for functional tests (Rails)

    - by insane.dreamer
    In my application_controller, I have the following set to include the locale with all paths generated by url_for: def default_url_options(options={}) { :locale => I18n.locale } end My resource routes then have a :path_prefix = "/:locale" Works fine on the site. But when it comes to my functional tests, the :locale is not passed with the generated urls, and therefore they all fail. I can get around it by adding the locale to the url in my tests, like so: get :new, :locale => 'en' But I don't want to have to manually add the locale to every functional test. I tried adding the default_url_options def above to test_helper, but it seems to have no effect. Is there any way I can change the default_url_options to include the locale for all my tests? Thanks.

    Read the article

  • $PATH in Vim doesn't match Terminal

    - by donut
    I'm using MacVim and when I don't launch it from the Terminal (mvim) its $PATH does not include what I have set in my .bash_profile. It only seems to have the default values, /usr/bin:/bin:/usr/sbin:/sbin. I'm running OS X 10.5.8. Even if I could set it manually in my .vimrc that would be okay, though I would prefer it to pull from the same place as Terminal. I've tried following what one site suggested, adding let $PATH += /blah/foo:/bar/etc to no avail. Edit/Solution: See my answer below. MacVim has an option to fix this.

    Read the article

  • Guidance required: FIrst time gonna work with real high end database (size = 50GB).

    - by claws
    I got a project of designing a Database. This is going to be my first big scale project. Good thing about it is information is mostly organized & currently stored in text files. The size of this information is 50GB. There are going to be few millions of records in each Table. Its going to have around 50 tables. I need to provide a web interface for searching & browsing. I'm going to use MySQL DBMS. I've never worked with a database more than 200MB before. So, speed & performance was never a concern but I followed things like normalization & Indexes. I never used any kind of testing/benchmarking/queryOptimization/whatever because I never had to care about them. But here the purpose of creating a database is to make it quickly searchable. So, I need to consider all possible aspects in design. I was browsing archives & found: http://stackoverflow.com/questions/1981526/what-should-every-developer-know-about-databases http://stackoverflow.com/questions/621884/database-development-mistakes-made-by-app-developers I'm gonna keep the points mentioned in above answers in mind. What else should I know? What else should I keep in mind?

    Read the article

  • PHP readdir() not returning files in alphabetical order

    - by Buggabill
    I am reading through a directory with some pictures and such using a pretty simple implementation of readdir() like the following: if ($handle = opendir($path)) { while (false !== ($szFilename = readdir($handle))) { if ($szFilename[0] !== '.') { if (is_file($path.$szFilename)) { // do stuff } } } } The problem that I am having is that the files are not being read in alphabetical order as the docs for readdir() state: Returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem. Another weird thing is that, on the local testing server, the same code works great. This is running on a server using the LAMP stack in both cases. I know that I can build an array and just sort it, but I was wondering if I was missing something in what I was doing. Thanks for any insight!

    Read the article

  • Problem in matlab with too many outputs

    - by Ben Fossen
    I am writing a Matlab program for simpson's rule I keep getting an error about to many outputs when the program gets to left_simpson = Simpson(a,c,(e1)/2,level, level_max); What is wrong with settinf left_simpson to Simpson(a,c,(e1)/2,level, level_max);? function Simpson(a,b,e1,level, level_max) level = level + 1; h = b - a; c = (a+b)/2; one_simpson = h*(f(a) + 4*f(c) + f(b))/6; d = (a+c)/2; e = (c+b)/2; two_simpson = h*(f(a) + 4*f(d) + 2*f(c) + 4*f(e))/2; if level >= level_max disp('h') simpson_result = two_simpson; disp('maximum levels reached') disp(simpson_result); if abs(two_simpson - one_simpson) < 15*e1 simpson_result = two_simpson + (two_simpson - one_simpson)/15; else left_simpson = Simpson(a,c,(e1)/2,level, level_max); right_simpson = Simpson(c,b,(e1)/2,level, level_max); simpson_result = left_simpson + right_simpson; end end

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >