Daily Archives

Articles indexed Saturday May 31 2014

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

  • JButton Image Ignoring GridBagConstraints

    - by daemor
    I am working on an application and have a screen that needs to have elements (namely some custom JButtons) appear and disappear based on a user selection. However for some reason, when I add these buttons to their pane, the buttton image goes to the top corner, and leaves the text in the center, completely ignoring GridBagConstraints. I am completely stumped on this one as I have done this same exact thing dozens of times earlier in the program without any issues. Here is an image of the problem: The problem is in this method here, and occurs down towards the bottom. public void init(){ contentPane.removeAll(); // Setup jlabels JLabel countyLabel = new JLabel("County"); countyLabel.setFont(new Font("Times New Roman", Font.PLAIN, 18)); JLabel measureByLabel = new JLabel("Measure By: "); measureByLabel.setFont(new Font("Times New Roman", Font.PLAIN, 18)); String[] countyChoices = {"Washtenaw", "Oakland", "Livingston"}; // setup components JComboBox<String> countyCombo = new JComboBox<String>(countyChoices); // place baseComponents c.weightx = 0.5; c.weighty = 0.5; c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.NORTH; contentPane.add(countyLabel, c); c.gridx = 2; contentPane.add(countyCombo, c); c.gridy = 1; c.gridx = 0; contentPane.add(trenchButton, c); c.gridx = 2; contentPane.add(bedButton, c); c.gridy = 2; c.gridx = 1; contentPane.add(systemSelection, c); c.gridy = 3; c.gridx = 0; contentPane.add(lengthButton, c); c.fill = GridBagConstraints.BOTH; c.gridwidth = 4; c.gridy = 4; c.gridx = 0; contentPane.add(choicePane, c); GridBagConstraints con = new GridBagConstraints(); con.weightx = 0.5; con.weighty = 0.5; con.gridx = 0; con.gridy = 0; choicePane.add(lengthButton, c); // revalidate and repaint choicePane.revalidate(); choicePane.repaint(); contentPane.revalidate(); contentPane.repaint(); } I have tried doing this in separate methods, the button looks fine when added to the contentPane, the pane is for sure set to gridbagconstraints as I used the expression JPanel choicePane = new JPanel(new GridBagLayout()) to initialize it.

    Read the article

  • Basic Steps in reading Excel files into matlab

    - by user3693727
    >> [NUM,TXT,RAW]=xlsread('C:\Users\Lincoln Wachn\Google Drive\Summer time\Book1') ??? Error using ==> xlsread at 219 XLSREAD unable to open file C:\Users\Lincoln Wachn\Google Drive\Summer time\Book1. File C:\Users\Lincoln Wachn\Google Drive\Summer time\Book1.xls not found. This is the error that I have received when I try to read a simple Excel file into MATLAB. This is a snapshot of the spreadsheet I would like to load in. Could guide me the basic know-how to extract these data? I have looked through the other questions pertaining to reading Excel files into MATLAB, but I am still very confused. I ultimately wish to extract the file below for my project using the same method. The second image shows the data I have to extract which I could not do. Its file type seems to be different, it is comma separated values file which is not xls. Hence, I am also confuse about whether different file type prevents extraction of data. Thanks you for helping(:

    Read the article

  • match elements from two files, how to write the intended format to a new file

    - by user2489612
    I am trying to update my text file by matching the first column to another updated file's first column, after match it, it will update the old file. Here is my old file: Name Chr Pos ind1 in2 in3 ind4 foot 1 5 aa bb cc ford 3 9 bb cc 00 fake 3 13 dd ee ff fool 1 5 ee ff gg fork 1 3 ff gg ee Here is the new file: Name Chr Pos foot 1 5 fool 2 5 fork 2 6 ford 3 9 fake 3 13 The updated file will be like: Name Chr Pos ind1 in2 in3 ind4 foot 1 5 aa bb cc fool 2 5 ee ff gg fork 2 6 ff gg ee ford 3 9 bb cc 00 fake 3 13 dd ee ff Here is my code: #!/usr/bin/env python import sys inputfile_1 = sys.argv[1] inputfile_2 = sys.argv[2] outputfile = sys.argv[3] inputfile1 = open(inputfile_1, 'r') inputfile2 = open(inputfile_2, 'r') outputfile = open(outputfile, 'w') ind = inputfile1.readlines() cm = inputfile2.readlines()[1:] outputfile.write(ind[0]) #add header for i in ind: i = i.split() for j in cm: j = j.split() if j[0] == i[0]: outputfile.writelines(j[0:3] + i[3:]) inputfile1.close() inputfile2.close() outputfile.close() When I ran it, it returned a single column rather than the format i wanted, any suggestions? Thanks!

    Read the article

  • Writing different structs to a file in C++? [on hold]

    - by user58053
    I need a way to write structures of three different kinds to a binary file, which later has to be searched. (As in, for example, struct A has two fields, an int and a char; struct B has int and a long; I need to output all structures whose int equals the one given from keyboard). I understand how to write structs of the same kind to a file and how to search them, but here I am just lost, best thing I came up with is declaring a struct containing all possibly needed fields and leaving the ones I don't need empty, but it really feels wrong, there HAS to be a better way to do that. I've read about binary files and could not find anything relevant, most examples and tutorials deal with writing one data type. Could anyone point me in the right direction? EDIT: I am looking for what @Jerry_coffin called database mode, and will probably use one of the existing database systems for that, best way to go, probably. Thank you everybody for the suggestions

    Read the article

  • Why trigger query fails in the sqlite with Qt?

    - by dexterous_stranger
    I am a beginner in the SQL. I am using SQLite, Qt - on embedded systems. I want to put a trigger here. The trigger is that whenever the primary key Id is greater than 32145, then channelNum=101 should be set. I want to set the attrib name - text also, but I got the compilation issue. I believe that the setting of trigger is the part of DDL - Data definition language. Please let me know that if I am wrong here. Here is my create db code. I get the sql query error. Also please do suggest how to set the text attrib = "COmedy". /** associate db with query **/ QSqlQuery query ( m_demo_db ); /** Foreign keys are disabled by default in sqlite **/ /** Here is the pragma to turn them on first **/ query.exec("PRAGMA foreign_keys = ON;"); if ( false == query.exec()) { qDebug()<<"Pragma failed"; } /** Create Table for storing user preference LCN for DTT **/ qDebug()<<"Create Table postcode.db"; query.prepare(" CREATE TABLE dttServiceList (Id INTEGER PRIMARY KEY, attrib varchar(20), channelNum integer )" ); if ( false == query.exec()) { qDebug()<<"Create dttServiceList table failed"; } /** Try placing trigger here **/ triggerQuery = "CREATE TRIGGER upd_check BEFORE INSERT ON dttServiceList \ FOR EACH ROW \ BEGIN \ IF Id > 32145 THEN SET channelNum=101; \ END IF; \ END; "; query.prepare(triggerQuery); if ( false == query.exec()) { qDebug()<<"Trigger failed !!"; qDebug() << query.lastError(); } Also, how to set the text name in the trigger - I want to SET attrib = "Comedy".

    Read the article

  • Installing SSL certs with nginx on Amazon EC2

    - by Ethan
    I finally got a cert from an authority and am struggling to get things working. I've created the appropriate combined certificate (personal + intermediate + root) and nginx is pointing to it. I got an elastic IP and connected it to my EC2 instance. My DNS records point to that IP. But when I point the browser to the hostname, I get the standard "Connection Untrusted" bit, with ssl_error_bad_cert_domain. Port 443 is open - I can get to the site over https if I ignore the warning. Weird thing is, under technical details, it lists the domain I tried to access as valid! When I try and diagnose with ssl testing sites, they don't even detect a certificate! What am I missing here? domain is yanlj.coinculture.info. Note I've got coinculture.info running on a home server without a dedicated IP and have the same problem, but I'll be moving that to the same EC2 instance as soon as I figure this thing out. I thought the elastic IP would solve things but it hasn't

    Read the article

  • Is it possible to limit output bandwidth between eth0 and lo?

    - by mmcbro
    I'm trying to limit the bandwidth between my eth0 output (nginx proxy) to my loopback inteface (apache) by filtering on destination port. Incoming Packet -> Eth0 -> 0.0.0.0:80 Nginx -> tc qdisc class/iptable mangle 2525port -> 127.0.0.1:2525 Apache I don't know if it's even possible I'm just experimenting. My rules are the followings : tc qdisc add dev eth0 root handle 1:0 htb tc class add dev eth0 parent 1:0 classid 1:10 htb rate 2mbps ceil 2mbps prio 0 tc filter add dev eth0 parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10 iptables -A OUTPUT -t mangle -p tcp --dport 2525 -j MARK --set-mark 10 I also tried to with FORWARD chain but its still the same.

    Read the article

  • Apache server doesn't create directory or file under www-data user [duplicate]

    - by Harkonnen
    This question already has an answer here: What permissions should my website files/folders have on a Linux webserver? 4 answers very newbie to Apache here I installed Apache 2.4 on my Arch server where I installed newznab (a newsgroups indexer). I have noticed that all files newznab needs to create are created under my login user, and not apache default user (www-data). I read here that it's bad security practice to allow www-data to write files. I agree. But as an apache newbie, I would like to know where (in the httpd.conf I suppose ?) the user allowed to write files can be configured, because I want another account to be allowed to write files instead of my main account.

    Read the article

  • Laravel Forge SSH on windows not recognized

    - by alysdal
    I decided to try out the Laravel Forge, but I'm having trouble with the SSH keys. I use digitalocean.com for the VMs and have used SSH keys with success many times before. However when I paste my public key into Forge (which adds it to the server) I'm not able to connect to it. I use Putty and I get the following error: Disconnected: No supported authentication methods available (server sent: publickey) Key was generated using puttygen and was added to pageant. I have tried using the very same key files as my other VM and tried creating a new one, but all without luck. I'm hoping someone can help me out here. Edit: here is my putty log http://pastebin.com/ZGmm8Mcv

    Read the article

  • Mac OSX DHCP Stopped Working [on hold]

    - by Jesse James Richard
    Tethering a Raspberry PI to a MacBook (Mavericks) via ethernet is proving to be a real pain. This worked for about a day. My MacBook required a rare reboot and once it came back up the Pi won't get an address. I've confirmed it's not a problem with the Pi. It's a problem with the MacBook for sure. It's basically just stopped giving out IPs. I've read as much as I've found about how to fix this friggin' problem, but I've thus far come up blank. Internet sharing Wi-fi Ethernet enabled, and/or Edited /etc/bootpd.plist as described here (http://www.jacquesf.com/2011/04/mac-os-x-dhcp-server/ - this worked initially and now no longer does) Pi connected directly to the router has no problems. My MacBook DHCP server will no longer give out addresses. Any help would be much appreciated.

    Read the article

  • where are user name and pasword saved in windows native vpn connection?

    - by Tîrêj
    I am using time freeze program but I can not save my free vpn user name and pasword. Since user name and pasword changed daily I have to unfreeze change pasword then freeze again. In the time freeze there is option to excusing file and folder. if I find the location of vpn setting that save the user name and pasword, I will have ability to use without unfreezing and re freezing. There is a location with path %userprofile%\AppData\Roaming\Microsoft\Network\Connections\Pbk\ that contain vpn configurations except user name and password. I need the location that store user name and password.

    Read the article

  • gtk2/mate apps are choppy on debian testing [migrated]

    - by b0ti
    I have recently upgraded to a core-i7 system and now all the apps from mate (GTK2 based) are very slow. Basically when I switch to a workspace that has a couple mate-terminals open, they are redrawn as if these were sent over the network. GTK3 apps and firefox work properly and are refreshed instantly. I'm running Debian testing. I have tried to reinstall xorg and related packages and everything seems to work fine except for this. Here is my xorg.log. Any hints?

    Read the article

  • Apache resolves all URLs to default

    - by Ariel
    I am using Apache 2.2 on a Debian-based distro. For some reason, all URLs are directed to the default index. No error or anything. That means: example.domain.com goes to domain.com. "example" can be just anything. In the default Vhost file (/etc/apache2/sites-available/default) I've added: ServerName: www.domain.com But it still keeps that odd behaviour. Please let me know how to enable the common, default behaviour. I haven't changed anything by the way, this is since installation. Update: Following SvW's answer, I am looking for a way to force Apache not to accept any URL, only those specified as VirtualHosts.

    Read the article

  • How to disable password change for openldap user?

    - by Keve
    Considering possible solutions for some improvements I run into this theoretical question and I couldn't find a satisfying answer. Some of you may have first-hand experience with this in practice, so here the question goes: How can I disable password changing for an OpenLDAP user? The account must stay enabled, allowed to log on to workstations and work as usual, but should not be able to change its own password. Can this be done? If so, how difficult is it to implement it? All suggestions are appreciated! For reference: Servers and workstations are to run a mixture of FreeBSD and OpenBSD. Accounts to get password disabled are student or generic workstation accounts. Environment is a school.

    Read the article

  • Mimicking Google's Persistent Disks -- Is this a logical FreeBSD disaster recovery strategy?

    - by Casey Jordan
    I am looking into FreeBSD to provide a more comprehensive backup and disaster recovery strategy for database servers. Ideally I want to mimic what google is doing with "Persistent disks" https://developers.google.com/compute/docs/disks#snapshots I am hoping someone who knows more about FreeBSD can validate these ideas/questions: I have read that FreeBSD can take instant disk snapshots, therefore if our databases trigger a consistent state (Block all writes, and flush buffers to disk), I would assume I could take snapshots every hour without service interruption for more than a few seconds. Is this true? Is there a way to take snapshots and back them up offsite easily? Can this be done incrementally as to save how much disk space is actually used? If a rollback needed to be done, how long does this typically take? Is a rollback also instantaneous? Thanks!

    Read the article

  • Why does my SQL Server use AWE memory? and why is this not visible in RAMMap?

    - by Marnix Klooster
    We have a Windows Server 2008 R2 (64-bit) 8GB server where, according to Sysinternals RAMMap, 2GB of memory is allocated using AWE. As far as I understood, this means that these pages stay in physical memory and are never pushed out. This causes other apps to be pushed out of physical memory. In RAMMap, on the Physical Pages tab, the Process column is empty for all of the AWE pages. We run SQL Server on that box, but (through SQL Server Management Studio, under Server Properties - Memory, under Server memory options) it says is configured not to use AWE. However, when stopping SQL Server, the AWE pages are suddenly gone. So it really is the culprit. So I have three questions: Why does RAMMap not know/show that a SQL Server process is responsible for that AWE memory? Why does SQL Server Management Studio say that AWE memory is not used? How do we make configure SQL Server to really not use AWE memory?

    Read the article

  • Why does an ampersand in URL cause failure of some command in Mac OS X Terminal?

    - by congliu
    Why does an ampersand in URL cause failure of the following command? I want to open a web page by running Safari in Terminal, placing the URL as an argument. This works as expected: open -a safari "http://endic.naver.com/search.nhn?sLn=en&searchOption=all&query=good" But once the quotes being removed, it wouldn't work as expected: open -a safari http://endic.naver.com/search.nhn?sLn=en&searchOption=all&query=good Instead, it returns: [3] 5395 [4] 5396 [1] Done open -a safari http://endic.naver.com/search.nhn?sLn=en [2] Done searchOption=all Seems like ampersand in the URL was treated as "running previous command in the background", though there is no space following the ampersand in the URL.

    Read the article

  • WD my cloud 4th is Super Slow

    - by Saduser
    I am using a WD my cloud 4Tb and I have read other posts about users complaining about getting only 10Mb per second. My problem is that I am getting about 100kb/s to transfer a 125gb iPhoto library. Estimated time is 11 days to transfer this file. This is unacceptable. On the back of the WD cloud I am getting a solid green light and from what I read this means that I am on a gigabyte network. I have mac book pro running Mac OS Mavericks. I have tried 4 different cables and turned off my router firewall. I don't run anti-virus nor any firewall on the mac. Other things I have checked: direct connection to both router and WD cloud device. Tried wireless but it is even slower. Previously I was able to transfer a 55Gb iPhoto library in 14 hours which I felt was acceptable. I figured it would take approximately double the time to transfer the 125gb file but 11 days is ridiculous. Any other suggestions? Anything else I can check (how to check it) what is the bottle neck?

    Read the article

  • Windows 8.1 reset

    - by CreeperInATardis
    I recently had a massive crash on my Windows 8.1 partition, which has rendered it (practically) unusable. I tried to do a refresh, but the problem is, I have a Windows 8 install disk, not 8.1, and thus it didn't work. I also do not have any system restore points/backups of any sort, but I have managed to move my files off. Also, I do not know where my product key is (and cannot find it online), so a clean reinstall would not work. My question is, is there any way to change my Windows 8 disc into an 8.1 disc to allow me to refresh/reset my PC, or is there any other way to do this (aside from repurchasing?) Thanks!

    Read the article

  • Cannot "add to address book" in thunderbird on mac. Know a workaround?

    - by Arthur
    Runing TB 24.5.0 on Mac 10.8.5. I configure TB so that File-"Use Mac OS X Address Book" is not selected. Can open Address Book and see addresses in "COllected Addresses" & create New contact there. But in TB cannot "add to address book". I click on star to right of email address or ctrl-click correspondent and "add to address book". Nothing happens. But correspondent should be added to (some) address book. This is a major inconvenience because I use the address book to distinguish between junk mail from people who I do not know and good mail from people who I do know. Currently the only way for me to add anybody to the address book is to do so by hand, one at a time in "collected addresses". I welcome any work around that would let me add somebody to an address book with a single click. Thanks

    Read the article

  • Synergy: avoid single machine loop when client is not connected

    - by petobens
    In order to loop between my screens I have the following section in my synergy.sgc file: section: links Pedro-Acer: right = pedro-lubuntu left = pedro-lubuntu pedro-lubuntu: left = Pedro-Acer right = Pedro-Acer end With those settings When the client disconnects the server screen wraps around itself as seen in the image below. I don't want this behavior. The only reason I set the config file to loop between my screens is because I want to have a single key to switch between them: keystroke(alt+`) = switchInDirection(right) If there is way to have a single key for switching in both directions without having looping screens then that would also solve my problem.

    Read the article

  • Git workflow for two tight-knit projects

    - by Pioul
    Two very similar projects I'm maintaining an online Markdown editor using Git as RCS (and accessorily made available on GitHub). From this web app, I've created a Chrome app: the code is the same, aside from some Chrome technicalities. I care about open sourcing these two projects. Still, the Chrome app's code being the same as the web app's except for some dull details, I've first chosen to (1) not publish the Chrome app on GitHub, and (2) not use Git to manage its code. Instead, I would manually review the web app's commits, then replicate the few changes in the Chrome app. … slightly drifting apart However, I've decided to add a feature to the Chrome app only. So, even though both codebases will remain broadly similar, they'll be diverging enough to make me reconsider the rationale behind my initial decision to not version control nor share the Chrome app's source code. Since I'm now willing to use Git to version control both apps, and that I want to share both of them on GitHub, how should I go about it? Should I use two different repositories, or one repo with two long-running branches? What would be the pros and cons of each approach in that context? What would be the easiest/fastest way to regularly "import" commits from the web app to the Chrome app, since the web app is going to remain the master branch? Is cherry-picking the only solution?

    Read the article

  • SSHing thru an HTTP proxy

    - by Siler
    Typical scenario: I'm trying to SSH thru a corporate HTTP proxy to a remote machine using corkscrew, and I get: ssh_exchange_identification: Connection closed by remote host Obviously, there's a lot of reasons this might be happening - the proxy might not allow this, the remote box might not be running sshd, etc. So, I tried to tunnel manually via telnet: $ telnet proxy.evilcorporation.com 82 Trying XX.XX.XX.XX... Connected to proxy.evilcorporation.com. Escape character is '^]'. CONNECT myremotehost.com:22 HTTP/1.1 HTTP/1.1 200 Connection established So, unless I'm mistaken... it looks like the connection is working. So, why then, doesn't it work via corkscrew? ssh -vvv [email protected] -p 22 -o "ProxyCommand corkscrew proxy.evilcorporation.com 82 myremotehost.com 22" OpenSSH_6.6, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Executing proxy command: exec corkscrew proxy.evilcorporation.com 82 myremotehost.com 22 debug1: permanently_set_uid: 0/0 debug1: permanently_drop_suid: 0 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 debug1: identity file /root/.ssh/id_ecdsa type -1 debug1: identity file /root/.ssh/id_ecdsa-cert type -1 debug1: identity file /root/.ssh/id_ed25519 type -1 debug1: identity file /root/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.6p1 Ubuntu-2ubuntu1 ssh_exchange_identification: Connection closed by remote host

    Read the article

  • How can I find the USB wireless adapter into the dmesg log file?

    - by AndreaNobili
    I am pretty new in Linux (RaspBian for RaspBerry Pi but I think that there are not difference) and I have to install an USB wireless network adapter (the product is the TP-Link TL-WN725N, this one: http://www.tp-link.it/products/details/?model=TL-WN725N ) Now, I think that this is not automatically recognized by my system because if I execute ifconfig command I obtain the following output: pi@raspberrypi ~ $ ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:2a:9f:b0 inet addr:192.168.1.8 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:475 errors:0 dropped:0 overruns:0 frame:0 TX packets:424 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:34195 (33.3 KiB) TX bytes:89578 (87.4 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) So now it see only my ethernet network interface and not the wireless. So I was thinkig to try to see into the dmesg, but I don't know what have I to see and how to select it into the dmesg output. For example by the following command I can see the line of the dmesg log file relate to my ethernet port: pi@raspberrypi ~ $ cat /var/log/dmesg |grep -i eth [ 3.177620] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:2a:9f:b0 [ 18.030389] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup [ 19.642167] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1 But what can I try to search for the USB wireless adapter? Tnx

    Read the article

  • Windows 7 product key, which is the valid one - in registry or on a sticker?

    - by me how
    I am not too familiar with the software licensing and how this all works, but I have a question regarding Windows 7 and partially Office - generally Microsoft products. I have been asked to assist our IT guy who wants to collect all the product IDs for Windows 7 and Office. I haven't been given much details how to go about it and how to collect it. After a bit of research I have decided to use a freeware that pulls the software licenses out of the registry. I thought that was the easiest and would provide the most accurate product IDs. I've used Belrac Avisor to obtain all the informations. It turns out that about 25 machines use the same product key. I have asked if the company has bought a commercial license or something but there isn't anyone available at the moment who could answer my question. I have told the IT guy that there are 25 machines using the same product key and asked if that is alright. He told me to go around and write the product keys from the sticker(label) on each machine. I am just not quite sure if that's the right approach specially that the numbers do not match.... So, now I see that the numbers aren't matching and my question is in terms of software licensing which is the VALID and correct product key to provide if ever questioned about software license? Is it the number on the sticker or is it the number stored in the registry?

    Read the article

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