I have been following a tutorial on YouTube for Java using Eclipse. Currently I am trying to multiply two doubles and output the result as a double using JOptionPane.showMessageDialog but it is giving me an error. Here is my code: import javax.swing.JOptionPane; public class Variables { public static void main(String arg[]) { double length = 3; double width = 2; double area = length*width; JOptionPane myIO = new JOptionPane(); myIO.showMessageDialog(null, area); } } and the error: Exception in thread "main" java.lang.Error: Unresolved compilation problem: The method showMessageDialog(Component
The following code fails although I have the gtk bindings for python installed. This is a debian machine and I have the package named python-gtk2 installed >>> import gtk Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named gtk How can I fix this? Edit1: Per comment request: Python 2.7.3rc2 (default, May 22 2012, 01:05:47) Edit2: Per comment request: >>> print sys.path ['', '/home/lorb', '/usr/lib/python2.7/dist-packages', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/l
If I am on a local branch that is not tracking any remote branch and I give the command git fetch Given I have several remotes defined in $GIT_DIR/config, from which remote is the fetch done? I tried to find out from the man page, but this point is unclear to me. Additionally: How can I change this default remote without making the local branch tracking?
I had some problems with my video blog. The preview of my video on Google is the default preview of videos. Even if the video last 1:20, Google shows that it lasts 0:20. Is it possible to modify it ? Best regards, Brunner Nathan
I have an app which uses AVFoundation and tracks the face, eyes, and mouth position. I use the CIFaceFeature to detect these and mark them on the screen. Is there a simple way to detect a wink using the framework?
This is a fairly general query as I'm very confused about how to do this. I want to use the apache server which I have downloaded as part of XAMPP in order to test the website I am building, which will use php and mysql. The general question is: how do I do this? As far as I understand it, the files go into C:\xampp\htdocs, which can then be accessed via localhost. What confuses me though is that the XAMPP admin stuff is also located here - so, for instance, I can't replace the file index.php without losing access to phpMyAdmin and so on. Do I have to create a new folder for the website within
I'm trying to auto size the columns of my sheet. I'm writing the file and in the end I try to resize all of my columns. // Add some data $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('B1', 'test1111111111111111111111') ->setCellValue('C1', 'test1111111111111') ->setCellValue('D1', 'test1111111') ->setCellValue('E1', 'test11111') ->setCellValue('F1', 'test1') ->setCellValue('G1', 'test1'); foreach($objPHPExcel->getActiveSheet()->getColumnDimension() as $col) { $col->setAutoSize(true); } $objPHPExcel->getActiveSheet()->calculateColumnWidths(); The above code doesn't work. Doesn't change th
I have a problem very similar to these: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener when using MyFaces with WASCE/Geronimo java.lang.ClassNotFoundException : com.sun.faces.config.ConfigureListener Error with Jboss while deploying a jsp/servlet web app "com.sun.faces.config.ConfigureListener" Error I've managed to find a workaround but still not solved the issue. When I deploy my application to Tomcat 7.0.34 which is configured in Eclipse Juno Service Release 1 (Build id: 20120920-0800) I get: INFO: Starting Servlet Engine: Apache Tomcat/7.0.34 maj 22, 2013 5:10:34
I'm receiving the following error while autoloading a library named 'phpass' as follows. An Error Was Encountered Unable to load the requested class: Phpass Code to autoload the library $autoload['libraries'] = array('database', 'phpass'); The phpass.php file resides in the application/libraries folder, and the class is declared as class phpass meaning that the issue cannot be related to capitalisation or the file path as suggested in the majority of other answers I have come across. Please can you tell me what I am missing? It works perfectly in MAMP, however, when uploading to my Linux Ubunt
In machine A for some reason I get a bunch of: ==21855== Invalid read of size 4 ==21855== at 0x422A26F: ??? (in /lib/i686/cmov/libc-2.11.3.so) ==21855== by 0x4216E2F: vsnprintf (in /lib/i686/cmov/libc-2.11.3.so) ==21855== by 0x41FE421: snprintf (in /lib/i686/cmov/libc-2.11.3.so) ==21855== by 0x804F95B: put_lines (lines.c:354) ==21855== by 0x805076B: examine_lines (lines.c:658) ==21855== by 0x80509D8: read_lines (lines.c:715) ==21855== by 0x804EED0: main (app.c:564) ==21855== Address 0x444230c is 12 bytes inside a block of size 13 alloc'd ==21855== at 0x40255BC: malloc (vg_replace_malloc.c:270)
My example script clicks the first "rate" button it finds on a page, yet I want it to find text and then click the next "rate" button on a page. VERSION BUILD=8300326 RECORDER=FX TAB T=1 SET !DATASOURCE C:\Users\admin\Documents\iMacros\Downloads\extract.csv SET !DATASOURCE_COLUMNS 1 SET !LOOP 1 SET !DATASOURCE_LINE {{!LOOP}} URL GOTO={{!COL1}} SEARCH SOURCE=TXT:"my favorite energy drink" TAG POS=1 TYPE=SPAN ATTR=TXT:*<SP>Rating:<SP>Good<SP>Answer WAIT SECONDS=2 The search line seems to work, yet the tag line jumps the script back to the top of the page.
I have given an option to user to Export Images As JPG and I have stored png images So, i have created some php script to do so. png is converting fine.. but when i downloaded the jpg image and try to open in image viewer, its showing corrupted. My php code: Converting PNG to JPG $input_file = 'images/image1364926178.png'; $filename = time().'.jpg'; $output_file = 'images/'.$filename; $input = imagecreatefrompng($input_file); if($input){ list($width, $height) = getimagesize($input_file); $output = imagecreatetruecolor($width, $height); $white = imagecolorallocate($output, 255, 255, 255); image
I'm using tomcat 7 in my application. When I start the server, it shows me following warning message while startup:- May 15, 2013 11:45:10 AM org.apache.tomcat.jdbc.pool.ConnectionPool abandon WARNING: Connection has been abandoned PooledConnection[oracle.jdbc.driver.T4CConnection@d6d9b4]:java.lang.Exception at org.apache.tomcat.jdbc.pool.ConnectionPool.getThreadDump(ConnectionPool.java:1006) at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:672) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:607) at org.apache.tomcat.jdbc.po
I want slice the main windows as like this my layout code is follow: QGridLayout *gLayout = new QGridLayout (); viewWidget->setStyleSheet("background-color: #333;" ); for ( i = 0; i < m_numOfVideoWidget; i++) { QWidget *vWidget = new QWidget(viewWidget); vWidget->setSizePolicy(QSizePolicy ::Expanding , QSizePolicy ::Expanding ); videoList.append( vWidget); } index = 0; for ( j = 0; j < 4; j += 2) { gLayout->addWidget( videoList[ index++], 0, j, 2, 2); } for ( i = 2; i < 4; i++) for ( j = 0; j < 4; j++) gLayout-> addWidget( videoList[ index++], i, j); viewWidget->setLayout(gLayout ); Unfortunat
I want to create a boostrap markup definition with this image: What do I have to do that row1, row2 and row3 share the same div/column? If I would do table design then I would use a rowspan... UPDATE Bad resizing behavior with a larger window (see button) Better resizing behavior with a smaller window (see button) Thats the code: <div class="row"> <div class="span6"> <div class="row"> <div class="span3">xxxxxxxxxxxx name</div> <div class="span3"> <input type="text" class="text" /> </div> </div> <div class="row"> <div class="span3">xxxxxxxxxxxxxx from</div> <div class="span3"> <input type="text
I have looked thoroughly on the internet for an answer to this question, but it seems to be too specific for an answer anywhere else. This is my last stop. To preface, this is not a homework problem, but it is adapted from an online Coursera course, whose quiz has already passed. I got the correct answer, but it was mostly luck. Also, it is a more of a general programming question than anything related to the course, so I know for a fact that it is within my right to ask it on a public forum. The last thing is that I'm trying to do this in MatLab; however if you have an answer that is in C++ o
I have a pandas dataframe, df: c1 c2 0 10 100 1 11 110 2 12 120 How do I iterate over the rows of this dataframe? For every row, I want to access its elements (values in cells) by the name of the columns. For example: for row in df.rows: print(row['c1'], row['c2']) I found a similar question, which suggests using either of these: for date, row in df.T.iteritems(): for row in df.iterrows(): But I do not understand what the row object is and how I can work with it.
I have a class country with an arraylist that stores countries. I have created a get and set to add and get items from specified indexes from the array list but i wont work. Whenever i call an index from the arraylist i get an out of bounds exception because the array is empty or at least seems to be. public class country extends Application { public ArrayList<country> countryList = new ArrayList<country>(); public String Name; public String Code; public String ID; public country() { } public country(String name, String id, String code) { this.Name = name; this.ID = id; this.Code = code; } pub
I have some issues to download a directory though mac's terminal. On Windows: svn+ssh://[email protected]/home/netimage/svn/xxxxx.dk2 I've tried it though mac terminal via. this without luck. svn co http://xxxxxx/home/netimage/svn xxxxxx --username netimage also tried svn co http://xxxxxx/home/netimage/svn/xxxxx.dk2 --username netimage My password keyphrase is in "ssh add -K mypasswordkey.ppk" What to do?
im currently working on a c++ application which is using a c library which needs a callback implemented from my side for example the callback is defined as this: int onWrite(char *what, char *buffer, size_t size, off_t offset); i have std::set which needs to be formated and written into buffer and take care of size and offset where size is buffer's size and offset how many bytes have already been processed is there a c++ way where i can stream-like into buffer? i think about something like this: SomeSTLStandardStream stream(buffer,size); stream.ignore(offset); // to drop the first n offset byt
I'm investigating how to develop a decent web app with Python. Since I don't want some high-order structures to get in my way, my choice fell on the lightweight Flask framework. Time will tell if this was the right choice. So, now I've set up an Apache server with mod_wsgi, and my test site is running fine. However, I'd like to speed up the development routine by making the site automatically reload upon any changes in py or template files I make. I see that any changes in site's .wsgi file causes reloading (even without WSGIScriptReloading On in the apache config file), but I still have to pr
I'm working with a winforms application that is targeting .net 4.5 and I really need to inspect the UI elements. I've used Snoop to inspect wpf elements in the past, and I've come across Hawekeye as well. However, it appears hawkeye is not compatible with .net 4.5. Are there any tools out there than can give me similar results?
I already developed fully-fledged video chat application in Java with Swing but now my requirement is to make that application web based. So where to I start? Is there any hint or any tool that convert my application into web based application?
How we can handle SSL certificate errors for chrome and internet explorer with selenium web driver. When I am working with Firefox it is working fine. Could you please provide me the solution to handle SSL certificate error. Below is the code i tried. // For Chrome @Test public void CRconfiguration() throws Exception { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); System.setProperty("webdriver.chrome.driver", "D:\\Softwares\\Selenium softwares\\drivers\\chromedriver.exe"); _driver = new ChromeDriver(capabilities
I have a significant amount of data which I must analyse in Excel (this would be much easier in a DB, I realize). Each line item has a T/F indicator for it's membership in a given category and I would like to get a correlation of volume and price for each category across months. The quantity of data I am talking about is between 8-30k records at a time. We use Excel 2010 at my office Example data: State | Cat.1 | Cat.2 | Cat.3 | TimeStamp | Volume | Price WA | TRUE | FALSE | FALSE | 01/31/13 12:00 | 113.1 | 35.64 WA | TRUE | TRUE | FALSE | 01/31/13 13:00 | 65.2 | 32.52 FL | TRUE | FALSE | TRUE
I have the class Devices with Platform as one of the properties: public partial class DevicesCollection : ObservableCollection<Device> { public DevicesCollection() : base() { } } public partial class Device : INotifyPropertyChanged { private string hostIP; private string password; private int platform; private string status = ""; private int loop = 1; public Device() { } public Device(string ip, string pswd, int tp) { HostIP = ip; Password = pswd; Platform = tp; Status = "Disconnected"; Loop = 1; } As well as I have Platform class: public partial class PlatformsCollection : ObservableCollectio
I am building a web application that interact with documents for later printing. In some points is similar to Google Docs. I am considering using cm/mm on the CSS of my documents pages because it will help me on the document generation. Example: // A4 size .page { width: 210mm; height: 297mm; margin: 2cm 5cm; } <div class="page"> ... </div> What are the main issues of following this approach?
I'm wondering if there's any possible way how to use or implement SELECT query into JavaM API for GT.M database system. I'm using version 0.1, since I haven't found any other version ( https://github.com/Gadreel/javam/blob/master/README.md ). If there's no option yet, could you recommend me any other API for this DBMS, using Java? I know there's some gtm4j ( http://code.vistaehr.com/gtm4j ), but it takes advantage of springframework, which is not convenient for me. I'm new with GT.M and I just want to test, how to connect to it using Java and use some basic queries.