Daily Archives

Articles indexed Thursday May 31 2012

Page 16/18 | < Previous Page | 12 13 14 15 16 17 18  | Next Page >

  • What design pattern do you use to support graceful fallback on old platforms?

    - by JoJo
    Let's say I need to add a drop shadow behind a box. Some old platforms do not support drop shadows, so I have to fake it by putting an image behind the box. Here's the pseudo code of how I'm currently handling this fallback: if (dropShadowsAreSupported) { box.addDropShadow("black"); } else { box.putImageBehindIt("gaussianBlur.png"); } Is this the right way to handle it? It seems too amateur to me. Is there a better design pattern?

    Read the article

  • Efficient Bus Loading

    - by System Down
    This is something I did for a bus travel company a long time ago, and I was never happy with the results. I was thinking about that old project recently and thought I'd revisit that problem. Problem: Bus travel company has several buses with different passenger capacities (e.g. 15 50-passenger buses, 25 30-passenger buses ... etc). They specialized in offering transportation to very large groups (300+ passengers per group). Since each group needs to travel together they needed to manage their fleet efficiently to reduce waste. For instance, 88 passengers are better served by three 30-passenger buses (2 empty seats) than by two 50-passenger buses (12 empty seats). Another example, 75 passengers would be better served by one 50-passenger bus and one 30-passenger bus, a mix of types. What's a good algorithm to do this?

    Read the article

  • When using method chaining, do I reuse the object or create one?

    - by MainMa
    When using method chaining like: var car = new Car().OfBrand(Brand.Ford).OfModel(12345).PaintedIn(Color.Silver).Create(); there may be two approaches: Reuse the same object, like this: public Car PaintedIn(Color color) { this.Color = color; return this; } Create a new object of type Car at every step, like this: public Car PaintedIn(Color color) { var car = new Car(this); // Clone the current object. car.Color = color; // Assign the values to the clone, not the original object. return car; } Is the first one wrong or it's rather a personal choice of the developer? I believe that he first approach may quickly cause the intuitive/misleading code. Example: // Create a car with neither color, nor model. var mercedes = new Car().OfBrand(Brand.MercedesBenz).PaintedIn(NeutralColor); // Create several cars based on the neutral car. var yellowCar = mercedes.PaintedIn(Color.Yellow).Create(); var specificModel = mercedes.OfModel(99).Create(); // Would `specificModel` car be yellow or of neutral color? How would you guess that if // `yellowCar` were in a separate method called somewhere else in code? Any thoughts?

    Read the article

  • What happens if we serialize and deserialize two objects which references to each other?

    - by Seregwethrin
    To make it more clear, this is a quick example: class A implements Serializable { public B b; } class B implements Serializable { public A a; } A a = new A(); B b = new B(); a.b = b; b.a = a; So what happens if we serialize a and b objects into a file and deserialize from that file? I thought we get 4 objects, 2 of each. Identical objects but different instances. But I'm not sure if there's anything else or is it right or wrong. If any technology needed to answer, please think based on Java. Thank you.

    Read the article

  • when should a database table be broken into multiple tables with relations?

    - by GSto
    I have an application that needs to store client data, and part of that is some data about their employer as well. Assuming that a client can only have one employer, and that the chance of people having identical employer data is slim to none, which schema would make more sense to use? Schema 1 Client Table: ------------------- id int name varchar(255), email varchar(255), address varchar(255), city varchar(255), state char(2), zip varchar(16), employer_name varchar(255), employer_phone varchar(255), employer_address varchar(255), employer_city varchar(255), employer_state char(2), employer_zip varchar(16) **Schema 2** Client Table ------------------ id int name varchar(255), email varchar(255), address varchar(255), city varchar(255), state char(2), zip varchar(16), Employer Table --------------------- id int name varchar(255), phone varchar(255), address varchar(255), city varchar(255), state char(2), zip varchar(16) patient_id int Part of me thinks that since are clearly two different 'objects' in the real world, seperating them out into two different tables makes sense. However, since a client will always have an employer, I'm also not seeing any real benefits to seperating them out, and it would make querying data about clients more complex. Is there any benefit / reason for creating two tables in a situation like this one instead of one?

    Read the article

  • Online Code Editor [closed]

    - by Velvet Ghost
    The major online IDEs are hosted on the service provider's server. Examples are Kodingen, Cloud9, ShiftEdit. Hence they would be unavailable if the external server was down for some reason, and I prefer to do my computing on my own computer anyway. Does anyone know of an online IDE or editor (preferably just an editor - a simple implementation of the Ace or CodeMirror JS editors) which can be downloaded and run on localhost (on a local LAMP server)? I've found two so far - Eclipse Orion and Wiode, but I don't like either of them very much, and I'm looking for alternatives. Also suitable are browser extensions which run natively on the browser (offline) without going to some external site. An example would be SourceKit for Chrom(e/ium).

    Read the article

  • Project management without experience

    - by Raven13
    I'm a web developer who is part of a three-man team that has been tasked with a rather large and complex development project. Other than some direction and impetus from management, we're pretty much on our own to develop the new website. None of us have any project management experience nor do my two coworkers seem like they would be interested in taking on that role, so I feel like it's up to me to implement some kind of structure to the development process in order to avoid issues down the road. My question is: what can I do as a developer without project managment experience to ensure that our project gets developed successfully and avoid the pitfalls of developing a project without a plan?

    Read the article

  • File system with chained clusters

    - by Maki Maki
    I'm trying to create school file system with partitions on disks, every partition has its cluster for her representation. typedef unsigned long ClusterNo; const unsigned long ClusterSize = 2048; int x, y ;//x ,y are entries for two-chained lists of clusters if (endOfFile<maxsize// { ... { pointer = KernelFS::searchFreeCluster(partitionPointer->letter) " How can I initialize the beginning for two clusters, their pointers to be 32 bits?

    Read the article

  • to upgrade / install wine 1.55 on ubuntu 12.04 or any distro

    - by user67550
    Wine news and installation 1.5.5 on ubuntu Now available in PPA wine version 1.55, an application that lets Windows programs run on any distribution with GNU / Linux. Wine (recursive acronym in English for Wine Is Not an Emulator, which means "Wine Is Not an Emulator") is a reimplementation of the application programming interface for Win16 and Win32 operating systems based on Unix. Allows execution of programs designed for MS-DOS and Microsoft Windows Version 3.11, 95, 98, Me, NT, 2000, XP, Vista and 7 The name was originally an acronym Wine Windows Emulator. This meaning was later changed to the current recursive acronym. These are some of the highlights: Support for the installation of Mono as a complement to wine in the package. The dither pattern brushes in the motor DIB. Support to install the runtime. NET 4.0. D3dx9 DDS files supported. Several bug fixes. To install on Ubuntu just open the console and type: sudo add-apt-repository ppa: ubuntu-wine/ppa sudo apt-get update sudo apt-get install wine1.5 Source: ubuntutips If you enjoyed this post share it with your friends, thanks

    Read the article

  • MySQL Workbench will not open on my Ubuntu 12.04

    - by Voidcode
    I have install mysql-workbench version 5.2.38+dfsg-3 via Ubuntu Software Center on my Ubuntu 12.04 laptop for some week ago, This work fine until now! Now when I press in the mysql-workbench icon in the Unity lanuncher, It just start opening and then nothing happens :( If I try start it via the terminal: I get this: http://paste.ubuntu.com/1004428/ UPDATE: I can open it via: sudo mysql-workbench But then is can save my passwords.. it says: voidcode@voidcode-Aspire-5750:~$ sudo mysql-workbench [sudo] password for voidcode: ** Message: Gnome keyring daemon seems to not be available. Stored passwords will be lost once quit Ready.

    Read the article

  • How long to wait before Humble Bundle games appear in Software Centre?

    - by Synesso
    At software-center.ubuntu.com it says Thank you for downloading your Humble Bundle games from the Ubuntu Software Center Notes: As these games have been recently added to Ubuntu Software Center it might take a minute for them to appear. If you see a "Not found" message, Ubuntu Software Center is working in the background to update the list of available apps. When I click on a link, the software centre opens and it says There isn’t a software package called “swordandsworcery” in your current software sources. I have waited for about 30 minutes now. I have also executed sudo apt-get update & restarted software centre to no avail. Do I keep waiting?

    Read the article

  • Cannot install ia32-libs

    - by Marcos Junior
    I don't know why I can't install ia32-libs. It claims for a dependency that cannot be found on repos. junior@mediacenter:~$ sudo apt-get install ia32-libs Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: ia32-libs : Depends: ia32-libs-multiarch E: Unable to correct problems, you have held broken packages. junior@mediacenter:~$ sudo apt-get install ia32-libs-multiarch Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: ia32-libs-multiarch:i386 : Depends: gstreamer0.10-plugins-good:i386 but it is not going to be installed Depends: gtk2-engines:i386 but it is not going to be installed Depends: gtk2-engines-murrine:i386 but it is not going to be installed Depends: gtk2-engines-pixbuf:i386 but it is not going to be installed Depends: gtk2-engines-oxygen:i386 but it is not going to be installed Depends: ibus-gtk:i386 but it is not going to be installed Depends: libcanberra-gtk-module:i386 but it is not going to be installed Depends: libcurl3:i386 but it is not going to be installed Depends: libgail-common:i386 but it is not going to be installed Depends: libglapi-mesa:i386 but it is not going to be installed Depends: libglu1-mesa:i386 but it is not going to be installed Depends: libgtk2.0-0:i386 but it is not going to be installed Depends: libqt4-opengl:i386 but it is not going to be installed Depends: librsvg2-common:i386 but it is not going to be installed Recommends: libgl1-mesa-glx:i386 but it is not going to be installed Recommends: libgl1-mesa-dri:i386 but it is not going to be installed E: Unable to correct problems, you have held broken packages. Running ubuntu Precise: junior@mediacenter:~$ uname -a Linux mediacenter 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux Synaptic fix broken package does nothing. Any tips?? Thanks I need this package to install other apps like teamviewer7.

    Read the article

  • Wireless not working with a Compaq Presario CQ57

    - by X I V
    This is the first time I installed ubuntu. I first installed 11.04 then upgraded. When I installed 11.04, the wireless card was detected and the driver was installed instantly. Everything worked so far. The thing is that as soon as I upgraded to 12.04, it stopped working. I've tried several solutions from all of the internet but nothing seems to work. What can I do? I really don't know much about ubuntu.

    Read the article

  • Ubuntu server upgrade 11.04 to 11.10 fails

    - by DLosc
    I'm actually trying to upgrade my Ubuntu 11.04 server to 12.04, but I have to go through 11.10 first, right? Well, do-release-upgrade is failing miserably. Here are some representative screenshots: Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 And finally... Yeah. I found this question, which appears to have similar errors, but I've tried all of the suggestions given there and nothing has changed. I tried running apt-get dist-upgrade; it churned for a while and eventually came back with "Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?" Ran apt-get update and got much the same kinds of error messages I got from do-release-upgrade. Any ideas/suggestions/solutions? Should I try downloading & upgrading from the CD instead? I'm glad to provide any further information I've forgotten.

    Read the article

  • Can I resize my partitions?

    - by Tim
    Following is a screenshot of my current partitions shown by gparted Note that the partitions on the right of /dev/sda3, without labels on them in the figure, are /dev/sda6 (for /home), /dev/sda7 (for /), unallocated, and /dev/sda5 (for swap), from left to right, form altogether the primary partition /dev/sda4. I would like to resize the partitions, such that some unused space from /dev/sda7 (for /) and the small unallocated space can be moved to /dev/sda3 (for /windows-d) and make it larger. If it is possible, I wonder how to do that? Thanks and regards!

    Read the article

  • package update in ubuntu on vitual box

    - by Ayusman
    while following one of the tutorials I needed to install a curl package. Here are my system configuration: Virtualbox 4.1 on Windows 7 64 bit. I have installed ubuntu 12.04 on the virtual box. When I try the following: sudo apt-get install curl I see the following errors: [sudo] password for userMe: Reading package lists... Done Building dependency tree Reading state information... Done Package curl is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'curl' has no installation candidate userMe@userMe-ubuntu:~$ When I try the same on a direct installation of ubuntu on a laptop (not a virtual machine) there is no problem. I am assuming this may be because of network settings. Please note that my work PC is in a corporate network and uses auto proxy settings (using a .pac file) for internet access etc. Any help will be appreciated.

    Read the article

  • passwordless ssh not working

    - by kuurious
    I've tried to setup a password-less ssh b/w A to B and B to A as well. Generated the public and private key using ssh-keygen -trsa on both the machines. Used the ssh-copy-id utility to copy the public-keys from A to B as well as B to A. The passwordless ssh works from A to B but not from B to A. I've checked the permissions of the ~/ssh/ folder and seems to be normal. A's .ssh folder permissions: -rw------- 1 root root 13530 2011-07-26 23:00 known_hosts -rw------- 1 root root 403 2011-07-27 00:35 id_rsa.pub -rw------- 1 root root 1675 2011-07-27 00:35 id_rsa -rw------- 1 root root 799 2011-07-27 00:37 authorized_keys drwxrwx--- 70 root root 4096 2011-07-27 00:37 .. drwx------ 2 root root 4096 2011-07-27 00:38 . B's .ssh folder permissions: -rw------- 1 root root 884 2011-07-07 13:15 known_hosts -rw-r--r-- 1 root root 396 2011-07-27 00:15 id_rsa.pub -rw------- 1 root root 1675 2011-07-27 00:15 id_rsa -rw------- 1 root root 2545 2011-07-27 00:36 authorized_keys drwxr-xr-x 8 root root 4096 2011-07-06 19:44 .. drwx------ 2 root root 4096 2011-07-27 00:15 . A is an ubuntu 10.04 (OpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009) B is a debian machine (OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007) From A: #ssh B works fine. From B: #ssh -vvv A ... ... debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /root/.ssh/identity ((nil)) debug2: key: /root/.ssh/id_rsa (0x7f1581f23a50) debug2: key: /root/.ssh/id_dsa ((nil)) debug3: Wrote 64 bytes for a total of 1127 debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred gssapi-keyex,gssapi-with-mic,gssapi,publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/identity debug3: no such identity: /root/.ssh/identity debug1: Offering public key: /root/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug3: Wrote 368 bytes for a total of 1495 debug1: Authentications that can continue: publickey,password debug1: Trying private key: /root/.ssh/id_dsa debug3: no such identity: /root/.ssh/id_dsa debug2: we did not send a packet, disable method debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: password [email protected]'s password: Which essentially means it's not authenticating using the file /root/id_rsa. I ran the ssh-add command in both the machines as well. The authentication part of /etc/ssh/sshd_config file is # Authentication: LoginGraceTime 120 PermitRootLogin yes StrictModes yes RSAAuthentication yes PubkeyAuthentication yes #AuthorizedKeysFile %h/.ssh/authorized_keys # Don't read the user's ~/.rhosts and ~/.shosts files I'm running out of ideas. Any help would be appreciated.

    Read the article

  • Which, among the humble indie bundle V games, work on 10.04?

    - by daithib8
    Inevitably, I've coughed up for the latest Humble Bundle, containing 5 games: Amnesia, Bastion, Limbo, Psychonauts and Superbrothers: Sword and Sorcery. At the download page it says download for ubuntu but after that it transpired (after much head scratching) that the three games it lists "are not available for your version of ubuntu". The other two, Bastion and Psychonauts "will appear on the page soon", but until then does anybody think they might work? I don't want to to be disappointed after downloading a 4gb file, causing me to reminisce on childhood memories of loading 8-bit tape games for 45 minutes only to find out that you had to reload them once you died after 30 seconds in.

    Read the article

  • Ubuntu slows down even after cpu-intensive process is ended

    - by Matt2
    After a Skype video call, or the use of virtualbox, Ubuntu slows down to a crawl, even after the process is ended. Running htop reveals that processes that used little CPU before are now all using about 30% cpu (namely Compiz, Firefox, Python, and Skype, but I'm sure there are others), to the point where all my cores are at 99%. All I can do from here is restart. Any idea why this is happpening? I'm running Ubuntu 12.04 64-bit on 3.7 GiB of memory, Intel® Core™ i3 CPU M 330 @ 2.13GHz × 4, VESA: M92 graphics driver. Not sure why I'm running VESA, I installed fglrx, but I suppose that's a different question. Thanks in advance!

    Read the article

  • ATI Radeon HD 4650 AGP Video card not recognized properly

    - by PastorLarry
    I have an ASUS ATI Radeon HD 4650 AGP in this system (yeah, I know how old it is). I've been on Ubuntu since 10.04, and the system has never properly recognized the card. I have always had the VESA drivers installed. Now that I have the time to address the problem, 12.04 was listing the card as "Unknown" under the System Settings. Meanwhile, Sysinfo recognizes the card as: Advanced Micro Devices [AMD] nee ATI RV730 Pro AGP [Radeon HD 4600 Series] (prog-if 00 [VGA controller]) Subsystem: ASUSTeK Computer Inc. Device 0028 So I know that this card should be using the radeon driver (or even the radeonhd driver). However, when I installed the mesa-utils package, the card is suddenly reported as: Gallium 0.4 on llvmpipe (LLVM 0x300) So now, I'm completely at a loss. It seems that the llvmpipe stuff has to do with OpenGL, but it still appears that I don't have the proper video driver installed. That being said, anyone know what I can do to force the system to recognize the card and use the radeon driver? [EDIT 05.28] I did look at some other information, including glxinfo and a couple of other commands (it was REALLY late, so I don't remember the other commands) and I got these: glxinfo | grep vendor: server glx vendor string: SGI client glx vendor string: Mesa Project and SGI OpenGL vendor string: X.org glxinfo | grep renderer: OpenGL renderer string: Gallium 0.4 on AMD RV730 One of the other commands gave a whole lot of info and near the end stated that the activation string for the radeon driver was "modprobe radeon". I've tried that from sudo and as root, but it doesn't seem to change anything. I'm at a complete loss. I've even added the xorg-edgers ppa to my Software Sources and updated and rebooted the system, but nothing has changed. Most of all, I can't seem to find any documentation on this issue, as it seems that it's assumed that the radeon driver will install automatically, no questions asked. I feel like such a newbie. Does anyone have any ideas on this? [edit 05.28] results of lsmod | grep radeon (in a more readable format than the comment below): radeon 733693 3 ttm 65344 1 radeon drm_kms_helper 45466 1 radeon drm 197692 5 radeon,ttm,drm_kms_helper i2c_algo_bit 13199 1 radeon [edit 05.29] This is my /etc/X11/xorg.conf: Section "ServerLayout" Identifier "aticonfig Layout" Screen 0 "aticonfig-Screen[0]-0" 0 0 EndSection Section "Module" EndSection Section "Monitor" Identifier "aticonfig-Monitor[0]-0" Option "VendorName" "ATI Proprietary Driver" Option "ModelName" "Generic Autodetecting Monitor" Option "DPMS" "true" EndSection Section "Device" Identifier "aticonfig-Device[0]-0" Driver "fglrx" BusID "PCI:1:0:0" EndSection Section "Screen" Identifier "aticonfig-Screen[0]-0" So here is my question. Can I simply change the name of the driver in the device section to "radeon" instead of "fglrx" and have the radeon driver work? Or is ther a way to use this as a tmeplate and change the appropriate lines and activate the radeon driver through this file?

    Read the article

  • TX 1000 Nvidia driver problem

    - by Marduk
    Hello i installed the news ubuntu the other day and istalled all the drivers and then restart the laptop. then i get the login screen with no problem then when i login the black screen in about 10 mins a window popup saying that the application compiz has closed unexpectedly i relunch the app. and then it happens again. i have uninstalled nvidia driver then restarted and the OS works fine.. tryed older driver and still the same problem. anyone out there can help would be great.

    Read the article

  • can't get past the login screen

    - by Greg
    Using a brand-new install to a usb stick of 12.04 lts installed by Universal USB Installer 1.8.9.8. I log in as "ubuntu" with a blank password, the console appears for a second or two with text scrolling past and then it returns to the login page. I've used the same usb stick on several computers with the same results, so it doesn't appear to be a hardware/driver issue. I have not tried installing to the hard drive, because I wanted to try it out first.

    Read the article

  • Linux installation on Acer Aspire One D270

    - by ronnie
    I was planning to buy Acer Aspire One D270 within a few days and as everybody installs linux on their netbook I was also planning to do that. Now, my question is how is Acer's hardware compatibility with linux and specifically in respect to the new Acer Aspire One D270. Has anybody tried installing linux on these new netbooks. It will be a great help if a D270 user can share his/her experience with linux usage. I read on some forums that there is some linux driver issue with Intel GMA 3600 and that people are not able to adjust their brightness. So, as I am a linux noob is this a major issue or not. Specs: RAM : 2Gb DDR3 Processor: Intel N2600(Cedar Trail) Graphics: Intel GMA 3600 HardDisk: 320Gb 5400 rpm

    Read the article

  • Can't Log in to Lubuntu 12.04 X Server

    - by isomorphismes
    As of rebooting yesterday I can't login as myself to the X server part of 64-bit Lubuntu 12.04. Same problem as Can not get passed the login screen but that solution didn't work for me. Troubleshooting steps I already took: I can log in as guest (with whatever window manager) to the graphic (X) view of Lubuntu. log in as myself into a virtual terminal. (In fact I'm writing this from w3m for that reason.) So I know my password is correct and that most aspects of the system are working. One of the top google results for "can't log into lubuntu" mentioned a disk-full problem on netbooks; I don't have that problem. Let me know if I need to paste any messages or config files to make this question clearer and I'll do so. $ ls -l /home total 12 drwxr-xr-x 99 me me 12288 May 26 14:16 me $ ls -ld /tmp drwxrwxrwt 16 root root 4096 May 26 15:46 /tmp

    Read the article

  • How do I mount an HP Touchpad (Cyanogen Mod 9)?

    - by C.Werthschulte
    I've recently installed Cyanogen Mod 9 on my HP Touchpad tablet, but I'm encountering problems when trying to access it from my Ubuntu laptop (Ubuntu 11.10, Gnome-Shell, Nautilus). I've first tried accessing it via PTP as suggested here. Ubuntu will recognize the Touchpad as a digicam and only grant me access to two directories: "DCIM" and "Pictures". I then tried accessing the tablet via MTP using this post on OMGUbuntu!. Ubuntu will connect to the tablet, but only grant me access to a folder named "Playlists". I'm a bit clueless as to what I'm doing wrong and would very much appreciate any help or hints. Many thanks!

    Read the article

< Previous Page | 12 13 14 15 16 17 18  | Next Page >