Search Results

Search found 1017 results on 41 pages for 'kevin pang'.

Page 24/41 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • How do I place another attribute to a MKAnnotation?

    - by kevin Mendoza
    for my app each annotation on a map corresponds to a mine locality. each mine has its own unique 7 digit integer identifier. I'm trying to add the property minesEntryNumber to the annotation so when the annotation is clicked on later I can bring up specific information on the selected annotation. This is part of my code: for (id mine in mines) { //NSLog(@"in the loop"); workingCoordinate.latitude = [[mine latitudeInitial] doubleValue]; workingCoordinate.longitude = [[mine longitudeInitial] doubleValue]; iProspectAnnotation *tempMine = [[iProspectAnnotation alloc] initWithCoordinate:workingCoordinate]; [tempMine setTitle:[mine mineName]]; tempMine.minesEntryNumber = [mine entryNumber]; //other code for dealing with mine types and adding the annotation to the mapview } the code works fine without the "tempMine.minesEntryNumber = [mine entryNumber];" part. It loads the map and shows the annotations. however when I try and put this in it brings up an error. So how do I add this property to each annotation and how do I access it later in a different .m file?

    Read the article

  • Advantages/Disadvantages of different implementations for Comparing Objects using .NET

    - by Kevin Crowell
    This questions involves 2 different implementations of essentially the same code. First, using delegate to create a Comparison method that can be used as a parameter when sorting a collection of objects: class Foo { public static Comparison<Foo> BarComparison = delegate(Foo foo1, Foo foo2) { return foo1.Bar.CompareTo(foo2.Bar); }; } I use the above when I want to have a way of sorting a collection of Foo objects in a different way than my CompareTo function offers. For example: List<Foo> fooList = new List<Foo>(); fooList.Sort(BarComparison); Second, using IComparer: public class BarComparer : IComparer<Foo> { public int Compare(Foo foo1, Foo foo2) { return foo1.Bar.CompareTo(foo2.Bar); } } I use the above when I want to do a binary search for a Foo object in a collection of Foo objects. For example: BarComparer comparer = new BarComparer(); List<Foo> fooList = new List<Foo>(); Foo foo = new Foo(); int index = fooList.BinarySearch(foo, comparer); My questions are: What are the advantages and disadvantages of each of these implementations? What are some more ways to take advantage of each of these implementations? Is there a way to combine these implementations in such a way that I do not need to duplicate the code? Can I achieve both a binary search and an alternative collection sort using only 1 of these implementations?

    Read the article

  • Design Pattern for error handling in ASP.NET 3.5 site

    - by Kevin
    I am relatively new to ASP.NET programming, and web programming in general. We have a site we recently ported from .NET 1.1 to 3.5. Currently we have two methods of error handling: either catching the error during data load on a page and displaying the formatted error in a label on the page, or redirecting to a generic error page. Both of these are somewhat annoying, as right now I'm trying to redesign how our errors are displayed. We are soon moving to Master pages, and I'm wondering if there is a way to "build in" an error handling control. What I mean by this is using a ASP.NET user control I've designed that simply gets passed the error string returned from the server. If an error occurs, the page would not display the content, and instead display the error control. This provides us with the ability to retain the current banner/navigation during an error (which we don't get with the generic error page), as well as keeping me from having to add the control to every aspx page we have (which I have to do with using the label-per-page system). Does something like this make sense? Ultimately I just want to have the error control added to a single page, and all other pages have access to it directly. Is this something Master pages help with? Thanks!

    Read the article

  • WPF ListView GridViewColumn Double Click

    - by Kevin
    Hi, I have a WPF ListView that opens a certain window when double clicked on a certain item inside the list view, but I have a problem. When I double click the GridViewColumn, that also opens up a certain window. Is there a way to detect if the sender is a gridviewColumn or a listView item? Thanks

    Read the article

  • Bizarre Son of Suckerfish ie6/ie7 problem - 2 letters from right-most dropdown menu also appearing o

    - by Kevin Burke
    I'm interning for an NGO in India and trying to fix their website, including updating their menu so it's not the last item on the page to load, and it's centered on the screen. Everything works well enough but when I try out my new menu in IE6, I get this weird error where the content below the menu is padded an extra 30px or so and the material in the right-most drop down appears on the far left of the screen, always visible. When I drop down the rightmost link ("Publications") the content appears both in the correct location and in the same spot on the far left of the screen, and changes color when I hover as well. It's tough to describe, so it would probably be best if you took a look: visit http://sevamandir.org/a30/aboutus.htm in your IE6/IE7 browser to see for yourself. I really appreciate your help. Also I'm using a 1000px wide monitor, if there's more hijinks going on outside that space I'd like to know about that too. I took a look at the problem again and it's even weirder than I thought. Only two letters of the bottom-most drop down menu item are shown, no matter how many items are in the left-most drop down menu. When I delete the left-most drop down menu, the bottom item from the next left-most item shows up in the same space. The padding between the menu and the content is always the same. When I hover over the real menu item, the two letters on the left hand side change color to match the hover color. Unfortunately many people that visit our website are using old browsers so IE6 support is pretty crucial, this problem is really weird though, and I would appreciate some help. I uploaded a file with the entire style.css sheet in the and HTML code below, at http://sevamandir.org/a30/aboutus.htm. Here's the relevant code: in the html head: <script> sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> text surrounding the menu - the menu is simply <ul id="nav"><li></li></ul> etc. <!--begin catchphrase--> <div style="float:left; height:27px; width:520px; margin:0px; font:16px Arial, Helvetica, sans-serif; font-weight:bold; color:#769841;"> Transforming lives through democratic &amp; participatory development </div> <?php include("menu.php"); ?> </div><!-- end header --> <!--begin main text div--> <div id="maincontent"> Relevant menu CSS: #nav, #nav ul { font:bold 11px Verdana, sans-serif; float: left; width: 980px; list-style: none; line-height: 1; background: white; font-weight: bold; padding: 0; border: solid #769841; border-width: 0; margin: 0 0 1em 0; } #nav a { display: block; width: 140px; /*this is the total width of the upper menu*/ w\idth: 120px; /*this is the width less horizontal padding */ padding: 5px 10px 5px 10px; /*horiz padding is the 2nd & 4th items here - goes Top Right Bottom Left */ color: #ffffff; background:#b6791e; text-decoration: none; } #nav a.daddy { background: url(rightarrow2.gif) center right no-repeat; } #nav li { float: left; padding: 0; width: 140px; /*this needs to be updated to match top #nav a */ background:#b6791e; } #nav li:hover, #nav li a:hover, #nav li:hover a { background:#769841; } #nav li:hover li a { background:#ffffff; color:#769841; } #nav li ul { position: absolute; left: -999em; height: auto; width: 14.4em; w\idth: 13.9em; font-weight: bold; border-width: 0.25em; /*green border around dropdown menu*/ margin: 0; } #nav li ul a { background:#ffffff; color:#769841; } #nav li li { padding-right: 1em; width: 13em; background:#ffffff; } #nav li ul a { width: 13em; w\idth: 9em; } #nav li ul ul { margin: -1.75em 0 0 14em; } #nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul { left: -999em; } #nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul { left: auto; } #nav li:hover, #nav li.sfhover, { background: #769841; color:#ffe400; } #nav li a:hover, #nav li li a:hover, #nav li:hover li:hover, #nav li.sfhover a:hover { background: #769841; color:#ffe400; }

    Read the article

  • Generate a set of strings with maximum edit distance

    - by Kevin Jacobs
    Problem 1: I'd like to generate a set of n strings of fixed length m from alphabet s such that the minimum Levenshtein distance (edit distance) between any two strings is greater than some constant c. Obviously, I can use randomization methods (e.g., a genetic algorithm), but was hoping that this may be a well-studied problem in computer science or mathematics with some informative literature and an efficient algorithm or three. Problem 2: Same as above except that adjacent characters cannot repeat; the i'th character in each string may not be equal to the i+1'th character. E.g., 'CAT', 'AGA' and 'TAG' are allowed, 'GAA', 'AAT', and 'AAA' are not. Background: The basis for this problem is bioinformatic and involves designing unique DNA tags that can be attached to biologically derived DNA fragments and then sequenced using a fancy second generation sequencer. The goal is to be able to recognize each tag, allowing for random insertion, deletion, and substitution errors. The specific DNA sequencing technology has a relatively low error rate per base (~1%), but is less precise when a single base is repeated 2 or more times (motivating the additional constraints imposed in problem 2).

    Read the article

  • Codeigniter: Checklist for new users & logistics of app

    - by Kevin Brown
    I'm developing my first web-app, and I'm working through logistics. New users (At first login) need to complete a few things before they can use the app fully. For example, they need to complete their profile before they can move on to step 2, which is taking a test. What's the best way to go about creating a "new-user" checklist? I want it to be as simple as possible, coding wise, and as easy as possible for the user.

    Read the article

  • UILabel: Using the userInteractionEnabled method on a label

    - by Kevin Bomberry
    Hello again. I am wondering if anyone has used the userInteractionEnabled method on a UILabel to allow the label to act like a button (or just to fire off a method). Any help would be greatly appreciated. Cheers! Update (4/30/09 @1:07pm) Clarification: I have a standard InfoButton and next to it I want to place a label with the text "settings" and I would like the label to function like the button (which flips over to a settings screen. So, basically I need to tie the already defined showSettinsView to the "infoLabel" label; a user clicks on the infoButton or infoLabel and the method fires off. The infoButton is already working and is using an IBAction to trigger the method. I would like to know how to wire up the label to implement the same method. That is all. Cheers!

    Read the article

  • Targeting Android with Scala 2.8 Trunk builds

    - by Kevin Wright
    The definitive reference for using Scala on android seems to be here: http://www.scala-lang.org/node/160 Unfortunately, all the references on using scala with android are based around Scala 2.7 and refer to a custom build android-library.jar, with a couple of cryptic references suggesting that this custom build isn't needed for later versions of android (I'm using 2.1 / API v7) So... What are the steps needed to use Scala 2.8 in an android project? Preferably using eclipse and the Android tools that Google supplies for that IDE.

    Read the article

  • How can I add the column data type after adding the column headers to my datatable?

    - by Kevin
    Using the code below (from a console app I've cobbled together), I add seven columns to my datatable. Once this is done, how can I set the data type for each column? For instance, column 1 of the datatable will have the header "ItemNum" and I want to set it to be an Int. I've looked at some examples on thet 'net, but most all of them show creating the column header and column data type at once, like this: loadDT.Columns.Add("ItemNum", typeof(Int)); At this point in my program, the column already has a name. I just want to do something like this (not actual code): loadDT.Column[1].ChangeType(typeof(int)); Here's my code so far (that gives the columns their name): // get column headings for datatable by reading first line of csv file. StreamReader sr = new StreamReader(@"c:\load_forecast.csv"); headers = sr.ReadLine().Split(','); foreach (string header in headers) { loadDT.Columns.Add(header); } Obviously, I'm pretty new at this, but trying very hard to learn. Can someone point me in the right direction? Thanks!

    Read the article

  • My java.util.Scanner won't work

    - by Kevin Steen Hansen
    Hello Stackoverflow my code is getting this error: Skriv din alder herunder og tryk enter: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:907) at java.util.Scanner.next(Scanner.java:1530) at java.util.Scanner.nextInt(Scanner.java:2160) at java.util.Scanner.nextInt(Scanner.java:2119) at Tasteturindtastning.main(Tasteturindtastning.java:20) [Finished in 1.7s with exit code 1] Adn my code is: // Starter java som man plejer, læs i HejVerden.java public class Tasteturindtastning { public static void main(String[] arg) { /* Jeg skal nu angive en variable, men jeg kan ikke bestemme denne variable * Da jeg ønsker at indtastningen fra dette tastetur skal være variablen. * I stedet for int og double bruger jeg så java.util.Scanner, som aflæser * brugerens indtastninger. */ java.util.Scanner tastetur = new java.util.Scanner(System.in); // Printer en opgave/spørgsmål til brugeren System.out.println("Skriv din alder herunder og tryk enter:"); int alder; // Angiver et variablenavn alder = tastetur.nextInt(); // Angiver variablen med værdien fra indtastningen /* Herunder gør jeg brug af et if statement der tjekker værdien for * variablen alder, og ser om den er lig med eller højere end 18, og hvis * dette er tilfældet, så udprinter den en sætning */ if (alder >= 18) System.out.println("Du er myndig, da du er " + alder + " år gammel"); // Printes hvis han er 18 eller ældre } } Can snyone tell me what is wrong?

    Read the article

  • Codeigniter: db data in controller

    - by Kevin Brown
    I'm confused about what to do... I'm working on a user's page where they can view certain things only if their supervisor has given them "money" or "credits". I need a simple way to get the person that is their supervisor by doing something like: $data['employer'] = $this->home_model->getEmployees(array('user_id'=>$manager_id)); Basically, get the user information about a person who's user_id matches the manager_id of the currently logged in member. I don't know how to set the variable $manager_id. Additional Information: The current user has an id, and a manager_id. I need the id of the manager. So, I need to grab the manager_id of the logged-in user and find the manager who's user_id is that of the manager_id. What's the process to do this? I can get each individually, but I don't know how to use one to get the other... I know it is confusing, but I'm confused! Thanks for the help!

    Read the article

  • WPF Window Top Won't Change.

    - by Kevin Lam
    Hi, I am using animations with my window to slide out or slide back up. But when these animations are not used. I would like to use Window.Top to set the position of the window, but I think due to animations I cannot set the top. I was wondering if anyone knows how to fix this? Thanks example. window.top is already = 33. but when is ay window.top =900; it will stay at 33.

    Read the article

  • Rails Pretty URL with Decimals

    - by Kevin Sylvestre
    I have a rails application that allows searches using longitude and latitude. I have added a 'pretty' route with: map.connect 'stores/near/:longitude/:latitude', :controller => 'stores', :action => 'index' This works for integer latitude and longitude values (http://localhost:3000/stores/near/-88/49) but fails for decimal values (http://localhost:3000/stores/near/-88.341/49.123) giving: Routing Error No route matches "/stores/near/-88/49.0" with {:method=>:get} Any ideas how to use pretty URLs in rails with decimals?

    Read the article

  • 'client_errors' warning in output from cron job that runs PHP on GoDaddy

    - by Kevin
    Hi. I have several cron jobs that I've set up on my GoDaddy hosting account through their control panel. The commands look like this: /web/cgi-bin/php5 "$HOME/html/myfolder/cron_do_stuff.php" The jobs runs as scheduled, and the scripts work perfectly, and the output from the scripts always gets sent to my email address. I would love a way to disable this (since the PHP script can send it's own emails if it's necessary). But my real question is about the output, which always contains this on the first line: /web/cgi-bin/php5: Symbol `client_errors' has different size in shared object, consider re-linking Looks like a server configuration error to me, and after talking with GoDaddy they said it's a benign warning and not to worry about it. I was just curious if anyone had ideas for fixing it.

    Read the article

  • tomcat 6 - Cluster / BackupManager

    - by Kevin
    Hi, I have a question regarding Clustering (session replication/failover) in tomcat 6 using BackupManager. Reason I chose BackupManager, is because it replicates the session to only one other server. I am going to run through the example below to try and explain my question. I have 6 nodes setup in a tomcat 6 cluster with BackupManager. The front end is one Apache server using mod_jk with sticky session enabled Each node has 1 session each. node1 has a session from client1 node2 has a session from client2 .. .. Now lets say node1 goes down ; assuming node2 is the backup, node2 now has two sessions (for client2 and client1) The next time client1 makes a request, what exactly happens ? Does Apache "know" that node1 is down and does it send the request directly to node2 ? =OR= does it try each of the 6 instances and find out the hard way who the backup is ?

    Read the article

  • Show/Hide button (text) for Accordion

    - by Kevin
    Have an accordion with a "view" button to open close the accordion panel (using jQuery Tools), but I would like to have dynamic text that says "show/hide" depending on the state... Here is the code for the accordion in asp.NET <div id="accordion"> <% foreach (var eventModel in ViewModel) { %> <% var isNewMonth = eventModel.Date.Month != previousMonth; %> <% if (isNewMonth && previousMonth > 0) { %></table></div><% } %> <% previousMonth = eventModel.Date.Month; %> <% if (isNewMonth) { %> <h2><%= string.Concat(eventModel.Date.ToString("MMMM"), " ", eventModel.Date.Year) %> <span style="float:right;"><a href="#" class="button blue small">View</a></span></h2> <div class="pane" style="display:block"> <table id="listTable" width="100%" cellpadding="3" cellspacing="0" border="0"> <tr align="left" valign="top"><th align="left" valign="top">Date</th><th align="left" valign="top">Event</th><th align="left" valign="top">Event Type</th></tr> <% } %> <tr align="left" valign="top"><td align="left" valign="top"><b><span id="date" style="float:left;"> <%= string.Concat(eventModel.Date.ToString("MMMM"), " ", eventModel.Date.Day, " </span><span id='day' style='float:left'>" + eventModel.Date.DayOfWeek + "</span> ")%></b></td><td align="left" valign="top" ><%= Html.ActionLink(eventModel.Name.Truncate(40), "event", "register", new { id = eventModel.Id }, null)%></td><td align="left" valign="top"><%= string.Concat(" ", eventModel.Sport)%></td></tr> <% } %> <% if (ViewModel.Count > 0) { %></table></div><% } %> </div> Here is the initialization script using jQuery: $(function() { $("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: 0}); $(".small").click(function() { moveToTop(); }); });

    Read the article

  • Incorporating Devise Authentication into an already existing user structure?

    - by Kevin
    I have a fully functional authentication system with a user table that has over fifty columns. It's simple but it does hash encryption with salt, uses email instead of usernames, and has two separate kinds of users with an admin as well. I'm looking to incorporate Devise authentication into my application to beef up the extra parts like email validation, forgetting passwords, remember me tokens, etc... I just wanted to see if anyone has any advice or problems they've encountered when incorporating Devise into an already existing user structure. The essential fields in my user model are: t.string :first_name, :null => false t.string :last_name, :null => false t.string :email, :null => false t.string :hashed_password t.string :salt t.boolean :is_userA, :default => false t.boolean :is_userB, :default => false t.boolean :is_admin, :default => false t.boolean :active, :default => true t.timestamps For reference sake, here's the Devise fields from the migration: t.database_authenticatable :null => false t.confirmable t.recoverable t.rememberable t.trackable That eventually turn into these actual fields in the schema: t.string "email", :default => "", :null => false t.string "encrypted_password", :limit => 128, :default => "", :null => false t.string "password_salt", :default => "", :null => false t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" t.string "reset_password_token" t.string "remember_token" t.datetime "remember_created_at" t.integer "sign_in_count", :default => 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.datetime "created_at" t.datetime "updated_at" What do you guys recommend? Do I just remove email, hashed_password, and salt from my migration and put in the 5 Devise migration fields and everything will be OK or do I need to do something else?

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >