Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 66/613 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • In Eclipse, how do I change the default modifiers in the class/type template?

    - by gustafc
    Eclipse's default template for new types (Window Preferences Code Style Code Templates New Java Files) looks like this: ${filecomment} ${package_declaration} ${typecomment} ${type_declaration} Creating a new class, it'll look something like this: package pkg; import blah.blah; public class FileName { // Class is accessible to everyone, and can be inherited } Now, I'm fervent in my belief that access should be as restricted as possible, and inheritance should be forbidden unless explicitly permitted, so I'd like to change the ${type_declaration} to declare all classes as final rather than public: package pkg; import blah.blah; final class FileName { // Class is only accessible in package, and can't be inherited } That seems easier said than done. The only thing I've found googling is a 2004 question on Eclipse's mailing list which was unanswered. So, the question in short: How can I change the default class/type modifiers in Eclipse? I'm using Eclipse Galileo (3.5) if that matters.

    Read the article

  • change application windows style

    - by Suriyan Suresh
    I start IE as a process and then i would like to change the following properties of a application. remove title bar, toolbar of a application(if IE) set top,left location and size through c# prevent process from minimizing , i have used the following code but had no luck(find the handle of the process and then pass it to below function) public void SetFormOnDesktop(int hwnd) { int hwndf = hwnd; IntPtr hwndParent = FindWindow("ProgMan", null); SetParent(hwndf, hwndParent); } EDIT 1: Is it possible to prevent IE context menu and prevent it from showing on taskbar

    Read the article

  • PHP/CSS issue, one account has a fine style, the other is weird

    - by HighFlyerPL185
    Hello there, I am currently having the above issue, where on a CMS called phpVMS a CSS displaying front page works fine on the first account, but does not on any other user accounts. This only applies to the frontpage, and all of the tags seem to be closed. The top half of the picture is how it should display and how it displays for user GSM1001. The bottom half is for users GSM1002 upwards. I am really puzzled and I'd appreciate any suggestions. I am happy to post snippets of the code here or on jsFiddle if you require to see it. Thank you, kind regards.

    Read the article

  • Interface with inner implementation - good or bad

    - by dermoritz
    I am working on a project with many someInterface - someInterfaceImpl-pairs. Some days ago I got the idea (probably inspired by reading some objective c code) to include the default implementations as an inner class. Now some colleagues (all with much more java experience than me) saw this idea - feedback was between shocked and surprised ("this is working?"). I googled around a bit but didn't find much evidence of usefulness of this "pattern" (personal i like it): pdf-paper and a faq about code style What do you think - especially in those cases where an "default" implementation is tightly coupled to an interface. Update i just found this: Java Interface-Implementation Pair (see accepted answer)

    Read the article

  • Pre-done SQLs to be converted to Rails' style moduls

    - by Hoornet
    I am a Rails newbie and would really appreciate if someone converted these SQLs to complete modules for rails. I know its a lot to ask but I can't just use find_by_sql for all of them. Or can I? These are the SQLs (they run on MS-SQL): 1) SELECT STANJA_NA_DAN_POSTAVKA.STA_ID, STP_DATE, STP_TIME, STA_OPIS, STA_SIFRA, STA_POND FROM STANJA_NA_DAN_POSTAVKA INNER JOIN STANJA_NA_DAN ON(STANJA_NA_DAN.STA_ID=STANJA_NA_DAN_POSTAVKA.STA_ID) WHERE ((OSE_ID=10)AND (STANJA_NA_DAN_POSTAVKA.STP_DATE={d '2010-03-30'}) AND (STANJA_NA_DAN_POSTAVKA.STP_DATE<={d '2010-03-30'})) 2) SELECT ZIGI_OBDELANI.OSE_ID, ZIGI_OBDELANI.DOG_ID AS DOG_ID, ZIGI_OBDELANI.ZIO_DATUM AS DATUM, ZIGI_PRICETEK.ZIG_TIME_D AS ZIG_PRICETEK, ZIGI_KONEC.ZIG_TIME_D AS ZIG_KONEC FROM (ZIGI_OBDELANI INNER JOIN ZIGI ZIGI_PRICETEK ON ZIGI_OBDELANI.ZIG_ID_PRICETEK = ZIGI_PRICETEK.ZIG_ID) INNER JOIN ZIGI ZIGI_KONEC ON ZIGI_OBDELANI.ZIG_ID_KONEC = ZIGI_KONEC.ZIG_ID WHERE (ZIGI_OBDELANI.OSE_ID = 10) AND (ZIGI_OBDELANI.ZIO_DATUM = {d '2010-03-30'}) AND (ZIGI_OBDELANI.ZIO_DATUM <= {d '2010-03-30'}) AND (ZIGI_PRICETEK.ZIG_VELJAVEN < 0) AND (ZIGI_KONEC.ZIG_VELJAVEN < 0) ORDER BY ZIGI_OBDELANI.OSE_ID, ZIGI_PRICETEK.ZIG_TIME ASC 3) SELECT STA_ID, SUM(STP_TIME) AS SUM_STP_TIME, COUNT(STA_ID) FROM STANJA_NA_DAN_POSTAVKA WHERE ((STP_DATE={d '2010-03-30'}) AND (STP_DATE<={d '2010-03-30'}) AND (STA_ID=3) AND (OSE_ID=10)) GROUP BY STA_ID 4) SELECT DATUM, TDN_ID, TDN_OPIS, URN_OPIS, MOZNI_PROBLEMI, PRIHOD, ODHOD, OBVEZNOST, ZAKLJUCEVANJE_DATUM FROM OBRACUNAJ_DAN WHERE ((OSE_ID=10) AND (DATUM={d '2010-02-28'}) AND (DATUM<={d '2010-03-30'})) ORDER BY DATUM These SQLs are daily working hours and I got them as is. Also I got Database with it which (as you can see from the SQL-s) is not in Rails conventions. As a P.S.: 1)Things like STP_DATE={d '2010-03-30'}) are of course dates (in Slovenian date notation) and will be replaced with a variable (date), so that the user could choose date from and date to. 2) All of this data will be shown in the same page in the table,so maybe all in one module? Or many?; if this helps, maybe. So can someone help me? Its for my work and its my 1st project and I am a Rails newbie and the bosses are getting inpatient(they are getting quite loud actually) Thank you very very much!

    Read the article

  • NoMethodError using Memcached Sinatra-style

    - by sevennineteen
    I've just installed Memcached on my Mac and updated my Sinatra app configuration as described in Heroku's documentation, but I'm getting a NoMethodError when trying to use the hash-based syntax they specify: >> CACHE['color'] = 'blue' >> CACHE['color'] Using explicit get and set methods as below seems to work fine. >> CACHE.set('color', 'blue') >> CACHE.get('color') If necessary I can use the latter syntax, but the former seems more elegant. I haven't tested this on Heroku's environment since I'd like whatever implementation I use to work on my local environment as well. Thanks!

    Read the article

  • How to Change Style of Parent <li> on Hover

    - by Stuart Haiz
    I have a WordPress site (on my localhost) that uses a <ul> for a custom menu. How can I change the CSS of a <li> on hover only if it has a <ul> sub-menu? All the main menu items have a border-radius and I want to remove this on the current item (Services, below) for example: <div class="main-nav"> <ul class="menu" id="menu-main-nav"> <li><a href="#">Home</a></li> <li><a href="#">Services</a> <ul class="sub-menu"> <li><a href="#">Item One</a></li> <li><a href="#>Item Two</a></li> </ul> </li> <li><a href="#>Contact</a></li> </ul> </div> I can't find a CSS solution and I've tried jQuery too: $('ul.sub-menu').parent().hover(function(){ $(this).addClass('no-radius'); });

    Read the article

  • getting page info from a webpage while sharing facebook style

    - by user556167
    Hi all. I am writing an app to share a page to friends when browsing. To this end, I can get the url of the page to my app and display it on the screen. Could anyone tell me, how to improve this, to show the headline of the page and the picture of a page as it appears when a page is being shared to friends on facebook. Here is the code to get and display the url of the page: Intent intent = getIntent(); String action = intent.getAction(); String type = intent.getType(); String mNewLinkUrl=""; if (action != null && type != null && Intent.ACTION_SEND.equals(action) && "text/plain".equals(type)){ mNewLinkUrl = intent.getStringExtra(Intent.EXTRA_TEXT); } TextView ptext = (TextView) findViewById(R.id.pagetext); ptext.append("\n"+mNewLinkUrl); Any insight will be appreciated. //update 1 found a method: use Jsoup to download the html as a Document. And use Elements and Element to get the data. For eg, the following is the code to get the links in imports in the html page: Elements imports = doc.select("link[href]"); for (Element link : imports) { Log.d(TAG,"link.tagName()"+link.tagName()+"link.attr(abs:href)"+link.attr("abs:href") +"link.attr(rel)"+link.attr("rel")); } But I am not able to figure out what attributes facebook exactly gets. Can anyone help me in this? Thank you.

    Read the article

  • Best three tier C# Implement "style"

    - by nXqd
    I'm new to C# three tier implement and I've found a lot of implementations in Internet. I don't know what difference and benefit from its . Thanks a lot for reading this and I'm waiting for your answers. And I really want to know your implementation :)

    Read the article

  • A StringToken Parser which gives Google Search style "Did you mean:" Suggestions

    - by _ande_turner_
    Seeking a method to: Take whitespace separated tokens in a String; return a suggested Word ie: Google Search can take "fonetic wrd nterpreterr", and atop of the result page it shows "Did you mean: phonetic word interpreter" A solution in any of the C* languages or Java would be preferred. Are there any existing Open Libraries which perform such functionality? Or is there a way to Utilise a Google API to request a suggested word?

    Read the article

  • What are the advantages of squashing assignment and error checking in one line?

    - by avakar
    This question is inspired by this question, which features the following code snippet. int s; if((s = foo()) == ERROR) print_error(); I find this style hard to read and prone to error (as the original question demonstrates -- it was prompted by missing parentheses around the assignment). I would instead write the following, which is actually shorter in terms of characters. int s = foo(); if(s == ERROR) print_error(); This is not the first time I've seen this idiom though, and I'm guessing there are reasons (perhaps historical) for it being so often used. What are those reasons?

    Read the article

  • Using Message Boxes in Windows 7 style

    - by Meta
    After reading the MSDN article about proper user interface here: http://msdn.microsoft.com/en-us/library/aa974176.aspx I want to modify the message boxes I use in my applications to reflect those guidelines (for example, have the Main Instructions in a larger font, better named Buttons, etc...). My question is, is there an API that allows you to easily build those kind of message boxes (a la user32\MessageBox()), or do you actually have to build your own message boxes which follow the guidelines?

    Read the article

  • most widely used python web app deployment style

    - by mete
    I wonder which option is more stable (leaving performance aside) and is more widely used (I assume the widely used one is the most stable): apache - mod_wsgi apache - mod_fcgid apache - mod_proxy_ajp apache - mod_proxy_http for a project that will serve REST services with small json formatted input and output messages and web pages, up to 100 req/s. Please comment on apache if you think nginx etc. is more suitable. Thanks.

    Read the article

  • How to set the width of a cell in a UITableView in grouped style

    - by Tomen
    I have been working on this for about 2 days, so i thought i share my learnings with you. The question is: Is it possible to make the width of a cell in a grouped UITableView smaller? The answer is: No. But there are two ways you can get around this problem. Solution #1: A thinner table It is possible to change the frame of the tableView, so that the table will be smaller. This will result in UITableView rendering the cell inside with the reduced width. A solution for this can look like this: -(void)viewWillAppear:(BOOL)animated { CGFloat tableBorderLeft = 20; CGFloat tableBorderRight = 20; CGRect tableRect = self.view.frame; tableRect.origin.x += tableBorderLeft; // make the table begin a few pixels right from its origin tableRect.size.width -= tableBorderLeft + tableBorderRight // reduce the width of the table tableView.frame = tableRect; } Solution #2: Having cells rendered by images This solution is described here: http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html I hope this information is helpful to you. It took me about 2 days to try a lot of possibilities. This is what was left.

    Read the article

  • SO style alert header

    - by Zachary
    I apologize if this question is vague, but I want to build a drop down header, very similar to the one on StackOverflow that alerts you whenever you have earned a new badge, or on Twitter whenever a new tweet comes in. I've been looking around on the internet for a tutorial, but I'm having trouble googling exactly what I'm looking for. I assume there is a way to do this in jQuery, or there may be a jQuery plugin for it, but I haven't had any luck finding one. The idea would probably be to make an AJAX request every so many seconds, and if a new alert-worthy item is found, display it for the user. If someone could point me to a resource to learn how to build one, and/or an existing plugin, that would be great.

    Read the article

  • YUI vs jQuery, for css style layouts

    - by tony
    Hi Complete novice question. I've used jQuery a bit, YUI not at all and know very little about it. I work on a website thats IE specific, we're now looking at making it cross browser. jQuery seems great at hiding the differences between browsers from a javascript point of view. However in terms of css layout is it YUI that I should really be looking at? thanks

    Read the article

  • Metro style apps with Html and C#

    - by labroo
    According to this slide http://geekswithblogs.net/images/geekswithblogs_net/technetbytes/windows-8-platform-tools.jpg Does it mean I have to use XAML view with C# if I want to develop a metro styled application? Can I use a HTML/JS/CSS - C# combination with event handlers and all? Something like ASP.NET Webforms/MVC . I know it is not the same client server architecture, but since metro styled apps support HTML/JS, I was wondering. I can use Win-JS. But can I rather write C# than Javascript, and use HTML rather than XAML?(I dont know XAML and I like C#) All the C# samples I found online use XAML.

    Read the article

  • jQuery plugin to style objects

    - by Alex
    Hi. I've been looking at the various JavaScript UI libraries and am wondering if there's one that can add some styling to page elements. I'm currently adding rounded corners, shadows, borders, and gradients via my own CSS + hacks to get it working on IE. I'm using jQuery for a number of tasks and wondered if there's a plugin that can add these design flairs more easily to DIVs. Not that you want to go overboard with this stuff, but when you need to use it, you'd like to depend on cross-browser and tried-and-tested solutions. Thanks.

    Read the article

  • Java interface 'interview'-style problem

    - by Codenotguru
    Problem/Task: Write an interface with one method and two classes that implement this interface. Now write a main method with an array that holds an instance of each class. Using a for-each loop, invoke the method upon each item. Is this an interview question? (I'm not sure if the author meant to post this as a question or was looking for an answer to the above.)

    Read the article

  • How difficult is it for an artist to make their own artwork cohesive to another artists' style? [on hold]

    - by user36200
    I have a lot of artwork I purchased from a website, but the artist who drew the game assets is unavailable. I need to create additional artwork which fits with this style, but I am not an artist- nor do I have any idea of how artists work. Obviously, the solution is to find a new artist, who I can pay to draw this artwork while keeping it to look at certain way. I am scared of wasting money though. I don't want to contract an artist, only to find out it is extremely difficult for someone to match another person's art style. I don't need it to be identical, I just need it to be cohesive. I also want to know what I'm asking of people, before I ask them. Artists are workers just like me, and deserve to be understood when contracted. As an artist, is it extra difficult or time consuming to alter your artwork to match a certain style? Does it require a lot of talent to make a cohesive piece of art? To be specific, I am talking about structures, such as 2D symbols of towns for a map. They all have this "gritty" penciling effect to them and lots of saturated colors, which is what will be required when I say "cohesive". Along with looking like the architecture belongs in the same world.

    Read the article

  • Code Golf: Leibniz formula for Pi

    - by Greg Beech
    I recently posted one of my favourite interview whiteboard coding questions in "What's your more controversial programming opinion", which is to write a function that computes Pi using the Leibniz formula. It can be approached in a number of different ways, and the exit condition takes a bit of thought, so I thought it might make an interesting code golf question. Shortest code wins! Given that Pi can be estimated using the function 4 * (1 - 1/3 + 1/5 - 1/7 + ...) with more terms giving greater accuracy, write a function that calculates Pi to within 0.00001. Edit: 3 Jan 2008 As suggested in the comments I changed the exit condition to be within 0.00001 as that's what I really meant (an accuracy 5 decimal places is much harder due to rounding and so I wouldn't want to ask that in an interview, whereas within 0.00001 is an easier to understand and implement exit condition). Also, to answer the comments, I guess my intention was that the solution should compute the number of iterations, or check when it had done enough, but there's nothing to prevent you from pre-computing the number of iterations and using that number. I really asked the question out of interest to see what people would come up with.

    Read the article

  • What are basic programs like, recursion, Fibonacci, small trick programs?

    - by Mike
    This question may seem daft (I'm a new to 'programming' and should probably stop if this is the type of question I'm required to ask)... What are: "basic programs like, recursion, fibonacci, factorial, string manipulation, small trick programs"? I've recently read Coding Horror - the non programmer and followed the links to Kegel and How to get hired. Then I delved through some similar questions here (hence the block quote) and I realised that as a fully fledged non-programmer I probably wouldn't know if I knew recursion (or any of the others) because I wouldn't know what it looked like, or why it was used, and what the results would look like after it was used. I suppose I'm trying to get a picture of "the basics". What the principles are and why we learn them - where they'll be used and what result/s your looking for. If they'll be used as an interview question during my first interview sometime in 2020 I would like to look less ignorant than those 199 out of 200 who just don't know the how, or the why, of programming. As always...I'll get my coat. Thanks Mike

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >