Daily Archives

Articles indexed Saturday April 10 2010

Page 12/89 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Getting GPU clock speeds with SetupDiEnumDeviceInfo

    - by user157078
    Hi everyone! I posted a question earlier regarding obtaining GPU clock speeds, but I guess the thread appeared as already answered since someone had replied to it. I'd been advised by one of your members to try extracting GPU clock speeds using SetupDiEnumDeviceInfo. However, I looked around at some examples, like this one: http://www.codeproject.com/KB/system/DevMgr.aspx and nothing seemed to be displayed about the clock speed. Could someone please elaborate on how to achieve this, if at all possible? Thanks again

    Read the article

  • jQuery/Ajax with Zend Framework

    - by Nathan
    I've been tinkering around with Zend-Framework and Jquery for a month or so, and finally started tinkering with them together using ZendX_JQuery. It seems I've ran into something that at first seemed it should be simple, So maybe I'm just missing something here. I have a view along the lines of: $this->ajaxLink( $this->escape($var->title), $this->baseUrl() . "/another/action", array('update' => '#domain' . $var->id , 'complete' => '$("#domain' . $var->id .'").toggle("slow");')); echo '<div id="domain"' . $var->id . '" style="display:none;" ></div>'; Which works correctly, when the link displayed by the code above is clicked it loads the contents returned from /another/action into the domain"id" div. The problem occurs when the view loaded by the above contains an ajaxLink() the ajax link stops working. This can be fixed by adding an option to the ajaxLink() array "inline" = true but what if I need other JQuery views helpers to work when loaded into the page via ajax i.e. dialogContainer() I guess I could simply be asking how to control where zendx jquery helper puts java script. by default it is trying to put all statments in the <head> section in a single <script> tag. I need away around that for views displayed from an ajax call. Does Dojo try and force all php rendered javascript/ajax into the head also? Thanks.

    Read the article

  • PostSharp OnExceptionAspect not working as expected

    - by Rune Sundling
    Created a simple class to test out the OnExceptionAspect in PostSharp. [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] public class ExceptionSwallower : OnExceptionAspect { public override void OnException(MethodExecutionEventArgs eventArgs) { eventArgs.FlowBehavior = FlowBehavior.Return; base.OnException(eventArgs); } } Added the attribute to a method [ExceptionSwallower] public void SomeMethod() { throw new Exception(); } and invoked it. However, the exception is not actually swallowed, which seems odd. I haven't been able to find any similar problems, so I expect there is some minor thing I haven't gotten right. Anyone?

    Read the article

  • How to save data from multiple views of an iPhone app?

    - by DownUnder
    Hi Everyone. I'm making an app where I need to save the text in multiple views in the app when the app quits. I also need to be able to remove all of the data from just one of those views and when the app quits, it's possible not all of those views will have been created yet. After reading this post I thought perhaps it would be good to use a singleton that manages my app data which loads in the data when it is first requested and saved it when the app quits. Then in each view where I need to save data I can just set it on the singleton. I gave it a go but have run into some issues. At first I didn't synthesize the properties (as in the post I was using as a guide) but the compiler told me I needed to make getters and setters, so I did. Now when my applicationWIllTerminate: gets call the app crashes and the console says "Program received signal: “EXC_BAD_ACCESS”. kill quit". Is anyone able to tell me what I'm doing wrong, or suggest a better approach to saving the data? //SavedData.h #import <Foundation/Foundation.h> #define kFileName @"appData.plist" @interface SavedData : NSObject { NSString *information; NSString *name; NSString *email; NSString *phone; NSString *mobile; } @property(assign) NSString *information; @property(assign) NSString *name; @property(assign) NSString *email; @property(assign) NSString *phone; @property(assign) NSString *mobile; + (SavedData *)singleton; + (NSString *)dataFilePath; + (void)applicationWillTerminate:(NSNotification *)notification; @end //SavedData.m #import "SavedData.h" @implementation SavedData @synthesize information; @synthesize name; @synthesize email; @synthesize phone; @synthesize mobile; static SavedData * SavedData_Singleton = nil; + (SavedData *)singleton{ if (nil == SavedData_Singleton){ SavedData_Singleton = [[SavedData_Singleton alloc] init]; NSString *filePath = [self dataFilePath]; if([[NSFileManager defaultManager] fileExistsAtPath:filePath]){ NSMutableArray * array = [[NSMutableArray alloc] initWithContentsOfFile:filePath]; information = [array objectAtIndex:0]; name = [array objectAtIndex:1]; email = [array objectAtIndex:2]; phone = [array objectAtIndex:3]; mobile = [array objectAtIndex:4]; [array release]; } UIApplication *app = [UIApplication sharedApplication]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:UIApplicationWillTerminateNotification object:app]; } return SavedData_Singleton; } + (NSString *)dataFilePath{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *DocumentsDirectory = [paths objectAtIndex:0]; return [DocumentsDirectory stringByAppendingPathComponent:kFileName]; } + (void)applicationWillTerminate:(NSNotification *)notification{ NSLog(@"Application will terminate received"); NSMutableArray *array = [[NSMutableArray alloc] init]; [array addObject:information]; [array addObject:name]; [array addObject:email]; [array addObject:phone]; [array addObject:mobile]; [array writeToFile:[self dataFilePath] atomically:YES]; [array release]; } @end Then when I want to use it I do myLabel.text = [SavedData singleton].information; And when I change the field [SavedData singleton].information = @"my string"; Any help will be very much appreciated!

    Read the article

  • Strange error inserting new relationship data in core-data

    - by michael
    My app will allow users to create a personalised list of events from a large list of events. I have a table view which simply displays these events, tapping on one of them takes the user to the event details view, which has a button "add to my events". In this detailed view I own the original event object, retrieved via an NSFetchedResultsController and passed to the detailed view (via a table cell, the same as the core data recipes sample). I have no trouble retrieving/displaying information from this "event". I am then trying to add it to the list of MyEvents represented by a one to many (inverse) relationship: This code: NSManagedObjectContext *context = [event managedObjectContext]; MyEvents *myEvents = (MyEvents *)[NSEntityDescription insertNewObjectForEntityForName:@"MyEvents" inManagedObjectContext:context]; [myEvents addEventObject:event];//ERROR And this code (suggested below): //would this add to or overwrite the "list" i am attempting to maintain NSManagedObjectContext *context = [event managedObjectContext]; MyEvents *myEvents = (MyEvents *)[NSEntityDescription insertNewObjectForEntityForName:@"MyEvents" inManagedObjectContext:context]; NSMutableSet *myEvent = [myEvents mutableSetValueForKey:@"event"]; [myEvent addObject:event]; //ERROR Bot produce (at the line indicated by //ERROR): *** -[NSComparisonPredicate evaluateWithObject:]: message sent to deallocated instance Seems I may have missed something fundamental. I cant glean any more information through the use of debugging tools, with my knowledge of them. 1) Is this a valid way to compile and store an editable list like this? 2) Is there a better way? 3) What could possibly be the deallocated instance in error? -- I have now modified the Event entity to have a to-many relationship called "myEvents" which referrers to itself. I can add Events to this fine, and logging the object shows the correct memory addresses appearing for the relationship after a [event addMyEventObject:event];. The same failure happens right after this however. I am still at a loss to understand what is going wrong. This is the backtrace #0 0x01f753a7 in ___forwarding___ () #1 0x01f516c2 in __forwarding_prep_0___ () #2 0x01c5aa8f in -[NSFetchedResultsController(PrivateMethods) _preprocessUpdatedObjects:insertsInfo:deletesInfo:updatesInfo:sectionsWithDeletes:newSectionNames:treatAsRefreshes:] () #3 0x01c5d63b in -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] () #4 0x0002e63a in _nsnote_callback () #5 0x01f40005 in _CFXNotificationPostNotification () #6 0x0002bef0 in -[NSNotificationCenter postNotificationName:object:userInfo:] () #7 0x01bbe17d in -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] () #8 0x01c1d763 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] () #9 0x01ba25ea in -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] () #10 0x01bdfb3a in -[NSManagedObjectContext processPendingChanges] () #11 0x01bd0957 in _performRunLoopAction () #12 0x01f4d252 in __CFRunLoopDoObservers () #13 0x01f4c65f in CFRunLoopRunSpecific () #14 0x01f4bc48 in CFRunLoopRunInMode () #15 0x0273878d in GSEventRunModal () #16 0x02738852 in GSEventRun () #17 0x002ba003 in UIApplicationMain () Cheers.

    Read the article

  • IE image map remains clickable behind another div

    - by Ryan Giglio
    I have an Image Map of the United States. When you click on a state, the map fades out and a map of that state appears with an image map of the area codes in the state. In Firefox, Safari, and Chrome, the state map becomes clickable and the United States map becomes unclickable until you close the sate popover. However in Internet Explorer, the United States map remains clickable through the state popover, and I cannot click on any area codes. Here is my javascript: $(document).ready(function() { $("#usMap").html(); $("#usMap").load("/includes/us_map.inc"); }); $('area').live('click', function() { var state = $(this).attr("class"); var statePopover = $("<div id='statePopoverContainer'><a id='popoverCloseButton'>Close State</a><div id='statePopover'></div></div>"); $("#usMap").append(statePopover); $("#usMapImage").fadeTo('slow', 0.2); $("#statePopover").load("/includes/stateMaps/" + state + ".html"); }); $("#popoverCloseButton").live('click', function() { $("#statePopoverContainer").remove(); $("#usMapImage").fadeTo('slow', 1); }); I am loading the map on document ready because if you don't have Javascript, something else appears. And here is the CSS for all things related: div#usMap { width:676px; height:419px; text-align: center; position: relative; background-color:#333333; z-index: 1; } img#usMapImage { z-index: 1; } area { cursor: pointer; } div#statePopoverContainer { width:100%; height:100%; z-index:5; position:absolute; top:0; left:0; } a#popoverCloseButton { position:absolute; right:0; padding-right:5px; padding-top:5px; color:#FFFFFF; cursor:pointer; } You can see this happening at http://dev.crewinyourcode.com/ Login with beta/tester

    Read the article

  • OpenVPN: ifup tap0 drops all connections

    - by raspi
    I'm trying to create star shaped "virtual" LAN with OpenVPN which is not connected to physical network. ie. tap0 packets should not go to eth0. Packet should only go through OpenVPN to connected clients. This setup works with my OpenVPN testing machine which runs Virtual Box but not on my actual server which is running on top of Xen. Both servers are running Ubuntu Intrepid. /etc/network/interfaces: iface tap0 inet manual address 10.10.10.1 netmask 255.255.255.0 gateway 10.10.10.1 /etc/openvpn/server.conf mode server tls-server port 1194 proto udp dev tap client-to-client ca /etc/openvpn/easy-rsa/keys/ca.crt cert /etc/openvpn/easy-rsa/keys/servername.crt key /etc/openvpn/easy-rsa/keys/servername.key dh /etc/openvpn/easy-rsa/keys/dh384.pem ifconfig-pool-persist ipp.txt server-bridge 10.10.10.1 255.255.255.0 10.10.10.128 10.10.10.250 push .route 10.10.10.1 255.255.255.0 keepalive 5 60 comp-lzo persist-key persist-tun status /var/log/openvpn-status.log log-append /var/log/openvpn.log verb 3 user nobody group nogroup ifup tap0 on Virtual Box: everything ok, SSH keeps running. But on Xen SSH connection drops and I have to reboot whole machine. What I'm missing?

    Read the article

  • Setting up Pure-FTPd with admin/user permissions for same directory

    - by modulaaron
    I need to set up 2 Pure-FTPd accounts - ftpuser and ftpadmin. Both will have access to a directory that contains 2 subdirectories - upload and downlaod. The permissions criteria needs to be as follows: ftpuser can upload to /upload but cannot view the contents (blind drop). ftpuser can download from /download but cannot write to it. ftpadmin has full read/write permissions to both, including file deletion Currently, the first two are not a problem - disabling /upload read access and /download write access for ftpuser did the job. The problem is that when a file is uploaded by ftpuser, it's permissions are set to 644, meaning that user ftpadmin can only read it (note that all FTP directories are chown'd to ftpuser:ftpadmin). How can I give ftpadmin the power he so rightfully deserves?

    Read the article

  • Windows 7 system drive says it is raw, but System Recovery starts without issues

    - by iulianchira
    I have been running Windows 7 RC1 since it was available a couple of months ago and had no issues whatsoever until today. When I start my laptop, Windows does not boot but instead Windows System Recovery starts. I've used diskpart to list the partitions on the drive and my system partition (c:) has a RAW filesystem. I really need to save all data on the disk as fast as I cant and I would really like not to have to reinstall my system.

    Read the article

  • How to map a key to a file explorer shell extension?

    - by Tony_Henrich
    I have a file explorer shell extension called "Copy File Path" or "Copy Folder Path", depending on which pane I am in in file explorer, which copies the full path of a file or a folder to the clipboard. Because it's very handy for me, I use it many times during the day. To make it more productive, I would like to assign a function key to it instead of using the right mouse click context menu, looking for it in the menu (big menu because of many extensions) and selecting it. The way I want to use it is select the file with the mouse and hit the function key. Is there a utility or tool, tray taskmaybe, which can add this functionality to Windows?

    Read the article

  • Unpacking gems [Rails 2.3.5]

    - by yuval
    I have the following gems defined in my environment.rb file: config.gem "authlogic" config.gem "paperclip" config.gem "pauldix-feedzirra", :lib => "feedzirra", :source => "http://gems.github.com" config.gem 'whenever', :lib => false, :source => 'http://gemcutter.org/' I have them installed on my local computer and everything is working well. Since I am working on a shared-server (DreamHost), I need to unpack those gems to get them to work (can't install them as I did on my own computer to get them to work). Before uploading, I ran the following on my local machine: rake gems:unpack This created the following folders in /vender/gems: authlogic-2.1.3, paperclip-2.3.1.1, pauldix-feedzirra-0.0.18, whenever-0.4.1 So it looks like they're all there. When I run rake db:migrate on the server, though, I get these following error: Missing these required gems: pauldix-feedzirra For some reason, the feedzirra unpacked gem is not detected. Could anybody give me a clue as to why this is happening and how to solve it? Thanks!

    Read the article

  • Jquery image preview plugin issue...

    - by Pandiya Chendur
    I have a problem with an image preview that comes up when you hover over a thumbnail. I can change the distance between the preview and the cursor, but if a thumbnail is close to the side of the window, the preview cant fit and you only see part of it.. hope that makes sense... is there a way to make it so that if the preview doesnt fit, it will show up on the other side of the cursor?.... Here is the script... this.imagePreview = function() { /* CONFIG */ xOffset = 10; yOffset = 30; // these 2 variable determine popup's distance from the cursor // you might want to adjust to get the right result /* END CONFIG */ $("a.preview").hover(function(e) { this.t = this.title; this.title = ""; var c = (this.t != "") ? "<br/>" + this.t : ""; $("body").append("<p id='preview'> <img src='" + this.href + "' alt='Image preview' />" + c + "</p>"); $("#preview") .css("top", (e.pageY - xOffset) + "px") .css("left", (e.pageX + yOffset) + "px") .fadeIn("slow"); }, function() { this.title = this.t; $("#preview").remove(); }); $("a.preview").mousemove(function(e) { $("#preview") .css("top", (e.pageY - xOffset) + "px") .css("left", (e.pageX + yOffset) + "px"); }); }; // starting the script on page load $(document).ready(function() { imagePreview(); }); EDIT: see what i am getting, http://img202.imageshack.us/img202/4991/browserpreviewf.jpg my image at the right corner of the page so when i hover the img my preview goes even further right that is besides the page scrollbar half the preview is available.... How to get the preview to the left of the cursor..

    Read the article

  • jQuery, PHP, AJAX, "tu" variable beeing posted for no reason, shows in var_dump()

    - by Mattis
    A jQuery AJAX request .post()s data to page.php, which creates $res and var_dump()s it. $res: $res = array(); foreach ($_REQUEST as $key => $value) { if($key){ $res[$key] = $value; } } var_dump($res): array(4) { ["text1"]=> string(6) "mattis" ["text2"]=> string(4) "test" ["tu"]=> string(32) "deb6adbbff4234b5711cc4368c153bc4" ["PHPSESSID"]=> string(32) "cda24363cb9d3226bd37b2577ed0bc0b" } My javascript only sends text1 and text2: $.post("page.php",{ text1:"mattis", text2:"test" } What is the "tu" variable beeing sent? Apparantly it's very similar to the session id, but I've never seen it before. EDIT: It is sent in IE but not in FF.

    Read the article

  • Nasty deep nested loop in Rails

    - by CalebHC
    I have this nested loop that goes 4 levels deep to find all the image widgets and calculate their sizes. This seems really inefficient and nasty! I have thought of putting the organization_id in the widget model so I could just call something like organization.widgets.(named_scope), but I feel like that's a bad short cut. Is there a better way? Thanks class Organization < ActiveRecord::Base ... def get_image_widget_total total_size = 0 self.trips.each do |t| t.phases.each do |phase| phase.pages.each do |page| page.widgets.each do |widget| if widget.widget_type == Widget::IMAGE total_size += widget.image_file_size end end end end end return total_size end ... end

    Read the article

  • Help to edit the Recent Posts Wordpress widget to diplay in all 3 languages at once

    - by CreativEliza
    Site link: http://nuestrafrontera.org/wordpress/ I want the feed of recent post titles to show in the sidebar for all 3 languages, separated by language. So, for example, under Recent Posts the sidebar would have "English" and then the latest 3 posts in English, then "Español" and the latest 3 in Spanish and then French. All in a list in the column and appearing on all pages with the sidebar in all languages. I am using the most current version of Wordpress with the WPML plugin. I believe the Wordpress widget for Recent Posts needs to be tweaked to do this. Here is the code (from wp-includes/default-widgets.php): class WP_Widget_Recent_Posts extends WP_Widget { function WP_Widget_Recent_Posts() { $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your blog") ); $this->WP_Widget('recent-posts', __('Recent Posts'), $widget_ops); $this->alt_option_name = 'widget_recent_entries'; add_action( 'save_post', array(&$this, 'flush_widget_cache') ); add_action( 'deleted_post', array(&$this, 'flush_widget_cache') ); add_action( 'switch_theme', array(&$this, 'flush_widget_cache') ); } function widget($args, $instance) { $cache = wp_cache_get('widget_recent_posts', 'widget'); if ( !is_array($cache) ) $cache = array(); if ( isset($cache[$args['widget_id']]) ) { echo $cache[$args['widget_id']]; return; } ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title']); if ( !$number = (int) $instance['number'] ) $number = 10; else if ( $number < 1 ) $number = 1; else if ( $number > 15 ) $number = 15; $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1)); if ($r->have_posts()) : ?> <?php echo $before_widget; ?> <?php if ( $title ) echo $before_title . $title . $after_title; ?> <ul> <?php while ($r->have_posts()) : $r->the_post(); ?> <li><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li> <?php endwhile; ?> </ul> <?php echo $after_widget; ?> <?php wp_reset_query(); // Restore global post data stomped by the_post(). endif; $cache[$args['widget_id']] = ob_get_flush(); wp_cache_add('widget_recent_posts', $cache, 'widget'); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = (int) $new_instance['number']; $this->flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset($alloptions['widget_recent_entries']) ) delete_option('widget_recent_entries'); return $instance; } function flush_widget_cache() { wp_cache_delete('widget_recent_posts', 'widget'); } function form( $instance ) { $title = esc_attr($instance['title']); if ( !$number = (int) $instance['number'] ) $number = 5; ?> <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p> <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:'); ?></label> <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /><br /> <small><?php _e('(at most 15)'); ?></small></p> <?php } }

    Read the article

  • Throw of a die in Java

    - by Arkapravo
    The throw of a die is a popular program in Java, public class Die { /* This program simulates rolling a die */ public static void main(String[] args) { int die; // The number on the die. die = (int)(Math.random()*6 + 1); System.out.println (die); } // end main() } // end class What I wish to do is make it repeat, 500 times. I have not been able to put this program into a loop of 500. I usually program in Python, thus I guess my Java has rusted ! Any help is most welcome !

    Read the article

  • Making TeamCity integrate the Subversion build number into the assembly version.

    - by Lasse V. Karlsen
    I want to adjust the output from my TeamCity build configuration of my class library so that the produced dll files have the following version number: 3.5.0.x, where x is the subversion revision number that TeamCity has picked up. I've found that I can use the BUILD_NUMBER environment variable to get x, but unfortunately I don't understand what else I need to do. The "tutorials" I find all say "You just add this to the script", but they don't say which script, and "this" is usually referring to the AssemblyInfo task from the MSBuild Community Extensions. Do I need to build a custom MSBuild script somehow to use this? Is the "script" the same as either the solution file or the C# project file? I don't know much about the MSBuild process at all, except that I can pass a solution file directly to MSBuild, but what I need to add to "the script" is XML, and the solution file decidedly does not look like XML. So, can anyone point me to a step-by-step guide on how to make this work? This is what I ended up with: Install the MSBuild Community Tasks Edit the .csproj file of my core class library, and change the bottom so that it reads: <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /> <Target Name="BeforeBuild"> <AssemblyInfo Condition=" '$(BUILD_NUMBER)' != '' " CodeLanguage="CS" OutputFile="$(MSBuildProjectDirectory)\..\GlobalInfo.cs" AssemblyVersion="3.5.0.0" AssemblyFileVersion="$(BUILD_NUMBER)" /> </Target> <Target Name="AfterBuild"> Change all my AssemblyInfo.cs files so that they don't specify either AssemblyVersion or AssemblyFileVersion (in retrospect, I'll look into putting AssemblyVersion back) Added a link to the now global GlobalInfo.cs that is located just outside all the project Make sure this file is built once, so that I have a default file in source control This will now update GlobalInfo.cs only if the environment variable BUILD_NUMBER is set, which it is when I build through TeamCity. I opted for keeping AssemblyVersion constant, so that references still work, and only update AssemblyFileVersion, so that I can see which build a dll is from.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >