Daily Archives

Articles indexed Sunday October 14 2012

Page 8/13 | < Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Detect duplicate in a subset from a set of elements

    - by Abhinav Shrivastava
    I have a set of numbers say : 1 1 2 8 5 6 6 7 8 8 4 2... I want to detect the duplicate element in subsets(of given size say k) of the above numbers... For example : Consider the increasing subsets(for example consider k=3) Subset 1 :{1,1,2} Subset 2 :{1,2,8} Subset 3 :{2,8,5} Subset 4 :{8,5,6} Subset 5 :{5,6,6} Subset 6 :{6,6,7} .... .... So my algorithm should detect that subset 1,5,6 contains duplicates.. My approach : 1)Copy the 1st k elements to a temporary array(vector) 2) using #include file in C++ STL...using unique() I would determine if there's any change in size of vector.. Any other clue how to approach this problem..

    Read the article

  • Returning a mock object from a mock object

    - by Songo
    I'm trying to return an object when mocking a parser class. This is the test code using PHPUnit 3.7 //set up the result object that I want to be returned from the call to parse method $parserResult= new ParserResult(); $parserResult->setSegment('some string'); //set up the stub Parser object $stubParser=$this->getMock('Parser'); $stubParser->expects($this->any()) ->method('parse') ->will($this->returnValue($parserResult)); //injecting the stub to my client class $fileHeaderParser= new FileWriter($stubParser); $output=$fileParser->writeStringToFile(); Inside my writeStringToFile() method I'm using $parserResult like this: writeStringToFile(){ //Some code... $parserResult=$parser->parse(); $segment=$parserResult->getSegment();//that's why I set the segment in the test. } Should I mock ParserResult in the first place, so that the mock returns a mock? Is it good design for mocks to return mocks? Is there a better approach to do this all?!

    Read the article

  • Help to understand the abstract factory pattern

    - by Chobeat
    I'm learning the 23 design patterns of the GoF. I think I've found a way to understand and simplify how the Abstract Factory works but I would like to know if this is a correct assumption or if I am wrong. What I want to know is if we can see the result of the Abstract Factory method as a matrix of possible products where there's a Product for every "Concrete Factory" x "AbstractProduct" where the Concrete Factory is a single implementation among the implementations of an AbstractFactory and an AbstractProduct is an interface among the interfaces to create Products. Is this correct or am I missing something?

    Read the article

  • What are the differences between Special Edition and the Third Edition of Stroustrup's The C++ Programming Language?

    - by TheBlueCat
    I'm buying a few C++ books after moving from Java. I obviously want to read the reference manual from the man himself, though I cannot tell the difference between these two editions. The special edition is ten pages shorter than the third edition. However, the special edition is recommended over the third edition and it seems this version covers the ASCII standard when the other edition does not. Can anyone shed a bit of light on this?

    Read the article

  • Would Using a PHP Framework Be Beneficial in My Context?

    - by Fractal
    I've just started work at a small start-up company who mainly uses PHP to develop their front-end apps. I had no prior PHP experience before joining, and this has led to my apps becoming large pieces of spaghetti code. I essentially started by adding code to implement an initial feature, and then continued to hack in more code to implement further features – without much thought for the overall design. The apps themselves output XML to render on small mobile devices. I recently started looking into frameworks that I could use. I reckon an advantage would be that they seem to force developers to modularise their programs using good-practice design patterns. This seems great for someone in my position. The extra functions they provide, for example: interfacing with databases in such a way as to make SQL injection impossible, would be very useful too. The downside I can see is that there will be a lot of overhead for me in terms of the time taken to learn the framework itself (while still getting to grips with PHP itself). I'm also worried that it will be overkill for the scale of the apps we develop. They tend to be programs that interface with a fairly simple back-end DB, and will generate about 5 different XML screens. Probably around 1 or 2 thousand lines of code. The time it takes just to configure the frameworks may not be worth it. The final problem I can see is that developers in the company – who have to go over my code, and who do not know the PHP framework I may use – will have a much harder time understanding it. Given those pros and cons, I'm still not sure on what the best course of action will be; so any advice will be greatly appreciated.

    Read the article

  • Typical text encoding+BOM, and EOL behavior on mobile devices

    - by Dan W
    Typical things to worry about when dealing with text are the BOM/signature, encoding, and the end of line (EOL) char/chars. I know that Windows often favours \r\n (CR+LF) and Mac/Linux favours \n (LF), but how about mobile devices such as the iPhone and Android? Do typical apps on those platforms favour one or the other? Also, which text encodings are mobiles most likely to use - UTF-8, iso-8859-1, or even Windows 1252 (or other default codepage) or maybe even UTF-16? And if they use UTF-8/16, are they likely to need (or require not having) a BOM/signature? What is the typical behavior here?

    Read the article

  • How ad retargeting works?

    - by Bojan Babic
    Recently, I read that Facebook ads are moving towards retargeting and got interested deeper into subject. Essentially, retargeting is technique advertisers use that tracks purchase intent by putting cookies into your browser and when you visit another website within ad network you will see ad for item you "wanted to buy". In order this to for, both publisher and advertiser need to work together. Publisher needs add couple of lines of javascript and publisher need to be able to read this info across sites. In most cases, javascript inserts iframe from adnetwork domain. Iframe script sets cookies for both host domain and remote adnetwork domain. However, Same Origin policy do not let iframes read/set content from parent domain. Is there something I'm missing here? Can someone explain how this technique actually works?

    Read the article

  • What percentage of software developers work solo?

    - by JMather
    I'm trying to put together some ideas for a talk, and one of the things that occurred to me, is if there's any documentation or research into how many programmers work as the lone developer within their team. I think this is an important distinction because individual developers (and perhaps small team developers) end up having to wear many more hats than developers part of a large developer group. It could give us some better insight to career development and transition tactics, as well. I've tried some generally googling, and wasn't able to turn up anything, so I'm hoping maybe someone has seen (or studied) something related to this. Thanks in advance!

    Read the article

  • How can I build this payment receipt/booking application?

    - by Festus
    I'm planning to build a payment receipt/booking application for a media company with several branches in different locations. The application should be able to move data across the network/internet to a central database where the administrator/accountant in a different location will be able to see the result of the entire job for the day from each branch. Application will run on windows environment. Will be able to send result of the booking to a Point Of Sales printer for print output. Now, I'm confused about choosing the right programming language to accomplish this task. I'm between beginner/intermediate level in PHP, I know HTML/CSS and JavaScript. I have tried to do this in PHP but, I'm face with several challenges and I fear for the POS part since PHP application run on the web browser. I don't know if python will be best suited for this and how long will it take someone with my experience level to pick up python. Any suggestion will be highly appreciated.

    Read the article

  • Where to download Broadcom STA .deb file?

    - by Argusvision
    Situation: I don't have wireless access through Ubuntu due to needing the Broadcom STA driver for my wireless card. I don't currently have access to a physical (cabled) connection that will allow my Ubuntu machine access. (Security reasons, no unidentified machines.) Where can I download a .deb file for the Broadcom STA driver? I'm not asking how to install through jockey-gtk (the "Additional Drivers" menu option) or through Synaptic. Thank you in advance for any assistance.

    Read the article

  • GNU GRUB version 1.99-21ubuntu3 with windows installer

    - by fwrlfo
    I have this problem after damage I think hit the OS GNU GRUB version 1.99-21ubuntu3 Minimal bash-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions. I read the thread that was posted before but I don't have an ubuntu cd because I used "windows installer" ..... please don't tell me to uninstall it and install it again because I have important files and I don't want to lose. please help

    Read the article

  • How can I get a 1920x1080 resolution?

    - by Sam T.
    I a newbie Linux and have just installed Ubuntu in a dual boot with Windows 7. I love the interface of Ubuntu but unfortunately I can only get a 800x600 or 1024x728 resolution with black bars all around the screen. I have an nVidia GTX 570 graphics card and an Asus 1080p 23" monitor. What may be of note is that I had to use the nomodeset command on installation of the boot would get stuck at a line with "nouveau", which I understand is to do with the drivers. Additionally, when I type in xrandr to the terminal, it comes up with the error message "failed to get size of gamma for output default". I guess what I am looking for here is someone who could explain to me really simply the steps I have to take to get a full 1080p resolution, at which point I am sure i will become a great fan of the OS! Thanks in advance, Sam T.

    Read the article

  • How to make Firefox windows style less space consuming?

    - by chocobai
    Firefox takes up so much space on small screens, so I'm searching for solutions that make firefox' interface less space consuming on ubuntu 12.04 with gnome3. Good examples are the chromium-style, but chromium is kind of slow in gnome3. Chromium does it, firefox on osx does it. Is this also possible on ubuntu via a custom modification or something? Here a screenshot of what I am thinking about: Firefox on OSX: https://wiki.mozilla.org/images/5/50/Firefox-4-Mockup-i06-%28OSX%29-%28TabsTop%29-%28Persona%29.png Thanks for your help.

    Read the article

  • Make middle-click close window(s) on unity launcher

    - by humanityANDpeace
    I am looking for a way to achieve this on my 12.04 ubuntu system: Clicking with the middle mouse button on one of the unity launcher icons will close the related windows/programs. At present a middle-button-click causes (when possible) another instance of the same programme to start. There is nothing wrong with that, only I use this less often than I need a quick way to close some programs. The current way is a lengthy 2-click way. Right-click on the icon Select "quit" in the unity-setting in the ccsm (compiz config settings manager) some few things can be changed in the ubuntu unity plugin already. there are other reporst about settings being done in dconf and gconf. What chances are there to tweak the behavior as described above? In Firefox I am used to close tabs by "middle-clicking" on the tabs. In GLX/Cairo-dock I also associate "middle-click" with the close the program. When using ubuntu unity launcher I keep on mistakingly opening new windows, when indeed I wanna close the respective window(s). :(

    Read the article

  • Failed to download repository information in update manager

    - by user95092
    Details W:Failed to fetch *http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu/dists/precise/main/source/Sources 404 Not Found , W:Failed to fetch *http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu/dists/precise/main/binary-amd64/Packages 404 Not Found , W:Failed to fetch *http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found , E:Some index files failed to download. They have been ignored, or old ones used instead. Whats causing this and how to fix it? Ty Regards

    Read the article

  • Unity not running on startup

    - by Dan
    OK, so Firefox was running extremely slow, I ran it in safe mode and still slow, so I rebooted and when she came back on, I wasn't at the regular Unity login, it was like a classic Windows login (where I had to enter my username and password manually, not a list of users). I logged in and only my desktop was visible (with icons and my wallpaper). Nothing else. I was able to open a terminal with Ctrl+ Alt+T and typed... sudo unity ...which got it up (albeit with the default icons on the launcher ex. I had unlocked Libre Office and it was back). In "Startup Applications..." there was absolutely nothing at all... This happens every time I reboot. Thunderbird de-synced from my Gmail but Pidgin is still connected. When I do Ctrl+Alt+L it locks the screen as normal, but I have no option to switch user. I have the only account on this computer but I cannot access the main login screen to get to my Guest account. I'm not very Ubuntu-savy, but it's pretty clear that I'm starting in some sort of safemode. I am on a fresh install of Ubuntu 12.04.1 LTS (just installed it last night).

    Read the article

  • Is it possible to update my graphic card drivers?

    - by madmaxpt
    This is what the lspci -v command shows in the VGA compatible controller section: 00:02.0 VGA compatible controller: Intel Corporation Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller (prog-if 00 [VGA controller]) Subsystem: Dell Device 048e Flags: bus master, fast devsel, latency 0, IRQ 44 Memory at f0200000 (32-bit, non-prefetchable) [size=512K] I/O ports at 18d0 [size=8] Memory at d0000000 (32-bit, prefetchable) [size=256M] Memory at f0000000 (32-bit, non-prefetchable) [size=1M] Expansion ROM at <unassigned> [disabled] Capabilities: <access denied> Kernel driver in use: i915 Kernel modules: i915 i915 is only compatible with OpenGL 1.4 and cannot use shaders and I'd like to use some Open GL 2.0 functionalities. Is it possible to update the drivers or is my hardware limited to OpenGL 1.4 ?

    Read the article

  • Bluetooth not working on an Alienware m14x r2

    - by S. L.
    on my alienware m14x r2 laptop with ubuntu 12.04.1 x64, the bluetooth interface is not working. WLAN works fine. I have a dualboot install with ubuntu & win 7 on this laptop. In win 7, the bluetooth interface works fine, because its all activated in BIOS. I have the killer wireless-n 1202 a/g/n interface with integrated bluetooth 4.0 in this laptop. Here is some code : sudo rfkill list 0: phy0: Wireless LAN Soft blocked: no Hard blocked: no lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 003: ID 064e:8128 Suyin Corp. Bus 002 Device 003: ID 0cf3:3004 Atheros Communications, Inc. Bus 002 Device 004: ID 187c:0521 Alienware Corporation dmesg | grep "Bluetooth" [ 2.590377] Bluetooth: Core ver 2.16 [ 2.590395] Bluetooth: HCI device and connection manager initialized [ 2.590397] Bluetooth: HCI socket layer initialized [ 2.590399] Bluetooth: L2CAP socket layer initialized [ 2.590403] Bluetooth: SCO socket layer initialized [ 2.591518] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 2.591519] Bluetooth: BNEP filters: protocol multicast [ 2.599411] Bluetooth: RFCOMM TTY layer initialized [ 2.599415] Bluetooth: RFCOMM socket layer initialized [ 2.599416] Bluetooth: RFCOMM ver 1.11 [ 2.696552] Bluetooth: Generic Bluetooth USB driver ver 0.6 [ 2.696751] Bluetooth: Atheros AR30xx firmware driver ver 1.0 [ 2.702607] Bluetooth: Configuration file not found ar3k/ramps_0x11020000_40.dfu [ 2.702609] Bluetooth: Loading sysconfig file failed Any ideas to fix that problem ?

    Read the article

  • Samba folder is gone

    - by bioShark
    I seem to have some issues sharing folders from my Ubuntu 12.04 machine to a Win7 machine. After playing around with the settings, I decided to revert to Samba's original setting by reinstalling it: sudo apt-get purge samba sudo rm -rf /etc/samba/ /etc/default/samba sudo apt-get install samba just to be sure I also run: sudo apt-get install samba samba-common system-config-samba winbind Now, I can't find /etc/samba folder any more. Even when I try to share a folder through Nautilus, I get: Samba's testparm returned error 1: Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf": No such file or directory Error loading services. Same when I try to list: xxx@xxx:~$ ll /etc/samba ls: cannot access /etc/samba: No such file or directory Any ideas what I did wrong, or what other package am I missing? cheers

    Read the article

  • DVD-drive detected by BIOS and UEFI but not by Ubuntu 12.04

    - by user97591
    I have build a new tower containing; Asrock Z77 extreme4 (motherboard) Core i7 (processor) Hitachi LGE-DMGH 12 L (B) GH15F SATA (SATA DVD-drive) Problem is; BIOS and UEFI has no problems detecting the DVD-drive but it is not detected by Ubuntu 12.04. It is not present in /etc/fstab or /etc/mtab. Below is the contents of fstab and mtab. Thanks for all your help. fstab: # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=f007bc60-da4c-4f36-99a7-77083c5f3654 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=5d59949c-aed9-442a-877d-5abf1ccaadc3 none swap sw 0 0 mtab: /dev/sda1 / ext4 rw,errors=remount-ro 0 0 proc /proc proc rw,noexec,nosuid,nodev 0 0 sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0 none /sys/fs/fuse/connections fusectl rw 0 0 none /sys/kernel/debug debugfs rw 0 0 none /sys/kernel/security securityfs rw 0 0 udev /dev devtmpfs rw,mode=0755 0 0 devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0 tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0 none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0 none /run/shm tmpfs rw,nosuid,nodev 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0 gvfs-fuse-daemon /home/tom/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=tom 0 0

    Read the article

  • How can I set the date format to my country setting?

    - by Jamina Meissner
    I am German, but I use only English software. Hence, I am also using English Ubuntu. It's not because I don't know how to install German Ubuntu. It's because I prefer to work with English software environment. However, I would like to keep date & time format in German format, just as I use a German keyboard layout in English Ubuntu. I can set the time format to 24h time. But how can I set the date format to German time format? It is irritating for me to have the day number before the time numbers: In other words, instead of "Oct 14 15:16" I want it to display "14 Okt" or (if only English language is available) "14 Oct 15:16" or "14th Oct 15:16". At least, the number of the day should be displayed before the month. In Windows, it was no problem to choose time/date/currency settings according to a chosen country. Where can I do this in Ubuntu? The best would be if I could freely enter the date/time format myself with variables (DD.MM hh.mm.ss etc). I found answers for Ubuntu 11.04, but not for Ubuntu 12.04. I am using Ubuntu 12.04, 64-bit. Keep in mind that I am a beginner. So I'd like to be able to do this via GUI, if possible. EDIT: I found the answer in a forum. Go to System Settings... and choose Language Support. There are two tabs, Language and Reginal Formats. You are by default on the Language tab. On the Language tab, click Install / Remove Languages. A window with a list of languages opens. Mark the language(s) you want to add for your time/date/currency format. Click Apply Changes. Ubuntu will now download and install the additional language files, as well as help files of other applications in this language. So don't be irritated. When Ubuntu has finished applying the changes, switch to Regional Formats tab. (Do not change the Language for menus and windows on the Language tab if you only want to change the date/time/unit format). There you can choose from the dropdown list the language for your preferred format for date/time/currency/unit. Log out and log in again to have the changes take effect.

    Read the article

  • Logitech K260 keyboard responds very, very slow

    - by Pierre
    I bought a Logitech K260 wireless keyboard/mouse combination and connected it to my Ubuntu 12.04 workstation. The mouse seems to work fine for now, it is quick and is working quite smoothly. The keyboard however is very, very slow. It takes about two to three seconds for a character to appear after being typed. What might be the problem? I have found even a review of someone who states that he's gaming with this keyboard, which I am not planning to do, for me it will serve as a writing keyboard only as soon as it works properly. Who might be able to help?

    Read the article

  • Question No 207630 replied by Marco Braida

    - by kishor
    Question No 207630 replied by Marco Braid After your reply I could install Synaptic,then AptonCD,Gdebi and some other applications. I had made APTONCD. I was convienced that Ubuntu 12.04 LTS is working well. I had removed everything ( Ubuntu 12.04,Fuduntu,Linix mint 13) from my hard disk and reinstalled Ubuntu 12.04 LTS. Your sugestion which worked well earlier does not work now. I get following msg on terminal. Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: gdebi-core The following NEW packages will be installed: gdebi gdebi-core 0 upgraded, 2 newly installed, 0 to remove and 411 not upgraded. Need to get 0 B/185 kB of archives. After this operation, 1,398 kB of additional disk space will be used. Do you want to continue [Y/n]? y Media change: please insert the disc labeled 'APTonCD for ubuntu precise - amd64 (2012-10-14 10:27) DVD1' in the drive '/media/cdrom/' and press enter Media change: please insert the disc labeled 'APTonCD for ubuntu precise - amd64 (2012-10-14 10:27) DVD1' in the drive '/media/cdrom/' and press enter Media change: please insert the disc labeled 'APTonCD for ubuntu precise - amd64 (2012-10-14 10:27) DVD1' in the drive '/media/cdrom/' and press enter This is for gdebi similar msg is on terminal when I tried for Synaptic and AptonCD. I had downloaded files for Synaptic and treid but without susscess. Kishor

    Read the article

  • Migrating a Windows Server to Ubuntu Server to provide Samba, AFP and Roaming Profiles

    - by Dan
    I'm replacing our old Windows XP Pro office server with a HP Microserver running Ubuntu Server 12.04 LTS. I'm not a Linux expert but I can find my way around a terminal prompt, I'm a Mac user by choice. The office use a mix of Windows XP Pro machines and OSX Lion laptops. I included Samba during installation, and I'm planning on using Netatalk for the AFP and Bonjour sharing. I'd quite like to have samba make the server appear in 'My network places' on the Windows machines the way Bonjour makes it appear in finder on the Macs, if this is possible? I want to get to a point so that a user logging into Windows, gets connected to the Ubuntu server (do they need an Ubuntu user account?) which get them their shares and their Windows user profile (though a standard profile across users would do). The upshot is to make centralised control of user accounts (e.g. If a person leaves, killing their account on the server stops their Windows logon and ability to access Samba shares) and to ensure files aren't stored on the individual machines for backup/security purposes. I want to make this as simple as possible, so don't want to have loads of stuff I don't need, I just can't figure out: What I need at the server end: - will Samba be enough (already installed as part of initial installation), or will I need to cock around with LDAP (and how does this interact with Samba) - For someone of moderate Linux competence like me, is there a package that offers easy admin of user accounts, e.g. a GUI like phpLDAPadmin (if LDAP is necessary) How to configure the XP machines: - do I need to have the XP machines set up as a domain controller (I've no idea, really) - roaming profiles looks to offer the feature of putting the user's files on the server rather than the machine itself along with a profile that follows the user from machine to machine. Syncing Mac user's home folders with the server This is less of a concern because I can set up Time Machine if it comes to it, but I'd appreciate any recommendations of what approach I should take having the Mac home folders synced to the server.

    Read the article

  • Failed GRUB after 10.04 to 12.04 upgrade in system with LVM

    - by Vagelis L
    I am using Ubuntu Server as a SMB server at work and two days ago I have tried to upgrade it to 12.04. After reboot, I got this grub_xput missing grub rescue> and all attempts to start from this prompt failed (missing components, although grub directory is normally set as prefix). My system sits and boots on an LVM (soft raid-5). I have read almost all posts in many forums, tried grub rescue, boot-repair, ubuntu-secure-remix with boot-repair but without positive result. This is the log of my last (and best so far) attempt to fix this system. Any suggestions? Please help.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >