Daily Archives

Articles indexed Tuesday March 9 2010

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

  • bi-directional o2m/m2o beats uni-directional o2m in SQL efficiency?

    - by Henry
    Use these 2 persistent CFCs for example: // Cat.cfc component persistent="true" { property name="id" fieldtype="id" generator="native"; property name="name"; } // Owner.cfc component persistent="true" { property name="id" fieldtype="id" generator="native"; property name="cats" type="array" fieldtype="one-to-many" cfc="cat" cascade="all"; } When one-to-many (unidirectional) Note: inverse=true on unidirectional will yield undesired result: insert into cat (name) values (?) insert into Owner default values update cat set Owner_id=? where id=? When one-to-many/many-to-one (bi-directional, inverse=true on Owner.cats): insert into Owner default values insert into cat (name, ownerId) values (?, ?) Does that mean setting up bi-directional o2m/m2o relationship is preferred 'cause the SQL for inserting the entities is more efficient?

    Read the article

  • Cleanest way to log who updated what in CF-ORM / Hibernate?

    - by Henry
    One of the requirements of my project is to log who (which Staff) updated what (from what version to what version). UI needs to show who updated entity X at what time and what are updated. What is the cleanest way to implement this? For discussion purpose, imagine... Account has a Contact, and I need to store who update the contact, when, and what's updated.

    Read the article

  • Server load high, CPU idle. NFS the cause?

    - by Mech Software
    I am running into a scenario where I'm seeing a high server load (sometimes upwards of 20 or 30) and a very low CPU usage (98% idle). I'm wondering if these wait states are coming as part of an NFS filesystem connection. Here is what I see in VMStat procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 2 1 0 1298784 0 0 0 0 16 5 0 9 1 1 97 2 0 0 1 0 1308016 0 0 0 0 0 0 0 3882 4 3 80 13 0 0 1 0 1307960 0 0 0 0 120 0 0 2960 0 0 88 12 0 0 1 0 1295868 0 0 0 0 4 0 0 4235 1 2 84 13 0 6 0 0 1292740 0 0 0 0 0 0 0 5003 1 1 98 0 0 4 0 0 1300860 0 0 0 0 0 120 0 11194 4 3 93 0 0 4 1 0 1304576 0 0 0 0 240 0 0 11259 4 3 88 6 0 3 1 0 1298952 0 0 0 0 0 0 0 9268 7 5 70 19 0 3 1 0 1303740 0 0 0 0 88 8 0 8088 4 3 81 13 0 5 0 0 1304052 0 0 0 0 0 0 0 6348 4 4 93 0 0 0 0 0 1307952 0 0 0 0 0 0 0 7366 5 4 91 0 0 0 0 0 1307744 0 0 0 0 0 0 0 3201 0 0 100 0 0 4 0 0 1294644 0 0 0 0 0 0 0 5514 1 2 97 0 0 3 0 0 1301272 0 0 0 0 0 0 0 11508 4 3 93 0 0 3 0 0 1307788 0 0 0 0 0 0 0 11822 5 3 92 0 0 From what I can tell when the IO goes up the waits go up. Could NFS be the cause here or should I be worried about something else? This is a VPS box on a fiber channel SAN. I'd think the bottleneck wouldn't be the SAN. Comments?

    Read the article

  • Where can I find the gtk-builder-convert script?

    - by Marty
    I've built a small GUI app for work that uses some .glade files for pop-up windows. Recently, the ground beneath me was shifted - my environment was upgraded. Newer pyGTK versions require GTKBuilder and .xml files instead of Glade and .glade files and now my poor app is broken. I need to convert the .glade file to the newer .xml file. Problem is Glade-3 is not on our system, and I can't find gtk-builder-convert on the web. I've looked at the Gnome GIT Browser, don't know where to start looking or how to search it. Would anyone be kind enough to point me to the gtk-builder-convert python script?

    Read the article

  • php tree structure problem

    - by agazerboy
    Hi All, I have all my data in my database. It has following 4 columns id source_clust target_clust result_clust 1 7 72 649 2 9 572 650 3 649 454 651 4 32 650 435 This data is like tree structure. source_clust and target_clust generate target_clust. target_clust can be source_clust or target_clust to make a new target_clust. Is there any php function or class that I can use to generate tree structure for my data???? I see this MySql site they are doing exactly what I need but I couldn't find how to implement that query in my data. Thanks !

    Read the article

  • Why do I get "mysql_query(): supplied argument is not a valid"

    - by Brian Ojeda
    Why do I get a "mysql_query(): supplied argument is not a valid" for the first... $r = mysql_query($q, $connection); In the following code... $bId = trim($_POST['bId']); $title = trim($_POST['title']); $story = trim($_POST['story']); $q = "SELECT * "; $q .= "FROM " . DB_NAME . ".`blog` "; $q .= "WHERE `blog`.`id` = {$bId}"; $r = mysql_query($q, $connection); //confirm_query($r); if (mysql_num_rows($r) == 1) { $q = "UPDATE " . DB_NAME . ".`blog` SET `title` = '{$title}', `story` = '{$story}' WHERE `id` = {$bId}"; $r = mysql_query($q, $connection); if (mysql_affected_rows() == 1) { //Successful $data['success'] = true; $date['errors'] = false; $date['message'] = "You are the Greatest!"; } else { //Fail $data['success'] = false; $data['error'] = true; $date['message'] = "You can't do it fool!"; } } I also get an "mysql_num_rows(): supplied argument is not a valid MySQL result resource" error too. Side notes: I am using 1&1 Hosting (worst hosting ever), custom .htaccess file with one line text to enable PHP 5.2 (only why with 1&1 Hosting).

    Read the article

  • Just a general THANK YOU to EVERYONE. [closed]

    - by ajax81
    Hi All, I really just wanted to thank everybody that participates in the stackoverflow community. On more than one occasion, your minds have saved me from soul-eating project managers and career-ending deadlines. The commendable awareness exhibited by contributors that their answers are studied/used as learning material by millions of developers all over the world has created a regulated trust that seemingly keeps the nonsense (and egos) at the bottom of the barrel and out of the way. As an up-and-coming developer with so much to learn, I am grateful for each and every one of their patient contributions. I wish I could come up with a catchy/funny sign-off that makes everybody feel good, but I lack the funny bone that so many of the people on this site seem to have been born with. Instead, I can only leave my gratitude and a promise that as long as the community stays this great, I'll stay an avid reader...and one day be experienced enough to carry the torch of contribution. Sincerely, Daniel the Intern

    Read the article

  • A tool to aid completion of missing or incomplete source code documentation

    - by Pekka
    I have several finished, older PHP projects with a lot of includes that I would like to document in javadoc/phpDocumentor style. While working through each file manually and being forced to do a code review alongside the documenting would be the best thing, I am, simply out of time constraints, interested in tools to help me automate the task as much as possible. The tool I am thinking about would ideally have the following features: Parse a PHP project tree and tell me where there are undocumented files, classes, and functions/methods (i.e. elements missing the appropriate docblock comment) Provide a method to half-way easily add the missing docblocks by creating the empty structures and, ideally, opening the file in an editor (internal or external I don't care) so I can put in the description. Optional: Automatic recognition of parameter types, return values and such. But that's not really required. The language in question is PHP, though I could imagine that a C/Java tool might be able to handle PHP files after some tweaking. Looking forward to your suggestions! Bounty There are already very good suggestions for this (that I have not yet had the time to check out) to point out the gaps, but none yet providing aid in filling them. I want to give the question some more exposure, maybe there is some sort of a graphical extension to php_codesniffer to achieve the level of automation I'm dreaming of. Looking forward to any additional input!

    Read the article

  • Efficient algorithm to find a maximum common subset of two sets?

    - by datasunny
    Each set contains bunch of checksums. For example: Set A: { 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f 07736dde2f8484a4a3af463e05f039e3 5b1e374ff2ba949ab49870ca24d3163a } Set B: { 6639e1da308fd7b04b7635a17450df7c 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f } The maximum common subset of A and B is: { 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f } A lot of this operations will be performed, so I'm looking for an efficient algorithm to do so. Thanks for your help.

    Read the article

  • hibernate query cache specify cache duration

    - by cometta
    below is how i do query cache getHibernateTemplate().setCacheQueries(true); List<IssSection> result = (List<IssSection>) getHibernateTemplate().findByCriteria(crit); getHibernateTemplate().setCacheQueries(false); may i know how to specify duration of maximum time to cache this method? let say i want to clear cache after 5 mins expirated

    Read the article

  • How can I pad an image with CodeIgniter?

    - by Shamoon
    My user is uploading an image of any size XX x YY. I want to find the larger dimension and shrink the image to a square of 250x250 with transparent padding being added to make up the difference. Is there any way to accomplish this with CI's Image Lib?

    Read the article

  • Running out of label names in assembly

    - by mamidon
    Heyo, My class at college has us writing programs in assembly. I have never truly appreciated the ease of C until now. Now, when I program in assembly, I often have to make while/for/if loops and conditionals with labels eg: SKIP: ... COMP:ADD R1, R1, #0 ;Check for equality BRZ WHILEEND ... ;code inside the while loop JMP COMP ;Return to while loop WHILEEND: ... So, in this while loop (example) I have used 1 label for the subroutine and 2 more for the loop itself. I've run out of good label names for all the loops and branches I'm doing in assembly, what do you guys do to keep it varied and descriptive?

    Read the article

  • StackOverflowError occured as using java.util.regex.Matcher

    - by Captain Kidd
    Hi guys I try to catch text by Regular Expression. I list codes as follows. Pattern p=Pattern.compile("<@a>(?:.|\\s)+?</@a>"); Matcher m = p.matcher(fileContents.toString()); while(m.find()) { //Error will be thrown at this point System.out.println(m.group()); } If the length of text I want to catch is too long, system will throw me a StackOverflowError. Otherwise, the codes work well. Please help me how to solve this problem.

    Read the article

  • How do I set up for sharing code (ASP.NET) across multiple domain names?

    - by Scott J.
    I have built a website and now the customer wants to split it between three different domains. What is the best way to do this? This is what I have so far. c:/website1/ points to www.website1.com c:/website1/vd1/ points to www.website2.com c:/website1/vd2/ points to www.website3.com The webhost I'm working with has done it the following way, but now I'm getting a bunch of errors that seems like it's not seeing the App_code folder. Do I need to make a lot of changes? How does this affect the location references?

    Read the article

  • SQL SERVER Improve Performance by Reducing IO Creating Covered Index

    This blog post is in the response of the T-SQL Tuesday #004: IO by Mike Walsh. The subject of this month is IO. Here is my quick blog post on how Cover Index can Improve Performance by Reducing IO.Let us kick off this post with disclaimers about Index. Index is a very complex subject and [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Windows 7 crashes with a blue screen

    - by Chinook pilot
    I am running win 7 32 bit on a Gateway Media Center. Without any interaction from me, and the only thing on the screen is my screen saver it crashes and the fault is "Stop" and a long string of numbers. I have had a "adapi sys message but now it seems to be this "Stop' MESSAGE. Any help will be appreciated.

    Read the article

  • What exactly interpret #!/bin/bash line?

    - by vava
    Many scripts in different languages have a #!/bin/bash header with a path to interpreter, so they can be executed without explicit call to interpreter from command line. But what exactly reads this line and run the interpreter, is it shell or kernel?

    Read the article

  • Viewing font glyphs

    - by Jan
    what's the best program for viewing font files? I need to see the glyphs and their corresponding unicode. Windows Character Map does a horrible job at displaying certain fonts.

    Read the article

  • Foreign key,local key?

    - by user198729
    CREATE TABLE products ( id integer unsigned auto_increment primary key ) ENGINE=INNODB; CREATE TABLE orders ( id integer PRIMARY KEY auto_increment, product_id integer unsigned, quantity integer, INDEX product_id_idx (product_id), FOREIGN KEY (product_id) REFERENCES products (id) ) ENGINE=INNODB; Here the products and orders obviously have some kind of relation--foreign key relation. Also a coin has two sides,so I'm doubting how do we say which table is the foreign key side or local key side?

    Read the article

  • BCB: how to get the (approximate) width of a character in a given TFont?

    - by mawg
    It's a TMemo, not that that should make any difference. Googling suggests that I can use Canvas->TextWidth() but those are Delphi examples and BCB doesn't seem to offer this property. I really want something analogous to memo->Font->Height for width. I realize that not all fonts are fixed width, so a good estimate will do. All that I need is to take the width of a TMemo in pixels and make a reasonable guess at how many characters of the current font it will hold. Of course, if I really want to be lazy, I can just google for the average height/width ratio, since height is known. Remember, an approximation is good enough for me if it is tricky to get exact. http://www.plainlanguagenetwork.org/type/utbo211.htm says, " A width to height ratio of 3:5 (0.6) is recommended for most applications"

    Read the article

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