Search Results

Search found 1600 results on 64 pages for 'ben packard'.

Page 5/64 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Consecutive 'if' statements

    - by Ben Packard
    How can I check one thing AND THEN another, if the first is true? For example, say I have a shopping basket object, and I only want to do something if the basket has been created AND it isn't empty. I've tried: if (basket && [basket numberOfItems >0])... But the second condition is evaluated even if the first fails, resulting in a crash (presumably because i'm calling numberOfItems on an object that doesn't exist). I can nest them, but this seems a bit ugly, and more to the point is problematic. Say I want to do one thing if the basket exists AND isn't empty, but another if either isn't true. That doesn't really work well in nested if statements.

    Read the article

  • How can I check that the NSPasteboard is updated?

    - by Ben Packard
    I'm automating a copy command to place some text on the pasteboard every second or so - unfortunately this is my only way of accessing the text, which is in another application. After copying, I access the pasteboard text and process it. Sometimes, the copy command will be sent when nothing is selected - for example in textEdit, if the cursor is at the end of a line (instead of highlighting some text) and you hit copy, you get a system beep because there is nothing selected to copy. The pasteboard does not update and retains its previous data. I can't think of a creative way to identify when this happens. If I send a copy command and the pasteboard doesn't update, is there any kind of time stamp on the pasteboard I can access that will confirm that something has or hasn't been captured? I was looking at the changeCount, but I'm not sure what that is for exactly, and the documentation didn't help me much - red herring? Any simple and effective ideas gratefully received!

    Read the article

  • Strange behaviour when posting CGEvent to PSN

    - by Ben Packard
    If I set up a loop that posts some keyboard events to a PSN, I find that it works fine except for when first launched. The event only seems to post when i do something with the mouse manually - even just moving it slightly. Here's the details, if they help. An external application has a list box of text lines, which I am reading by posting copy commands (and checking the pasteboard). Unfortunately this is my only way to get this text. Sometimes, the application pulls focus away from the list, which I can detect. When this happens, the most reliable way to return focus is by sending a mouse event to click on a text field directly above the list, then send a 'tab' keyboard event to shift the focus onto the list. So at launch, the loop runs fine, scrolling down the list and copying the text. When focus is shifted away, its is detected fine, and the events are sent to move focus back to the list. But nothing seems to happen. The loop continues detecting that focus has changed, but the events only work once I move the mouse. Or even just use the scroll wheel. Strange. Once this has happened the first time, it works fine - each time focus moves, the PSN events switch it back without me having to do anything at all. Here's the code that runs in the loop - verified as working: //copy to pasteboard - CMD-V e3 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)8, true); CGEventSetFlags(e3, kCGEventFlagMaskCommand); CGEventPostToPSN(&psn, e3); CFRelease(e3); e4 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)8, false); CGEventPostToPSN(&psn, e4); CFRelease(e4); //move cursor down e1 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)125, true); CGEventPostToPSN(&psn, e1); CFRelease(e1); e2 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)125, false); CGEventPostToPSN(&psn, e2); CFRelease(e2); And here's where I switch focus, also working (except when first required): //click in text input box - point is derived earlier e6 = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, point, 0); CGEventPostToPSN(&psn, e6); CFRelease(e6); e7 = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseUp, point, 0); CGEventPostToPSN(&psn, e7); CFRelease(e7); //press tab key to move to chat log table CGEventRef e = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)48, true); //CGEventPost(kCGSessionEventTap, e); CGEventPostToPSN(&psn, e); CFRelease(e); CGEventRef e11 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)48, false); CGEventPostToPSN(&psn, e11); CFRelease(e11);

    Read the article

  • Common NSNotification mistakes?

    - by Ben Packard
    A simplification... A building has an array of apartment objects. Each apartment has a single currentTenant. These tenants are of type Person. Note that currentTenant doesn't have a reference to the apartment, so can't send information back up the chain. When a tenant has a plumbing issue he raises an NSNotification: [nc postNotificationName:@"PlumbingIssue" object:self]; Each Apartment observes notifications ONLY FROM it's own current tenant (this is set up when the apartment is built, before there is a current tenant): [nc addObserver:self selector:@selector(alertBuildingManager:) name:@"PlumbingIssue" object:[self currentTenant]; When the apartment receives a notification from it's own currentTenant, it sends it's own notification, "PlumberRequired", along with the apartment number and the currentTenant in an NSDictionary. Apartment observes these notifications, which it will take from any apartment (or other object): [nc addObserver:self selector:@selector(callPlumber) name:@"PlumberRequired" object:nil]; Is there something I could be getting fundamentally wrong here? What's happening is that the apartment is receiving notifications from any and all currentTenants, rather than jus it's own. Sorry that the actual code is a bit too unwieldy to post. Was just wondering if there's a gap in my understanding about observing notifications from a particular sender?

    Read the article

  • Silly Objective-C inheritance problem when using property

    - by Ben Packard
    I've been scratching my head with this for a couple of hours - I haven't used inheritance much. Here I have set up a simple Test B class that inherits from Test A, where an ivar is declared. But I get the compilation error that the variable is undeclared. This only happens when I add the property and synthesize declarations - works fine without them. TestA Header: #import <Cocoa/Cocoa.h> @interface TestA : NSObject { NSString *testString; } @end TestA Implementation is empty: #import "TestA.h" @implementation TestA @end TestB Header: #import <Cocoa/Cocoa.h> #import "TestA.h" @interface TestB : TestA { } @property NSString *testProp; @end TestB Implementation (Error - 'testString' is undeclared) #import "TestB.h" @implementation TestB @synthesize testProp; - (void)testing{ NSLog(@"test ivar is %@", testString); } @end

    Read the article

  • Attaching user data to AXObserver

    - by Ben Packard
    I am using an AXObserver to monitor when a window is closed. In the callback, I am just raising an NSNotification. All working well. What is the correct syntax for attaching some user data as refcon? The working call looks like this: err6 = AXObserverAddNotification(observerTable, tableRef, kAXUIElementDestroyedNotification, nil); and the callback specified when I create the observer has the signature: static void cbTableClosed (AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon) I want to replace refcon with an object of my own, but don't know how to change either line. The obvious objective-c type changes through up warnings.

    Read the article

  • Removing object from NSMutableArray

    - by Ben Packard
    Just a small query... I stumbled across the following shortcut in setting up a for loop (shortcut compared to the textbook examples I have been using): for (Item *i in items){ ... } As opposed to the longer format: for (NSInteger i = 0; i < [items count]; i++){ ... } //think that's right If I'm using the shorter version, is there a way to remove the item currently being iterated over (ie 'i')? Or do I need to use the longer format?

    Read the article

  • Sending a 'copy' command in cocoa

    - by Ben Packard
    Is there any way to send a copy (command-c) instruction without using a cgEvent to mimic the keystrokes? I don't have access to the text field in the application I want to take text from, so need to replicate manually copying to the clipboard, and there seemss to be a bug with cgevent posting. According the Quartz documentation, to type a capital Z I should use: CGEventRef event1, event2, event3, event4; event1 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)56, true); event2 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)6, true); event3 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)6, false); event4 = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)56, false); However, if I attach this set of instuctions to an NSTimer, it only works the first time it is fired. example output: ZzzZzzzzZZzzZ (vs expected ZZZZZZZZZ). How else might I send a copy command to the active window?

    Read the article

  • numberOfSectionsInTableView is requested in/after viewDidLoad ONLY if tableview is empty

    - by Ben Packard
    A simple tableviewController, empty. A modal that can be launched from a button. No data in the data source for the tableview, and no rows displayed. I open the modal, use it to add an item, and return to the tableview controller. The tableview updates itself automatically, and the new row is displayed. I add a second item. The table view does NOT update automatically. I can tell by logging inside numberOfSectionsInTableView that even if I go to add the first item and cancel, the tableview refreshes - it asks for the number of sections, rows, and the cell to display (if there is one). But not if there is one pre-existing row in the table. I've scoured my code but can't find anything that would cause the tableview to know when the first item is added, but none afterwards. Any ideas? EDIT - I have further narrowed my issue so will close this shortly and post a more specific question

    Read the article

  • Useful Excel keyboard shortcuts

    - by Ben Lings
    What keyboard shortcuts do you use in Excel? Things I've discovered recently and found very useful are: Shift + Space - select the current row Ctrl + Space - select the current column Ctrl + Shift + Space - select the block of contiguous cell Ctrl + + - Insert (as in the context menu). If the current row is selected, will insert a new row. Ctrl + - - Delete (as in the context menu). If the current row is selected, will delete entire row. What (apart from the normal cut, copy, paste, etc) do you use? Ctrl + 1 to open the Format dialog. Shift + F2 to add/edit a cell comment. Shift + F2, followed by Esc to select the current cell comment, which can then be moved around with the arrow keys (????) or deleted by pressing Del. Ctrl + ???? to move to the last non-blank cell in a series. This is usually the edge of a table, but not if you have blank cells in the path. Pressing End followed by an arrow key does the same thing. Alt + F11 to open the VBA editor. Alt + = to start a SUM() formula and go straight to selecting cells to be summed. Ctrl + G or F5 to jump to a cell by typing its coordinates (e.g. C3) Ctrl + Home to jump to the top left, usually A1 unless you you are in a frozen split view, in which case it will jump to the top left of the "data" area. Ctrl + ; and Ctrl + Shift + ; to insert the current date and time, respectively. I know Ben Lings already posted this one, but I find it indispensable.

    Read the article

  • Probelms Intstalling Trac using apt-get Ubuntu Jaunty

    - by Ben Waine
    Hi, I'm having some issues getting apt to install trac correctly on my Ubuntu Jaunty Box. Using the command 'apt-get install trac' I get the following output: root@myserver:~# apt-get install trac Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. Since you only requested a single operation it is extremely likely that the package is simply not installable and a bug report against that package should be filed. The following information may help to resolve the situation: The following packages have unmet dependencies: trac: Depends: python-setuptools (> 0.5) but it is not installable Depends: python-pysqlite2 (>= 2.3.2) but it is not going to be installed Depends: python-subversion but it is not installable Depends: libjs-jquery but it is not installable Recommends: python-pygments (= 0.6) but it is not installable or enscript but it is not installable Recommends: python-tz but it is not installable E: Broken packages I have successfully used the command on my karmic kola desktop machine and am able to create new projects etc. I thought I might be able to solve the problem by installing all python related extensions. This produced a very similar output. I have Main, universe and multi-verse repositories enabled. Its a remote machine and I have no access to the gui. Hope someone can help, googleing failed to solve the issue or find a solution! Thanks, Ben

    Read the article

  • Can you "swap" the Sysprep answer file in Windows 7

    - by Ben
    I have a load of new Lenovo laptops which I am due to distribute in my company. We are distributed in multiple locations and I want to ship the laptops "boxed" and untouched by IT hand for distribution. We are using LANDesk to do all the software distribution and provisioning, but are currently falling at the first hurdle as when booted, the laptops kick into the Lenovo mini-setup wizard. I assume this is because they have been sysprepped at Lenovo. In order to keep with our (almost) zero touch strategy I want the users to PXE boot into a PE of some sort, which will run a script on startup which replaces the sysprep answer file with one of my own. (i.e. prepopulated with product key, company info etc.) and then reboot to complete Sysprep. The plan is that this will run, and then install the LANDesk agent as a post-sysprep task, which in turn will complete the provisioning. Anyone have any experience / know any pitfalls to look out for / can suggest a suitable, PXE-bootable PE environment? Apologies for the verbosity of the question - it takes a bit of explaining! Thanks in advance, Ben

    Read the article

  • Finding the model of an old computer i used to own?

    - by mcbeav
    This might sounds ridiculous, but I need some help finding the model of an old computer i used to own. I know what the computer looks like. It was made by Packard Bell, but i can't find hardly any information on older packard bell computers anywhere online. I got the computer around 1999, give or take a couple of years. It came with Windows 98 preinstalled. It was a tower desktop. I was wondering if anyone knows of a website or reference tool where i can find some information on older model desktop computers.

    Read the article

  • Howto: SaaS / PHP Application / Tenants / Security

    - by Ben Fransen
    Hi all, Being completely new in the webhostingcorner I have a few questions on how to implement/setup a webserver for a SaaS application. I'm about to rent my own server for a new product (CMS) I'm launching in two months. Developing the system wasn't that much of wild ride to me, but a correct way to implement it, is. So lets say this is my situation: I want to host 10 websites for 8 clients. There are 6 single sites, and two clients have two websites they can manage with my software. The CMS must be placed on the server too, all clients are connecting to 1 system The database must be placed Depending on the contract a client makes, the client gets some storage. How to measure the used storage over the DB, FileSystem and email Clients may not, in any case be able to somehow get outside their directory, but from the CMS directory the CMS must be able to create files and dirs in a clients directory (for templates, imagegalleries, widgets, etc, etc). I was thinking about something like a dirstructure like this: ./CMS/ [all CMS files] ./Websites/*/ [all websites] My hostingprovider will install updates to the os (CentOS, latest) and the admin panel (Direct Admin). Is there anybody with experience on this topic? Or do you have some thoughts about it? please join the conversation since I'm completely new to this. Ben

    Read the article

  • Cluster FIle System

    - by Ben
    We are looking for to choose a clustered file system for our in house appplication. Let me first highlight my requirement. we have a storage and 2 servers at present.We get the data files from remote servers to our server and on both servers we are running our application to access those data and make a final result as per our requirements. In future may be after 3-4 months, we can add another servers in current cluster pool to handle more data load from remote location data senders. So my requirement is that to integrate same storage partition on 2-3 servers , it might be 4-5 more servers in future, My application read data from storage partition and write back to storage partition. Is there any bottleneck / limitation from RHCS , GFS2 or anything.? We are new with RHCS + GFS and all. Can we have any other better approach or someway to deal with our requirement light way? what is the best OS version for this ? how's RHEL 6.4 64 bit ? please share some case study or some gudie reference as per past experiences with such environnmnets Regards, Ben

    Read the article

  • How do I make wallpaper fit both monitors in dual monitor setup?

    - by Ben
    I am deploying some custom corporate wallpaper as part of a Windows 7 rollout. Some people will be using dual monitors, and the additional monitors may be either 4:3 or widescreen. I want to use the same wallpaper on both screens (i.e. 2 copies of the same wallpaper, not stretched across both.) If I set the background to "stretch", it uses the aspect ratio of the primary monitor to stretch the wallpaper on both monitors. So, for example, if I have a dual monitor setup using a 4:3 TFT as primary and my (widescreen) laptop LCD as secondary - the image shows on the laptop LCD in 4:3, with a black stripe down either side. I've only noticed this as an issue with my "custom" wallpaper. Both the default MS wallpaper and the built in Lenovo wallpaper don't seem to have this issue. Is this by using "trickery" such as using an image larger than the largest resolution you will have and centering it? (i.e. so you crop out part of the image.) Or can this be done "properly"? I don't want to use 3rd party software to do this, but would happily do a bit of Powershell scripting if this would solve the issue. Thanks in advance, Ben

    Read the article

  • How to switch sound-drivers, and to which? [AMD] Hudson Azalia Controller

    - by Anders Martini
    System settings/sound does not open, freezes and I have to force close. Speaker symbol with volume control does not open scroll-down menu, and there is no sounds. Many people have problems with Hudson Azalia in Ubuntu, but I found no working solution. I don't really understand much of this, but here are some more details: aplay -l : **** List of PLAYBACK Hardware Devices **** (after running this one, it starts some kind of process that doesn't get any results, and doesn't stop, terminal has to be shut down) lspci -vnn | grep -iA5 audio: 00:01.1 Audio device [0403]: Advanced Micro Devices [AMD] nee ATI Device [1002:9902] Subsystem: Hewlett-Packard Company Device [103c:184c] Flags: bus master, fast devsel, latency 0, IRQ 53 Memory at f0444000 (32-bit, non-prefetchable) [size=16K] Capabilities: <access denied> Kernel driver in use: snd_hda_intel -- 00:14.2 Audio device [0403]: Advanced Micro Devices [AMD] Hudson Azalia Controller [1022:780d] (rev 01) Subsystem: Hewlett-Packard Company Device [103c:184c] Flags: bus master, slow devsel, latency 32, IRQ 54 Memory at f0440000 (64-bit, non-prefetchable) [size=16K] Capabilities: <access denied> Kernel driver in use: snd_hda_intel It seems to me that I'm currently running hda Intel drivers on my AMD Hudson Azalia soundcard. I can't see what drivers this soundcard uses. Do I need any additional drivers for my soundcard, and where would I find them?

    Read the article

  • crippling repeating "pciehp card not present" notifications

    - by Nanne
    When using ubuntu (12.04, both installed and on a live usb) I get a lot of these messages: pciehp 0000:00:1c.5:pcie04: Card not present on Slot(37) pciehp 0000:00:1c.5:pcie04: Card present on Slot(37) And with a lot I mean about 20 per second. This has a crippling effect, and I would like to get rid of it :) The computer is a packard bell easynote BG48-U-100 DC. I tip I picked up from some fedora/redhat error here was to look at lspci -vnn. I have pasted the part about "00:1c.5" here: http://pastebin.com/0sfsiqW2 For what good it may do, here is the lsmod of my machine: http://pastebin.com/DQZy1kAL From that first pastebin I think to conclude that it has to do with the module shpchp, which seems to me (aka: google) to have something to do with ACPI. That's as far as I've come in disecting this. Can anyone help me along further? What can I do, check etc? I did see this topic but my intentions are not to surpress the error message: I know how to do this (from that topic ;) ), but I'm looking for a real sollution. Finding the problem on the internet does suspect me to believe it is neither an ubuntu specific nor a packard-bell specific problem.If you google the problem it seems that is present on several other distribution/hardware combo's as well, and it looks like the advice is to remove one of the drivers? I have no clue as to which driver I should look at and and what would be the effect of just removing it. I have seen this topic which is old-ish, but describes my problem and is about a similar computer. The solution in this topic was to compile a new kernel using a spanish guide, which seems a bit extreme to me, so I'm kinda hoping for a better solution than that.

    Read the article

  • Quels mythes sur le métier de développeur se révèlent être vrais ? Un enseignant passe en revue quelques « non-mythes »

    Quels mythes sur le métier de développeur se révèlent être vrais ? Un enseignant passe en revue quelques « non-mythes » Dans une démarche peu habituelle, Mordechai Ben-Arin, professeur au département d'enseignement des sciences à l'institut Weizmann en Israël, s'est attaqué à ce qu'il qualifie de « non-mythes » sur le métier de développeur. Ce sont, d'après lui, les mythes que les enseignants réfutent généralement pour encourager les étudiants à suivre des études de génie logiciel... alors qu'ils ne sont pas forcément faux. Dans un document de 7 pages, Mordechai Ben-Arin (alias Moti) s'attache ainsi à démontrer la véracité de plusieurs lieu commun. Co...

    Read the article

  • Generalize, or Fix The Problem?

    - by Droogans
    Which of these two programmers is "better", from a managerial standpoint? The first programmer is Albert. You tell Al to make a system that will pass you the salt at the dinner table. He does it in less than a day. It works fine. The second programmer is Ben. Ben is told to make a program to pass the salt, and after two days, he's still working on it. It will save time in the long run...if you need pepper, ketchup, etc. There isn't any clear indication that there will be a need for this, but it's not improbable. Who's the better programmer to have working under you, as a manager?

    Read the article

  • Google I/O 2010 - ?Run corp apps on App Engine? Yes we do.

    Google I/O 2010 - ​Run corp apps on App Engine? Yes we do. Google I/O 2010 - ​Run corporate applications on Google App Engine? Yes we do. App Engine, Enterprise 201 Ben Fried, Irwin Boutboul, Justin McWilliams, Matthew Simmons Hear Google CIO Ben Fried and his team of engineers describe how Google builds on App Engine. If you're interested in building corp apps that run on Google's cloud, this team has been doing exactly that. Learn how these teams have been able to respond more quickly to business needs while reducing operational burden. For all I/O 2010 sessions, please go to code.google.com/events/io/2010/sessions.html From: GoogleDevelopers Views: 14 0 ratings Time: 55:53 More in Science & Technology

    Read the article

  • Where to use Controller.HttpContext

    - by Ben
    Hi, In my base controller's constructor I am calling an extension method that checks for specific cookies on the client. Currently I am using System.Web.HttpContext.Current to get the current context. However, I am lead to believe that I should be using Controller.HttpContext since it is more testable and contains additional information about the request. However, Controller.HttpContext returns null on creation (believe this is by design) but also on Initialize and Execute methods (unless I use Routing.RequestContext.HttpContext?). So if I should be using Controller.HttpContext instead of HttpContext.Current, at what point is it available to me in a request? Thanks Ben

    Read the article

  • ISAPI Rewrite rule help ( .html -> .aspx )

    - by ben
    Hello, Recently I'm working on a refactor project from asp to asp.net 3.5. There are lots of .html file uses .inc file for the header and footer in the old site, and needed to be converted to .aspx uses master page. My problem is, for search engine and for bookmark those old pages are all gone Therefore I need to redirect the old .html pages to .aspx. I've been trying to find a way to fix that, finally i found ISAPI_Rewrite might be the tool that i can use. After a few hours reading the document on the site, i still have no clue how to write the syntax at all :( Could anyone give a some examples please? ex. rewrite all urls under www.example.com/en to www.example.com/ rewrite all .html to .aspx The server is using Windows 2000, IIS6, ISAPI_Rewrite 3 Lite Thanks in advance ben :)

    Read the article

  • Can I ReRender a JSF Component from backing bean code?

    - by Ben
    Hi, Can I rerender a jsf ui component when a valuechangelistener method is run? The reason i'm asking is that my valuechangelistener method changes the values of the input boxes but when I run it, they don't seem to be rerender. The following doesn't work: <h:inputText id="inputbox_id"/> <h:selectOneMenu valueChangeListener="#{myBean.changeCountryMenu}"> <a4j:support event="onchange" rerender="inputbox_id" action="#{bean.test}> </h:selectOneMenu> Notice that bean.test() is never run. So the solution I thought of is to rerender the inputbox from the valueChangeListener. If there is some other better solution i'd be glad to hear... Thank you! Ben.

    Read the article

  • NVelocity ASP.NET Examples

    - by Ben
    I'm looking to use NVelocity in my ASP.NET MVC application, not as a view engine, just for rendering some email templates. However, I cannot for the life of me get it to work. I have downloaded it from the castle project and followed the example at http://www.castleproject.org/others/nvelocity/usingit.html#step1 No matter what I try I don't seem to be able to load a template located in my site. The example suggests using the absolute path, which I have tried to no avail: Template t = engine.GetTemplate("/Templates/TestEmail.vm"); So please can someone give me two examples. One of loading a template located in the web site directory and secondly one parsing a string variable (as it is likely that my templates will be stored in a database). Many thanks Ben

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >