Daily Archives

Articles indexed Saturday June 5 2010

Page 18/79 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Virtualbox for Mac OS X - using an external USB drive, which filesystem is ideal?

    - by bencnscp
    Assuming that I am NOT going to add NTFS drivers that allow read+write of NTFS partitions, I was wondering if the choice of filesystem when I partition an external USB drive matters. The choices appear to be HFS+ vs. FAT32. For the time being, I simply created two half-sized paritions, one of each type. :) I plan to run various versions of Windows, and keep the VirtualBox files on the external drive.

    Read the article

  • Static Typing and Writing a Simple Matrix Library

    - by duckworthd
    Aye it's been done a million times before, but damnit I want to do it again. I'm writing a simple Matrix Library for C++ with the intention of doing it right. I've come across something that's fairly obvious in mathematics, but not so obvious to a strongly typed system -- the fact that a 1x1 matrix is just a number. To avoid this, I started walking down the hairy path of matrices as a composition of vectors, but also stumbled upon the fact that two vectors multiplied together could either be a number or a dyad, depending on the orientation of the two. My question is, what is the right way to deal with this situation in a strongly typed language like C++ or Java?

    Read the article

  • Failed to set the initialPlaybackTime for a MPMoviePlayerController when recreating it in the second

    - by vicky
    Hi, everyone. It's really wired. When at the first time a MPMoviePlayerController (e.g., theMovie) is created, its initialPlaybackTime can be set successfully. But when theMoive is released and re-create a new MPMoviePlayerController, its intialPlaybackTime can not be set correctly, actually the movie always plays from the start. The code is as follows. -(void)initAndPlayMovie:(NSURL *)movieURL { MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; // create a notification for moviePlaybackFinish [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie]; theMovie.initialPlaybackTime = 15; [theMovie setScalingMode:MPMovieScalingModeAspectFill]; [theMovie play];} -(void) moviePlayBackDidFinish:(NSNotification*)notification { MPMoviePlayerController * theMovie = [notification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie]; [theMovie release]; [self initAndPlayMovie:[self getMovieURL]]; } With the above code, when the viewcontroller did load and run initAndPlayMovie, the movie starts to play from 15 seconds, but when it plays finished or "Done" is pushed, a new theMovie is created and starts to play from 0 second. Does anybody know what happened with the initialPlaybackTime property of MPMoviePlayerController? And whenever you reload the viewController where the above code is (presentModalViewController from a parent viewcontroller), the movie can start from any playback time. I am really confused what's the difference of the MPMoviePlayerController registration methods between the viewcontroller load and the recreating it after release. Need your help! Thank you!

    Read the article

  • Zend not autoloading models

    - by Guy
    Ok, this is driving me nuts! I have a directory structure as follows: application - modules -- default --- controllers --- models ---- DbTable ---- Cachmapper.php --- views My config file looks like this [production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.modules[] = The application seems to work, if I navigate to localhost, it correctly goes to the index controller. But, for some reason it refuses to load any models. Fatal error: Class 'Model_Cachmapper' not found in .............................../application/modules/default/controllers/IndexController.php on line 26 Ideas? Thanks

    Read the article

  • hidden folders in Internet

    - by lego69
    very often in Internet I see links like this: www.abcde.com/~main/material/hello and this part ~main/material/hello is grey, if I remove hello I receive access forbidden, can somebody explain, what is this system, and is it possible receive access?

    Read the article

  • ImageChops.duplicate - python

    - by ariel
    Hi I am tring to use the function ImageChops.dulpicate from the PIL module and I get an error I don't understand: this is the code import PIL import Image import ImageChops import os PathDemo4a='C:/Documents and Settings/Ariel/My Documents/My Dropbox/lecture/demo4a' PathDemo4b='C:/Documents and Settings/Ariel/My Documents/My Dropbox/lecture/demo4b' PathDemo4c='C:/Documents and Settings/Ariel/My Documents/My Dropbox/lecture/demo4c' PathBlackBoard='C:/Documents and Settings/Ariel/My Documents/My Dropbox/lecture/BlackBoard.bmp' Slides=os.listdir(PathDemo4a) for slide in Slides: #BB=Image.open(PathBlackBoard) BB=ImageChops.duplicate(PathBlackBoard) #BB=BlackBoard and this is the error; Traceback (most recent call last): File "", line 1, in ImageChops.duplicate('c:/1.BMP') File "C:\Python26\lib\site-packages\PIL\ImageChops.py", line 57, in duplicate return image.copy() AttributeError: 'str' object has no attribute 'copy' any help would be much appriciated Ariel

    Read the article

  • Is there a good free (prefrerably PDF) bash tutorial online?

    - by morpheous
    I am finding myself doing a lot more messing around with scripts than I used to and my lack of knowledge in this area (and linux sysadmin/security in general), is becoming a hindrance. Can anyone recommend a good online resource for bash scripting/linux admin. Preferably, it will be in pdf format, so I can copy it (single file) onto my PDA.

    Read the article

  • Sql Server 2005 multiple insert with c#

    - by bottlenecked
    Hello. I have a class named Entry declared like this: class Entry{ string Id {get;set;} string Name {get;set;} } and then a method that will accept multiple such Entry objects for insertion into the database using ADO.NET: static void InsertEntries(IEnumerable<Entry> entries){ //build a SqlCommand object using(SqlCommand cmd = new SqlCommand()){ ... const string refcmdText = "INSERT INTO Entries (id, name) VALUES (@id{0},@name{0});"; int count = 0; string query = string.Empty; //build a large query foreach(var entry in entries){ query += string.Format(refcmdText, count); cmd.Parameters.AddWithValue(string.Format("@id{0}",count), entry.Id); cmd.Parameters.AddWithValue(string.Format("@name{0}",count), entry.Name); count++; } cmd.CommandText=query; //and then execute the command ... } } And my question is this: should I keep using the above way of sending multiple insert statements (build a giant string of insert statements and their parameters and send it over the network), or should I keep an open connection and send a single insert statement for each Entry like this: using(SqlCommand cmd = new SqlCommand(){ using(SqlConnection conn = new SqlConnection(){ //assign connection string and open connection ... cmd.Connection = conn; foreach(var entry in entries){ cmd.CommandText= "INSERT INTO Entries (id, name) VALUES (@id,@name);"; cmd.Parameters.AddWithValue("@id", entry.Id); cmd.Parameters.AddWithValue("@name", entry.Name); cmd.ExecuteNonQuery(); } } } What do you think? Will there be a performance difference in the Sql Server between the two? Are there any other consequences I should be aware of? Thank you for your time!

    Read the article

  • How to have internet connection over VPN while "Microsoft Firewall Client for ISA server" is running

    - by blocked
    I have the software mentioned in the title running on my machine. When I connect over VPN to my company's network, my internet connection gets borked, because somehow the ISA firewall blocks it. This is completely idiotic, because my work involves extensive use of the internet, so having to disconnect and reconnect continuously seriously cripples my productivity. (Meaning: I'm tearing my hair out here.) Can I have my VPN connection and somehow still have my internet connection too? I'm open to any solution.

    Read the article

  • Disable "These files might be harmful to your computer" warning?

    - by Jeff Atwood
    I keep getting this irritating warning when copying files over the network: These files might be harmful to your computer Your internet security settings suggest that one or more files may be harmful. Do you want to use it anyway? I am copying a file from \\192.168.0.197\c$ (home server) to my local machine which is at \\192.168.0.4. How do I turn off this meaningless "warning"?

    Read the article

  • LINQ to SQL or Entities, at this point?

    - by orlon
    I'm a bit late to the game and have decided to spend some spare time learning LINQ. As an exercise, I'm going to rewrite a WebForms app in MVC 2 (which is also new to me). I managed to find a few topics regarding LINQ here (http://stackoverflow.com/questions/16322/learning-about-linq, http://stackoverflow.com/questions/8050/beginners-guide-to-linq, http://stackoverflow.com/questions/252683/is-linq-to-sql-doa), which brought the concern of Entities vs SQL to my attention. The threads are all over a year old however, and I can't seem to find any definitive information on which ORM is preferable. Is Entities more or less LINQ to SQL 2.0 at this point? Is it still more difficult to use? Is there any reason to use LINQ to SQL, or should I just jump into Entities? The applications I write at my present employer have a lengthy lifecycle (~10 years), so I'm trying to pick the best technology available.

    Read the article

  • Passing value from :locals to link_remote_to

    - by Teef L
    In my edit.haml file, I have =render :partial => 'old_question_tags', :locals => {:current_question => @question.id}. I'd like to pass the value in :current_question to a link_to_remote call in _old_question_tags.haml: #{link_to_remote image_tag('red-x.png', {:alt => "Remove #{t.name} tag"}), :url => {:action => 'remove_old_tag_from_question', :tag_remove => t.id, :current_question => current_question}} But I get this error on the link_to_remote line: ActionView::TemplateError (undefined local variable or method `current_question' for #<ActionView::Base:0xdb2fec8>) In _old_question_tags.haml, if I just print current_question (using =current_question), it prints the number without any problems. How do I properly pass that value to the partial so that I can pass it to the link_to_remote call?

    Read the article

  • Writing good tests for Django applications

    - by Ludwik Trammer
    I've never written any tests in my life, but I'd like to start writing tests for my Django projects. I've read some articles about tests and decided to try to write some tests for an extremely simple Django app or a start. The app has two views (a list view, and a detail view) and a model with four fields: class News(models.Model): title = models.CharField(max_length=250) content = models.TextField() pub_date = models.DateTimeField(default=datetime.datetime.now) slug = models.SlugField(unique=True) I would like to show you my tests.py file and ask: Does it make sense? Am I even testing for the right things? Are there best practices I'm not following, and you could point me to? my tests.py (it contains 11 tests): # -*- coding: utf-8 -*- from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse import datetime from someproject.myapp.models import News class viewTest(TestCase): def setUp(self): self.test_title = u'Test title: bareksc' self.test_content = u'This is a content 156' self.test_slug = u'test-title-bareksc' self.test_pub_date = datetime.datetime.today() self.test_item = News.objects.create( title=self.test_title, content=self.test_content, slug=self.test_slug, pub_date=self.test_pub_date, ) client = Client() self.response_detail = client.get(self.test_item.get_absolute_url()) self.response_index = client.get(reverse('the-list-view')) def test_detail_status_code(self): """ HTTP status code for the detail view """ self.failUnlessEqual(self.response_detail.status_code, 200) def test_list_status_code(self): """ HTTP status code for the list view """ self.failUnlessEqual(self.response_index.status_code, 200) def test_list_numer_of_items(self): self.failUnlessEqual(len(self.response_index.context['object_list']), 1) def test_detail_title(self): self.failUnlessEqual(self.response_detail.context['object'].title, self.test_title) def test_list_title(self): self.failUnlessEqual(self.response_index.context['object_list'][0].title, self.test_title) def test_detail_content(self): self.failUnlessEqual(self.response_detail.context['object'].content, self.test_content) def test_list_content(self): self.failUnlessEqual(self.response_index.context['object_list'][0].content, self.test_content) def test_detail_slug(self): self.failUnlessEqual(self.response_detail.context['object'].slug, self.test_slug) def test_list_slug(self): self.failUnlessEqual(self.response_index.context['object_list'][0].slug, self.test_slug) def test_detail_template(self): self.assertContains(self.response_detail, self.test_title) self.assertContains(self.response_detail, self.test_content) def test_list_template(self): self.assertContains(self.response_index, self.test_title)

    Read the article

  • jeditable accidentally triggering on Draggable on nested items

    - by ripper234
    I'm using jquery-ui's draggable for drag-and-drop, and jeditable for inline editing. When I drag and drop an element that's also editable, right after it's dropped jeditable kicks in and pops into 'edit mode'. How can I disable this behavior? Edit - the problem happens because of netsting - see this example. I also added draggable to the mix to make the example more realistic (the actual real problem is in this site that I'm working on) Note - even though this question has an accepted answer because of the bounty rules, the problem is still not resolved for me.

    Read the article

  • CouchDB in-place updates

    - by Jason
    Hi http://wiki.apache.org/couchdb/Document_Update_Handlers CouchDB ( 0.10 and above ) supports in-place updates now. I'm having trouble understanding how it works. I tried to use the example provided but I couldn't get it to work. Can someone provide some examples and uris used to access the in-place updates. Thanks

    Read the article

  • Packaging a Bundle with a static library

    - by 4thSpace
    I have a static library that includes some xibs. These will basically be the same across projects. I'd like to include the xibs as part of the library. I can include their veiwcontrollers, reference these controllers in the calling project but then there isn't a xib to load. When I right click the xib in the library project, it can't be part of the target. I thought about creating a CFPluginBundle but that creates a new project. I'd loose all of my IBOutlet and IBAction references. What is the best way to reuse xibs that also have outlets and actions to specific controllers?

    Read the article

  • reactivating or binding a hover function in jquery??

    - by mathiregister
    hi guys, with the following three lines: $( ".thumb" ).bind( "mousedown", function() { $('.thumb').not(this).unbind('mouseenter mouseleave'); }); i'm unbinding this hover-function: $(".thumb").hover( function () { $(this).not('.text, .file, .video, .audio').stop().animate({"height": full}, "fast"); $(this).css('z-index', z); z++; }, function () { $(this).stop().animate({"height": small}, "fast"); } ); i wonder how i can re-bind the exact same hover function again on mouseup? the follwoing three lines arent't working! $( ".thumb" ).bind( "mouseup", function() { $('.thumb').bind('mouseenter mouseleave'); }); to get what i wanna do here's a small explanation. I want to kind of deactivate the hover function for ALL .thumbs-elements when i click on one. So all (but not this) should not have the hover function assigned while i'm clicking on an object. If i release the mouse again, the hover function should work again like before. Is that even possible to do? thank you for your help!

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >