Daily Archives

Articles indexed Wednesday March 17 2010

Page 26/128 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • How to retrieve XML attribute for custom control

    - by David
    I've created a combo box control with a edittext and spinner. I'm trying to let the android:prompt attribute be passed onto the spinner, which means I need to catch it in the constructor which passes my the AttributeSet and set it on the spinner. I can't figure out how to get the value of the prompt. I'm trying, int[] ra = { android.R.attr.prompt }; TypedArray ta = context.getTheme().obtainStyledAttributes(ra); int id = ta.getResourceId(0, 0); I get back 0, which means it didn't find the attribute. I also did a ta.count() which returned 0. So I'm not getting anything back. My XML simply defines an android:prompt value. Thanks

    Read the article

  • Recover data from hard disk

    - by Hitesh Solanki
    Hi I have formatted my c: drive and window xp is installed successfully,but I cannot able to access d: drive. when I am trying to double click on the d: drive,following message is displayed: "the disk in drive D: is not formatted, do you want to format it now ? " When I am trying to access from command prompt,the following message is displayed: "The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted." So please help me.... Thanks in advance....

    Read the article

  • What does a Java static method look like in Ruby?

    - by Hosh
    In Java, a 'static method' would look like this: class MyUtils { . . . public static double mean(int[] p) { int sum = 0; // sum of all the elements for (int i=0; i<p.length; i++) { sum += p[i]; } return ((double)sum) / p.length; } . . . } // Called from outside the MyUtils class. double meanAttendance = MyUtils.mean(attendance); What's the equivalent 'Ruby way' of writing a 'static method'?

    Read the article

  • Saving CFPropertyLists To Users Folder

    - by stephen blinkhorn
    I'm trying to save a CFPropertyList to a location in the user's home folder. Using the code below I'm getting errorCode = -10 (unknown error). CFURLRef fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("~/testfile.txt"), kCFURLPOSIXPathStyle, false ); SInt32 errorCode; Boolean status = CFURLWriteDataAndPropertiesToResource(fileURL, xmlData, NULL, &errorCode); If I change the path to something like "/testfile.txt" without the '~' then everything works. How can one save a property list to the current user's home folder? Must one obtain the user's name first and include it in the path such as /users/toffler/testfile.txt?

    Read the article

  • WCF Service Throttling

    - by Mubashar Ahmad
    Dear All I have a WCF Service Deployed in a Console App with BasicHTTPBinding and SSL enabled on port using NetSH command and more over following attribute is set as well. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] And also i have set the Throttling behavior as <serviceThrottling maxConcurrentCalls="2147483647" maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647" /> On the other hand i have created a Test Client(for load test) that initiates multiple clients simultaneously(multiple threads) and performs transactions on server. everything seems fine and working properly but on server the CPU utilization is doesn't grow so i added some logging to view the number of concurrent calls to the server and found that its never went over 6. i have reviewed the performance counter logging code more than twice and it seems fine to me. So i want to ask where is the problem in this situation and one more thing i haven't specified any kind of ContextMode or ConcurrencyMode yet. After this Post I noticed that whenever i start another Intance of Test Client my concurrent Server Calls counter increase to 2 like if i am running only 1 instance the maximum Concurrent Rcvd Calls will be 2 and if there are two instance the same value goes to 4 and so on. Is there any limit of Number of WCF Calls from once process? Looking for help Mubashar *Added on 17-March******************* Today i ran another test with one test client(with 50 concurrent users) on the same machine on which the server is running this time i am getting exact result what i wanted it to show i.e. Maximum concurrent Calls Rcvd by Server = 50 but i need to do it the same on others machines as well. Can anybody help me on this.

    Read the article

  • Mongodb performance on Windows

    - by Chris
    I've been researching nosql options available for .NET lately and MongoDB is emerging as a clear winner in terms of availability and support, so tonight I decided to give it a go. I downloaded version 1.2.4 (Windows x64 binary) from the mongodb site and ran it with the following options: C:\mongodb\bin>mkdir data C:\mongodb\bin>mongod -dbpath ./data --cpu --quiet I then loaded up the latest mongodb-csharp driver from http://github.com/samus/mongodb-csharp and immediately ran the benchmark program. Having heard about how "amazingly fast" MongoDB is, I was rather shocked at the poor benchmark performance. Starting Tests encode (small).........................................320000 00:00:00.0156250 encode (medium)........................................80000 00:00:00.0625000 encode (large).........................................1818 00:00:02.7500000 decode (small).........................................320000 00:00:00.0156250 decode (medium)........................................160000 00:00:00.0312500 decode (large).........................................2370 00:00:02.1093750 insert (small, no index)...............................2176 00:00:02.2968750 insert (medium, no index)..............................2269 00:00:02.2031250 insert (large, no index)...............................778 00:00:06.4218750 insert (small, indexed)................................2051 00:00:02.4375000 insert (medium, indexed)...............................2133 00:00:02.3437500 insert (large, indexed)................................835 00:00:05.9843750 batch insert (small, no index).........................53333 00:00:00.0937500 batch insert (medium, no index)........................26666 00:00:00.1875000 batch insert (large, no index).........................1114 00:00:04.4843750 find_one (small, no index).............................350 00:00:14.2812500 find_one (medium, no index)............................204 00:00:24.4687500 find_one (large, no index).............................135 00:00:37.0156250 find_one (small, indexed)..............................352 00:00:14.1718750 find_one (medium, indexed).............................184 00:00:27.0937500 find_one (large, indexed)..............................128 00:00:38.9062500 find (small, no index).................................516 00:00:09.6718750 find (medium, no index)................................316 00:00:15.7812500 find (large, no index).................................216 00:00:23.0468750 find (small, indexed)..................................532 00:00:09.3906250 find (medium, indexed).................................346 00:00:14.4375000 find (large, indexed)..................................212 00:00:23.5468750 find range (small, indexed)............................440 00:00:11.3593750 find range (medium, indexed)...........................294 00:00:16.9531250 find range (large, indexed)............................199 00:00:25.0625000 Press any key to continue... For starters, I can get better non-batch insert performance from SQL Server Express. What really struck me, however, was the slow performance of the find_nnnn queries. Why is retrieving data from MongoDB so slow? What am I missing? Edit: This was all on the local machine, no network latency or anything. MongoDB's CPU usage ran at about 75% the entire time the test was running. Edit 2: Also, I ran a trace on the benchmark program and confirmed that 50% of the CPU time spent was waiting for MongoDB to return data, so it's not a performance issue with the C# driver.

    Read the article

  • Removing and adding persistent stores to a core data application

    - by mkko
    I'm using core data on an iPhone application. I have multiple persisntent stores that I'm switching from one to another so that only one of the stores can be active at the time. I have one managed object context and the different persistent stores are similar in data format (sqlite) and share the same managed object model. I'm importing the data to each persistent store from a respective XML file. For the first import everything works fine, but after I remove the imported data (the persistent store and the physical file) and then re-import, core data gives me an error: *** Terminating app due to uncaught exception 'NSObjectInaccessibleException', reason: 'The NSManagedObject with ID:0x3c14e00 <x-coredata://6D14F11E-2EA7-4141-9BE8-53747DE6FCC6/Book/p2> has been invalidated.' This error comes from the save: of NSManagedObjectContext. Before re-importing, i'm removing the persistent store from the persistent store coordinator and removing the physical file, so everything should be as if re-importing was done for the first time. Alos, the objects in managed object context are removed and the context is sent the reset: message (I don't know if this is actually needed). Could some one help me out here? How should the persistent store be switched? I'm basically using the same logic as tutored here: http://blog.sallarp.com/iphone-core-data-uitableview-drill-down/ Thanks in advance.

    Read the article

  • webrat, rspec, nokogiri segfault

    - by adamaig
    I'm getting a segfault in nokogiri (1.4.1) run (under cucumber 0.6.1/webrat 0.7.0/rspec 1.3.x) response.should have_selector("div", :class => "fieldWithErrors") and the div in the page is actually <div class="fieldWithErrors validation_error"> stuff </div> Everything runs fine if I just test nokogiri against a test document >> require 'nokogiri' >> doc = Nokogiri::HTML.parse("<div class='a b'>love to have problems</div>") => ... >> doc.css(".a") => [#<Nokogiri::XML::Element:0x3d62ac name="div" attributes=[#<Nokogiri::XML::Attr:0x3d6258 name="class" value="a b">] children=[#<Nokogiri::XML::Text:0x3d5e68 "love to have problems">]>] So I want to know how to setup a minimal webrat test of an html fragment document to help file a bug.

    Read the article

  • jQuery slideToggle stay open on hover

    - by durilai
    I have a div that I have bound the jQuery hover event to activate a slideDown using slideToggle: <div class="Square"> <div class="RedSquare"></div> <div class="GraySquare"></div> </div> $("div.RedSquare").hover( function() { $(this).siblings("div.GraySquare").slideToggle("fast"); }, function() { $(this).siblings("div.GraySquare").slideToggle("fast"); } ); It toggles a div '.GraySquare' right below it. Basically making a gray box slide down from the red box. The problem I am facing is that when the mouse moves over the gray div the slide toggles up. I want it to remain down when hovering over the red or gray square. Any help is appreciated.

    Read the article

  • WAMP apache server : problem running php files

    - by Peter
    I have installed WAMP 2 and am using firefox 3.6. I have saved my php file test.php in C:\wamp\bin\apache\Apache2.2.11\htdocs and I now open http://localhost/test.php in my firefox browser but I get a file not found error Not Found The requested URL /test.php was not found on this server. What am I doing wrong?

    Read the article

  • Remove the complete stying of a html button/submit

    - by Saif Bechan
    Is there a way of completely removing the styling of a button in Internet Explorer. I use a css sprite for my button, and everything looks ok. But when i click the button, it moves to the top a little, it makes it look out of shape. Is there a css click state, or mousedown? I don't know what triggers that state. I know it't not a really big deal, but sometimes it's the small things that matter.

    Read the article

  • How to copy x and y coordinate from one Flex component to another

    - by Tam
    Hi, I would like to base one component's x and y cooridnates according to another, I tried using the binding notation but it doesn't seem to work! <?xml version="1.0" encoding="utf-8"?> <s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:vld ="com.lal.validators.*" xmlns:effect="com.lal.effects.*" xmlns:components="com.lal.components.*" width="400" height="100%" right="0" horizontalAlign="right" verticalCenter="0"> ...... <s:VGroup width="125" height="100%" horizontalAlign="right" gap="0" width.normal="153" x.normal="247" width.expanded="199" x.expanded="201"> ...... <s:Panel includeIn="expanded" id="buttonsGroup" mouseOut="changeStateToNormal();" mouseOver="stopChangeToNormal();" skinClass="com.lal.skins.TitlelessPanel" title="hi" right="0" width="125" height="700" > ..... <s:Label text="Jump To Date" paddingTop="20" /> <s:TextInput id="wholeDate" width="100" mouseOver="stopChangeToNormal();" click="date1.visible = true" focusOut="date1.visible = false"/> ... </s:Panel> </s:VGroup> <mx:DateChooser id="date1" change="useDate(event); this.visible = false; " visible="false" mouseOver="stopChangeToNormal();" y="{wholeDate.y}" x="{wholeDate.x}" /> </s:VGroup>

    Read the article

  • How can I prevent users from taking screenshots of my application window?

    - by Midday
    What are some methods to prevent screenshots from being taken, if any? I've considered setting the "Print Screen" button as a hotkey, which makes the window fuzzy. However, there would be the problem of other 3rd party screenshot tools. How can I prevent their use? Why would I want such a thing? The idea is to create a chat client which you can't share the chatted information with others, not by copy & paste nor by print screen... Looking for general ideas or suggestions rather than actual code.

    Read the article

  • separating JSS from CSS at plone.htmlhead

    - by badchoosed
    Hey there! I'm using Plone 3.1.7 in a project that needs performance tweaks. One of the tweaks requests that CSS should be at the top of page and the JS should be at the bottom. However both are located at <div tal:replace="structure provider:plone.htmlhead" /> In main_template. How do I split these ones? Thanks in advance

    Read the article

  • Zend/PHP: How to disable webpage behind popup ?

    - by NAVEED
    I am working on zend framework, PHP and jQuery. I am working on popups sometimes. When any popup is open on the screen, we can still clicks links on webpage behind popup which causes some unexpected behaviour. How can I disable a webpage behind popup. I have seen some web application in which when popup appears then webpage behind popup become shady. I have read some tutorial about this. In each tutorial a link is used to open a dialog and an special attribute is added in for modal. But I have a different case I have to open dialog on some condition in action. I check a condition in action after post like this: $form = new Edit_Form( ); $this->view->form = $form; $this->view->form->setAction($this->view->url()); $request = $this->getRequest(); if ( $request->isPost() ) { $values = $request->getParams(); if( $values['edit'] ) { $this->view->openEditBox(); } } Now check in view to see that it should open an edit pop or not: if( $this->openEditBox ){ $jsonOutput ['content'] = '<div class="DialogBox" title="Edit">' . $this->form->render() . '</div>'; echo Zend_Json::encode($jsonOutput); } Any Idea? Thanks

    Read the article

  • What kind parser that phpdoc use ?

    - by justjoe
    When the first time, i install phpdoc, i love it so much. And i want to create its mini version for myself use. So, can anybody give me information about what kind of parser it has. and Maybe a image reference on how it works (so i can picture it visually in my mind) ?

    Read the article

  • iPhone game and reading plist file and looping through multidimensional array.

    - by Fulvio
    I have a question regarding an iPhone game I'm developing. At the moment, below is the code I'm using to currently I loop through my multidimensional array and position bricks accordingly on my scene. Instead of having multiple two dimensional arrays within my code as per the following (gameLevel1). Ideally, I'd like to read from a .plist file within my project and loop through the values in that instead. Please take into account that I'd like to have more than one level within my game (possibly 20) so my .plist file would have to have some sort of separator line item to determine what level I want to render. I was then thinking of having some sort of method that I call and that method would take the level number I'm interested in rendering. e.g. Method? +(void)renderLevel:(NSString levelNumber); e.g. .plist file? #LEVEL_ONE# 0,0,0,0,0,0,0,0,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,1,1,1,1,1,1,1,0 0,0,0,0,0,0,0,0,0 #LEVEL_TWO# 1,0,0,0,0,0,0,0,1 1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1 0,1,1,1,1,1,1,1,0 1,1,1,1,1,1,1,1,1 0,1,1,1,1,1,1,1,0 1,1,1,1,1,1,1,1,1 0,1,1,1,1,1,1,1,0 1,1,1,1,1,1,1,1,1 0,1,1,1,1,1,1,1,0 1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1 1,0,0,0,0,0,0,0,1 Code that I'm currently using: int gameLevel[17][9] = { { 0,0,0,0,0,0,0,0,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,1,1,1,1,1,1,1,0 }, { 0,0,0,0,0,0,0,0,0 } }; for (int row=0; row < 17; row++) { for (int col=0; col < 17; col++) { thisBrickValue = gameLevel[row][col]; xOffset = 35 * floor(col); yOffset = 22 * floor(row); switch (thisBrickValue) { case 0: brick = [[CCSprite spriteWithFile:@"block1.png"] autorelease]; break; case 1: brick = [[CCSprite spriteWithFile:@"block0.png"] autorelease]; break; } brick.position = ccp(xOffset, yOffset); [self addChild:brick]; } }

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >