Search Results

Search found 1770 results on 71 pages for 'stupid idiot'.

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

  • A stupid question in if block

    - by priyanka.sarkar_2
    I have a very stupid issue if (updateYN.ToUpper() != Constants.NO || updateYN.ToUpper() != Constants.N) { // execute code for any other updateYN } I am trying to perform a filteration that if the value of updateYN is not NO(Constants.NO) or N(Constants.N), then execute the statement. But the problem is that , irresptive of the values , the if block is executing. What wrong is there Thanks

    Read the article

  • setting source classpath in eclipse with stupid project structure

    - by lisak
    What do you guys do, when you have huge project built with ant for instance, where the source folders are right bellow the root project folder, for building classpath from source files ? putting entire project as a source folder is nonsense. Putting separate folders as source folders can't be done if they are part of the package hierarchy and the only thing I could think of, is to copy the source folders into a separate folder and add it then as source folder which is weird but I don't know how else to do it. Having to duplicate sources just because of the eclipse way of making classpath and also because of somebody doing stupid project structure

    Read the article

  • Why are compilers so stupid?

    - by martinus
    I always wonder why compilers can't figure out simple things that are obvious to the human eye. They do lots of simple optimizations, but never something even a little bit complex. For example, this code takes about 6 seconds on my computer to print the value zero (using java 1.6): int x = 0; for (int i = 0; i < 100 * 1000 * 1000 * 1000; ++i) { x += x + x + x + x + x; } System.out.println(x); It is totally obvious that x is never changed so no matter how often you add 0 to itself it stays zero. So the compiler could in theory replace this with System.out.println(0). Or even better, this takes 23 seconds: public int slow() { String s = "x"; for (int i = 0; i < 100000; ++i) { s += "x"; } return 10; } First the compiler could notice that I am actually creating a string s of 100000 "x" so it could automatically use s StringBuilder instead, or even better directly replace it with the resulting string as it is always the same. Second, It does not recognize that I do not actually use the string at all, so the whole loop could be discarded! Why, after so much manpower is going into fast compilers, are they still so relatively dumb? EDIT: Of course these are stupid examples that should never be used anywhere. But whenever I have to rewrite a beautiful and very readable code into something unreadable so that the compiler is happy and produces fast code, I wonder why compilers or some other automated tool can't do this work for me.

    Read the article

  • A stupid question about wordpress and php

    - by bubdada
    It may seem stupid question, but i've a serious problem... if you could check out orcik.net the thumbnail images does not appear. I figured out the reason but I don't know how to solve.. http://orcik.net/projects/thumb/orcikthumb.php?src=http://orcik.net/wp-content/uploads/2010/05/mac-safari-search-cache.png If you go to the above link you will get page not found error. However, if you go to the link below you'll get the thumbnail version of the image... http://orcik.net/projects/thumb/orcikthumb.php?src=/wp-content/uploads/2010/05/mac-safari-search-cache.png I'm using this piece of code on wordpress and the line appears like <a href="<?php the_permalink() ?>" rel="bookmark"> <img src="<?php bloginfo('template_directory'); ?>/includes/orcikthumb.php?src=<?php get_thumbnail($post->ID, 'full'); ?>&amp;h=<?php echo get_theme_mod($height); ?>&amp;w=<?php echo get_theme_mod($width); ?>&amp;zc=1" alt="<?php the_title(); ?>" /> </a> Thus, I believe I can't change the directory of image. But I could not figure out why I am getting page not found error. Is that might be CHMOD'es??? or something else?? Thanks

    Read the article

  • Cisco ASA bonding/teaming/port-channel capabilities

    - by Antoine Benkemoun
    Hello, This seemed to me like a really simple question that I would be able to answer by myself but I have not been able to find any info on this subject. I have a Cisco ASA 5510 which has 4 FastEthernet interfaces. I was wondering if it would be possible to use 2 or 3 of these interfaces as a port-channel in order to agregate bandwidth for multiple VLANs. I have found no info on the Cisco website nor on Google. Is this just a stupid/crazy idea or am I missing something ? Thank you in advance for your help, Antoine

    Read the article

  • stupid caching in asp.net

    - by kusanagi
    i use such code string.Format("<img src='{0}'><br>", u.Avatar); u.Avatar-it's like '/img/path/pic.jpg' but in this site i can upload new image instead old pic.jpg. so picture new, but name is old. and browser show OLD picture (cache). if i put random number like /img/path/pic.jpg?123 then works fine, but i need it only ufter upload, not always. how can i solve this? ?????????? ??????

    Read the article

  • Django stupid mark_safe?

    - by Mark
    I wrote this little function for writing out HTML tags: def html_tag(tag, content=None, close=True, attrs={}): lst = ['<',tag] for key, val in attrs.iteritems(): lst.append(' %s="%s"' % (key, escape_html(val))) if close: if content is None: lst.append(' />') else: lst.extend(['>', content, '</', tag, '>']) else: lst.append('>') return mark_safe(''.join(lst)) Which worked great, but then I read this article on efficient string concatenation (I know it doesn't really matter for this, but I wanted consistency) and decided to update my script: def html_tag(tag, body=None, close=True, attrs={}): s = StringIO() s.write('<%s'%tag) for key, val in attrs.iteritems(): s.write(' %s="%s"' % (key, escape_html(val))) if close: if body is None: s.write(' />') else: s.write('>%s</%s>' % (body, tag)) else: s.write('>') return mark_safe(s.getvalue()) But now my HTML get escaped when I try to render it from my template. Everything else is exactly the same. It works properly if I replace the last line with return mark_safe(unicode(s.getvalue())). I checked the return type of s.getvalue(). It should be a str, just like the first function, so why is this failing?? Also fails with SafeString(s.getvalue()) but succeeds with SafeUnicode(s.getvalue()). I'd also like to point out that I used return mark_safe(s.getvalue()) in a different function with no odd behavior.

    Read the article

  • What's your favorite stupid error message?

    - by Robusto
    Here's my candidate, just encountered, from an automated Java build. I just had to share it. "Composite step 'master' failed due to unsatisfication of success condition." In other words, it failed because it didn't succeed. Uh, thanks. I feel so much more ... what's the word I'm looking for here? Ah, enlightened. I think it would be fun to hear yours, and I'm sure you have plenty. I really enjoyed the best programmer jokes that appeared here earlier, so maybe this will bring a few smiles and lighten the load in a similar fashion. (I searched for something similar on SO, but didn't find anything.)

    Read the article

  • Stupid problem with Javascript calculations and postbacks

    - by rockinthesixstring
    I'm working on an ASP.NET web app where I'm using a Wizard to take the client through a large series of steps. One of the steps includes calculating a bunch of numbers on the fly... the numbers calculate properly but when I click "next" and then go back again... some of the numbers are not retained. Here is the calculation function function CalculateFields() { txtSellingPrice = document.getElementById('<%=txtSellingPrice.ClientID %>'); txtBalanceSheet = document.getElementById('<%=txtBalanceSheet.ClientID %>'); txtDownPayment = document.getElementById('<%=txtDownPayment.ClientID %>'); txtSusEarn = document.getElementById('<%=txtSusEarn.ClientID %>'); txtSusRev = document.getElementById('<%=txtSusRev.ClientID %>'); txtBalanceMult = document.getElementById('<%=txtBalanceMult.ClientID %>'); txtGoodwillMult = document.getElementById('<%=txtGoodwillMult.ClientID %>'); txtSellingPriceMult = document.getElementById('<%=txtSellingPriceMult.ClientID %>'); txtGoodWill = document.getElementById('<%=txtGoodWill.ClientID %>'); txtBalance = document.getElementById('<%=txtBalance.ClientID %>'); chkTakeBack = document.getElementById('<%=chkTakeBack.ClientID %>'); txtVendorTakeBackPercentage = document.getElementById('<%=txtVendorTakeBackPercentage.ClientID %>'); txtSusEarnPercentage = document.getElementById('<%=txtSusEarnPercentage.ClientID %>'); txtBalanceMultPercentage = document.getElementById('<%=txtBalanceMultPercentage.ClientID %>'); txtGoodwillMultPercentage = document.getElementById('<%=txtGoodwillMultPercentage.ClientID %>'); txtSellingPriceMultPercentage = document.getElementById('<%=txtSellingPriceMultPercentage.ClientID %>'); var regexp = /[$,]/g; //Empty value checks SellingPrice = (SellingPrice == "" ? "$0" : SellingPrice); BalanceSheet = (BalanceSheet == "" ? "$0" : BalanceSheet); DownPayment = (DownPayment == "" ? "$0" : DownPayment); susearn = (susearn == "" ? "$0" : susearn); susrev = (susrev == "" ? "$0" : susrev); balmult = (balmult == "" ? "$0" : balmult); goodmult = (goodmult == "" ? "$0" : goodmult); sellmult = (sellmult == "" ? "$0" : sellmult); //Replace $ with String.Empty SellingPrice = txtSellingPrice.value.replace(regexp, ""); BalanceSheet = txtBalanceSheet.value.replace(regexp, ""); DownPayment = txtDownPayment.value.replace(regexp, ""); susearn = txtSusEarn.value.replace(regexp, ""); susrev = txtSusRev.value.replace(regexp, ""); balmult = txtBalanceMult.value.replace(regexp, ""); goodmult = txtGoodwillMult.value.replace(regexp, ""); sellmult = txtSellingPriceMult.value.replace(regexp, ""); //Set the new values txtGoodWill.value = "$" + (SellingPrice - BalanceSheet); txtBalance.value = "$" + (SellingPrice - DownPayment); txtSellingPriceMult.value = "$" + SellingPrice; txtGoodwillMult.value = "$" + (SellingPrice - BalanceSheet); txtBalanceMult.value = "$" + BalanceSheet; if (chkTakeBack.checked == 1) { txtVendorTakeBackPercentage.value = Math.round((SellingPrice - DownPayment) / SellingPrice * 100); } else { txtVendorTakeBackPercentage.value = "0"; } if (!(susearn == "") && !(susearn == "0") && !(susearn == "$0")) { txtSusEarnPercentage.value = Math.round(susearn / susrev * 100); txtBalanceMultPercentage.value = Math.round(balmult / susearn); txtGoodwillMultPercentage.value = Math.round(goodmult / susearn); txtSellingPriceMultPercentage.value = Math.round(sellmult / susearn); } else { txtSusEarnPercentage.value = "0"; txtBalanceMultPercentage.value = "0"; txtGoodwillMultPercentage.value = "0"; txtSellingPriceMultPercentage.value = "0"; } } all of these calculate properly and retain their value across postbacks txtGoodWill.value = "$" + (SellingPrice - BalanceSheet); txtBalance.value = "$" + (SellingPrice - DownPayment); txtSellingPriceMult.value = "$" + SellingPrice; txtGoodwillMult.value = "$" + (SellingPrice - BalanceSheet); txtBalanceMult.value = "$" + BalanceSheet; These ones however do not retain their value across postbacks if (chkTakeBack.checked == 1) { txtVendorTakeBackPercentage.value = Math.round((SellingPrice - DownPayment) / SellingPrice * 100); } else { txtVendorTakeBackPercentage.value = "0"; } if (!(susearn == "") && !(susearn == "0") && !(susearn == "$0")) { txtSusEarnPercentage.value = Math.round(susearn / susrev * 100); txtBalanceMultPercentage.value = Math.round(balmult / susearn); txtGoodwillMultPercentage.value = Math.round(goodmult / susearn); txtSellingPriceMultPercentage.value = Math.round(sellmult / susearn); } else { txtSusEarnPercentage.value = "0"; txtBalanceMultPercentage.value = "0"; txtGoodwillMultPercentage.value = "0"; txtSellingPriceMultPercentage.value = "0"; } The txtVendorTakeBackPercentage always comes back BLANK and the other three always come back as 0 I'm firing these functions by using the onkeyup event within the form fields. If Not Page.IsPostBack Then txtSellingPrice.Attributes.Add("onkeyup", "CalculateFields()") txtBalanceSheet.Attributes.Add("onkeyup", "CalculateFields()") txtDownPayment.Attributes.Add("onkeyup", "CalculateFields()") txtSusRev.Attributes.Add("onkeyup", "CalculateFields()") txtSusEarn.Attributes.Add("onkeyup", "CalculateFields()") End If any thoughts/help/direction would be greatly appreciated.

    Read the article

  • Simple stupid foreach loop question

    - by user281180
    In the code below i`m trying to read a list of selected projects and a list of all projects available. I want to store the all the projects that have not been selected from the list of all projects. But with the code below, I`m having list of all projects...Where and how to break the second loop incase projectId.Value == selectedProjectId.Value ? public IEnumerable NotselectedProjects; public IEnumerable NotSelectedProjects() { if (this.NotselectedProjects == null) { List<SelectListItem> result = new List<SelectListItem>(); foreach (var selectedProjectId in selectedProjects) { foreach (var projectId in projectLists) { if (projectId.Value != selectedProjectId.Value) { result.Add(new SelectListItem { Selected = false, Text = projectId.Text, Value = projectId.Value }); this.NotselectedProjects = result.AsEnumerable(); } } } } return this.NotselectedProjects; }

    Read the article

  • Stupid newbie c++ two-dimensional array problem.

    - by paulson scott
    I've no idea if this is too newbie or generic for stackoverlflow. Apologies if that's the case, I don't intend to waste time. I've just started working through C++ Primer Plus and I've hit a little stump. This is probably super laughable but: for (int year = 0; year < YEARS; year++) { cout << "Year " << year + 1 << ":"; for (int month = 0; month < MONTHS; month++) { absoluteTotal = (yearlyTotal[year][year] += sales[year][month]); } cout << yearlyTotal[year][year] << endl; } cout << "The total number of books sold over a period of " << YEARS << " years is: " << absoluteTotal << endl; I wish to display the total of all 3 years. The rest of the code works fine: input is fine, individual yearly output is fine but I just can't get 3 years added together for one final total. I did have the total working at one point but I didn't have the individual totals working. I messed with it and reversed the situation. I've been messing with it for God knows how long. Any idea guys? Sorry if this isn't the place!

    Read the article

  • Stupid Facebook Connect question about customizing the share-button

    - by Geuis
    I really hate asking about anything retarded as Facebook Connect on SO, but their own development forums are horrendous. We're implementing a Facebook share button using this: <fb:share-button class="url" href="http://oursite.com/"></fb:shared-button> This is documented(poorly) here: http://wiki.developers.facebook.com/index.php/Fb:share-button I need to be able to change the text from "Share" to something else. I've spent 2 hours looking for an answer to this and have come up short. Thanks a lot for any help, and sorry for asking about something this retarded.

    Read the article

  • Stupid java question: Is it a method?

    - by Stefan
    Hello, I'm no Java guy, so I ask myself what this means: public Button(Light light) { this.light = light; } Is Button a method? I ask myself, because it takes an input parameter light. But if it was a method, why would it begin with a capital letter and has no return data type? Here comes the full example: public class Button { private Light light; public Button(Light light) { this.light = light; } public void press() { light.turnOn(); } } I know, this question is really trivial. However, I have nothing to do with Java and haven't found a description for the Button thing above. I'm just interested.

    Read the article

  • .htaccess stupid issue

    - by justnoone
    I have a server where I can only configure httpd using .htaccess, a cannot access global configuration. I want to rewrite almost every non-existing path to index.php, so I did something like: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?path=$1 [L,QSA] And that is ok. But another thing I want to do is to prevent access to path where I keep PHP files (I cannot store them somewhere else) which is for example /php. I would like that anything starting with /php rewrites to index.php?path=php... so I did something like: RewriteCond %{REQUEST_URI} ^/php.* RewriteRule ^(.*)$ /index.php?path=$1 [L,QSA] And that also would work ok if I had access to global configuration. In case of per-directory configuration, when I access /php it rewrites it to index.php?path=php and than puts directory name before that: /php/index.php?path=php. I read documentation and I realize that it uses internal redirects when per-directory confoguration is used. How can I avoid this behavior?

    Read the article

  • Some stupid warnings

    - by thetna
    I have a number of C source files(both .c and .h files). header files contains a number of functions. Out of those functions, only partially are used in a source .C file.Suppose a.h,b.h are header files and a.c and b.c are .c files. a.h is included in a.c. But only a number of functions those are in a. h are used and rest are not used. After compilation I find following warnings: function XXXX defined but not used. But those XXXX functions which are not used in a.c are used in b.c. So, i can't completely remove those functions too. So , i decided to make a separate file containing only those XXXX functions and included it wherever it is used.Doing this is creating multiple number of header files. Can anybody please suggest me to some effective way to solve this problem.

    Read the article

  • Is this plain stupid: GIT Sharing Via DropBox?

    - by yar
    I realize that there are similar questions, but my question is slightly different. I'm wondering whether sharing a bare repository via a synchronized DropBox folder on multiple computers would work for sharing code via GIT. Really what I want to know is: is sharing a GIT repo via DropBox (the repo gets updated on each person's local drive) the same as sharing it from one centralized location, e.g., via SSH, git or HTTP? Is this the same or different from sharing a GIT repo via a shared network drive? Note: This is not an empirical question: it seems to work fine. I'm asking whether the way a GIT repo is structured is compatible with this way of sharing. EDIT To clarify/repeat, I'm talking about keeping the GIT repository on DropBox as a bare repository. I'm not talking about keeping the actual files that are under source control in DropBox.

    Read the article

  • jquery stupid error

    - by user276640
    here is url http://mrhome.ru/Home/MenuPageContent/41?q=??&pid=39 if click search, it not work (quess it because of param q) but on url http://mrhome.ru/Home/main search is work what the problem?

    Read the article

  • Is there an idiot's guide to software licensing somewhere?

    - by Karpie
    Basically, my knowledge on the issue is zilch other than the fact that open-source and closed-source exists. I'm a web developer (not a designer in the slightest), so I look online for things like icons. I've always been a big fan of these icons, which have a Creative Commons Attribution 2.5 License. As far as I can see, this license says 'do whatever you want with them as long as you have a link back to me somewhere'. Is that assumption correct? Just today I found a new icon set, with a much more confusing license (found here), and to be quite honest I have no idea if I'm allowed to use them or not. At the moment I want to just use them for toy stuff that might never see the light of day, but then my source code is stored on Github, is it legal to store the icons there where they're publicly accessible? If I put them on my personal website that might have ads on it to make me five cents every now and then, is that legal? If I use them on a site that offers a free service to users, is that legal? If that site then starts making money (via things like paid subscriptions) or gets bought out by someone (highly unlikely but one day possible) is that legal? Is there some noob guide out there that explains all this stuff, because I would hate to start using this sort of stuff now only to have to change it all later. Even if I buy the icons, there's still licensing issues that I don't understand! :( And this sort of stuff keeps popping up more and more often...

    Read the article

  • WebMotion, le nouveau framework web libre en Java fondé sur le principe du « Keep It Simple and Stupid »

    WebMotion, le nouveau framework web libre en Java Fondé sur le principe « KISS » du « Keep It Simple, Stupid » WebMotion est un framework de développement d'application web qui repose sur une architecture REST et sur le standard Java EE 6. Ce framework propose 2 fonctionnalités principales: La première est d'assurer la couche présentation par le biais de pages (JSP, HTML, etc.). La seconde est d'exposer ...

    Read the article

  • I am one step closer to installing ubuntu, back is grayed out and I was stupid enough to not make a backup

    - by user283544
    Ok, so yeah, i've been stupid enough not to make a backup and 1 step closer to installing ubuntu. What I need is that is windows totally safe and not gonna be touched I made a new partition from windows, and in ubuntu installer I chose "Something else" Then I chose that partition as an ext4 and mount "/" Device for bootloader is my hard disk, /dev/sda/, that's what keeps me a little aware. So I need a quick answer is my windows 7 gonna be touched?

    Read the article

  • javascript question - onclick

    - by harry_T
    I am trying to get this code to work, but it keeps failing. try this link.. http://tinyurl.com/ye5khug enter Edmonton, click on icon, then on "web site". <script> function newPop(url, myWin, width, height, left, top, scrollbars) { parms = 'toolbar=yes, scrollbars=no, location=no, menubar=no, resizable=no, width= ' + width + ' , height=' + height + ' , left= ' + left + ' , top= ' + top + ' , titlebar=no , scrollbars = ' + scrollbars ; var newwin = window.open(url,myWin, parms); newwin.resizeTo(width,height); newwin.moveTo(0,0); newwin.moveTo(left,top); newwin.focus(); return false; } </script> <a onclick=" return newPop('http://google.com','window', '800','800','100','0','yes')" href="#">Web Site</a>

    Read the article

  • Need an idiot-proof picture resizing program for Windows.

    - by marcusw
    My friend needs to resize some pictures as part of a web publishing job, but he is rather clueless when it comes to computers. I am in charge of teaching him how to do this, but only have Linux (albeit with Wine installed) at my disposal for testing. Could you guys recommend a fast, easy, batch-capable, and hopefully open-source program that will resize pictures to the resolution he wants? It doesn't have to be anything fancy, but it needs to be quick and easy to use. Thanks!

    Read the article

  • Need an idiot-proof picture resizing program for Windblows.

    - by marcusw
    My friend needs to resize some pictures as part of a web publishing job, but he is rather clueless when it comes to computers. I am in charge of teaching him how to do this, but only have Linux (albeit with Wine installed) at my disposal for testing. Could you guys recommend a fast, easy, batch-capable, and hopefully open-source program that will resize pictures to the resolution he wants? It doesn't have to be anything fancy, but it needs to be quick and easy to use. Thanks!

    Read the article

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