Search Results

Search found 303 results on 13 pages for 'charlie wu'.

Page 9/13 | < Previous Page | 5 6 7 8 9 10 11 12 13  | Next Page >

  • Fluent / NHibernate Collections of the same class

    - by Charlie Brown
    I am new to NHibernate and I am having trouble mapping the following relationships within this class. public class Category : IAuditable { public virtual int Id { get; set; } public virtual string Name{ get; set; } public virtual Category ParentCategory { get; set; } public virtual IList<Category> SubCategories { get; set; } public Category() { this.Name = string.Empty; this.SubCategories = new List<Category>(); } } Class Maps (although, these are practically guesses) public class CategoryMap : ClassMap<Category> { public CategoryMap() { Id(x => x.Id); Map(x => x.Name); References(x => x.ParentCategory) .Nullable() .Not.LazyLoad(); HasMany(x => x.SubCategories) .Cascade.All(); } } Each Category may have a parent category, some Categories have many subCategories, etc, etc I can get the Category to Save correctly (correct subcategories and parent category fk exist in the database) but when loading, it returns itself as the parent category. I am using Fluent for the class mapping, but if someone could point me in the right direction for just plain NHibernate that would work as well.

    Read the article

  • data parsed to database Nokogiri rails

    - by Charlie Allombert
    So I'm just getting started with Nokogiri and Rails I have the following which returns the name of someone. TEST.rb: require 'nokogiri' require 'open-uri' url = "http://www.imdb.com/title/tt1439629/" doc = Nokogiri::HTML(open(url)) puts doc.css("div#wrapper [...too long...]")[0].text Now I created a table in my DB on rails and want to send the returned name to the actor table in the name column! How would I do that ? I can't seem to find atutorial on this... My goal would eventually be to have a rails form where I'd input an IMDB link which would return title and so on... (Also I'm new to ruby rails and programming so please provide easy info!)

    Read the article

  • Why does this Haskell code produce the "infinite type" error?

    - by Charlie Flowers
    I am new to Haskell and facing a "cannot construct infinite type" error that I cannot make sense of. In fact, beyond that, I have not been able to find a good explanation of what this error even means, so if you could go beyond my basic question and explain the "infinite type" error, I'd really appreciate it. Here's the code: intersperse :: a -> [[a]] -> [a] -- intersperse '*' ["foo","bar","baz","quux"] -- should produce the following: -- "foo*bar*baz*quux" -- intersperse -99 [ [1,2,3],[4,5,6],[7,8,9]] -- should produce the following: -- [1,2,3,-99,4,5,6,-99,7,8,9] intersperse _ [] = [] intersperse _ [x] = x intersperse s (x:y:xs) = x:s:y:intersperse s xs And here's the error trying to load it into the interpreter: Prelude :load ./chapter.3.ending.real.world.haskell.exercises.hs [1 of 1] Compiling Main ( chapter.3.ending.real.world.haskell.exercises.hs, interpreted ) chapter.3.ending.real.world.haskell.exercises.hs:147:0: Occurs check: cannot construct the infinite type: a = [a] When generalising the type(s) for `intersperse' Failed, modules loaded: none. Thanks. EDIT: Thanks to the responses, I have corrected the code and I also have a general guideline for dealing with the "infinite type" error in Haskell: Corrected code intersperse _ [] = [] intersperse _ [x] = x intersperse s (x:xs) = x ++ s:intersperse s xs What the problem was: My type signature states that the second parameter to intersperse is a list of lists. Therefore, when I pattern matched against "s (x:y:xs)", x and y became lists. And yet I was treating x and y as elements, not lists. Guideline for dealing with the "infinite type" error: Most of the time, when you get this error, you have forgotten the types of the various variables you're dealing with, and you have attempted to use a variable as if it were some other type than what it is. Look carefully at what type everything is versus how you're using it, and this will usually uncover the problem.

    Read the article

  • how to load data and store the data from a file using numpy

    - by Charlie Epps
    I have the following file like this: 2 qid:1 1:0.32 2:0.50 3:0.78 4:0.02 10:0.90 5 qid:2 2:0.22 5:0.34 6:0.87 10:0.56 12:0.32 19:0.24 20:0.55 ... he structure is follwoing like that: output={} rel=2 qid=1 features={} # the feature list "1:0.32 2:0.50 3:0.78 4:0.02 10:0.90" output.append([rel,qid,features]) ... How can I write my python code to load the data, thanks

    Read the article

  • Lazy loading? Better avoiding it?

    - by Charlie Pigarelli
    I just read about this design pattern: Lazy Load. And, since in the application i'm working on i have all the classes in one folder, i was wondering if this pattern could just make me avoiding the include() function for every class. I mean: It's nice to know that if i forgot to include a class, PHP, before falling into an error, trough an __autoload() function try to get it. But is it fine enough to just don't care about including classes and let PHP do it by your own every time? Or we should write __autoload() just in case it is needed?

    Read the article

  • Is my way of doing threads in Android correct?

    - by Charlie
    Hi, I'm writing a live wallpaper, and I'm forking off two separate threads in my main wallpaper service. One updates, and the other draws. I was under the impression that once you call thread.start(), it took care of everything for you, but after some trial and error, it seems that if I want my update and draw threads to keep running, I have to manually keep calling their run() methods? In other words, instead of calling start() on both threads and forgetting, I have to manually set up a delayed handler event that calls thread.run() on both the update and draw threads every 16 milliseconds. Is this the correct way of having a long running thread? Also, to kill threads, I'm just setting them to be daemons, then nulling them out. Is this method ok? Most examples I see use some sort of join() / interrupt() in a while loop...I don't understand that one...

    Read the article

  • Static methods requiring var

    - by Charlie Pigarelli
    Ok, i'm stuck on this, why don't i get what i need? class config { private $config; # Load configurations public function __construct() { loadConfig('site'); // load a file with $cf in it loadConfig('database'); // load another file with $cf in it $this->config = $cf; // $cf is an array unset($cf); } # Get a configuration public static function get($tag, $name) { return $this->config[$tag][$name]; } } I'm getting this: Fatal error: Using $this when not in object context in [this file] on line 22 [return $this->config[$tag][$name];] And i need to call the method in this way: config::get()...

    Read the article

  • Is there a way to create my own "push pins" for a image without using Google Maps API?

    - by Charlie
    I am interested in working with friends via the internet on a fantasy world map. One of the things I want to do is host an image of the map online and allow us to insert push pins into the image that would then be associated with infoboxes. I don't want to resort to using the Google Map APIs mainly because this is something I want to just share among friends and not publicly. Terms of usage for the APIs state we would need to make the implementation available for everyone. This seems simple enough yet I've no idea how to do this. I looked into image maps, but that requires constant updates to the html markup itself. I just want to insert/delete/edit pushpins and infoboxes on the image and through our site itself. Can someone help me get started?

    Read the article

  • Error comparing hash to hashed mysql password (output values are equal)

    - by Charlie
    Im trying to compare a hashed password value in a mysql database with the hashed value of an inputted password from a login form. However, when I compare the two values it says they aren't equal. I removed the salt to simply, and then tested what the outputs were and got the same values $password1 = $_POST['password']; $hash = hash('sha256', $password1); ...connect to database, etc... $query = "SELECT * FROM users WHERE username = '$username1'"; $result = mysql_query($query); $userData = mysql_fetch_array($result); if($hash != $userData['password']) //incorrect password { echo $hash."|".$userData['password']; die(); } ...other code... Sample output: 7816ee6a140526f02289471d87a7c4f9602d55c38303a0ba62dcd747a1f50361| 7816ee6a140526f02289471d87a7c4f9602d55c38303a0ba62dcd747a1f50361 Any thoughts?

    Read the article

  • Find record whose field 'name' not contained within any other record

    - by charlie
    I have a model Foo with a String bar and a String name. Some records' bar contain the name of other records in them. This is intentional. I want to find the "root Foo" records - that is, the ones where their name do not appear in the bar records of any other Foo records. Example: Foo id: 1 name: 'foo1' bar: 'something something' id: 2 name: 'foo2' bar: 'foo1 something' id: 3 name: 'foo3' bar: 'foo1, foo4' My method root_foos would return foo2 and foo3 since their names do not appear in any bar string. edit: I don't want to use a relation or foreign key here - just this method.

    Read the article

  • Quick and Dirty Backups with rsync

    It's not always the best tool for the job, but if you need to get a backup into the cloud quickly and easily, rsync might do the trick. Charlie Schluting steps you through how to build a script to do just that.

    Read the article

  • Ma este Oracle Data Mining újdonságok webcast!

    - by Fekete Zoltán
    2010. május 12-én szerdán 18 órakor a böngészonkkel kapcsolódva a következo roppant érdekes eloadást hallgathatjuk meg az Oracle BIWA keretében: BIWA SIG TechCast Series - May 12 - Data Mining Made Easy, az eloadó Charlie Berger, az Oracle adatbányászati vezetoje. Könnyen elvégezheto adatbányászat! Az Oracle Data Miner 11g Release 2 új "Work flow" grafikus felületének bevezetése. Csatlakozni az Oracle BIWA-hoz a ezen a linken ingyenesen lehet. Itt találhatjuk meg, hogyan lehet meghallgatni ezt a konferenciát: www.oraclebiwa.org

    Read the article

  • Harris Corporation Streamlines Manufacturing Assembly Operations with AutoVue

    - by Pam Petropoulos
    "AutoVue is a critical component to our business process; we can’t live without it.” – Charlie Davies, Principal ECAE Applications Engineer, Harris Corporation. Read how Harris Corporation, an international communications and information technology company in the high tech space, is using AutoVue to streamline their manufacturing assembly operations, enhance design reviews and improve communication of engineering changes. Click here to read the complete story.

    Read the article

  • Oracle Service Bus Customer Panel - Choice Hotel's Deployment Description at OpenWorld

    - by Bruce Tierney
    Choice Hotels shared their Oracle Service Bus deployment during the recent Customer Panel on Oracle Service Bus.  Charlie Taylor of Choice provides an excellent in-depth description of architectural guidelines including project naming and project structure.  Below is a screenshot from the session highlighting the flow from proxy service to business service, transformation, orchestration and more: For more information about Oracle OpenWorld SOA & BPM Session, please see the Focus on SOA and BPM document 

    Read the article

  • Apple publie une mise à jour de sécurité qui colmate la faille mise à jour lors du Pwn2Own 2010

    Apple a publié une mise à jour de sécurité pour Mac OS X Leopard et Mac OS X Snow Leopard, que ce soit la version normale ou la version Serveur. Cette mise à jour de sécurité colmate la faille que Charlie Miller avait mis à jour lors du Pwn2own 2010 qui s'était tenu fin mars. Voir http://support.apple.com/kb/HT4131 pour plus d'information sur la mise à jour sécurité 2010-003 Voir également Jusqu'ici, aucun navigateur ne résiste aux attaques des experts en séc...

    Read the article

  • Why String.replaceAll() don't work on this String ?

    - by Aloong
    //This source is a line read from a file String src = "23570006,music,**,wu(),1,exam,\"Monday9,10(H2-301)\",1-10,score,"; //This sohuld be from a matcher.group() when Pattern.compile("\".*?\"") String group = "\"Monday9,10(H2-301)\""; src = src.replaceAll("\"", ""); group = group.replaceAll("\"", ""); String replacement = group.replaceAll(",", "#@"); System.out.println(src.contains(group)); src = src.replaceAll(group, replacement); System.out.println(group); System.out.println(replacement); System.out.println(src); I'm trying to replace the "," between \"s so I can ues String.split() latter. But the above just not working , the result is: true Monday9,10(H2-301) Monday9#@10(H2-301) 23570006,music,**,wu(),1,exam,Monday9,10(H2-301),1-10,score, but when I change the src string to String src = "123\"9,10\"123"; String group = "\"9,10\""; It works well true 9,10 9#@10 1239#@10123 What's the matter with the string???

    Read the article

  • Convert file for XLS to TXT format

    - by meenakshi
    I renamed a .xls file to .txt file but the .txt file shows like this: öRn÷åËþEõZ;zûÕ÷IÉD;Üÿêá¾ú‡×_*4u\çBq&?!€¨(ˆô‰/t/ª§‹'Oý?WïçþJ®½ãÁÁ|DiæEÇ’IŠ›ðä/\$r'Ù¡îê?|ÕÝꮲ¸ó—QG¦çåΊ/–×ÒÏpQP~Q|å?‘ÈpÖ‘»ëËß62 Š/zaqçÎÖ©ú•ênÆ›WÚ·«àÙ}S«ˆº/~Ø×:U”¥‡7îTísvçùòl!ý0ýá»êéqx[T¯ß¿ø1 ¼ð…PïXáÃñ}ý«Å'gK)á*ÐÒm¦ŽØ™¯Püä©ïªÇË‹—‹U¡Jq5ÿ‚Šÿò6qúߟX½ûuqi&×6êÞç~°ðÄÜ‹Òý¥Ÿø…cŸEão(ýNÖáÛ«îâW·‰ôîÏn¥zÚ¨—ÞŸqwø6XuÁËóñ¤;¢òhz¾&®û\â:çýÎxÒL\ïùJn2ì4ÓÖ¾‚{9˜Œ›‰<Ÿ¸qgØ0ä†Ï'®Ûë5¹Ñó‰ë›ò0~FšÜäù How can I get the same data as in an .xls file?

    Read the article

  • Windows update on netbook requires CD (hint, there's no CD drive)

    - by bwooceli
    An "Important" update for Microsoft Works (via Windows Update) on a Dell netbook gets about halfway through and then pops up with the super-awesome "Please insert Microsoft Works 9.0 disc" message. Of course, the netbook has no CD rom drive, there is no handy folder (that i can find) containing "Works9.msi", and I have no Works9 disc. It wouldn't be so bad, except the update keeps coming up everytime WU runs. Any suggestions?

    Read the article

  • Silverlight Cream for April 29, 2010 -- #851

    - by Dave Campbell
    In this Issue: Carlos Figueira(-2-), Subodh Pushpak, Gergely Orosz, John Papa, Mike Snow(-2-), Rishi, Tim Heuer, Stefan Olson, and David Anson. Shoutouts: Josh Holmes blogged about a cool app the City of Miami has up: Miami 311: Built on Windows Azure Gergely Orosz reports on the state of a bug he found pre SL4: Silverlight 4 still displays large elements incorrectly Laura Foy and Charlie Kindel discuss WP7 on Channel 9: Windows Phone 7 Developer Tools Refresh Announced Charlie Kindel has an announcement, good instructions, and what's new notes on the Windows Phone Developer Tools CTP Refresh! Tim Heuer mentioned the workaround for this in his post (below), but I thought you might like to read Brandon Watson's debrief of what it's all about: Signed Assemblies Bug in the Windows Phone Tools CTP Refresh Laurent Bugnion posted about interrelations between versions of Blend and WP7 code... read it closely: Be careful when installing the Blend Windows Phone 7 Add-In From SilverlightCream.com: Consuming REST/POX services in Silverlight 4 Carlos Figueira has a pair of posts up about consuming services in Silverlight 4. This first one is about consuming REST/POX services. He provides a Service Contract that can be used with either and the full project code is available as well. Consuming REST/JSON services in Silverlight 4 In the second post, Carlos Figueira provides the code to allow WCF and Silverlight 4 to consume strongly-typed REST/JSON... and again, all the code is available. Silverlight and WCF caching Subodh Pushpak has a post up discussing caching in WCF, and has code demonstrating turning caching on at run-time. Detecting Silverlight Version Installed Gergely Orosz said it right when he said "Detecting the Silverlight version installed on a client machine isn’t entirely straightforward." ... and after reading this post, if you take the link to his ScottLogic blog, you'll get a full break-out of how it's done. Silverlight TV 22: Tim Heuer on Extending the SMF It's Thursday, and that means Silverlight TV! ... this week, John Papa has on Tim Heuer who has always been out there pushing media... and he's talking about SMF or Silverlight Media Framework for the uninitiated, and also extending it. Silverlight Tip of the Day #7 – Localized Resources Mike Snow has Tip Number 7 up and it's about localization... good end-to-end discussion and demonstration. Just thought I should use that to prove to my daughter that the tatoo she had put on the back of her neck actually reads "Eat More Broccoli" :) Silverlight Tip of the Day #8 – Detecting Alt, Shift, Control, Window & Apple Keys Combinations I just realized Mike Snow's site logo reads "Silverlight Tips of the Day" (bolding mine) ... that answers why I'm seeing more than one -- sorry Mike, couldn't pass it up :) ... Mike's second tip today and number 8 in the series is on detecting all the mouse button and ctl/alt/shift combinations in Silverlight. nRoute: More Wholesomeness, with SL 4 and .NET 4.0 Rishi has a post up announcing a new nRoute release for Silverlight 4 and .NET 4.0 He's tweaked the code to take advantages of enhancements in the new platforms, so check it out. Windows Phone 7 Developer Tools April 2010 Refresh Booya... Tim Heuer announced the release of the next drop in the WP7 tools ... dang wish I was at home today :) ... be sure to read the post for info such as the notes about Authenticode Assemblies and the release notes. Updates to Silverlight Multi-binding support Stefan Olson points up a SL4 change to Multi-binding support that he had previously blogged about. He shows the previous non-working example, and what you have to do to make it work now. Using XAML to create a custom wallpaper image for your mobile device David Anson has a solution for those pesky lost devices, and let me go on the record right now saying if anyone finds a WP7 phone laying around, just call me, it's mine :) [think that'd work??] ... ok, David's solution is a WPF app "MobileDeviceHomeScreenMaker" that you get the info set and it produces a png you then put on your device. But seriously about that lost phone... Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Correlate GROUP BY and LEFT JOIN on multiple criteria to show latest record?

    - by Sunbird
    In a simple stock management database, quantity of new stock is added and shipped until quantity reaches zero. Each stock movement is assigned a reference, only the latest reference is used. In the example provided, the latest references are never shown, the stock ID's 1,4 should have references charlie, foxtrot respectively, but instead show alpha, delta. How can a GROUP BY and LEFT JOIN on multiple criteria be correlated to show the latest record? http://sqlfiddle.com/#!2/6bf37/107 CREATE TABLE stock ( id tinyint PRIMARY KEY, quantity int, parent_id tinyint ); CREATE TABLE stock_reference ( id tinyint PRIMARY KEY, stock_id tinyint, stock_reference_type_id tinyint, reference varchar(50) ); CREATE TABLE stock_reference_type ( id tinyint PRIMARY KEY, name varchar(50) ); INSERT INTO stock VALUES (1, 10, 1), (2, -5, 1), (3, -5, 1), (4, 20, 4), (5, -10, 4), (6, -5, 4); INSERT INTO stock_reference VALUES (1, 1, 1, 'Alpha'), (2, 2, 1, 'Beta'), (3, 3, 1, 'Charlie'), (4, 4, 1, 'Delta'), (5, 5, 1, 'Echo'), (6, 6, 1, 'Foxtrot'); INSERT INTO stock_reference_type VALUES (1, 'Customer Reference'); SELECT stock.id, SUM(stock.quantity) as quantity, customer.reference FROM stock LEFT JOIN stock_reference AS customer ON stock.id = customer.stock_id AND stock_reference_type_id = 1 GROUP BY stock.parent_id

    Read the article

  • BDD IS Different to TDD

    - by Liam McLennan
    One of this morning’s sessions at Alt.NET 2010 discussed BDD. Charlie Pool expressed the opinion, which I have heard many times, that BDD is just a description of TDD done properly. For me, the core principles of BDD are: expressing behaviour in terms that show the value to the system actors Expressing behaviours / scenarios in a format that clearly separates the context, the action and the observations. If we go back to Kent Beck’s TDD book neither of these elements are mentioned as being core to TDD. BDD is an evolution of TDD. It is a specialisation of TDD, but it is not the same as TDD. Discussing BDD, and building specialised tools for BDD, is valuable even though the difference between BDD and TDD is subtle. Further, the existence of BDD does not mean that TDD is obsolete or invalidated.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13  | Next Page >