Search Results

Search found 353 results on 15 pages for 'oliver cooper'.

Page 12/15 | < Previous Page | 8 9 10 11 12 13 14 15  | Next Page >

  • Is "for(;;)" faster than "while (TRUE)"? If not, why do people use it?

    - by Chris Cooper
    for (;;) { //Something to be done repeatedly } I have seen this sort of thing used a lot, but I think it is rather strange... Wouldn't it be much clearer to say while (TRUE), or something along those lines? I'm guessing that (as is the reason for many-a-programmer to resort to cryptic code) this is a tiny margin faster? Why, and is it REALLY worth it? If so, why not just define it this way: #DEFINE while(TRUE) for(;;)

    Read the article

  • .NET User Management Customization

    - by Oliver S
    I was wondering if anyone could point me to some resources concerning customization of the user management system that is built in .NET. What I am talking about is: http://msdn.microsoft.com/en-us/library/ms998347.aspx I would like to know, how can I extend the user fields to store more than just common password, username? I want to store for example: birthday, and other result sets.

    Read the article

  • Building a modular Website with Zend Framework: Am I on the right way?

    - by Oliver
    Hi, i´m a little bit confused by reading all this posts an tutorials about staring with Zend, because there a so many different ways to solve a problem. I only need a feedback about my code to know if iam on the right way: To simply get a (hard coded) Navigation for my side (depending on who is logged in) i build a Controller Plugin with a postDispatch method that holds following code: public function postDispatch(Zend_Controller_Request_Abstract $request) { $menu = new Menu(); //Render menu in menu.phtml $view = new Zend_View(); //NEW view -> add View Helper $prefix = 'My_View_Helper'; $dir = dirname(__FILE__).'/../../View/Helper/'; $view->addHelperPath($dir,$prefix); $view->setScriptPath('../application/default/views/scripts/menu'); $view->menu = $menu->getMenu(); $this->getResponse()->insert('menu', $view->render('menu.phtml')); } Is it right that i need to set the helper path once again? I did this in a Plugin Controller named ViewSetup. There i do some setup for the view like doctype, headlinks, helper paths...(This step is from the book: Zend Framework in Action) The Menu class which is initiated looks like this: class Menu { protected $_menu = array(); /** * Menu for notloggedin and logged in */ public function getMenu() { $auth = Zend_Auth::getInstance(); $view = new Zend_View(); //check if user is logged in if(!$auth->hasIdentity()) { $this->_menu = array( 'page1' => array( 'label' => 'page1', 'title' => 'page1', 'url' => $view->url(array('module' => 'pages','controller' => 'my', 'action' => 'page1')) ), 'page2' => array( 'label' => 'page2', 'title' => 'page2', 'url' => $view->url(array('module' => 'pages','controller' => 'my', 'action' => 'page2')) ), 'page3' => array( 'label' => 'page3', 'title' => 'page3', 'url' => $view->url(array('module' => 'pages','controller' => 'my', 'action' => 'page3')) ), 'page4' => array( 'label' => 'page4', 'title' => 'page4', 'url' => $view->url(array('module' => 'pages','controller' => 'my', 'action' => 'page4')) ), 'page5' => array( 'label' => 'page5', 'title' => 'page5', 'url' => $view->url(array('module' => 'pages','controller' => 'my', 'action' => 'page5')) ) ); } else { //user is vom type 'client' //.. } return $this->_menu; } } Here´s my view script: <ul id="mainmenu"> <?php echo $this->partialLoop('menuItem.phtml',$this->menu) ?> </ul> This is working so far. My question is: is it usual to do it this way, is there anything to improve? I´m new to Zend and in the web are many deprecated tutorials which often is not obvious. Even the book is already deprecated where the autoloader is mentioned. Many thanks in advance

    Read the article

  • How are two-dimensional arrays formatted in memory?

    - by Chris Cooper
    In C, I know I can dynamically allocate a two-dimensional array on the heap using the following code: int** someNumbers = malloc(arrayRows*sizeof(int*)); for (i = 0; i < arrayRows; i++) { someNumbers[i] = malloc(arrayColumns*sizeof(int)); } Clearly, this actually creates a one-dimensional array of pointers to a bunch of separate one-dimensional arrays of integers, and "The System" can figure you what I mean when I ask for: someNumbers[4][2]; But when I statically declare a 2D array, as in the following line...: int someNumbers[ARRAY_ROWS][ARRAY_COLUMNS]; ...does a similar structure get created on the stack, or is it of another form completely? (i.e. is it a 1D array of pointers? If not, what is it, and how do references to it get figured out?) Also, when I said, "The System," what is actually responsible for figuring that out? The kernel? Or does the C compiler sort it out while compiling?

    Read the article

  • Dreamweaver CS5 - Have Design Window as a Panel?

    - by Oliver Jones
    I've been looking around on the dreamweaver interface, and I'm trying to get my design window as an external panel. Reason is, I have a dual monitor system, and I would like to have the main window (where you can have both code/split/design) on my main screen, but with the code selected, and a design view on my secondary monitor. I'm assuming this can't be done, although I have noticed you can have your code as an external panel (Code Inspector). Would like to hear your input. Thanks

    Read the article

  • If free() knows the length of my array, why can't I ask for it in my own code?

    - by Chris Cooper
    I know that it's a common convention to pass the length of dynamically allocated arrays to functions that manipulate them: void initializeAndFree(int* anArray, int length); int main(){ int arrayLength = 0; scanf("%d", &arrayLength); int* myArray = (int*)malloc(sizeof(int)*arrayLength); initializeAndFree(myArray, arrayLength); } void initializeAndFree(int* anArray, int length){ int i = 0; for (i = 0; i < length; i++) { anArray[i] = 0; } free(anArray); } but if there's no way for me to get the length of the allocated memory from a pointer, how does free() "automagically" know what to deallocate? Why can't I get in on the magic, as a C programmer? Where does free() get its free (har-har) knowledge from?

    Read the article

  • ExtJS Grid slow with 3000+ records

    - by Oliver Watkins
    I am using ExtJS Grid and its getting pretty slow with 3000+ records. Sorting takes about 4 seconds. Compared to other more Javascript tables, this is pretty slow. I am thinking maybe to use pagination in my table. However after reading the documentation, I am still a bit unsure about how pagination works in extjs. Does this pull data from the server each time u turn a page? I would prefer that wasn't the case. I would prefer the 3000 records are saved in the browser and then what is rendered is just a portion of those rows. Also I am using Extjs version 4.2.1. If I upgrade to version 5. will I get some performance improvements?

    Read the article

  • HTML - Which element to output text?

    - by Oliver Weiler
    I'm implementing a little chat application where I receive messages from a server, which I would like to display to a user. As I'm more of a backend guy, and lacking experience in frontend development, I don't know which element would be suited best to output the text. Two options come to my mind: Using a plain div Using a textarea (as far as I understand, this is intended to be used for input). (Would also be nice if I could somehow fade in the text using JQuery).

    Read the article

  • iPhone - Cannont access to an IBOutlet (nil valued)

    - by Oliver
    Hello, I have a problem acessing a IBOutlet. I have a NIB inside which there is a tableview, a toolbar and an UILabel (encasulated into a view). The controller (that is the file's owner) is defined as : @interface ChoixPeriodeController : UIViewController <UITableViewDelegate> { IBOutlet UILabel* __periodeInitialeLabel; } @property(nonatomic, retain) UILabel* periodeInitialeLabel; - (void) setSelectedPeriode:(Tache_TypePeriode)typePeriode; In the .m file, this function is called by the parent window to init the Label : - (void) setSelectedPeriode:(Tache_TypePeriode)typePeriode { NSMutableString* tmpString = [NSMutableString string]; [tmpString appendFormat:bla bla bla;....]; self.periodeInitialeLabel.text = tmpString; } Into this function, I can see that self.periodeInitialeLabel is at nil. I can't see why ? Everything is connected into IB... Do you see what can be the problem ?

    Read the article

  • iPhone - UIScrollView is scrolling before UIDatePicker that is placed inside it

    - by Oliver
    Hello, I have a UIDatePicker inside a UIScrollView. But the UIDatePicker does not respond to scroll touches. It's the scrollview that is scrolling. Reading some docs on the net, I've set "Delay Content Touches" to NO, an now I see the datepicker starting a slight scroll, but it's still the scrollview that take the final word. I have some place on the screen where the user can touch to scroll the view. So how may I separate the two kind of scrolls ans make the datepicker scroll in a normal way ? Thank you for your help

    Read the article

  • JQuery Animate.

    - by Oliver
    Hi Really easy, I'm sure... I have a div which is the full screen and I want it to slide down from the top to the bottom. I have this: $('#full-screen').animate({ "bottom":0, height: 'toggle' }, 1000, function() { // Animation complete. }); But this is the wrong way round as the bottom moves up; how do I get the bottom to stay where is is and the top to slide down to meet it? Thanks

    Read the article

  • Scala path dependent return type from parameter

    - by Rich Oliver
    In the following code using 2.10.0M3 in Eclipse plugin 2.1.0 for 2.10M3. I'm using the default setting which is targeting JVM 1.5 class GeomBase[T <: DTypes] { abstract class NewObjs { def newHex(gridR: GridBase, coodI: Cood): gridR.HexRT } class GridBase { selfGrid => type HexRT = HexG with T#HexTr def uniformRect (init: NewObjs) { val hexCood = Cood(2 ,2) val hex: HexRT = init.newHex(selfGrid, hexCood)// won't compile } } } Error message: Description Resource Path Location Type type mismatch; found: GeomBase.this.GridBase#HexG with T#HexTr required: GridBase.this.HexRT (which expands to) GridBase.this.HexG with T#HexTr GeomBase.scala Why does the compiler think the method returns the type projection GridBase#HexG when it should be this specific instance of GridBase? Edit transferred to a simpler code class in responce to comments now getting a different error message. package rStrat class TestClass { abstract class NewObjs { def newHex(gridR: GridBase): gridR.HexG } class GridBase { selfGrid => def uniformRect (init: NewObjs) { val hex: HexG = init.newHex(this) //error here } class HexG { val test12 = 5 } } } . Error line 11:Description Resource Path Location Type type mismatch; found : gridR.HexG required: GridBase.this.HexG possible cause: missing arguments for method or constructor TestClass.scala /SStrat/src/rStrat line 11 Scala Problem Update I've switched to 2.10.0M4 and updated the plug-in to the M4 version on a fresh version of Eclipse and switched to JVM 1.6 (and 1.7) but the problems are unchanged.

    Read the article

  • How to write a custom control, which can auto resize just like TextBox in a grid cell?

    - by Cooper.Wu
    I have tried to override MeasureOverride, but the available size will not change when i resize a grid. which contains my control. class MyFrameworkElement : FrameworkElement { override Size MeasureOverride(Size available) { this.Width = available.Width; this.Height = available.Width this.UpdateLayout(); // do something... } } This works only when application start. How to implement a auto resize control, just like a TextBox in a grid cell. The TextBox will auto resize to fill grid cell if grid resized.

    Read the article

  • How to load view-Templates from default when not available in module? Zend Framework

    - by Oliver
    Hi my problem with Zend Framework... unfortunately not solved after 3 hours of searching: I have a modular Zend Application, which is working fine if i have my module and error templates in the called module. If i delete error/error.phtml out of views/scripts/ a Fatal Error is showing up that there is no directory. To cut a long story short: How can i define that Zend falls back to default module in this situation? Many thanks in advance.

    Read the article

  • iPhone programming guideline : List / detail / modify

    - by Oliver
    Hello, I have a program that displays a list (a TableView). When the user clicks an item, it's detail is shown. On the detail view, the user can ask to modify it so a modify window is shown. Here, the user can ask to delete the item. I would like at this time return to the list with the item deleted from the list and from the data source. There may be thousands of methods to do this, but I wonder which is the best / good one. Could you help me, and/or give me a good reference to read about this ? Thank you.

    Read the article

  • How do I write a Photoshop Extension (8BX) plugin?

    - by Oliver Ahul
    The Adobe Photoshop CS3/4 SDk has a lot of examples for Filter, Import, Export etc plugins but I havent found anything that illustrates how to write a 8BX plugin. Reason I need to write one is to add a new drop down menu to the Photoshop root toolbar (where it displays File, Edit, Image .. Window. Help drop down menus). I have seen product like OneSoftware install an 8BX plugin into Adobe Photoshop CS3\Plug-Ins\Extensions directory that causes PS to add adrop down menu for OneSoft. That suggest this is a solvable problem :-) I tried by changing an existing plugin in the SDlK samples but no go. Specifically i modified the resource file: resource 'PiPL' (ResourceID, plugInName " PiPL", purgeable) { { Kind { **Extension** }, Name { plugInName "..." }, ... Despite using the Extension Kind , PS never loads the plugin. It doesnt generate any compile time or load error either. Anyone has ideas on how to go about doing this ? Thanks

    Read the article

  • Objective-C and Cocoa : crash when calling a class function without entering the function

    - by Oliver
    Hello, I have a class function (declared and implemented) in a class MyUtils : + (NSString*) theFunction:(NSString*)param1 param2:(NSString*)param2 param3:(NSString*)param3; When I call this function, with : NSString *item = [MyUtils theFunction:@"abc" param2:aPreviousNSString param3:@"xyz"; my app crashes. In the debugger I have a breakpoint on the first action of the "theFunction" function. And this breakpoint is never reached. If I replace the call by NSString *item = @"youyou"; then everything is ok. Forcing a retain on aPreviousNSString before the call does not change anything. Do you have an idea of what is happening ? Thanks

    Read the article

  • "Easiest" way to track unique visitors to a page, in real time?

    - by Cooper
    I need to record in "real time" (perhaps no more than 5 minute delay?) how many unique visitors a given page on my website has had in a given time period. I seek an "easy" way to do this. Preferably the results would be available via a database query. Two things I've tried that failed (so far): Google Analytics: Does the tracking/reporting, but not in real time - results are delayed by hours. Mint Analytics ( http://www.haveamint.com/ ): Tracks in real time, but seems to aggregate data in a way that prevents reporting of unique visitors to a single page over an arbitrary time frame. So, does anyone know how to make Mint Analytics do what I want, or can anyone recommend an analytics package or programmed approach that will do what I need?

    Read the article

  • How does Python store lists internally?

    - by Mike Cooper
    How are lists in python stored internally? Is it an array? A linked list? Something else? Or does the interpreter guess at the right structure for each instance based on length, etc. If the question is implementation dependent, what about the classic CPython?

    Read the article

  • What can you do in C without "std" includes? Are they part of "C," or just libraries?

    - by Chris Cooper
    I apologize if this is a subjective or repeated question. It's sort of awkward to search for, so I wasn't sure what terms to include. What I'd like to know is what the basic foundation tools/functions are in C when you don't include standard libraries like stdio and stdlib. What could I do if there's no printf(), fopen(), etc? Also, are those libraries technically part of the "C" language, or are they just very useful and effectively essential libraries?

    Read the article

  • Firefox not honoring must-revalidate cache headers returned by jQuery.ajax() request

    - by Oliver Weichhold
    UPDATE 1: Judging by this thread I am not the only one having this problem in FF 12 and only in 12. UPDATE 2: The problem does not seem to be limited to Ajax requests. From the looks of it everything that makes it into Firefox 12's cache will be fetched from there. No matter what. The server can specify cache control headers all day long. Bummer! What I'm trying to achieve is the following behavior: Browser may cache the response without revalidating for up to 5 minutes I don't care if the browser revalidates on every request (Both Chrome and IE9 do for example) When the expiration is up the browser MUST revalidate (which in my case will result in fresh data) Chrome and IE9 exhibit the desired behavior when issuing a jquery.ajax() request with ifModified: true and cache: true while Firefox 12 never revalidates, which poses a serious problem. These are the actual response headers: HTTP/1.1 200 OK Server: nginx Date: Sun, 03 Jun 2012 07:13:43 GMT Content-Type: text/javascript; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Vary: Accept-Encoding Cache-Control: private, must-revalidate, max-age=300 Last-Modified: Sun, 03 Jun 2012 07:07:13 GMT Content-Encoding: gzip Any suggestions?

    Read the article

  • c# Why can't open generic types be passed as parameters?

    - by Rich Oliver
    Why can't open generic types be passed as parameters. I frequently have classes like: public class Example<T> where T: BaseClass { public int a {get; set;} public List<T> mylist {get; set;} } Lets say BaseClass is as follows; public BaseClass { public int num; } I then want a method of say: public int MyArbitarySumMethod(Example example)//This won't compile Example not closed { int sum = 0; foreach(BaseClass i in example.myList)//myList being infered as an IEnumerable sum += i.num; sum = sum * example.a; return sum; } I then have to write an interface just to pass this one class as a parameter as follows: public interface IExample { public int a {get; set;} public IEnumerable<BaseClass> myIEnum {get;} } The generic class then has to be modified to: public class Example<T>: IExample where T: BaseClass { public int a {get; set;} public List<T> mylist {get; set;} public IEnumerable<BaseClass> myIEnum {get {return myList;} } } That's a lot of ceremony for what I would have thought the compiler could infer. Even if something can't be changed I find it psychologically very helpful if I know the reasons / justifications for the absence of Syntax short cuts.

    Read the article

  • Specifying $(this).val() for two different elements (by class)

    - by Chaya Cooper
    What would be the correct syntax for specifying 2 elements by class to evaluate their values when they have different classes? This snippet adds and/or removes values from "increase_priority1" when the user has selected both a complaint and ranked the importance level of the issue, however when I added the 2nd element (".complaint select") to the If Statement it stopped working properly and only accepts input from the 2nd item (Waist) after the 1rst item (Shoulders) has been selected. I believe the problem is that it's unable to determine which ".complaint select" to use, but I haven't been able to figure out how to use (this) for the 2nd element, or another similar approach. The complete function includes apx. 20 similar pairs of If Statements to set & unset other elements, and a working example with 4 pairs is available at http://jsfiddle.net/chayacooper/vWLEn/168/ I'm trying to avoid using ID's because that becomes pretty cumbersome to do for 25 Select elements and each of their values (ID's were also problematic because it stopped working when I added a 2nd element to the If Statement for removing/unsetting a value) Javascript var $increase_priority1 = $(".increase_priority1"); // If value is "Shoulders", complaint was Shoulders too small (select name=Shoulders value=Too_small) and it was assigned a level 1 priority (select class="ranking shoulders" value=1). // var's for other issues and priority levels go here $(".ranking, .complaint select").change(function() { var name = $(this).data("name"); //get priority name if ($(".complaint select").val() === "Too_small" && $(this).val() == 1 && !$(this).data("increase_priority1")) { //rank is 1, and not yet added to priority list $("<option>", {text:name, val:name}).appendTo($increase_priority1); $(this).data("increase_priority1", true); //flag as a priority item } if ($(this).data("increase_priority1") && ($(this).val() != 1 || $(".complaint select").val() != "Too_small")) { //is in priority list, but now demoted $("option[value=" + name + "]", $increase_priority1).remove(); $(this).removeData("increase_priority1"); //no longer a priority item } // Similar If Statements to set & unset other elements go here }); HTML <div> <label>To Increase - 1rst Priority <select name="modify_increase_1rst[]" class="increase_priority1" multiple> </select></label> </div> <div> <span class="complaint"> <label>Shoulders</label> <select name=Shoulders> <option value="null">Select</option><option value="Too_small">Too Small</option><option value="Too_big">Too Big</option><option value="Too_expensive">Too expensive</option> </select> </span> <label>Ranking</label> <select name="importance_bother_shoulders" class="ranking shoulders" data-name="Shoulders"> <option value="Null">Select</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option> <option value="5">5</option> </select> </div> <div> <span class="complaint"> <label>Waist</label> <select name=Waist> <option value="null">Select</option><option value="Too_small">Too Small</option><option value="Too_big">Too Big</option><option value="Too_expensive">Too expensive</option> </select> </span> <label>Ranking</label> <select name="importance_bother_waist" class="ranking waist" data-name="Waist"> <option value="Null">Select</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option> <option value="5">5</option> </select> </div>

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15  | Next Page >