Search Results

Search found 2409 results on 97 pages for 'alex polo'.

Page 83/97 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • Object initialization sequence in Objective-C

    - by Alex
    Hello everyone. The Cocoa framework has a convention to always call self = [super init] in the init method of an inherited class, because [super init] may return a new instance. What will happen if I do this? @interface MyClass : NSObject /* or any other class */ { int ivar_; } @end @implementation MyClass - (id)init { ivar_ = 12345; if ((self = [super init])) { NSLog(@"ivar_'s value is %d", ivar_); } return self; } @end In the case when [super init] returns a new instance, what will I see in the console? ivar_'s value is 0? I can't think of a way to check this myself, because I don't know which class may return a new instance from its init method. Also, can't seem to find explicit clarification for this scenario in the docs. Could anyone help me out? Thanks!

    Read the article

  • Getting all parent rows in one SQL query

    - by Alex
    I have a simple MySQL table thats contains a list of categories, level is determined by parent_id: id name parent_id --------------------------- 1 Home 0 2 About 1 3 Contact 1 4 Legal 2 5 Privacy 4 6 Products 1 7 Support 1 I'm attempting to make a breadcrumb trail. So i have the 'id' of the child, I want to get all available parents (iterating up the chain until we reach 0 "Home"). There could be any number or child rows going to an unlimited depth. Currently I am using an SQL call for each parent, this is messy. Is there a way in SQL to do this all on one query?

    Read the article

  • Which DB Server should I use?

    - by Alex
    I have to develop a new (desktop) app for a small business. This business currently has an Access database with millions of records. The file size is about 1.5 GB. The boss told me that searching on this DB is very slow. The DB consists of a single table with about 20 fields. I also think the overall DB design isn't great. I thought to use another DB server with a new design to improve both performance and efficiency. Considering this is a relatively small business, I don't want to spend much for a DB license, so I want to ask you what would you do. Continue to use Access, maybe improving and optimizing the DB in some way Buy a DB server license (in this case, which one?) ? (any idea?)

    Read the article

  • multiple threads writting to a same socket problem

    - by alex
    Hi: My program uses sockets for inter-process communication. There is one server listening on a socket port(B) on localhost waiting for a list of TCP clients to connect. And on the other end of the server is another a socket(A) that sends out data to internet. The server is designed to take everything the TCP clients send him and forward to a server on the internet. My question is if two of the TCP clients happened to send data at the same time, is this going to be a problem for the server's outgoing socket(A)? Thanks

    Read the article

  • Is RIA Services right for our Silverlight app at this point?

    - by Alex
    Hi, I'm looking at Silverlight architectures and RIA Services looks interesting, but I am a bit concerned about its prelease status and how the feature set will change. We need our client app to be as responsive as possible over a slow network link, so a high priority is a solid sync system for pushing model state changes from the client back to the server. Will RIA Services help us in this regard or will I have to roll my own logic to do this ? Are there any other frameworks that can assist with this? Is the feature set involved in these requirements liable to change much in the next couple of months? If it makes any difference, our frontend is 100% Silverlight, so we dont need to worry about exposing SOAP APIs from the server or anything like that. It appears to me that RIA so far is a bit more mature for Silverlight use. Is this correct?

    Read the article

  • How to enable core dump in my Linux C++ program

    - by Alex Farber
    My program is written in C++. compiled with gcc, using -g3 -O0 -ggdb flags. When it crashes, I want to open its core dump. Does it create core dump file, or I need to do something to enable core dump creation, in the program itself, or on computer where it is executed? Where this file is created, and what is its name?

    Read the article

  • Easy way to apply a function to an array

    - by alex
    I am aware of array_walk() and array_map(). However when using the former like so (on an old project) it failed array_walk($_POST, 'mysql_real_escape_string'); Warning: mysql_real_escape_string() expects parameter 2 to be resource, string given. So I went with this slightly more ugly version foreach($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string($value); } So why didn't the first way work? What is the best way to map values of an array to a function?

    Read the article

  • Having trouble using jQuery's .animate() to animate a div from left to right, right to left?

    - by Alex
    Hello, I seem to be having difficulties using jQuery .animate() to animate an absolutely positioned div from right to left on a button click, and left to right on another button click. I was wondering if you would be willing to help me understand what I'm doing wrong? Thanks. Below is my relevant CSS, HTML, and jQuery code. I can click the #moveLeft button and it wil indeed animate it to the left, but when I click the #moveRight button, nothing happens. Where am I going wrong? Thanks!! CSS #scorecardTwo { position:absolute; padding:5px; width: 300px; background-color:#E1E1E1; right:0px; top:0px; display:none; } HTML text text Left Right jQuery $("#scorecardTwo").fadeIn("slow"); $("#moveLeft").bind("click", function() { var config = { "left" : function() { return $(this).offset().left; }, "right" : function() { return $("body").innerWidth() - $K("#scorecardTwo").width(); } }; $("#scorecardTwo").css(config).animate({"left": "0px"}, "slow"); $(this).attr("disabled", "disabled"); $("#moveRight").attr("disabled", ""); }); $("#moveRight").bind("click", function() { var config = { "left" : function() { return $(this).offset().left; }, "right" : function() { return $("body").innerWidth() - $K("#scorecardTwo").width(); } }; $("#scorecardTwo").css(config).animate({"right" : "0px"}, "slow"); $(this).attr("disabled", "disabled"); $("#moveLeft").attr("disabled", ""); });

    Read the article

  • Problem with underscore(_) in Collections.binarySearch (Java)

    - by Alex Cheng
    Hi all. Problem: I am using Java Tutorials™ sourcecode for this. This is the source code. I tried this: --following with another section of sorted words-- words.add("count"); words.add("cvs"); words.add("dce"); words.add("depth"); --following with another section of sorted words-- and it works perfectly. However when I use this: --just a section of sorted words-- words.add("count"); words.add("cvs"); words.add("dce_iface"); words.add("dce_opnum"); words.add("dce_stub_data"); words.add("depth"); --following with another section of sorted words-- It does show dce_iface when I type dce, but when I type _ then following with o or s it shows me something else like dce_offset where the offset comes from words.add("fragoffset"); somewhere in the list. What can I do to solve this problem? Thank you in advance.

    Read the article

  • How to make an element slide with the viewport as it scrolls?

    - by alex
    I've Googled for this but must be using the wrong keywords. Basically I want to use the effect that Magento and now Stack Overflow uses. That is, there is an element in a column, and when you scroll down, it sticks to the top of the viewport. And once scrolled up again, it goes back into the normal page flow. This Ask A Question is a good page for example. Scroll down and watch the "How to Format" element come down (might need to make your viewport smaller if you have a large screen to see the effect). I've noticed it is setting position: fixed in the CSS. The JavaScript however is obfuscated. What's the easiest way to achieve this effect? Is there a jQuery plugin available?

    Read the article

  • What is a good way for a custom accessory view in a UITableViewCell to message the table view contro

    - by Alex Gosselin
    Hi Everyone, I am working on adding a custom accessory view, (a button) to a UITableViewCell, and I need it to tell the table view when it is touched, but I can't figure out how to communicate to the table view what button was pressed. Ideally I'd like to somehow call a function like this: [controller tableView:view didSelectCustomButtonAtIndexPath:indexPath usingCell:self]; when my custom view button is pressed. Sorry if this is a bit vague, I'm not really sure how to explain this well. I am basically looking for how to mimic the implementation for tableView:didSelectRowAtIndexPath: without having to subclass UITableViewCell. Thanks for any help.

    Read the article

  • More than one unique key for HashMap problem (Java)

    - by Alex Cheng
    This question is a continuation of this thread: In short: To solve my problem, I want to use Map<Set<String>, String>. However, after I sort my data entries in Excel, remove the unnecessary parameters, and the following came out: flow content ==> content content flow content ==> content depth distance flow content ==> content depth within flow content ==> content depth within distance flow content ==> content within flow content ==> content within distance I have more than one unique key for the hashmap if that is the case. How do I go around this... anyone have any idea? I was thinking of maybe Map<Set <String>, List <String>> so that I can do something like: Set <flow content>, List <'content content','content depth distance','content depth within ', ..., 'content within distance'> But because I am parsing the entries line by line I can't figure out the way how to store values of the same repeated keys (flow content) into the same list and add it to the map. Anyone have a rough logic on how can this be done in Java? Thanks in advance.

    Read the article

  • Rails nil can't be coerced into Float

    - by alex
    After adding items, attempting to view my cart leads me to this error: nil can't be coerced into Float with the math line in this method in my line_item model highlighted: def total_price product.price * quantity end line items create action def create product = Product.find(params[:product_id]) @line_item = @cart.add_product(product.id) @line_item.quantity = params[:quantity] view <div id= "text_field"><%= text_field_tag 'quantity' %> </div> <%= button_to 'Add to Cart', line_items_path(:product_id => product) %> This has held me back for a couple days. (I'm new). Thanks.

    Read the article

  • Improving the efficiency of multiple concurrent Core Animation animations

    - by Alex
    I have a view in my app that is very similar to the month view in the built-in Calendar app. There's a subview that holds the individual cells (a custom UIView subclass that draws text into its layer), and when the user navigates to the next "month", I create the new cells and slide the view to show them. When the animation stops, I remove the old, hidden cells and set things up so it's ready to go for the next animation. This all works nicely. However, I'd like to animate the cells' text color, as in the Calendar app, so that the outgoing ones transition to a lighter color and the incoming ones transition to a darker color. The problems is that I can have as many as 70 cells, so doing individual animations is very slow -- between 5-10 fps on my iPhone 3GS. I'm trying to find a less computationally intense way of doing this. My reading of the Shark results is that the majority of the time is spent redrawing the text for each frame for each frame. This makes sense, since text rendering is hardly the cheapest operation. I've considered creating a second view -- one holding the "outgoing" state and one holding the "incoming" state and using a single opacity animation to gradually reveal the updated cells while both are sliding. I'm concerned that instead of having 70 cells, I'll have 140, which seems like a lot of views. So, is that too many views or would there be a better way of doing this?

    Read the article

  • How to make compareTo sort a list alphabetically?

    - by Alex
    Hi How do I change my code so that it lists the elements in alphabetical order from a to z. Right now it's ordering from z to a. I can't figure it out and am stuck :-/ String sName1 = ((Address)o).getSurname().toLowerCase(); String sName2 = (this.surname).toLowerCase(); int result = (sName1).compareTo(sName2); return result; Thanks :)

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >