Search Results

Search found 1872 results on 75 pages for 'tom genoni'.

Page 54/75 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • JList with JScrollPane and prototype cell value wraps element names (replaces with dots instead of s

    - by Tom
    I've got a Jlist inside a JScrollPane and I've set a prototype value so that it doesn't have to calculate the width for big lists, but just uses this default width. Now, the problem is that the Jlist is for some reason replacing the end of an element with dots (...) so that a horizontal scrollbar will never be shown. How do I disable with "wrapping"? So that long elements are not being replaced with dots if they are wider than the Jlist's width? I've reproduced the issue in a small example application. Please run it if you don't understand what I mean: import javax.swing.*; import java.awt.*; public class Test { //window private static final int windowWidth = 450; private static final int windowHeight = 500; //components private JFrame frame; private JList classesList; private DefaultListModel classesListModel; public Test() { load(); } private void load() { //create window frame = new JFrame("Test"); frame.setSize(windowWidth, windowHeight); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setUndecorated(true); frame.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG); //classes list classesListModel = new DefaultListModel(); classesList = new JList(classesListModel); classesList.setPrototypeCellValue("prototype value"); classesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); classesList.setVisibleRowCount(20); JScrollPane scrollClasses = new JScrollPane(classesList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); for (int i = 0; i < 200; i++) { classesListModel.addElement("this is a long string, does not fit in width"); } //panel JPanel drawingArea = new JPanel(); drawingArea.setBackground(Color.white); drawingArea.add(scrollClasses); frame.add(drawingArea); //set visible frame.setVisible(true); } } Even if you force horizontal scrollbar, you still won't be able to scroll because the element is actually not wider than the width because of the dot (...) wrapping. Thanks in advance.

    Read the article

  • C# rotate a string 180 degrees

    - by Tom
    Hi im having a few problems rotating a string, i found that you need graphics.rotate() but when i change the rotation, i cannot even see the string. It appears the pivot point has completely thrown me. Also i saw an example with transform but i decided i did not need this? If my string was a graph label, reading top to bottom and i needed to rotate it 180 degrees so that it read bottom to top, how would i do this? Thanks in advance

    Read the article

  • Resources for setting up a Visual Studio/C++ development environment

    - by Tom H.
    I haven't done much "front-end" development in about 15 years since moving to database development. I'm planning to start work on a personal project using C++ and since I already have MSDN I'll probably end up doing it in Visual Studio 2010. I'm thinking about using Subversion as a version control system eventually. Of course, I'd like to get up and running as quickly as I can, but I'd also like to avoid any pitfalls from a poorly organized project environment. So, my question is, are there any good resources with common best practices for setting up a development environment? I'm thinking along the lines of where to break down a solution into multiple projects if necessary, how to set up a unit testing process, organizing resources, directories, etc. Are there any great add-ons that I should make sure I have set up from the start? Most tutorials just have one simple project, type in your code and click on build to see that your new application says, "Hello World!". This will be a Windows application with several DLLs as well (no web development), so there doesn't need to be a deploy to a web server kind of process. Mostly I just want to make sure that I don't miss anything big and then have to extensively refactor because of it. Thanks!

    Read the article

  • Javascript: Static member variable containing object instances

    - by tom
    I have the following: function Preferences() { } Preferences.players = { 'player1': new Player() } players is a static member variable of Preferences and I'm trying to make it an object containing an instance of a Player. However, it doesn't appear to let me do this. It seems like it will allow me to define players if I make it a non-static member variable however. Like so: function Preferences() { var players = { 'player1' : new Player() } } Is it possible to create a static member variable containing instances of an object in JS?

    Read the article

  • Is it possible in .NET to set the local endpoint (IP address) when using webclient to consume a web

    - by Tom
    I'm wondering if it is possible using .NET to call a remote web service and in effect specify which IP the call is made on. I'm consuming a service that limits the number of calls I can make based on IP. The service costs in the 20k range after the free limit is used up. I'm very close to enough calls but not quite there using the free service. My server has 3 IP so I could in effect triple the number of calls I could make to the remote service by changing the IP.

    Read the article

  • How can I improve my programming skills with out a computer (or reading material)?

    - by Tom Duckering
    Given the recent and continued chaos with grounded flights and folks stuck in airports, and what not, I'm wondering if anyone has any suggestions for activities that would help sharpen and develop a progammer's mind. The constraints are: Laptop is out of battery and there are no free sockets. You're bored of the book you're reading or you have none with you. Reasonable resources such as a pen and pad of paper are available. Rules can be bent within reason. As daft examples, things I have thought about are: How I might optimise the boarding of a plane. How I might improve the UI of a departure board.

    Read the article

  • "Invalid assignment" error from == operator

    - by Tom
    I was trying to write a simple method: boolean validate(MyObject o) { // propertyA && propertyB are not primitive types. return o.getPropertyA() == null && o.getPropertyB() == null; } And got a strange error on the == null part: Syntax error on token ==. Invalid assignment operator. Maybe my Java is rusty after a season in PLSQL. So I tried a simpler example: Integer i = 4; i == null; // compile error: Syntax error on token ==. Invalid assignment operator. Integer i2 = 4; if (i == null); //No problem How can this be? I'm using jdk160_05. To clarify: I'm not trying to assign anything, just do an && operation between two boolean values. I don't want to do this: if (o.propertyA() == null && o.propertyB() == null) { return true; } else { return false; }

    Read the article

  • C# is there a problem with division?

    - by Tom
    This is a piece of my code, it is called every second, after about 10 seconds the values start to become weird (see below): double a; double b; for (int i = 0; i < currAC.Length; i++ ) { a = currAC[i]; b = aveACValues[i]; divisor = (a/b); Console.WriteLine("a = " + a.ToString("N2") + "\t" + "b = " + b.ToString("N2")); Console.WriteLine("divisor = " + divisor); Console.WriteLine("a+b = " + (a+b)); } and the output: a = -0.05 b = 0.00 divisor = 41 a+b = -0.0524010372273268 currAC and aveACValues are double[] what on earth is going on???? The addition result is correct every time, but the division value is wrong, yet it is reading a and b correctly?? EDIT: '41' is the value of the first calculation, ie when a = currAC[0], but this should not remain???

    Read the article

  • JPanel's child components paint/layout problem

    - by Tom Brito
    I'm having a problem that when my frame is shown (after a login dialog) the buttons are not on correct position, then in some miliseconds they go to the right position (the center of the panel with border layout). When I make a SSCCE, it works correct, but when I run my whole code I have this fast-miliseconds delay to the buttons to go to the correct place. Unfortunately, I can't post the whole code, but the method that shows the frame is: public void login(JComponent userView) { centerPanel.removeAll(); centerPanel.add(userView); centerPanel.revalidate(); centerPanel.repaint(); frame.setVisible(true); } What would cause this delay to the panel layout? (I'm running everything in the EDT) -- update In my machine, this SSCCE shows the layout problem in 2 of 10 times I run it: import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class TEST { public static void main(String[] args) throws Exception { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { System.out.println("Debug test..."); JPanel btnPnl = new JPanel(); btnPnl.add(new JButton("TEST")); JFrame f = new JFrame("TEST"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().setLayout(new BorderLayout()); f.getContentPane().add(btnPnl); f.pack(); f.setSize(800, 600); f.setVisible(true); System.out.println("End debug test!"); } }); } } The button first appers in the up-left, and then it goes to the center. Please, note that I'm understand, not just correct. Is it a java bug? --update OK, so the SSCCE don't show the problem with you that tried till now. Maybe it's my computer performance problem. But this don't answer the question, I still think Java Swing is creating new threads for make the layout behind the scenes.

    Read the article

  • How to "reset" subviews of scrollview for new items?

    - by Tom Tallak Solbu
    I have a MasterViewController displaying Items. Selecting an Item (ItemA), displays images of ItemA in a DetailViewController. The DeatilViewController contains a scrollView, displaying all the images. When tableView:didSelectRowAtIndexPath is called, the images is added to an UIImageView, that is tagged and added as a subview to a scrollview. NSUInteger i; for (i = 1; i <= numberOfImages; i++) { NSString *imageName = [ItemAImages objectAtIndex:i-1]; UIImage *image = [UIImage imageNamed:imageName]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; imageView.tag = i; [scrollView addSubview:imageView]; } Works fine. But when I go back to the MasterViewController, and selects a ItemB, the ItemA is still displayed, like the iPhone simulator refuses to forget the previous scrollview,containing ItemA images. I have tried [subview removeFromSuperview]; which results in either no scrollview at all, or no effect. Depending on when this method is called. How can I "reset" the scrollview for the next Item?

    Read the article

  • Quaternion Cameras and projectile vectors

    - by Tom J Nowell
    In our software we have a camera based on mouse movement, and a quarternion at its heart. We want to fire projectiles from this position, which we can do, however we want to use the camera to aim. The projectile takes a vector which it will add to its position each game frame. How do we acquire such a vector from a given camera/quaternion?

    Read the article

  • What is the most popular generic collection data structure library for C?

    - by Tom Dalling
    I'm looking for a C library that provides generic collection data structures such as lists, associative arrays, sets, etc. The library should be stable and well tested. I'm basically looking for something better than the crappy C standard library. What C libraries fit this description? EDIT: I'd prefer that the library was cross-platform, but failing that, anything that works on Mac/Linux.

    Read the article

  • simulate to change the background color when click the link

    - by tom
    I have the following HTML and the java script below to simulate the background color change when the link block is clicked, but it doesn't seem to work. Any reason why? If I have only the onmousedown event handled, the background color will be changed to blue for sure. But if both onmousedown and onmouseup are handled, nothing would change visually. note... function changeColorOnMouseDown() { document.getElementById('note').style.background='blue'; } function changeColorOnMouseUp() { document.getElementById('note').style.background='#d8dde7'; }

    Read the article

  • Django Forms: TimeField Validation

    - by Tom
    I feel like I'm missing something obvious here. I have a Django form with a TimeField on it. I want to be able to allow times like "10:30AM", but I cannot get it to accept that input format or to use the "%P" format (which has a note attached saying it's a "Proprietary extension", but doesn't say where it comes from). Here's the gist of my form code: calendar_widget = forms.widgets.DateInput(attrs={'class': 'date-pick'}, format='%m/%d/%Y') time_widget = forms.widgets.TimeInput(attrs={'class': 'time-pick'}) valid_time_formats = ['%P', '%H:%M%A', '%H:%M %A', '%H:%M%a', '%H:%M %a'] class EventForm(forms.ModelForm): start_date = forms.DateField(widget=calendar_widget) start_time = forms.TimeField(required=False, widget=time_widget, help_text='ex: 10:30AM', input_formats=valid_time_formats) end_date = forms.DateField(required=False, widget=calendar_widget) end_time = forms.TimeField(required=False, widget=time_widget, help_text='ex: 10:30AM', input_formats=valid_time_formats) description = forms.CharField(widget=forms.Textarea) Any time I submit "10:30AM", I get a validation error. The underlying model has two fields, event_start and event_end, no time fields, so I don't think the problem is in there. What stupid thing am I missing?

    Read the article

  • How do I detect bots programatically

    - by Tom
    we have a situation where we log visits and visitors on page hits and bots are clogging up our database. We can't use captcha or other techniques like that because this is before we even ask for human input, basically we are logging page hits and we would like to only log page hits by humans. Is there a list of known bot IP out there? Does checking known bot user-agents work?

    Read the article

  • PHP: How to check for response code?

    - by Tom
    Hi, I'm a relative PHP newbie implementing a PayPal IPN listener and all seems to be working fine, except I dont really know how to check for a response code. I've tried something ugly with cURL but it doesn't work at all (I'm not understanding cURL). I've tried this piece of code that I grabbed from somewhere on the net: $fp = fsockopen('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); $response_headers = get_headers($fp); $response_code = (int)substr($headers[0], 9, 3); ... but it's not working (returns $response_code = 0). So right now, I'm debugging my IPN code without checking for a Response 200. Can anyone more experienced advise me on what's the proper/simple way to check this? Thanks

    Read the article

  • Possible to add an EventListener to a function for Actionscript 3?

    - by Tom
    I'm trying to setup something like Aspect Oriented Programming in Actionscript 3, basically the only thing I need to be able to do is something like this: SomeClass.getMethod("methodName").addEventListener(afterMethodExecuted, function() { //run code }); This way I can run code after (or before) any method in any class has run, allowing numerous new possibilities. How should I implement this?

    Read the article

  • Is there a simpliest way of doing this?

    - by Tom Brito
    Is there a simpler way of implement this? Or a implemented method in JDK or other lib? /** * Convert a byte array to 2-byte-size hexadecimal String. */ public static String to2DigitsHex(byte[] bytes) { String hexData = ""; for (int i = 0; i < bytes.length; i++) { int intV = bytes[i] & 0xFF; // positive int String hexV = Integer.toHexString(intV); if (hexV.length() < 2) { hexV = "0" + hexV; } hexData += hexV; } return hexData; } public static void main(String[] args) { System.out.println(to2DigitsHex(new byte[] {8, 10, 12})); } the output is: "08 0C 0A" (without the spaces)

    Read the article

  • Cannot add or update a child row: a foreign key constraint fails

    - by Tom
    table 1 +----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+----------------+ | UserID | int(11) | NO | PRI | NULL | auto_increment | | Password | varchar(20) | NO | | | | | Username | varchar(25) | NO | | | | | Email | varchar(60) | NO | | | | +----------+-------------+------+-----+---------+----------------+ table2 +------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+----------------+ | UserID | int(11) | NO | MUL | | | | PostID | int(11) | NO | PRI | NULL | auto_increment | | Title | varchar(50) | NO | | | | | Summary | varchar(500) | NO | | | | +------------------+--------------+------+-----+---------+----------------+ com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (myapp/table2, CONSTRAINT table2_ibfk_1 FOREIGN KEY (UserID) REFERENCES table1 (UserID)) What have I done wrong? I read this: http://www.w3schools.com/Sql/sql_foreignkey.asp and i don't see whats wrong. :S

    Read the article

  • Best workflow with Git & Github

    - by Tom Schlick
    Hey guys, im looking for some advice on how to properly structure the workflow for my team with git & github. we are recent svn converts and its kind of confusing on how we should best setup our day-to-day workflow. Here is a little background, im comfortable with command line and my team is pretty new to it but can follow use commands. We all are working on the same project with 3 environments (development, staging, and production). We are a mix of developers & designers so some use the Git GUI and some command line. Our setup in svn went something like this. We had a branch for development, staging and production. When people were confident with code they would commit and then merge it into the staging. The server would update itself and on a release day (weekly) we would do a diff and push the changes to the production server. Now i setup those branches and got the process with the server running but its the actual workflow that is confusing the hell out of me. It seems like overkill that every time someone makes a change on a file they would create a new branch, commit, merge, and delete that branch... from what i have read they would be able to do it on a specific commit (using the hash), do i have that right? is this an acceptable way to go about things with git? any advice would be greatly appreciated.

    Read the article

  • svn: Item <folder> is out of date

    - by Tom Brito
    I'm using subclipse, and always when delete a folder in Eclipse, and try to commit it, the following errors raise: svn: Item <folder> is out of date svn: DELETE of <folder>: 409 Conflict (http://myintranet) Deleting and commiting via command line works fine, but what's wrong with doing it via subclipse? Is anyone more experiencing this problem? (I experienced this problem in Ubuntu 9.10 and 10.04; last Eclipse version; and subclipse 1.4 - as the next versions of subclipse have much more bugs) --updated: Its when I delete folders, not files

    Read the article

  • How do I write a bash script to restart a process if it dies?

    - by Tom
    I have a python script that'll be checking a queue and performing an action on each item: # checkqueue.py while True: check_queue() do_something() How do I write a bash script that will check if it's running, and if not, start it. Roughly the following pseudo code (or maybe it should do something like ps | grep?): # keepalivescript.sh if processidfile exists: if processid is running: exit, all ok run checkqueue.py write processid to processidfile I'll call that from a crontab: # crontab */5 * * * * /path/to/keepalivescript.sh Thanks in advance.

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >