Search Results

Search found 6726 results on 270 pages for 'rafael de f ferreira'.

Page 168/270 | < Previous Page | 164 165 166 167 168 169 170 171 172 173 174 175  | Next Page >

  • FileReader File not Found Java

    - by Lucas Camargo de Carvalho
    I have done everything I know. The file is not a ".filetype.filetype". It is in the same folder as the .settings and the other project files. Why is this not working? Full path isn't working either, but strangely, a Scanner is working. import java.io.FileReader; public class test { public static void main(String[] args) { FileReader testFileReader = new FileReader("hotels.json"); } }

    Read the article

  • How to debug GWT using Ant

    - by Phuong Nguyen de ManCity fan
    I know that the job would be simpler if I use Google Plugin for Eclipse. However, in my situation, I heavily adapted Maven and thus, the plugin cannot suit me. (In fact, it gave me the whole week of headache). Rather, I relied on a ant script that I learned from http://code.google.com/webtoolkit/doc/latest/tutorial/appengine.html The document was very clear; I follow the article and successfully invoked DevMode using ant devmode. However, the document didn't tell me about debugging GWT (like Google Plugin for Eclipse can do). Basically, I want to add some parameter to an ant task that expose a debug port (something like (com.google.gwt.dev.DevMode at localhost:58807)) so that I can connect my eclipse to. How can I do that?

    Read the article

  • How to write a virtual conditional breakpoint in java

    - by Phuong Nguyen de ManCity fan
    I'm sorry if the question title may mis-inform you, but I cannot find a proper word to explain that. If you ever working with .NET, you would know that there is Assert class that will automatically wake up and attach debugger if necessary and then have debugger (Visual Studio) pausing at the Assert command, given the Assert command failed. Given I'm running a java program and having debugger connected, then how can I have debugger to break on certain condition without manually setup a break point? I'm expecting something like that: void doSomeThing(String x){ if (x==null) breakDebuggerNow(); }

    Read the article

  • Silverlight with MVVM Inheritance: ModelView and View matching the Model

    - by moonground.de
    Hello Stackoverflowers! :) Today I have a special question on Silverlight (4 RC) MVVM and inheritance concepts and looking for a best practice solution... I think that i understand the basic idea and concepts behind MVVM. My Model doesn't know anything about the ViewModel as the ViewModel itself doesn't know about the View. The ViewModel knows the Model and the Views know the ViewModels. Imagine the following basic (example) scenario (I'm trying to keep anything short and simple): My Model contains a ProductBase class with a few basic properties, a SimpleProduct : ProductBase adding a few more Properties and ExtendedProduct : ProductBase adding another properties. According to this Model I have several ViewModels, most essential SimpleProductViewModel : ViewModelBase and ExtendedProductViewModel : ViewModelBase. Last but not least, according Views SimpleProductView and ExtendedProductView. In future, I might add many product types (and matching Views + VMs). 1. How do i know which ViewModel to create when receiving a Model collection? After calling my data provider method, it will finally end up having a List<ProductBase>. It containts, for example, one SimpleProduct and two ExtendedProducts. How can I transform the results to an ObservableCollection<ViewModelBase> having the proper ViewModel types (one SimpleProductViewModel and two ExtendedProductViewModels) in it? I might check for Model type and construct the ViewModel accordingly, i.e. foreach(ProductBase currentProductBase in resultList) if (currentProductBase is SimpleProduct) viewModels.Add( new SimpleProductViewModel((SimpleProduct)currentProductBase)); else if (currentProductBase is ExtendedProduct) viewModels.Add( new ExtendedProductViewModels((ExtendedProduct)currentProductBase)); ... } ...but I consider this very bad practice as this code doesn't follow the object oriented design. The other way round, providing abstract Factory methods would reduce the code to: foreach(ProductBase currentProductBase in resultList) viewModels.Add(currentProductBase.CreateViewModel()) and would be perfectly extensible but since the Model doesn't know the ViewModels, that's not possible. I might bring interfaces into game here, but I haven't seen such approach proven yet. 2. How do i know which View to display when selecting a ViewModel? This is pretty the same problem, but on a higher level. Ended up finally having the desired ObservableCollection<ViewModelBase> collection would require the main view to choose a matching View for the ViewModel. In WPF, there is a DataTemplate concept which can supply a View upon a defined DataType. Unfortunately, this doesn't work in Silverlight and the only replacement I've found was the ResourceSelector of the SLExtensions toolkit which is buggy and not satisfying. Beside that, all problems from Question 1 apply as well. Do you have some hints or even a solution for the problems I describe, which you hopefully can understand from my explanation? Thank you in advance! Thomas

    Read the article

  • Python access an object byref / Need tagging

    - by Aaron C. de Bruyn
    I need to suck data from stdin and create a object. The incoming data is between 5 and 10 lines long. Each line has a process number and either an IP address or a hash. For example: pid=123 ip=192.168.0.1 - some data pid=123 hash=ABCDEF0123 - more data hash=ABCDEF123 - More data ip=192.168.0.1 - even more data I need to put this data into a class like: class MyData(): pid = None hash = None ip = None lines = [] I need to be able to look up the object by IP, HASH, or PID. The tough part is that there are multiple streams of data intermixed coming from stdin. (There could be hundreds or thousands of processes writing data at the same time.) I have regular expressions pulling out the PID, IP, and HASH that I need, but how can I access the object by any of those values? My thought was to do something like this: myarray = {} for each line in sys.stdin.readlines(): if pid and ip: #If we can get a PID out of the line myarray[pid] = MyData().pid = pid #Create a new MyData object, assign the PID, and stick it in myarray accessible by PID. myarray[pid].ip = ip #Add the IP address to the new object myarray[pid].lines.append(data) #Append the data myarray[ip] = myarray[pid] #Take the object by PID and create a key from the IP. <snip>do something similar for pid and hash, hash and ip, etc...</snip> This gives my an array with two keys (a PID and an IP) and they both point to the same object. But on the next iteration of the loop, if I find (for example) an IP and HASH and do: myarray[hash] = myarray[ip] The following is False: myarray[hash] == myarray[ip] Hopefully that was clear. I hate to admit that waaay back in the VB days, I remember being able handle objects byref instead of byval. Is there something similar in Python? Or am I just approaching this wrong?

    Read the article

  • Doing will_paginate pages calculation around a record

    - by Anderson De Andrade
    I'm displaying a list of events. I wanted displayed the page with the events for today by default. That was easy accomplished by: page = number_of_records_before_RECORD / number_of_pages + 1 Now I want to display the first item of today's events as the first item in that page. Maybe there is a way to generate page numbers around a record with negative values to get back.

    Read the article

  • flex3 Format date without timezone

    - by Maurits de Boer
    I'm receiving a date from a server in milliseconds since 1-1-1970. I then use the DateFormatter to print the date to the screen. However, Flex adds timedifference and thus it displays a different time than what I got from the server. I've fixed this by changing the date before printing to screen. But I think that's a bad solution because the date object doesn't hold the correct date. Does anyone know how to use the dateFormatter to print the date, ignoring the timezone? this is how I did it: function getDateString(value:Date):String { var millisecondsPerMinute:int = 1000*60; var newDate:Date = new Date(value.time - (millisecondsPerMinute*value.timezoneOffset)); var dateFormatter:DateFormatter = new DateFormatter(); dateFormatter.formatString = "EEEE DD-MM-YYYY LL:MM AA"; return dateFormatter.format(newDate); }

    Read the article

  • How to determine if a machine is running Active Directory

    - by Hannes de Jager
    I would like to know from Java code if the machine that I'm on is running active directory or that it has active directory installed (e.g. service may be stopped). Is there a reliable registry key to inspect? This is specifically for Windows 2008. I found info on the web that mentions HKLM\SOFTWARE\Microsoft\MSDTC\Security\DomainControllerState, but that value is 0 on my domain controller as well as on my normal windows 7 machine!?

    Read the article

  • Windows secure pinned website tile

    - by Stijn de Voogd
    I'm currently working on a pinned website tile for my website and instead of using a static XML file i'm linking the tile to a web api that returns user specific XML. My question is: Is it possible to secure this tile so that a user needs to be logged in before the data loads? The pinned website livetile doesn't send any security request headers/ cookies: - Http: Request, GET /v1/livetile/firsttile Command: GET + URI: /v1/livetile/firsttile ProtocolVersion: HTTP/1.1 UserAgent: Microsoft-WNS/6.3 Host: 192.168.14.109:2089 Cache-Control: no-cache HeaderEnd: CRLF Sidenote: Notice how it's not even sending an accept header even though it only wants xml. Info: http://msdn.microsoft.com/en-US/library/ie/dn455106 http://msdn.microsoft.com/en-us/library/ie/hh761491.aspx# Thanks in advance!

    Read the article

  • ListView Final Column Autosize creates scrollbar

    - by Courtney de Lautour
    Hi There, I am implementing a custom control which derives from ListView. I would like for the final column to fill the remaining space (Quite a common task), I have gone about this via overriding the OnResize method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (Columns.Count == 0) return; Columns[Columns.Count - 1].Width = -2; // -2 = Fill remaining space } or via another method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (!_autoFillLastColumn) return; if (Columns.Count == 0) return; int TotalWidth = 0; int i = 0; for (; i < Columns.Count - 1; i++) { TotalWidth += Columns[i].Width; } Columns[i].Width = this.DisplayRectangle.Width - TotalWidth; } Edit: This works fine until I dock the ListView into a parent container and resize via that control. Every second time the control size shrinks (IE, drag the the border one pixel), I get a scroll bar on the bottom which can't move at all (not even one pixel). The result of which is when I drag the size of the parent I am left with a flickering scroll bar in the ListView, and a 50% chance it will be there when the dragging stops.

    Read the article

  • USSD Retrieve IMEI Number

    - by Gustavo De Micheli
    Hello, I'm very new at USSD developing. I have a question: Can I retrieve the IMEI number of a MS(Mobile Station) via an USSD PUSH Application? The idea is to create an application that is pushed by the gateway, and is totally transparento to the Mobile phone user. Can it be done? Thanks for reading

    Read the article

  • Javascript Mouseover bubbling from children

    - by Nicky De Maeyer
    Ive got the following html setup: <div id="div1"> <div id="content1">blaat</div> <div id="content1">blaat2</div> </div> it is styled so you can NOT hover div1 without hovering one of the other 2 divs. Now i've got a mouseout on div1. The problem is that my div1.mouseout gets triggered when i move from content1 to content2, because their mouseouts are bubbling. and the event's target, currentTarget or relatedTarget properties are never div1, since it is never hovered directly... I've been searching mad for this, but I can only find articles and solutions for problems who are the reverse of what I need. It seems trivial but I can't get it to work... The mouseout of div1 should ONLY get triggered when the mouse leaves div1. One of the possibilities would be to set some data on mouse enter and mouseleave, but I'm convinced this should work out of the box, since it is just a mouseout... EDIT: bar.mouseleave(function(e) { if ($(e.currentTarget).attr('id') == bar.attr('id')) { bar.css('top', '-'+contentOuterHeight+'px'); $('#floatable-bar #floatable-bar-tabs span').removeClass('active'); } }); changed the mouseout to mouseleave and the code worked...

    Read the article

  • Keeping a database structure up to date in a project where code is on subversion?

    - by Bruno De Barros
    I have been working with Subversion for a while now, and it's been incredible for the management of my projects, and even to help managing the deployment to several different servers, but there is just the one thing that still annoys me. Whenever I make any changes to the database structure, I need to update every server manually, I have to keep track of any changes I made, and because some of my servers run branches of the project (modifications that are still being worked on, or were made for different purposes), it's a bit awkward. Until now, I've been using a "database.sql" file, which is a dump of the database structure for a specific revision. But it just seems like such a bad way to manage this. And I was wondering, how does everyone else manage their MySQL databases when they're working on a project and using Subversion?

    Read the article

  • memory leak in php script

    - by Jasper De Bruijn
    Hi, I have a php script that runs a mysql query, then loops the result, and in that loop also runs several queries: $sqlstr = "SELECT * FROM user_pred WHERE uprType != 2 AND uprTurn=$turn ORDER BY uprUserTeamIdFK"; $utmres = mysql_query($sqlstr) or trigger_error($termerror = __FILE__." - ".__LINE__.": ".mysql_error()); while($utmrow = mysql_fetch_array($utmres, MYSQL_ASSOC)) { // some stuff happens here // echo memory_get_usage() . " - 1241<br/>\n"; $sqlstr = "UPDATE user_roundscores SET ursUpdDate=NOW(),ursScore=$score WHERE ursUserTeamIdFK=$userteamid"; if(!mysql_query($sqlstr)) { $err_crit++; $cLog->WriteLogFile("Failed to UPDATE user_roundscores record for user $userid - teamuserid: $userteamid\n"); echo "Failed to UPDATE user_roundscores record for user $userid - teamuserid: $userteamid<br>\n"; break; } unset($sqlstr); // echo memory_get_usage() . " - 1253<br/>\n"; // some stuff happens here too } The update query never fails. For some reason, between the two calls of memory_get_usage, there is some memory added. Because the big loop runs about 500.000 or more times, in the end it really adds up to alot of memory. Is there anything I'm missing here? could it herhaps be that the memory is not actually added between the two calls, but at another point in the script? Edit: some extra info: Before the loop it's at about 5mb, after the loop about 440mb, and every update query adds about 250 bytes. (the rest of the memory gets added at other places in the loop). The reason I didn't post more of the "other stuff" is because its about 300 lines of code. I posted this part because it looks to be where the most memory is added.

    Read the article

  • Zend_Date and Zend Locale; can't get it to work ><

    - by Rick de Graaf
    Loving Zend Framework, hating Zend_Date... I'm buidling an app where one of the functions is to track the time one spends on a certain task. This works great. My previous question was my incapability to get the sum of all the timestamps (time spent on each task). Well that works as a charm, but when I echo this value, it adds one hour. Using gmdate() (just for checking) and the value turns out exactly as it's supposed to. I thought to solve this problem easeliy with Zend_Local, but I can't get the damn thing to work! This is my bootstrap code: protected function _initLocale() { $locale = new Zend_Locale('nl_NL'); $locale->setLocale($locale); Zend_Registry::set('Zend_Locale', $locale); } This is the code in my view file: $date = new Zend_Date($this->timequery, null, $locale); echo $date->toString(Zend_Date::HOUR.':'.Zend_Date::MINUTE.':'.Zend_Date::SECOND); The timestamp I'm processing is: 2632 which equals 00:43:52. The output I get is: 01:43:52 I know the extra hour comes from the time difference, but I can seem to solve this with Zend_Local and Zend_Date.

    Read the article

  • Draw text on a loaded pdf file with Zend Framework

    - by Rick de Graaf
    Hello, I'm trying to load a existing pdf file, and fill this with database information. Loading the file and everything is working, except for writing data to the loaded page. It doesn't write text to the loaded page. If I add a new page en use a foreach to apply drawing to all pages, all added pages are written, except for the loaded one. Below is the code I'm using: $pdf = Zend_Pdf::load('./documents/agreements/_root/gegevens.pdf'); // Load pdf $pdf->pages = array_reverse($pdf->pages); // reverse pages $pdf->pages[] = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); // Add a page (A4) $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); // Set font foreach($pdf->pages as $page) // Apply settings+text to every page (total of 2) { $page->setFont($font, 36); $page->setAlpha(0.25); $page->drawText('LALALALALALALA', 62, 260, 'UTF-8'); } $pdf->save('./documents/agreements/Gegevens_'.$this->school_id.'.pdf'); // Save file

    Read the article

  • UIView Login screen to tabbar logic

    - by Benjamin De Bos
    Folks, i'm having trouble with some navigation logic. Currently i have a simple two tabbed tabbar application. But i want to show a loginscreen in front. So that would be an UIView. Currently the code is as follows: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UIViewController *viewController1 = [[roosterViewController alloc] initWithNibName:@"roosterViewController" bundle:nil]; UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.viewControllers = @[viewController1, viewController2]; self.window.rootViewController = self.tabBarController; [self.window makeKeyAndVisible]; return YES; } SO this pushes a simple tabcontroller. Well, now i want to have a login screen. So that would be a simple UIView which pushes the tabbar controller. But i can't seem to see the logic on how to do this. I've been trying to present a modal view controller, but the thing is: the tabbar will be loaded on the background. Since i need the username/password information to work on the tabbarview, this won't work. My Logic would be: delegate load loginViewController load tabbar controller But, then i need to be able to "logout". So i need to destroy the tabbar controller and present the login screen. Any thoughts on this?

    Read the article

  • How-to display a .gif as background image?

    - by Vito De Tullio
    Hi! I have a javascript "loading" function like this: function splashScreen() { var div = document.createElement('div'); div.appendChild(document.createTextNode("some text")); div.setAttribute("style", "position: fixed; " + "width: 100%; height: 100%; " + "left: 0; top: 0; " + "z-index: 1000; " + "background: #fff url('img/loading.gif') no-repeat center; " + "font-size: x-large; " + "text-align: center; " + "line-height: 3em; " + "opacity: 0.75; " + "filter: alpha(opacity=75); "); document.getElementsByTagName('body')[0].appendChild(div); return true; } I use this function in the form action (onsubmit="return splashScreen()") to show a "rotating logo" while the next page load... The problem is in that "img/loading.gif" and safari (on winXP): in ff and ie I have no problems, and I clearly see the animated gif. In safari I can't see it. If I change the image with a (obviously static) png the image appears... Am I doing something wrong? What's the problem with safari?

    Read the article

  • How to store an inventory using hashtables?

    - by Harm De Weirdt
    Hello everyone. For an assignment in collego we have to make a script in Perl that allows us to manage an inventory for an e-store. (The example given was Amazon) Users can make orders in a fully text-based environment and the inventory must be updated when an order is completed. Every item in the inventory has 3 to 4 attributes: a product code, a title, a price and for some an amount (MP3's for example do not have this attribute) Since this is my first encounter with Perl, i don't really know how to start. My main problem is how i should "implement" the inventory in the program. One of the functions of the program is searching trough the titles. Another is to make an order, where the user should give a product code. My first idea was a hashtable with the productcode as key. But if i wanted to search in the titles that could be a problem because of this: the hashkey would be something like DVD-123, the information belonging to that key could be "The Green Mask 12" (without the ") where the 12 indicates how many of this DVD are currently in stock. So i'd have to find a way to ignore the 12 in the end. Another solution was to use the title as Hashkey, but that would prove cumbersome too I think. Is there a way to make a hashtable with 2 key's, and when I give only one it returns an array with the other values? (Including the other key and the other information) That way I could use another key depending on what info I need from my inventory. We have to read the default inventory from a txt file looking like this: MP3-72|Lady Gaga - Kiss and Run (Fear of Commitment Monster)|0.99 CD-400|Kings of Leon - Only By The Night|14.50|2 MP3-401|Kings of Leon - Closer|0.85 DVD-144|Live Free or Die Hard|14.99|2 SOFT-864|Windows Vista|49.95 Any help would be appreciated very much :) PS: I am sorry for my bad grammar, English isn't my native language.

    Read the article

  • Find Missing Records

    - by Lennie De Villiers
    Hi, My SQL is a bit bad. I got a query that when I run it I return for example 10 rows but there are 15 in my where clause, how do I identify those 5 that I can't find? Off course I can dump it in MS Excel but how do I use SQL?

    Read the article

< Previous Page | 164 165 166 167 168 169 170 171 172 173 174 175  | Next Page >