Search Results

Search found 734 results on 30 pages for 'thumb'.

Page 4/30 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Is "If a method is re-used without changes, put the method in a base class, else create an interface" a good rule-of-thumb?

    - by exizt
    A colleague of mine came up with a rule-of-thumb for choosing between creating a base class or an interface. He says: Imagine every new method that you are about to implement. For each of them, consider this: will this method be implemented by more than one class in exactly this form, without any change? If the answer is "yes", create a base class. In every other situation, create an interface. For example: Consider the classes cat and dog, which extend the class mammal and have a single method pet(). We then add the class alligator, which doesn't extend anything and has a single method slither(). Now, we want to add an eat() method to all of them. If the implementation of eat() method will be exactly the same for cat, dog and alligator, we should create a base class (let's say, animal), which implements this method. However, if it's implementation in alligator differs in the slightest way, we should create an IEat interface and make mammal and alligator implement it. He insists that this method covers all cases, but it seems like over-simplification to me. Is it worth following this rule-of-thumb?

    Read the article

  • Rules for Naming

    - by PointsToShare
    © 2011 By: Dov Trietsch. All rights reserved Naming Documents (or is it “Document, Naming”?) Tis but thy name that is my enemy; Thou art thyself, though not a Montague. What's Montague? It is nor hand, nor foot, Nor arm, nor face, nor any other part Belonging to a man. O, be some other name! What's in a name? That which we call a rose By any other name would smell as sweet; So Romeo would, were he not Romeo call'd, Retain that dear perfection which he owes Without that title. Romeo, doff thy name And for that name which is no part of thee Take all myself.  Shakespeare – Romeo and Juliet Act II, Scene 2 We normally only use the bold portion of the famous Shakespearean quote above, but it is really out of context. As the play unfolds, we learn that a name is all too powerful. Indeed it is because of their names that the doomed lovers die. There might be life and death in a name (BTW, when I wrote this monogram, I was in Hatfield, PA. Remember the Hatfields and the McCoys?) This is a bit extreme, but in the field of Knowledge Management (KM) names are of the utmost importance as well. When I write an article about managing SharePoint sites, how should I name it? “Managing a site” or “Site, managing”? Nine times out of ten I’d opt for the latter. Almost everything we do is “Managing” so to make life easier for a person looking for meaningful content, we title our articles starting with the differentiator rather than the common factor. As a rule of thumb, we start the name with the noun rather than the verb. It is not what we do that is the primary key; it is what we do it to. So, answer this – is it a “rule of thumb” or a “thumb rule?” This is tough. A lot of what we do when naming is a judgment call. Both thumb and rule are nouns, albeit concrete and abstract (more about this later), but to most people “thumb rule” is meaningless while “rule of thumb” is an idiom. The difference between knowledge and information is that knowledge is meaningful information placed in context. Thus I elect the “rule of thumb”. It is the more meaningful title. Abstract and Concrete are relative terms. Many nouns (and verbs) that are abstract to a commoner, are concrete to a practitioner of one profession or another and may even have different concrete meanings in different professional jargons. Think about “running”. To an executive it means running a business, to a marathoner its meaning is much more literal. Generally speaking, we store and disseminate knowledge within a practice more than we do it in general. Even dictionaries encyclopedias define terms as they apply to different audiences. The rule of thumb is to put the more concrete first, but within the audience’s jargon. Even the title of this monogram is a question. Do I name it “Naming Documents” or “Documents, Naming”? Well, my own rule of thumb (“Here he goes again!?”) states that the latter is better because it starts with a noun, but this is a document about naming more than it about documents. The rules of naming also apply to graphs and charts, excel spreadsheets, and so on. Thus, I vote for the former.  A better title could have been “Naming Objects” only the word “Object” is a bit too abstract. How about just “Naming” or “Naming, rules of”? You get the drift. One of the ways to resolve all of this is to store the documents in Knowledge-Bases, which may become the subjects of a future punditry. Knowledge bases use keywords to describe their content.  Use a Metadata store for the keywords to at least attempt some common grounds. Here is another general rule (rule of thumb?!!) – put at least the one keyword in the title. Use subtitles. Here is an example: Migrating documents – Screening, cleaning, and organizing our knowledge. The main keyword is “documents”, next is “migrating”, other keywords also appear in the subtitle. They are “screening”, “cleaning”, and “organizing”. Any questions? Send me an amply named document by email: [email protected]

    Read the article

  • How do you partition a USB Thumb / Flash Drive?

    - by Omar Shahine
    Out of the box, Windows will not allow you to partition a USB Thumb / Flash Drive. How can you do this? In case anyone is wondering Why you would do this? It's interesting in the case of a BitLocker ToGo drive where you can take a large thumbdrive (like 4 or 8 GB) and format a small amount of the drive to be used normally as a Fat32 drive and leave the remaining partition encrypted using BitLocker. This allows you to keep some non secret data on the unencrypted partition(like portable apps).

    Read the article

  • Is there a rule of thumb for RAM upgrades?

    - by Retrosaur
    I'm having a hard time figuring out whether or not a certain laptop/computer's RAM can be upgraded or not. Is there a rule of thumb that determines how much max RAM one could add to a system without looking it up via external websites? A little bit of a background information: I work in computer sales at a computer electronics store, so it is virtually impossible for me to install any sort of software that would detect computer specs, and I get a lot of customers who wonder what laptop/desktop RAM upgrades usually are. Is there a certain rule that adding more RAM entails? Does it make a difference if it's a 32-bit or 64-bit machine? OS?

    Read the article

  • Would anyone tell me how to fetch the media:thumb element's attribute from a json feed?

    - by ash
    I made a yahoo pipe that pulls up the atoms as json format; however, I can fetch and display all the elements in my html page except for the element's attribute. Would anyone tell me how to fetch the media:thumb element's attribute from a json feed? I am pasting the html page's code with javascript. If you save the html page and then view it in browser, you will see that all the necessary elements get output at html page except for the media:thumb as I cannot display the attribute of media:thumb when the feed is formatted as json. I am also pasting the some portion of the json feed so that you can have an idea what i am talking about. Please tell me how to retrieve attribute from media:thumb element of a json feed by using plain javascript but no server side code or javascript library. Thank you. function getFeed(feed){ var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = 'http://pipes.yahoo.com/pipes/pipe.run?_id=40616620df99780bceb3fe923cecd216&_render=json&_callback=piper'; document.getElementsByTagName("head")[0].appendChild(newScript); } function piper(feed){ var tmp=''; for (var i=0; i'; tmp+=feed.value.items[i].title+''; tmp+=feed.value.items[i].author.name+''; tmp+=feed.value.items[i].published+''; if (feed.value.items[i].description) { tmp+=feed.value.items[i].description+''; } tmp+='<hr>'; } document.getElementById('rssLayer').innerHTML=tmp; } </script> bchnbc .............................................................. Some portion of the json feed that gets generated by yahoo pipe .............................................................. piper({"count":2,"value":{"title":"myPipe","description":"Pipes Output","link":"http:\/\/pipes.yahoo.com\/pipes\/pipe.info?_id=f7f4175d493cf1171aecbd3268fea5ee","pubDate":"Fri, 02 Apr 2010 17:59:22 -0700","generator":"http:\/\/pipes.yahoo.com\/pipes\/","callback":"piper", "items": [{ "rights":"Attribution - Noncommercial - No Derivative Works", "link":"http:\/\/vodo.net\/mixtape1", "y:id":{"value":null,"permalink":"true"}, "content":{"content":"We're proud to be releasing this first VODO MIXTAPE. Actual tape might be a thing of the past, but before P2P, mixtapes were the most popular way of sharing popular culture the world had known -- and once called the 'most widely practiced American art form'. We want to resuscitate the spirit of the mixtape for this VODO MIXTAPE series: compilations of our favourite shorts, the weird, the wild and the wonky, all brought together in a temporary and uncomfortable company.","type":"text"}, "author": {"name":"Various"}, "description":"We're proud to be releasing this first VODO MIXTAPE. Actual tape might be a thing of the past, but before P2P, mixtapes were the most popular way of sharing popular culture the world had known -- and once called the 'most widely practiced American art form'. We want to resuscitate the spirit of the mixtape for this VODO MIXTAPE series: compilations of our favourite shorts, the weird, the wild and the wonky, all brought together in a temporary and uncomfortable company.", "media:thumbnail": { "url":"http:\/\/vodo.net\/\/thumbnails\/Mixtape1.jpg" }, "published":"2010-03-08-09:20:20 PM", "format": { "audio_bitrate":null, "width":"608", "xmlns":"http:\/\/xmlns.transmission.cc\/FileFormat", "channels":"2", "samplerate":"44100.0", "duration":"3092.36", "height":"352", "size":"733925376.0", "framerate":"25.0", "audio_codec":"mp3", "video_bitrate":"1898.0", "video_codec":"XVID", "pixel_aspect_ratio":"16:9" }, "y:title":"Mixtape #1: VODO's favourite short films", "title":"Mixtape #1: VODO's favourite short films", "id":null, "pubDate":"2010-03-08-09:20:20 PM", "y:published":{"hour":"3","timezone":"UTC","second":"0","month":"4","minute":"10","utime":"1270264200","day":"3","day_of_week":"6","year":"2010" }}, {"rights":"Attribution - Noncommercial - No Derivative Works","link":"http:\/\/vodo.net\/gilbert","y:id":{"value":"cd6584e06ea4ce7fcd34172f4bbd919e295f8680","permalink":"true"},"content":{"content":"A documentary short about Gilbert, the Beacon Hill \"town crier.\" For the last 9 years, since losing his job and becoming homeless, Gilbert has delivered the weather, sports, and breaking headlines from his spot on the Boston Common. Music (used with permission) in this piece is called \"Blue Bicycle\" by Dusseldorf-based pianist \/ composer Volker Bertelmann also known as Hauschka. Artistic Statement: This is the first in a series of profiles of people who I think are interesting, and who I see on almost a daily basis. I don't want to limit the series to people who live \"on the fringe,\" but it would be appropriate to say that most of the people I interview are eclectic, eccentric, and just a little bit unique. The art is in the viewing - but I hope to turn my lens on individuals that don't always color in the lines, whether they can help it or not.","type":"text"},"author":{"name":"Nathaniel Hansen"},"description":"A documentary short about Gilbert, the Beacon Hill \"town crier.\" For the last 9 years, since losing his job and becoming homeless, Gilbert has delivered the weather, sports, and breaking headlines from his spot on the Boston Common. Music (used with permission) in this piece is called \"Blue Bicycle\" by Dusseldorf-based pianist \/ composer Volker Bertelmann also known as Hauschka. Artistic Statement: This is the first in a series of profiles of people who I think are interesting, and who I see on almost a daily basis. I don't want to limit the series to people who live \"on the fringe,\" but it would be appropriate to say that most of the people I interview are eclectic, eccentric, and just a little bit unique. The art is in the viewing - but I hope to turn my lens on individuals that don't always color in the lines, whether they can help it or not.","media:thumbnail":{"url":"http:\/\/vodo.net\/\/thumbnails\/gilbert.jpeg"},"published":"2010-03-03-10:37:05 AM","format":{"audio_bitrate":null,"width":"624","xmlns":"http:\/\/xmlns.transmission.cc\/FileFormat","channels":"2","samplerate":null,"duration":"373.673","height":"352","size":"123321266.0","framerate":null,"audio_codec":"mp3","video_bitrate":null,"video_codec":"XVID","pixel_aspect_ratio":"16:9"},"y:title":"Gilbert","title":"Gilbert","id":"cd6584e06ea4ce7fcd34172f4bbd919e295f8680","pubDate":"2010-03-03-10:37:05 AM","y:published":{"hour":"3","timezone":"UTC","second":"0","month":"4","minute":"10","utime":"1270264200","day":"3","day_of_week":"6","year":"2010" }} ] }})

    Read the article

  • How to implement jquery and Mootools together ?

    - by Avi Kumar Manku
    I am developing a website in which I am implementing two slider for images gallery using one with jQuery and one with moottools. But there is problem in implementing these because when I use both together the jQuery slider doesn't works where mootools slider works. jQuery slider works in case where I remove mootools. What should I do to implement both sliders together? Any suggestions will be helpful. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Tresmode | Footwear &amp; Accessories</title> <script type="text/javascript" src="js/jquery-1.5.min.js"></script> <script src="js/jquery.easing.1.3.js" type="text/javascript"></script> <script src="js/jquery.slideviewer.1.2.js" type="text/javascript"></script> <!-- Syntax hl --> <script src="js/jquery.syntax.min.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> $(window).bind("load", function() { $("div#mygaltop").slideView({toolTip: true, ttOpacity: 0.5}); $("div#mygalone").slideView(); //if leaved blank performs the default kind of animation (easeInOutExpo, 750) $("div#mygaltwo").slideView({ easeFunc: "easeInOutBounce", easeTime: 2200, toolTip: true }); $("div#mygalthree").slideView({ easeFunc: "easeInOutSine", easeTime: 100, uiBefore: true, ttOpacity: 0.5, toolTip: true }); }); $(function(){ $.syntax({root: 'http://www.gcmingati.net/wordpress/wp-content/themes/giancarlo-mingati/js/jquery-syntax/'}); }); </script> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link href="css/product.css" rel="stylesheet" type="text/css" /> <link href="css/scroll.css" rel="stylesheet" type="text/css" /> <!--[if lte IE 8]> <link href="css/ieonly.css" rel="stylesheet" type="text/css" /> <![endif]--> <script language="javascript" type="text/javascript" src="js/mootools-1.2-core.js"></script> <script language="javascript" type="text/javascript" src="js/mootools-1.2-more.js"></script> <script language="javascript" type="text/javascript" src="js/SlideItMoo.js"></script> <script language="javascript" type="text/javascript"> window.addEvent('domready', function(){ /* thumbnails example , links only */ new SlideItMoo({itemsVisible:5, // the number of thumbnails that are visible currentElement: 0, // the current element. starts from 0. If you want to start the display with a specific thumbnail, change this thumbsContainer: 'thumbs', elementScrolled: 'thumb_container', overallContainer: 'gallery_container'}); /* thumbnails example , div containers */ new SlideItMoo({itemsVisible:5, // the number of thumbnails that are visible currentElement: 0, // the current element. starts from 0. If you want to start the display with a specific thumbnail, change this thumbsContainer: 'thumbs2', elementScrolled: 'thumb_container2', overallContainer: 'gallery_container2'}); /* banner rotator example */ new SlideItMoo({itemsVisible:1, // the number of thumbnails that are visible showControls:0, // show the next-previous buttons autoSlide:2500, // insert interval in milliseconds currentElement: 0, // the current element. starts from 0. If you want to start the display with a specific thumbnail, change this transition: Fx.Transitions.Bounce.easeOut, thumbsContainer: 'banners', elementScrolled: 'banner_container', overallContainer: 'banners_container'}); }); </script> </head> <body> <div id="landing"> <!-- landing page menu --> <div id="landing_menu"> <ul> <li><a class="active" href="#">SPECIALS</a></li> <li><a href="#">SHOP MEN'S</a></li> <li class="none"><a class="none" href="#">SHOP WOMEN'S</a></li> </ul> </div> <!-- landing page menu --> <!-- loading container menu --> <div id="container_part"> <div id="big_image_slider"> <!-- <img src="images/briteloves.png" alt="Britelove" /> --> <div id="mygaltop" class="svw"> <ul> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/briteloves.png" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/1.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/2.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/3.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/4.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/5.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/6.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/7.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/8.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/9.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/10.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/11.jpg" /></li> <li><img alt="Tresmode | Footwear &amp; Accessories" src="images/12.jpg" /></li> </ul> </div> </div> <div class="new_style_banner"><img src="images/new_styles.png" alt="new style" /></div> <div class="new_style_banner"><img src="images/ford-super-models.png" alt="ford super models" /></div> </div> <!--- loading container menu --> <!-- footer scrool ---> <div id="footer_scroll"> <!--thumbnails slideshow begin--> <div id="gallery_container"> <div id="thumb_container"> <div id="thumbs"> <a href="gallery/full/DC080302018.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/1.jpg"/></a> <a href="gallery/full/DC080302028.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/2.jpg" /></a> <a href="gallery/full/DC080302030.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/3.jpg"/></a> <a href="gallery/full/DC080302018.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/4.jpg" /></a> <a href="gallery/full/DC080302028.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/5.jpg" /></a> <a href="gallery/full/DC080302030.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/6.jpg"/></a> <a href="gallery/full/DC080302018.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/1.jpg"/></a> <a href="gallery/full/DC080302028.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/2.jpg" /></a> <a href="gallery/full/DC080302030.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/7.jpg"/></a> <a href="gallery/full/DC080302018.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/8.jpg" /></a> <a href="gallery/full/DC080302028.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/9.jpg" /></a> <a href="gallery/full/DC080302030.jpg" rel="lightbox[galerie]" target="_blank"><img src="gallery/thumb/10.jpg"/></a> </div> </div> </div> <!--thumbnails slideshow end--> </div> <!-- foooter scrooll --> </div> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-2064812-2"); pageTracker._initData(); pageTracker._trackPageview(); </script> </body> </html>

    Read the article

  • Both tab & hover triggered popups problem

    - by carpenter
    I am trying to display divs when hovering over thumb-nails and/or both when tabbing onto them. If I stick to my mouse, the popups seem to work OK - if I start with a tab press I can show the popops also (foward only - no shift + tab yet). Any help getting them to play well together? <script type="text/javascript"> // Note: the below is being run from an onmouseover on a asp:HyperLink at the moment function onhovering_and_tabbingon2() { var active_hover = 0; var num_of_thumb; // set the default focus onto the first thumb-nail and make its popup display document.getElementById('link_no' + active_hover).focus(); // set focus on the first thumb $('#pop' + active_hover).toggleClass('popup'); // show its popup as it is hidden // for when hovering over the thumbs $(".box img").hover( // so as to effect only images/thumb-nails within divs of class=box when hovering over them function () { // test for if the image is a thumb-entry and not a popup image - of class=thumbs2 thumb = $(this).attr('class'); if (thumb != "thumbs2") { // I need to add/toggle the class here to a "div" and not to the image being hovered on, a div with text that corrosponds to the hovered on image though // so grab the number of the thumb_entry - to use to id the div. num_of_thumb = $(this).attr('id').replace('thumb_entry_No', ''); // find the div with id 'pop' + num_of_thumb, and toggleClass on it $('#pop' + num_of_thumb).toggleClass('popup'); // shows the hovered on pic's popup // move the focus to the hovered on pic's a tag ?????? document.getElementById('link_no' + num_of_thumb).focus(); // if the previous popup that was showing was in box2.. if (active_hover == 1 || active_hover% 2 == 1) { $('#pop' + active_hover).toggleClass('popup4_line2'); } else { // remove/toggle the previous active popup's visibility $('#pop' + active_hover).toggleClass('popup'); } // set the new active_hover to num_of_thumb active_hover = num_of_thumb; } }, function () { } ); // same thing again - but for my second row/line of entries/thumb-nails... $(".box2 img").hover( // so as to effect only images/thumbs within divs of class=box2 function () { // test if the image is a thumb-entry and not a popup image thumb = $(this).attr('class'); if (thumb != "thumbs2") { // I need to add the class here to a "div" and not to the image being hovered on, a div that corrosponds to the hovered on image though // so grab the number of the thumb_entry being hovered on, so as to id the div. num_of_thumb = $(this).attr('id').replace('thumb_entry_No', ''); // find the div with id='pop' + num_of_thumb, and toggleClass on it $('#pop' + num_of_thumb).toggleClass('popup4_line2'); // move the focus to the hovered on pic's a tag ?? document.getElementById('link_no' + num_of_thumb).focus(); // if the previous popup that was showing was in box.. // or if the active_hover is even (modulus) if (active_hover == 0 || active_hover % 2 == 0) { $('#pop' + active_hover).toggleClass('popup'); } else { // remove the previous active visible popup $('#pop' + active_hover).toggleClass('popup4_line2'); } // set the new active_hover to num_of_thumb active_hover = num_of_thumb; } }, function () { } ); // todo: I would like to try to show the popups when tabbing through the thumb-nails also // but am lost... document.onkeyup = keypress; // ???? function keypress() { // alert("The key pressed was: " + window.event.keyCode); if (window.event.keyCode == "9") { //alert("The tab key was pressed!"); active_hover = active_hover + 1; // for tabbing into box 2 (odd numbers) if (active_hover == 1 || active_hover % 2 == 1) { // toggle visibility of previous popup $('#pop' + (active_hover - 1)).toggleClass('popup'); // toggle visibility of current popup $('#pop' + active_hover).toggleClass('popup4_line2'); // } else { // for tabbing into box from box2 // toggle visibility of previous popup $('#pop' + (active_hover - 1)).toggleClass('popup4_line2'); // toggle visibility of current popup $('#pop' + active_hover).toggleClass('popup'); // } // ?????? // // if (window.event.keyCode == "shift&9") { } } } } </script>

    Read the article

  • remove the id attribute from a div using jquery?

    - by getaway
    i want to remove the id attribute from this image: <img width="270" class="thumb" id="thumb" height="270" src="img/1_1.jpg" /> i tried doing this: $('img#thumb').RemoveAttr('id','none'); but its not remving it! thanks EDIT: $('img#thumb').attr('src', response); $('img#thumb').attr('id', 'nonthumb'); this deosnt load the picture, or in this case the src!! but when i remove the id attribute, it works fine

    Read the article

  • How to safely use VSS when using a working directory on a thumb drive?

    - by MatthewMartin
    I know putting code into VSS in general is as safe as putting money into a mutual fund run by Bernard Madoff, but I don't have the luxury of ditching it for subversion. That said, I need to be able to write code on two machines, I'm considering checking out code to a flash thumb drive. Anyone know in advance what I should/shouldn't do to avoid loss of work? Do I need to ensure the drive letter stays the same?

    Read the article

  • MySQL Table structure of thumb UP & DOWN for comments system ?

    - by Axel
    Hello, i already created a table for comments but i want to add the feature of thumb Up and Down for comments like Digg and Youtube, i use php & mysql and i'm wondering What's the best table scheme to implement that so comments with many likes will be on the top. This is my current comments table : comments(id,user,article,comment,stamp) Note: Only registred will be able to vote, so there isn't need to restrict the votes by IP Thanks

    Read the article

  • How do developer get rid of silly requirements?

    - by sugar
    Hmm ! First of all let me give you the note of the requirement. So that you can have idea what kind of problem I am facing. Words From Project Manager : Hey ! Sugar, I am assigning you a task for developing a framework. This framework is supposed to be developed for all iOS application. Please go through brief of the required framework. It should be able to detect the thickness of my Thumb. It should be able to detect whether User is using thumb or Fingers If user is using thumbs/Fingers, Framework should calculate the size of thumb/fingers. Once size is been calculated, all elements of user interface should arranged & resized automatically. ( not specified how & where as its framework - it should be smart enough to arrange automatically ) If thumb size is larger elements should get arranged near by center area of iPad/iPhone If thumb size is smaller elements should get arranged near by corners of iPad/iPhone If thumb size is larger, fonts of all elements should get smaller. ( assuming = aged person ) If thumb size is smaller, fonts of all elements should get larger. ( assuming smaller thumb = low aged person ) Summary : This framework is required for creating user-friendly user-interfaces programmatically. We need to develop a very developer-friendly framework. Framework should be developed in such a way that we can use in as many projects as needed. Well, I am a developer. What I want to have as an answer is as follows. How to describe them - the way of they thinking is bit ridiculous ? How do I explain them - we can better concentrate on developing actual projects ? How do I convince them - that this kind of things even if possible, is not recommended to develop such things ? How do I say politely, gently & respectfully NO to this ? What should I say, So that they can not point at my experience ? ( e.g. you are 3 years experienced guy & you must have abilities to develop such things ) Feeling horror. Please help. Thanks in advance, Sugar. Note : Please help me to tag this question properly. I am stuck & this is real situation. Frustrated & tensed. You guys might have faced such requirements from TopLevel. requesting you to help with your experience. Well ! I came to know that - those TOPLEVEL guys don't have any idea of iPad, iPhone, Apple etc. I would do one thing. Sir, before we go further for framework development. It is strongly recommended to read Apple Human Interface Guidlines.

    Read the article

  • asp.net image aspect ratio help

    - by StealthRT
    Hey all, i am in need of some help with keeping an image aspect ratio in check. This is the aspx code that i have to resize and upload an image the user selects. <%@ Page Trace="False" Language="vb" aspcompat="false" debug="true" validateRequest="false"%> <%@ Import Namespace=System.Drawing %> <%@ Import Namespace=System.Drawing.Imaging %> <%@ Import Namespace=System %> <%@ Import Namespace=System.Web %> <SCRIPT LANGUAGE="VBScript" runat="server"> const Lx = 500 ' max width for thumbnails const Ly = 60 ' max height for thumbnails const upload_dir = "/uptest/" ' directory to upload file const upload_original = "sample" ' filename to save original as (suffix added by script) const upload_thumb = "thumb" ' filename to save thumbnail as (suffix added by script) const upload_max_size = 512 ' max size of the upload (KB) note: this doesn't override any server upload limits dim fileExt ' used to store the file extension (saves finding it mulitple times) dim newWidth, newHeight as integer ' new width/height for the thumbnail dim l2 ' temp variable used when calculating new size dim fileFld as HTTPPostedFile ' used to grab the file upload from the form Dim originalimg As System.Drawing.Image ' used to hold the original image dim msg ' display results dim upload_ok as boolean ' did the upload work ? </script> <% randomize() ' used to help the cache-busting on the preview images upload_ok = false if lcase(Request.ServerVariables("REQUEST_METHOD"))="post" then fileFld = request.files(0) ' get the first file uploaded from the form (note:- you can use this to itterate through more than one image) if fileFld.ContentLength > upload_max_size * 1024 then msg = "Sorry, the image must be less than " & upload_max_size & "Kb" else try originalImg = System.Drawing.Image.FromStream(fileFld.InputStream) ' work out the width/height for the thumbnail. Preserve aspect ratio and honour max width/height ' Note: if the original is smaller than the thumbnail size it will be scaled up If (originalImg.Width/Lx) > (originalImg.Width/Ly) Then L2 = originalImg.Width newWidth = Lx newHeight = originalImg.Height * (Lx / L2) if newHeight > Ly then newWidth = newWidth * (Ly / newHeight) newHeight = Ly end if Else L2 = originalImg.Height newHeight = Ly newWidth = originalImg.Width * (Ly / L2) if newWidth > Lx then newHeight = newHeight * (Lx / newWidth) newWidth = Lx end if End If Dim thumb As New Bitmap(newWidth, newHeight) 'Create a graphics object Dim gr_dest As Graphics = Graphics.FromImage(thumb) ' just in case it's a transparent GIF force the bg to white dim sb = new SolidBrush(System.Drawing.Color.White) gr_dest.FillRectangle(sb, 0, 0, thumb.Width, thumb.Height) 'Re-draw the image to the specified height and width gr_dest.DrawImage(originalImg, 0, 0, thumb.Width, thumb.Height) try fileExt = System.IO.Path.GetExtension(fileFld.FileName).ToLower() originalImg.save(Server.MapPath(upload_dir & upload_original & fileExt), originalImg.rawformat) thumb.save(Server.MapPath(upload_dir & upload_thumb & fileExt), originalImg.rawformat) msg = "Uploaded " & fileFld.FileName & " to " & Server.MapPath(upload_dir & upload_original & fileExt) upload_ok = true catch msg = "Sorry, there was a problem saving the image." end try ' Housekeeping for the generated thumbnail if not thumb is nothing then thumb.Dispose() thumb = nothing end if catch msg = "Sorry, that was not an image we could process." end try end if ' House Keeping ! if not originalImg is nothing then originalImg.Dispose() originalImg = nothing end if end if %> What i am looking for is a way to just have it go by the height of what i set it: const Ly = 60 ' max height for thumbnails And have the code for the width just be whatever. So if i had an image... say 600 x 120 (w h) and i used photoshop to change just the height, it would keep it in ratio and have it 300 x 60 (w x h). Thats what i am looking to do with this code here. However, i can not think of a way to do this (or to just leave a wildcard for the width setting. Any help would be great :o) David

    Read the article

  • What are some best practises and "rules of thumb" for creating database indexes?

    - by Ash
    I have an app, which cycles through a huge number of records in a database table and performs a number of SQL and .Net operations on records within that database (currently I am using Castle.ActiveRecord on PostgreSQL). I added some basic btree indexes on a couple of the feilds, and as you would expect, the peformance of the SQL operations increased substantially. Wanting to make the most of dbms performance I want to make some better educated choices about what I should index on all my projects. I understand that there is a detrement to performance when doing inserts (as the database needs to update the index, as well as the data), but what suggestions and best practices should I consider with creating database indexes? How do I best select the feilds/combination of fields for a set of database indexes (rules of thumb)? Also, how do I best select which index to use as a clustered index? And when it comes to the access method, under what conditions should I use a btree over a hash or a gist or a gin (what are they anyway?).

    Read the article

  • Cropping image with ImageScience

    - by fl00r
    ImageScience is cool and light. I am using it in my sinatra app. But I can't understand how can I crop image with not square form and how can I make thumbnail with two dimensions. As I found on ImageScience site: ImageScience.with_image(file) do |img| img.cropped_thumbnail(100) do |thumb| thumb.save "#{file}_cropped.png" end img.thumbnail(100) do |thumb| thumb.save "#{file}_thumb.png" end img.resize(100, 150) do |img2| img2.save "#{file}_resize.png" end end I can crop thumb and resize thumb only with ONE dimension but I want to use two, as in RMagick. For example I want to crop 100x200px box from image, or I want to make thumbnail with width or height not bigger then 300 (width) or 500 (height) pixels.

    Read the article

  • jqGrid concatinating/building html tag incorrectly

    - by Energetic Pixels
    Please excuse to length of post. But I needed to explain what I am seeing. I have a onSelectRow option that is supposed to build stacked html <li> tags (such as <li>...</li> <li>...</li> <li>...</li> ) up to the number of static xml elements that I am looking at. But my script is concatinating all the image src links together instead of building the whole listobject tag. Everything else in my jqGrid script works with exception of repeated elements inside my xml. onSelectRow: function() { var gsr = $('#searchResults').jqGrid('getGridParam', 'selrow'); if (gsr) { var data = $('#searchResults').jqGrid('getRowData', gsr); $('#thumbs ul').html('<li><a class='thumb' href='' + data.piclocation + '' title='' + data.pictitle + ''><img src='" + data.picthumb + "' alt='" + data.pictitle + "' /></a><div class='caption'><div class='image-title'>" + data.pictitle + "</div></div></li>"); };" my xml file is something like this: <photo> <pic> <asset>weaponLib/stillMedia/slides/A106.jpg</asset> <thumb>weaponLib/stillMedia/thumbs/A106.jpg</thumb> <caption>Side view of DODIC A106</caption> <title>Side view of 22 caliber long rifle ball cartridge</title> </pic> <pic> <asset>weaponLib/stillMedia/slides/A106_A.jpg</asset> <thumb>weaponLib/stillMedia/thumbs/A106_A.jpg</thumb> <caption>Side view of DODIC A106</caption> <title>Side view of 22 caliber long rifle ball cartridge</title> </pic> <pic> <asset>weaponLib/stillMedia/slides/A106_B.jpg</asset> <thumb>weaponLib/stillMedia/thumbs/A106_B.jpg</thumb> <caption>Side view of DODIC A106</caption> <title>Side view of 22 caliber long rifle ball cartridge</title> </pic> <pic> <asset>weaponLib/stillMedia/slides/A106_C.jpg</asset> <thumb>weaponLib/stillMedia/thumbs/A106_C.jpg</thumb> <caption>Side view of DODIC A106</caption> <title>Side view of 22 caliber long rifle ball cartridge</title> </pic> <pic> <asset>weaponLib/stillMedia/slides/A106_D.jpg</asset> <thumb>weaponLib/stillMedia/thumbs/A106_D.jpg</thumb> <caption>Side view of DODIC A106</caption> <title>Side view of 22 caliber long rifle ball cartridge</title> </pic> My script works fine when it only sees one sequence, but when it sees more than one it puts all html inside the tags together then for the caption and title does the same for them. It generates only one <li></li> tag set instead of 5 in the example above like I want. The <li> tags are being used by a slideshow (with thumbnails) utility. Inside firebug, I can see the object that it is built for me: <a title="Side view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridge" href="weaponLib/stillMedia/slides/A106.jpgweaponLib/stillMedia/slides/A106_A.jpgweaponLib/stillMedia/slides/A106_B.jpgweaponLib/stillMedia/slides/A106_C.jpgweaponLib/stillMedia/slides/A106_D.jpg" class="thumb"><img alt="Side view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridge" src="weaponLib/stillMedia/thumbs/A106.jpgweaponLib/stillMedia/thumbs/A106_A.jpgweaponLib/stillMedia/thumbs/A106_B.jpgweaponLib/stillMedia/thumbs/A106_C.jpgweaponLib/stillMedia/thumbs/A106_D.jpg"></a> Within jqGrid, the cell is holding: <td title="weaponLib/stillMedia/slides/A106.jpgweaponLib/stillMedia/slides/A106_A.jpgweaponLib/stillMedia/slides/A106_B.jpgweaponLib/stillMedia/slides/A106_C.jpgweaponLib/stillMedia/slides/A106_D.jpg" style="text-align: center; display: none;" role="gridcell">weaponLib/stillMedia/slides/A106.jpgweaponLib/stillMedia/slides/A106_A.jpgweaponLib/stillMedia/slides/A106_B.jpgweaponLib/stillMedia/slides/A106_C.jpgweaponLib/stillMedia/slides/A106_D.jpg</td> I know that jqGrid is building it wrong. I am double-stumped as to direction to fix it. Any suggestions would be greatly greatly appreciated. tony

    Read the article

  • Optimization in Python - do's, don'ts and rules of thumb.

    - by JV
    Well I was reading this post and then I came across a code which was: jokes=range(1000000) domain=[(0,(len(jokes)*2)-i-1) for i in range(0,len(jokes)*2)] I thought wouldn't it be better to calculate the value of len(jokes) once outside the list comprehension? Well I tried it and timed three codes jv@Pioneer:~$ python -m timeit -s 'jokes=range(1000000);domain=[(0,(len(jokes)*2)-i-1) for i in range(0,len(jokes)*2)]' 10000000 loops, best of 3: 0.0352 usec per loop jv@Pioneer:~$ python -m timeit -s 'jokes=range(1000000);l=len(jokes);domain=[(0,(l*2)-i-1) for i in range(0,l*2)]' 10000000 loops, best of 3: 0.0343 usec per loop jv@Pioneer:~$ python -m timeit -s 'jokes=range(1000000);l=len(jokes)*2;domain=[(0,l-i-1) for i in range(0,l)]' 10000000 loops, best of 3: 0.0333 usec per loop Observing the marginal difference 2.55% between the first and the second made me think - is the first list comprehension domain=[(0,(len(jokes)*2)-i-1) for i in range(0,len(jokes)*2)] optimized internally by python? or is 2.55% a big enough optimization (given that the len(jokes)=1000000)? If this is - What are the other implicit/internal optimizations in Python ? What are the developer's rules of thumb for optimization in Python? Edit1: Since most of the answers are "don't optimize, do it later if its slow" and I got some tips and links from Triptych and Ali A for the do's. I will change the question a bit and request for don'ts. Can we have some experiences from people who faced the 'slowness', what was the problem and how it was corrected? Edit2: For those who haven't here is an interesting read Edit3: Incorrect usage of timeit in question please see dF's answer for correct usage and hence timings for the three codes.

    Read the article

  • Making a Live Thumb drive boot with Persistent files, settings AND *drivers* that load on boot?

    - by Luke Stanley
    I have seen https://wiki.ubuntu.com/LiveUsbPendrivePersistent but it's a mess. What methods support persistent drivers as well as files and settings and don't screw up lifespan of the flash drive? I'd like to see your personal recommendations on say, Portable Linux, USB Creator, Remastersys + Unetbootin, etc Backstory: I have a Inspiron 1525 that's hard drive has been slowly dying. I want to switch to a live USB/CD/DVD system until I can get it repaired but my laptops internal wifi device requires a network connection by another means for Xubuntu to let it work, and then I have to enter my Wifi key again, and THEN I have to reinstall Skype etc... I'd be damned every time I have to shut the laptop down. I'm ok with making a shell script for installing apps and copying settings as required but a good persistent install should make this old hat and slow and it doesn't take care of drivers. The last time I tried making an ISO with Remastersys it didn't seem to copy all the required settings.

    Read the article

  • How can I format a USB "thumb drive" so it will be readable on OS X and Windows?

    - by Ethan
    I have an OS X system. I want to use it to put some files on a USB drive and then be able to loan the drive to Mac and XP and Vista users so they can get the files off it. I also need to wipe the drive clean first to make sure there's nothing sensitive on it by accident because I'm going to be passing it around. What the name of the filesystem format I want? What's the procedure? Command line operations are fine.

    Read the article

  • My USB bootable thumb drive, no longer boots on a single particular computer on which it previously worked

    - by LiamMeron
    I created a bootable drive, booting CrunchBang, about 2 months ago. About a month ago, I booted into it on another laptop. After shutting down, I have been unable to get it to boot on my own laptop, despite having worked previously. I can still boot into it on my desktop, and can also boot into it on all other computers that I have tried. If I plug it in when I am running Ubuntu, the Home and / folders mount, the only error being that for some reason my PC likes to try and mount the swap partition too, which naturally, gives an error. The BIOS settings are all still setup to boot from USB. When I boot, all I get is a black screen with the white cursor, it will stay there for as long as I leave it. If it is worth anything, I have GRUB loader installed on the drive. The partitions look a little odd, but I am rather unfamiliar with how they are dealt with. The first partition, /, is sdb1 and has the bootable flag. The second partition is an extended system, and is sdb2. The third partition, according to GParted, seems to be nested under the second. This is the swap partition, and it is sdb5 The fourth partition is my home partition and is sdb6 and is also nested under the extended system. The first and fourth partitions are ext4. I don't know if that helps, but the more info, the better accuracy, generally. Thanks. EDIT: I tried reinstalling GRUB on the drive, but that didn't work. However, when I reinstalled GRUB on my laptop, I did it with my USB thumbdrive in. This caused the GRUB updater to find the /boot folder and add the proper details into my laptop's GRUB loader. I could log into CrunchBang from my laptop's GRUB but I was still unable to boot directly to the drive. It looked like my BIOS is unable to find the bootloader. I am unable to install GRUB to a partition I just created, a /boot partition at the start of the drive, GRUB just doesn't allow it. I think I'm going to have to reinstall #! on my drive, which won't be a great loss as I haven't put much time into it.

    Read the article

  • Is it possible to make a (Windows 7) executable automatically run when I put in my thumb drive?

    - by iconoclast
    I have portable apps on a thumbdrive, and want to automatically run the "menu" app (E:\Applications\Windows\Start.exe) when I insert that drive. I realize (or think I realize, based on a foggy memory of trying to find a way to do this some time ago) that it can no longer be done with the old autorun approach, at least not in Windows 7. But there must be some other way: maybe a daemon process that waits for the thumbdrive to be inserted, and then fires up the .exe file? Maybe a daemon that tries every five minutes or so to launch the menu, and doesn't make a fuss when it's not there. Maybe something else? How can I achieve this?

    Read the article

  • Two Way Sync of folder on PC to USB Thumb Drive over the internet.

    - by Tim Santeford
    Before flagging as duplicate please note that other similar posts do not have the same criteria below. Thanks Im looking for an app that will let me automatically sync a usb drive with a folder on my home system over the internet. I would like to roam from computer to computer and run this syncing app from the usb drive. Im looking for the same functionally as DropBox but without the 2gb restriction and without the need to fully install. Two Way sync between a usb drive and pc over the net Utilizes the full size of the usb drive not limited by an online storage size. (I dont need online backup or versioning) Allows the removal of the usb drive, Plugging it in to another computer will resume its sync. While the drive is connected the app should run silently keeping changed files in sync. (I dont want to run a manual process other than simply starting the app) Must be able to run as a portable app from the usb drive but can fully install on home pc. Window 7 Support is preferable. Please let me know if such and awesome app exists. TIA!

    Read the article

  • How should a developer reject impossible requirements?

    - by sugar
    Here's the problem I'm facing: Quote From Project Manager: Hey Sugar, I'm assigning you the task of developing a framework that could be used for many different iOS applications. Here are the requirements: It should be able to detect the thickness of the thumb or fingers being used to manipulate the UI. With this information, all elements of the UI should be arranged & sized automatically. For a larger thumb, elements should be arranged nearer the center of the screen. For a smaller thumb, elements should be arranged nearer the corners of the screen. For a larger thumb, all fonts should be smaller. (We're assuming an adult in this case.) For a smaller thumb, all fonts should be larger. (We're assuming a younger person in this case.) Summary: This framework is required for creating user-friendly user interfaces programmatically. The framework should be developed in such a way that we can use for as many projects as needed, so it must also be very developer-friendly. I am the developer given this task, so my questions are as follows: How can I explain that these requirements are a little ridiculous? How can I explain that it would be better to concentrate on developing actual projects? How can I explain that even if this were possible, I wouldn't recommended developing such a thing? How do I say NO to this project politely, gently, and respectfully? How can I explain that even for a developer with 3 years of experience, this might not be possible?

    Read the article

  • Shell Script, iterating over a folder

    - by Martin
    I have very basic shell scripting knowledge. I have photos under original folder on many different folder like this folder + folder1 + original + folder2 + original + folder3 + original + folder4 + original Using mogrify I'm trying to create thumbs under a thumb folder following a structure to this. folder + folder1 + original + thumb + folder2 + original + thumb + folder3 + original + thumb + folder4 + original + thumb I'm a little lost in how to write the shell script that may iterate through it. I'm ok giving mogrify its settings but I don't complete understand how to tell the script to go iterate each folder to run the mogrify command.

    Read the article

  • jquery intercept

    - by zurna
    In another question's discussion, I became aware of intercepting clicks and updating area without refreshing the whole page. Problem is, the following code seems correct to me and I dont receive any errors but data taken from another page is not displayed at all. Please advise. main page $('ul.thumbs li.pagination a').live('click', function() { var pageNumber = parseInt($(this).text().replace(/[^0-9]/g, '')); $(function ViewImages() { $.ajax({ type: "GET", url: "/FLPM/cp/images.cs.asp?Process=ViewImages&PAGEID=" + pageNumber, success: function(data) { $("#ViewImages").html(data); }, error: function (XMLHttpRequest, textStatus, errorThrown) { $("#ViewImages").html('.'); } }); }); return false; }); <div id="ViewImages"> </div> page where data lays <ul class="thumbs"> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/5P2B4K5M_sm.jpg" alt="Forest Flowers" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=21" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/6Z3L5U6W_sm.jpg" alt="Forest" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=20" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/8O5A7J8M_sm.jpg" alt="Dock" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=19" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/9Q6B3Q4S_sm.jpg" alt="Desert Landscape" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=18" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li> <a href="#" class="thumb"><img src="/FLPM/media/news/images/5B2N4W5Z_sm.jpg" alt="Creek" class="floatLeft" /></a> <br /> <a href="?Process=DeleteImage&IMAGEID=17" class="thumb"><span class="floatLeft">DELETE</span></a> </li> <li class="pagination">1.&nbsp;</li> <li class="pagination"><a href="2">2.</a>&nbsp;</li> </ul>

    Read the article

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