Search Results

Search found 4679 results on 188 pages for 'apple radar'.

Page 90/188 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • How do I put all the types matching a particular C# interface in an IDictionary?

    - by Kevin Brassen
    I have a number of classes all in the same interface, all in the same assembly, all conforming to the same generic interface: public class AppleFactory : IFactory<Apple> { ... } public class BananaFactory : IFactory<Banana> { ... } // ... It's safe to assume that if we have an IFactory<T> for a particular T that it's the only one of that kind. (That is, there aren't two things that implement IFactory<Apple>.) I'd like to use reflection to get all these types, and then store them all in an IDictionary, where the key is typeof(T) and the value is the corresponding IFactory<T>. I imagine eventually we would wind up with something like this: _map = new Dictionary<Type, object>(); foreach(Type t in [...]) { object factoryForType = System.Reflection.[???](t); _map[t] = factoryForType; } What's the best way to do that? I'm having trouble seeing how I'd do that with the System.Reflection interfaces.

    Read the article

  • remove the blank rows after i removed xml elements?

    - by fayer
    i removed some elements from a xml file with simpledom. the code: $this->xmlDocument->removeNodes("//entity[name='mac']"); here is the initial file: <entity id="1000070"> <name>apple</name> <type>category</type> <entities> <entity id="7002870"> <name>mac</name> <type>category</type> </entity> <entity id="7024080"> <name>iphone</name> <type>category</type> </entity> <entity id="7024080"> <name>ipad</name> <type>category</type> </entity> </entities> </entity> the file afterwards: <entity id="1000070"> <name>apple</name> <type>category</type> <entities> <entity id="7024080"> <name>iphone</name> <type>category</type> </entity> <entity id="7024080"> <name>ipad</name> <type>category</type> </entity> </entities> </entity> i wonder how i could also remove the blank lines that are left after i ran the removal code? thanks!

    Read the article

  • Positioning objects in views during re-orientation in iPad

    - by Arni
    iPad Gurus: Apple wants us to support all orientations. I take that to mean that a particular layout should either rotate so that all objects are positioned relatively the same OR, if that doesn't look good, then they ought to be repositioned, OR two views ought to be designed and built. If I rely on the built-in rotation mechanism, the objects either get resized or they straddle the edge of the page in one orientation or the other, or they disappear from view altogether. I can't seem to find the right settings to get the objects to align clearly so they are seen in each orientation. Repositioning leads to a lot of if statements in the View Controller. So I don't think Apple had that in mind. I tried replacing views and even view controllers in "willRotateToInterfaceOrientation" method, but that either causes crashes or the portrait views end up in landscape unexpectedly and vv. Moreover, two view controllers means double the coding for the same view. There must be proper way to handle orientation changes, but I have searched the internet and documentation and sample code in vain for something that works. How is this done properly? Thanks!

    Read the article

  • How do i implement tag searching with lucene?

    - by acidzombie24
    I havent used lucene. Last time i ask (many months ago, maybe a year) people suggested lucene. As am example say there are 3 items tag like this apples carrots apples carrots apple banana if a user search apples i dont care if there is any preference from 1,2 and 4. However i seen many forums do this which i hated is when a user search apple carrots 2 and 3 are get high results while 1 is hard to find even though it matches my search more closely. I HATED this in forums. Also i would like the ability to do search carrots -apples which will only get me 3. I am not sure what should happen if i search carrots banana but anyways as long as more 2 and 3 results are lower priority then 1 when i search apples carrots i'll be happy. Can lucene do this? and where do i start? i see a lot of classes and many of them talk about docs. What should i use for tagging?

    Read the article

  • My IF statement is changing variables in PHP

    - by user1902509
    I am fairly new to the whole programming thing, so forgive me if this is a stupid question. It seems odd that I haven't run into it before. I am trying to make an order form for a cake. You fill out the form, submit it, and it will then display the order in a new window, where you then hit "submit," and upload it to the Database. I have a series of If Statements to check for errors in the form before submitting it. Here is a simplified version of the code. Writing means any writing you want on the cake, Name is your name, and cake is what type of cake you want (the default is "None"). try { $name = trim($params->name); $cake = trim($params->cake); $writing = trim($params->writing); if (strlen($name) < 3){ throw new Exception("Please enter Your name."); } if ($cake = "None") { throw new Exception("Please select a Cake" } if ($cake = "Caramel Apple Pie" or $cake = "Pumpkin Pie" or $cake = "Eggnog Pie" and strlen($writing) > 1) { throw new Exception("We are sorry, but you can't write on any of our specialty pies."); } } catch(Exception $x) { $error = $x->getmessage(); } So what is happening is that when I go and hit submit the first time, the correct cake type comes up, but when you submit it the second time, the error comes up saying that I have "None" selected. All the other values are there and remain the same. I think the problem is that the first "IF" statement (Where it says "If($cake = "None")) is automatically changing $cake to "None" because I have tried commenting just that statement out, and it will then change the cake to be "Caramel Apple Pie," which is in the top of the next IF statement. Anyone know why it is doing this? And how to fix it?

    Read the article

  • Trying to get codeblocks working on Mac, running Lion. Can't get the compiler set up properly

    - by tjtoml
    First off, sorry if this is a stupid question. I installed code::blocks to try and get to know the program and start working on teaching myself c++. I have a MacBook Pro with OS 10.7.3. I ave code::blocks 10.05. When I try to build a "Hello world" nothing happens. Based on some googling I've figured out that it's because code::blocks doesn't know where to find the debugger/compiler. Further googling yielded me this page which tells me to install Xcode and to fix some things in the code::blocks settings. However, this wiki obviously has not been updated since Apple went to the App store, because the file paths it gives for the compiler do not exist (there is no /Developer/* even after installing Xcode). Xcode 4.3.2 was already installed when I installed code::blocks and code::blocks "auto-detected" several compilers. They did not work. If anyone knows where Xcode hides its compilers now that Apple has moved to the app store, I would be much obliged.

    Read the article

  • How to accommodate for the different screen resolution of iPhone 4?

    - by mystify
    This is a programming question! Read on before you vote to close! According to Apple, iPhone 4 has a new screen resolution: 3.5-inch (diagonal) widescreen Multi-Touch display 960-by-640-pixel resolution at 326 ppi This little detail affects our apps in a heavy way. Most of the demo apps on the net have one thing in common: They position views in the believe that the screen has a fixed size of 320 x 480 pixels. So what most -if not all- developers do is: They designed everything in such a way, that a touchable area is -for example- 50 x 50 pixels big. Just enough to tap it. Things have been positioned relative to the upper left, to reach a specific position on screen - let's say the center, or somewhere at the bottom. Edit: It seems Apple has integrated an switch that allows to tell if an app is highRes or not. Nice. When we develop high-resolution apps, probably they won't work on older devices. And if they did, they would suffer a lot from 4-times the size of any image, having to scale them down in memory. This is community wiki. Just add anything that you think is relevant to this huge problem (constant screen res was one of the main reasons why I didn't go for Android!!).

    Read the article

  • How to make simple dicitonary J2ME

    - by batosai_fk
    Hi, I am beginner in JavaME. I'd like to make simple dicitionary. The source data is placed on "data.txt" file in "res" directory. The structure is like this: #apple=kind of fruit; #spinach=kind of vegetable; The flow is so simple. User enters word that he want to search in a text field, e.g "apple", system take the user input, read the "data.txt", search the matched word in it, take corresponding word, and display it to another textfield/textbox. I've managed to read whole "data.txt" using this code.. private String readDataText() { InputStream is = getClass().getResourceAsStream("data.txt"); try { StringBuffer sb = new StringBuffer(); int chr, i=0; while ((chr = is.read()) != -1) sb.append((char) chr); return sb.toString(); } catch (Exception e) { } return null; } but I still dont know how to split it, find the matched word with the user input and take corresponding word. Hope somebody willing to share his/her knowledge to help me.. Add to batosai_fk's Reputation

    Read the article

  • SQL return ORDER BY result as an array

    - by EarthMind
    Is it possible to return groups as an associative array? I'd like to know if a pure SQL solution is possible. Note that I release that I could be making things more complex unnecessarily but this is mainly to give me an idea of the power of SQL. My problem: I have a list of words in the database that should be sorted alphabetically and grouped into separate groups according to the first letter of the word. For example: ape broom coconut banana apple should be returned as array( 'a' => 'ape', 'apple', 'b' => 'banana', 'broom', 'c' => 'coconut' ) so I can easily created sorted lists by first letter (i.e. clicking "A" only shows words starting with a, "B" with b, etc. This should make it easier for me to load everything in one query and make the sorted list JavaScript based, i.e. without having to reload the page (or use AJAX). Side notes: I'm using PostgreSQL but a solution for MySQL would be fine too so I can try to port it to PostgreSQL. Scripting language is PHP.

    Read the article

  • How to re-enable the idle timer in ios once it has been disabled (to allow the display to sleep again)?

    - by lindon fox
    I have figured out how to stop an iOS device from going to sleep (see below), but I am having troubles undoing that setting. According to the Apple Documentation, it should just be changing the value of the idleTimerDisabled property. But when I test this, it does not work. This is how I am initially stopping the device from going to sleep: //need to switch off and on for it to work initially [UIApplication sharedApplication].idleTimerDisabled = NO; [UIApplication sharedApplication].idleTimerDisabled = YES; I would have thought that the following would do the trick: [UIApplication sharedApplication].idleTimerDisabled = NO; From the Apple Documentation: The default value of this property is NO. When most applications have no touches as user input for a short period, the system puts the device into a "sleep” state where the screen dims. This is done for the purposes of conserving power. However, applications that don't have user input except for the accelerometer—games, for instance—can, by setting this property to YES, disable the “idle timer” to avert system sleep. Important: You should set this property only if necessary and should be sure to reset it to NO when the need no longer exists. Most applications should let the system turn off the screen when the idle timer elapses. This includes audio applications. With appropriate use of Audio Session Services, playback and recording proceed uninterrupted when the screen turns off. The only applications that should disable the idle timer are mapping applications, games, or similar programs with sporadic user interaction. Has anyone come across this problem? I am testing on iOS6 and iOS5. Thanks in advance.

    Read the article

  • How to retrive user input data entered tab bar View Controller when application start in iphone app

    - by TechFusion
    Hello, I have created window based application. Tab bar controller as root controller and it has three tabs. One Tab has Labels and TextFiled inputs like Name, Username and Password. I am looking to store this text filed inputs when user enters and able retrieve in other tabs. Previously I have set key for different text fields and setobject:withkey task and able to retrive text filed values in same view Controller [[NSUserDefaults standardUserDefaults] stringForKey:key] task. Now I am looking to create database which has different objects and each objects has data values of different Text Field inputs that I can access in whole application. like DatabaseName - Object1 - Name, Username & Password - Object2 - Name, Username & Password Something like structure in Normal C so it would be easy to retrieve data. I am looking NSUserDefaults Class and User Defaults Programming Topics in Cocoa(http://developer.apple.com/iPhone/library/documentation/Cocoa/Conceptual/UserDefaults/UserDefaults.html#//apple_ref/doc/uid/10000059-BCIDJFHD). Also Referring Archives and Serialization Programming guide(http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/Archiving/Archiving.html#//apple_ref/doc/uid/10000047i). Which method i need to use to create such type of database ? Thanks,

    Read the article

  • Sorting text and attached images in MFMailCompositeViewController?

    - by eOgas
    In the app I'm currently writing I'd like to populate the message body of an e-mail with a combination of text and images. It took me forever to find out that in order to get an embedded image, you had to have bold tags in the message body (...uhhh, yeah), otherwise the image just shows up as an attachment. But now I have the problem that all of the images just go to the end of the body, and I can't programmatically put text after or in between any of the attachments. So far I've tried: Adding images as part of the body string using tags and a base64 string. This would have worked, but most e-mail clients reject images embedded in this manner. Using normal tags with a references to the attached files, using the assigned filenames. Didn't work at all. Attaching images normally, but also attaching blocks of text to the e-mail. The text is not embedded in the same manner as the images. Turns out to be an attached txt file on the receiving end. Apple has restricted their MFMailComposieViewController class to the point of ridiculousness, but I know there has to be a way to do this, because they add in their stupid "Sent from my *apple device name here*" message at the end of every e-mail. So does anyone have any ideas?

    Read the article

  • iPhone settings not honoured

    - by winsmith
    My iPhone app has the following problem: Freshly installed, when I read out my "Play Sound" preference with the following code: defaults = [NSUserDefaults standardUserDefaults]; NSLog(@"Play Sounds? %d", [defaults boolForKey:@"play_sounds_preference"]); The setting always reads out as false, even though the default setting is set to true. Any ideas? Here is my Root.plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>StringsTable</key> <string>Root</string> <key>PreferenceSpecifiers</key> <array> <dict> <key>Type</key> <string>PSGroupSpecifier</string> <key>Title</key> <string>General Settings</string> </dict> <dict> <key>Type</key> <string>PSToggleSwitchSpecifier</string> <key>Title</key> <string>Sounds</string> <key>Key</key> <string>play_sounds_preference</string> <key>DefaultValue</key> <true/> </dict> </array> </dict> </plist> When the user opens the Settings.app and navigates to my app's name, THEN the setting reads out as true, even if the user doesn't change anything.

    Read the article

  • Objective C : UIButton image with NSArray in a random order

    - by Sarah
    Brief Idea about the flow : I have say minimum 1 and maximum 18 records in my database with a text and an image from which I have to fetch images and place any 3 of the same randomly to 3 UIButtons among which one image should match with my question. i.e. 1 is the answer and other 2 are the distractors. For Example : Question is : where is Apple? Now among the bunch of images, I want to place any 3 images on the 3 UIButtons(1 answer i.e. An Apple and 2 distractors) in a random order and on selecting the UIButton it should prompt me if it's a right answer or not. I am implementing below code for placing the UIImages in a random order : -(void) placeImages { NSMutableArray *images = [NSMutableArray arrayWithArray:arrImg]; NSArray *buttons = [NSArray arrayWithObjects:btn1,btn2,btn3, nil]; for (UIButton *btn in buttons) { int randomIndex= random() % images.count; UIImage *img = [images objectAtIndex:randomIndex]; [btn setImage:img forState:UIControlStateNormal]; [images removeObjectAtIndex:randomIndex]; } } But I am stuck at a point that how should I get 1 UIButton image with an answer and other as distractors also that how should i maintain the index of the image from the NSArray? Kindly guide me. Thank you.

    Read the article

  • EFI VMware Virtual SCSI Hard Drive (0.0) ... unsuccessful

    - by Ravichandra
    I installed the VMware-workstation-full-8.0.0-471780 and created new virtual michin with Mac OSX 10.6.6 with 4GB Ram, 1 Processer, 40GB Hard Disk(SCSI) and General -- Guest Operating system : Apple Mac OS X, Version: Mac OS Server 10.6. when I Power On the the VMWare gives the follwing unsuccessfull comments. -- EFI VMware Virtual SCSI Hard Drive (0.0) ... unsuccessful -- EFI VMware Virtual IDE CDROM Drive (IDE 1.0) ... unsuccessful Could you please help me. how to solve this errors

    Read the article

  • Need a non-Mac keyboard alternative for Mac users

    - by bLee
    I'm a Macbook Pro user. I like Apple products in general, but I hate their keyboards. I work on my computer/laptop 10+ hours a day, so I would like to have a keyboard that is Mac-compatible and ergonomic. I found this one on Amazon. It is specifically made for Mac. However, I would like to get some suggestions from people who found good keyboards for Mac.

    Read the article

  • Unable to enable FTP access of Mac OSX Snow Leopard

    - by Xetius
    When I try to enable the FTP service in the preferences (File Sharing-Options-Share Files and Folders Using FTP) the check box enables and then disables again. The console is giving me the message : 16/04/2010 12:14:20 com.apple.coreservicesd[51] sh: launchctl: command not found This indicates to me that it can't find the launchctl executable launchctl is present in the folder /bin /bin is set in the PATH variable for sh and bash shells and also in the ~/.MacOS/environment.plist How can I fix this so that my preferences can find this so that I can enable the FTP service.

    Read the article

  • Macbook Pro - Randomly sleeps and won't wake up

    - by James
    All, I have a Macbook Pro 13" (mid 2009) that has had a long time issues which seems to be getting worse. Occasionally, I will go to wake the computer with the keyboard and can't wake it. The HDD spins up, the light on the front of the computer stops blinking, but as soon as it seems like the display should light up, the HDD stops and the light begins blinking again. More rarely, the computer will suddenly sleep while I am using it and then enters the same sleep loop. The only way to resume working on the computer is to wait. Doing a hard restart just puts it right back into the 'sleep loop.' Here is an excerpt from kernel.log showing the laptops apparent narcolepsy: Jun 5 22:20:40 james-hales-macbook-pro kernel[0]: Wake reason: OHC1 Jun 5 22:20:40 james-hales-macbook-pro kernel[0]: Previous Sleep Cause: 5 Jun 5 22:20:40 james-hales-macbook-pro kernel[0]: The USB device Apple Internal Keyboard / Trackpad (Port 6 of Hub at 0x4000000) may have caused a wake by issuing a remote wakeup (2) Jun 5 22:20:40 james-hales-macbook-pro kernel[0]: HID tickle 31 ms Jun 5 22:20:41 james-hales-macbook-pro kernel[0]: 00000000 00000020 NVEthernet::setLinkStatus - not Active Jun 5 22:20:45 james-hales-macbook-pro kernel[0]: MacAuthEvent en1 Auth result for: 20:4e:7f:48:c0:ef MAC AUTH succeeded Jun 5 22:20:45 james-hales-macbook-pro kernel[0]: wlEvent: en1 en1 Link UP Jun 5 22:20:45 james-hales-macbook-pro kernel[0]: AirPort: Link Up on en1 Jun 5 22:20:45 james-hales-macbook-pro kernel[0]: en1: BSSID changed to 20:4e:7f:48:c0:ef Jun 5 22:20:46 james-hales-macbook-pro kernel[0]: AirPort: RSN handshake complete on en1 Jun 5 22:20:48 james-hales-macbook-pro kernel[0]: 00000000 00000020 NVEthernet::setLinkStatus - not Active Jun 5 22:20:54 james-hales-macbook-pro kernel[0]: Jun 5 22:20:55 james-hales-macbook-pro kernel[0]: Wake reason: OHC1 Jun 5 22:20:55 james-hales-macbook-pro kernel[0]: Previous Sleep Cause: 5 Jun 5 22:20:55 james-hales-macbook-pro kernel[0]: The USB device Apple Internal Keyboard / Trackpad (Port 6 of Hub at 0x4000000) may have caused a wake by issuing a remote wakeup (2) Jun 5 22:20:55 james-hales-macbook-pro kernel[0]: wlEvent: en1 en1 Link DOWN Jun 5 22:20:55 james-hales-macbook-pro kernel[0]: AirPort: Link Down on en1. Reason 4 (Disassociated due to inactivity). Jun 5 22:20:55 james-hales-macbook-pro kernel[0]: HID tickle 26 ms Jun 5 22:20:55 james-hales-macbook-pro kernel[0]: 00000000 00000020 NVEthernet::setLinkStatus - not Active Jun 5 22:20:58 james-hales-macbook-pro kernel[0]: MacAuthEvent en1 Auth result for: 20:4e:7f:48:c0:ef MAC AUTH succeeded Jun 5 22:20:58 james-hales-macbook-pro kernel[0]: wlEvent: en1 en1 Link UP Jun 5 22:20:58 james-hales-macbook-pro kernel[0]: AirPort: Link Up on en1 Jun 5 22:20:58 james-hales-macbook-pro kernel[0]: en1: BSSID changed to 20:4e:7f:48:c0:ef Jun 5 22:20:58 james-hales-macbook-pro kernel[0]: AirPort: RSN handshake complete on en1 Jun 5 22:21:02 james-hales-macbook-pro kernel[0]: 00000000 00000020 NVEthernet::setLinkStatus - not Active Jun 5 22:21:08 james-hales-macbook-pro kernel[0]: I have tried reseting the SMC and reinstalling Lion (short of erasing and installing) to no avail. The Genius bar has insisted that the problem would be resolved by reinstalling Lion (which they did, but didn't fix anything, still insisting...). Please don't say "logic board." Thoughts?

    Read the article

  • iCal and Google Calendar are synced, but invitations don't show up on Google Calendar

    - by Wayne M
    So I can view my Google Calendar from iCal. However when I get an invitation sent through Apple Mail and I click it, it adds the invite to the default iCal calendar and not my Google Calendar (i.e. going to Google Calendar or bringing it up on my iPhone doesn't show the newly-added event). How can I change this so clicking on an invite will add it to my Google Calendar and display in iCal's synced Google Calendar view?

    Read the article

  • Mac OS X - Could not start Terminal.app - shell has illegal value

    - by chemm
    I can not run the Terminal.app after rolling back my system from time machine. Mac OS X Version 10.6.2 It displays the following error. "Your are not authorized to run this application" "The administrator has set your shell to an illegal value" After that I have deleted the file ~/Library/Preferences/com.apple.Terminal.plist But the same message is displayed. I have repaired all system rights with the DiskUtility but that did not help.

    Read the article

  • Dashboard Devmode w/o "Always on Top" Possible?

    - by Travis
    I am using (and loving) OS X's Dashboard in dev mode ('defaults write com.apple.dashboard devmode YES') which lets you put the widgets on your desktop directly. The only downside is the widgets are "always on top". So all windows end up going under the widgets instead of above. Is there any way to disable this?

    Read the article

  • Change iPhone MAC address

    - by Freeman
    Hello, is it possible to change the iPhone MAC address? I have used ifconfig [interface] ether 01:02:03:04:05:06, but the MAC address does not change. Perhaps Apple has disabled the corresponding sysctl and it is necessary to patch the kernel.

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >