Search Results

Search found 2672 results on 107 pages for 'michael cereda'.

Page 63/107 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • How to change the value of None in Python?

    - by michael
    I'm currently reading chapter 5.8 of Dive Into Python and Mark Pilgrim says: There are no constants in Python. Everything can be changed if you try hard enough. This fits with one of the core principles of Python: bad behavior should be discouraged but not banned. If you really want to change the value of None, you can do it, but don't come running to me when your code is impossible to debug. I tried this in the interpreter None = "bad" I get a SyntaxError: assignment to None Just out of curiosity how do you change None?

    Read the article

  • Wondering about a way to conserve memory in C# using List<> with structs

    - by Michael Ryan
    I'm not even sure how I should phrase this question. I'm passing some CustomStruct objects as parameters to a class method, and storing them in a List. What I'm wondering is if it's possible and more efficient to add multiple references to a particular instance of a CustomStruct if a equivalent instance it found. This is a dummy/example struct: public struct CustomStruct { readonly int _x; readonly int _y; readonly int _w; readonly int _h; readonly Enum _e; } Using the below method, you can pass one, two, or three CustomStruct objects as parameters. In the final method (that takes three parameters), it may be the case that the 3rd and possibly the 2nd will have the same value as the first. List<CustomStruct> _list; public void AddBackground(CustomStruct normal) { AddBackground(normal, normal, normal); } public void AddBackground(CustomStruct normal, CustomStruct hover) { AddBackground(normal, hover, hover); } public void AddBackground(CustomStruct normal, CustomStruct hover, CustomStruct active) { _list = new List<CustomStruct>(3); _list.Add(normal); _list.Add(hover); _list.Add(active); } As the method stands now, I believe it will create new instances of CustomStruct objects, and then adds a reference of each to the List. It is my understanding that if I instead check for equality between normal and hover and (if equal) insert normal again in place of hover, when the method completes, hover will lose all references and eventually be garbage collected, whereas normal will have two references in the List. The same could be done for active. That would be better, right? The CustomStruct is a ValueType, and therefore one instance would remain on the Stack, and the three List references would just point to it. The overall List size is determined not by the object Type is contains, but by its Capacity. By eliminating the "duplicate" CustomStuct objects, you allow them to be cleaned up. When the CustomStruct objects are passed to these methods, new instances are created each time. When the structs are added to the List, is another copy made? For example, if i pass just one CustomStruct, AddBackground(normal) creates a copy of the original variable, and then passes it three times to Addbackground(normal, hover, active). In this method, three copies are made of the original copy. When the three local variables are added to the List using Add(), are additional copies created inside Add(), and does that defeat the purpose of any equality checks as previously mentioned? Am I missing anything here?

    Read the article

  • How can I set the TextColor of a TextAppearanceSpan?

    - by michael
    Hi, I currently able to create a Medium size TextAppearanceSpan, But how can I set the text color to a specified RBG color (say #c71585)? new TextAppearanceSpan(context, android.R.style.TextAppearance_Medium); I see there is a constructor for public TextAppearanceSpan(Context context, int appearance, int colorList) { But what is the int for colorList? Is there any example for this? Thank you.

    Read the article

  • Payment Processors - What do I need to know if I want to accept credit cards on my website?

    - by Michael Pryor
    This question talks about different payment processors and what they cost, but I'm looking for the answer to what do I need to do if I want to accept credit card payments? Assume I need to store credit card numbers for customers, so that the obvious solution of relying on the credit card processor to do the heavy lifting is not available. PCI Data Security, which is apparently the standard for storing credit card info, has a bunch of general requirements, but how does one implement them? And what about the vendors, like Visa, who have their own best practices? Do I need to have keyfob access to the machine? What about physically protecting it from hackers in the building? Or even what if someone got their hands on the backup files with the sql server data files on it? What about backups? Are there other physical copies of that data around? Tip: If you get a merchant account, you should negotiate that they charge you "interchange-plus" instead of tiered pricing. With tiered pricing, they will charge you different rates based on what type of Visa/MC is used -- ie. they charge you more for cards with big rewards attached to them. Interchange plus billing means you only pay the processor what Visa/MC charges them, plus a flat fee. (Amex and Discover charge their own rates directly to merchants, so this doesn't apply to those cards. You'll find Amex rates to be in the 3% range and Discover could be as low as 1%. Visa/MC is in the 2% range). This service is supposed to do the negotiation for you (I haven't used it, this is not an ad, and I'm not affiliated with the website, but this service is greatly needed.) This blog post gives a complete rundown of handling credit cards (specifically for the UK).

    Read the article

  • applicationShouldTerminateAfterLastWindowClosed: does not seem to work when the red x is used to clo

    - by Michael Minerva
    I have a small OSX Cocoa app that just bring up an IKPicutreTaker and saves the picture to a file if one is set. I use applicationShouldTerminateAfterLastWindowClosed: to close the application when the pictureTaker is closed. This all works fine when I either set(this is done when you have picked the picture you want) or when you hit cancel, but when I click on the red arrow in the top left of the windows, the application does not quit when the window is closed this way. Is this intended functionality or am I doing something wrong (not setting some flag?). Also, is there some way to disable this button?

    Read the article

  • How to branch with TortoiseHG

    - by Michael Tiller
    I downloaded TortoiseHg 1.0 for evaluation. For the life of me I can't figure out how to make a branch. It seems to understand branches (e.g. in its repository browser) but I just can't seem to find a way to make a branch. This seems like such a fundamental capability since out of the often touted benefits of DVC is the lightweight branching. I Googled around and couldn't find much discussion of this topic (at least for recent versions) so I have to assume I'm missing something, right?

    Read the article

  • Cakephp how to use Set Class to make an assoc array?

    - by michael
    I have the output array from a $Model-find() query which also pulls data from a hasMany relationship: Array( [Parent] => Array ( [id] => 1 ) [Child] => Array ( [0] => Array ( [id] => aaa [score] => 3 [src] => stage6/tn~4bbb38cc-0018-49bf-96a9-11a0f67883f5.jpg [parent_id] => 1 ) [1] => Array ( [id] => bbb [score] => 5 [src] => stage0/tn~4bbb38cc-00ac-4b25-b074-11a0f67883f5.jpg [parent_id] => 1 ) [2] => Array ( [id] => ccc [score] => 2 [src] => stage4/tn~4bbb38cc-01c8-44bd-b71d-11a0f67883f5.jpg [parent_id] => 1 ) ) ) I'd like to transform this output into something like this, where the child id is the key to additional child attributes: Array( [aaa] => Array ( [score] => 3 [src] => stage6/tn~4bbb38cc-0018-49bf-96a9-11a0f67883f5.jpg ) [bbb] => Array ( [score] => 5 [src] => stage0/tn~4bbb38cc-00ac-4b25-b074-11a0f67883f5.jpg ) [ccc] => Array ( [score] => 2 [src] => stage4/tn~4bbb38cc-01c8-44bd-b71d-11a0f67883f5.jpg ) } Is there an easy way to use Set::extract, Set::combine, Set::insert, etc. to do this efficiently? I cannot figure it out.

    Read the article

  • javascript binding

    - by Michael
    MyObj = { ajax: null, init: function() { this.ajax = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(); this.ajax.onload = function() { return function() {this.onload.apply(this, [null]);} }; }, onload: function () { Reader.log("I really hope I can use `this.ajax` here"); } } isn't it correct way to bind onload to MyObj? For some reason onload never called. However if I avoid binding and just put this.ajax.onload = this.onload then onload invoked. How to get binding work?

    Read the article

  • Regexing it up with IIS re-write module

    - by Michael Jasper
    I am developing a profile-based web application where each user is assigned there own url through their username & iis rewrite mod's magic. A typical user's profile url would be http://www.mymark.com/mike Each user is also created a blog in a multi-user wordpress installation. The wordpress url would look like this: http://www.mymark.com/blog/mike I am trying to use the rewrite module to create more canonical urls for the user (http://www.mymark.com/mike/blog), and have tried several regex variations that I have created through RegExr(a regex generation tool) and come up with this as the pattern to match (www.|)mymark.com/([^/]+)/blog but haven't had any success so far. What am I doing wrong here? Here is a screen shot of my re-write rule:

    Read the article

  • jQuery Cycle plugin: One pager to control multiple slideshow on a page

    - by Michael
    Hi there, I have a cycle plugin set up on a page (images) with a pager to control the horizontal slide. My issue is that there is a transparent overlay that needs to sit over part of the images for some text relating to each image but would rather have that with a different transition effect for this so it doesn't slide in from the left. Am I able to set up to slideshows, each with 3 pieces of related content, that I can position correctly and have them controlled with the one pager? My script currently looks like this: $(function() { $('.s4').before('<div id="nav" class="nav">').cycle({ fx: 'fade', speed: 'slow', speedIn: 'slow', // speed of the 'in' transition speedOut: 'slow', timeout: 6000, pager: '#nav' }); }); I hope this makes sense, Thanks

    Read the article

  • Use Java Annotation not to run a method

    - by Michael Mao
    Hi all: I've got a method in my class only for testing purpose : private void printOut(String msg, Object value) { System.out.println(msg + value); } It is a wrapper method for System.out.println(); So I hope, with the use of Annotation, I can choose not to run this method during productive environment while still keep those diagnostic output ready if I am to switch back to debugging environment. Which Annotation shall I put on top of the method name?

    Read the article

  • How to add monsters to a Pokemon game?

    - by Michael J. Hardy
    My friends and I are starting a game like Pokemon and we wanted to know how will we add monsters to the game? We're using VisualBasic because my friend's brother said it would be easier. So far we can put pictures of the monsters on the screen and you can click to attack and stuff. Right now when we want to add a monster we have to make a new window. This will take us a long time to make all the windows for each type of monster. Is there a tool or something to make this go faster? How do game companies do this?

    Read the article

  • Expression Blend 2/WPF Book

    - by Michael Damatov
    I'm looking for an Expression Blend 2 book that includes best-practices (Expression Blend 2/Visual Studio 2008) designer perspective (Expression Blend 2) programmer perspective (interoperability with Visual Studio 2008) How-To-chapters for Windows Forms developers (how to solve the same problem with WPF) Could you make a recommendation?

    Read the article

  • Reset UITextField's original placeholder text

    - by Michael
    I'm adding some user feedback mechanism into my app. The user types some comments into a text field and when that editing is done it updates a UITextView. Then when the user hits the submit button and moves on in the app the user may have need to send more feedback from the same form for a different item. I can reset the other fields and labels in the app to their default values when I hide the view, but not the textField (?). How can I reestablish the placeholder text next time the user accesses this view? Your suggestions are humbly appreciated.

    Read the article

  • NSTimer to smooth out playback position

    - by Michael
    I have an audio player and I want to show the current time of the the playback. I'm using a custom play class. The app downloads the mp3 to a file then plays from the file when 5% has been downloaded. I have a progress view update as the file plays and update a label on each call to the progress view. However, this is jerky... sometimes even going backward a digit or two. I was considering using an NSTimer to smooth things out. I would be fired every second to a method and pass the percentage played figure to the method then update the label. First, does this seem reasonable? Second, how do I pass the percentage (a float) over to the target of the timer. Right now I am putting the percent played into a dictionary but this seems less than optimal. This is what is called update the progress bar: -(void)updateAudioProgress:(Percentage)percent { audio = percent; if (!seekChanging) slider.value = percent; NSMutableDictionary *myDictionary = [[NSMutableDictionary alloc] init]; [myDictionary setValue:[NSNumber numberWithFloat:percent] forKey:@"myPercent"]; [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(myTimerMethod:) userInfo:myDictionary repeats:YES]; [myDictionary release]; } This is called first after 5 seconds but then updates each time the method is called. As always, comments and pointers appreciated.

    Read the article

  • javascript string exec strange behavior

    - by Michael
    have funciton in my object which is called regularly. parse : function(html) { var regexp = /...some pattern.../ var match = regexp.exec(html); while (match != null) { ... match = regexp.exec(html); } ... var r = /...pattern.../g; var m = r.exec(html); } with unchanged html the m returns null each other call. let's say parse(html);// ok parse(html);// m is null!!! parse(html);// ok parse(html);// m is null!!! // ...and so on... is there any index or somrthing that has to be reset on html ... I'm really confused. Why match always returns proper result?

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >