Daily Archives

Articles indexed Wednesday August 20 2014

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

  • Models, collections...and then what? Processes?

    - by Dan
    I'm a LAMP-stack dev who's been more on the JavaScript side the last few years and really enjoying the Model + Collection approach to data entities that BackboneJS, etc. uses. It's helped me organize my code in such a way that it is extremely portable, keeping all my properties and methods in the scope (model, collection, etc.) in which they apply. One thing that keeps bugging me though is how to organize the next level up, the 'process layer' as you might call it, that can potentially operate on instances of either models or collections or whatever else. Where should methods like find() (which returns a collection) and create() (which returns a model) reside? I know some people would put a create() in the Collection prototype, but while a collection operates on models I don't think it's exactly right to create them. And while a find() would return a collection I don't think it correct to have that action within the collection prototype itself (it should be a layer up). Can anyone offer some examples of any patterns that employ some kind of OOP-friendly 'process' layer? I'm sorry if this is a fairly well-known discussion but I'm afraid I can't seem to find the terminology to search for.

    Read the article

  • Is hashing of just "username + password" as safe as salted hashing

    - by randomA
    I want to hash "user + password". EDIT: prehashing "user" would be an improvement, so my question is also for hashing "hash(user) + password". If cross-site same user is a problem then the hashing changed to hashing "hash(serviceName + user) + password" From what I read about salted hash, using "user + password" as input to hash function will help us avoid problem with reverse hash table hacking. The same thing can be said about rainbow table. Any reason why this is not as good as salted hashing?

    Read the article

  • Where and how to reference composite MVP components?

    - by Lea Hayes
    I am learning about the MVP (Model-View-Presenter) Passive View flavour of MVC. I intend to expose events from view interfaces rather than using the observer pattern to remove explicit coupling with presenter. Context: Windows Forms / Client-Side JavaScript. I am led to believe that the MVP (or indeed MVC in general) pattern can be applied at various levels of a user interface ranging from the main "Window" to an embedded "Text Field". For instance, the model to the text field is probably just a string whereas the model to the "Window" contains application specific view state (like a persons name which resides within the contained text field). Given a more complex scenario: Documentation viewer which contains: TOC navigation pane Document view Search pane Since each of these 4 user interface items are complex and can be reused elsewhere it makes sense to design these using MVP. Given that each of these user interface items comprises of 3 components; which component should be nested? where? who instantiates them? Idea #1 - Embed View inside View from Parent View public class DocumentationViewer : Form, IDocumentationViewerView { public DocumentationViewer() { ... // Unclear as to how model and presenter are injected... TocPane = new TocPaneView(); } protected ITocPaneView TocPane { get; private set; } } Idea #2 - Embed Presenter inside View from Parent View public class DocumentationViewer : Form, IDocumentationViewerView { public DocumentationViewer() { ... // This doesn't seem like view logic... var tocPaneModel = new TocPaneModel(); var tocPaneView = new TocPaneView(); TocPane = new TocPanePresenter(tocPaneModel, tocPaneView); } protected TocPanePresenter TocPane { get; private set; } } Idea #3 - Embed View inside View from Parent Presenter public class DocumentationViewer : Form, IDocumentationViewerView { ... // Part of IDocumentationViewerView: public ITocPaneView TocPane { get; set; } } public class DocumentationViewerPresenter { public DocumentationViewerPresenter(DocumentationViewerModel model, IDocumentationViewerView view) { ... var tocPaneView = new TocPaneView(); var tocPaneModel = new TocPaneModel(model.Toc); var tocPanePresenter = new TocPanePresenter(tocPaneModel, tocPaneView); view.TocPane = tocPaneView; } } Some better idea...

    Read the article

  • Most efficient way to store this collection of moduli and remainders?

    - by Bryan
    I have a huge collection of different moduli and associated with each modulus a fairly large list of remainders. I want to store these values so that I can efficiently determine whether an integer is equivalent to any one of the remainders with respect to any of the moduli (it doesn't matter which, I just want a true/false return). I thought about storing these values as a linked-list of balanced binary trees, but I was wondering if there is a better way? EDIT Perhaps a little more detail would be helpful. As for the size of this structure, it will be holding about 10s of thousands of (prime-1) moduli and associated to each modulus will be a variable amount of remainders. Most moduli will only have one or two remainders associated to it, but a very rare few will have a couple hundred associated to it. This is part of a larger program which handles numbers with a couple thousand (decimal) digits. This program will benefit more from this table being as large as possible and being able to be searched quickly. Here's a small part of the dataset where the moduli are in parentheses and the remainders are comma separated: (46) k = 20 (58) k = 15, 44 (70) k = 57 (102) k = 36, 87 (106) k = 66 (156) k = 20, 59, 98, 137 (190) k = 11, 30, 68, 87, 125, 144, 182 (430) k = 234 (520) k = 152, 282 (576) k = 2, 11, 20, 29, 38, 47, 56, 65, 74, ...(add 9 each time), 569 I had said that the moduli were prime, but I was wrong they are each one below a prime.

    Read the article

  • The problems with Avoiding Smurf Naming classes with namespaces

    - by Daniel Koverman
    I pulled the term smurf naming from here (number 21). To save anyone not familiar the trouble, Smurf naming is the act of prefixing a bunch of related classes, variables, etc with a common prefix so you end up with "a SmurfAccountView passes a SmurfAccountDTO to the SmurfAccountController", etc. The solution I've generally heard to this is to make a smurf namespace and drop the smurf prefixes. This has generally served me well, but I'm running into two problems. I'm working with a library with a Configuration class. It could have been called WartmongerConfiguration but it's in the Wartmonger namespace, so it's just called Configuration. I likewise have a Configuration class which could be called SmurfConfiguration, but it is in the Smurf namespace so that would be redundant. There are places in my code where Smurf.Configuration appears alongside Wartmonger.Configuration and typing out fully qualified names is clunky and makes the code less readable. It would be nicer to deal with a SmurfConfiguration and (if it was my code and not a library) WartmongerConfiguration. I have a class called Service in my Smurf namespace which could have been called SmurfService. Service is a facade on top of a complex Smurf library which runs Smurf jobs. SmurfService seems like a better name because Service without the Smurf prefix is so incredibly generic. I can accept that SmurfService was already a generic, useless name and taking away smurf merely made this more apparent. But it could have been named Runner, Launcher, etc and it would still "feel better" to me as SmurfLauncher because I don't know what a Launcher does, but I know what a SmurfLauncher does. You could argue that what a Smurf.Launcher does should be just as apparent as a Smurf.SmurfLauncher, but I could see `Smurf.Launcher being some kind of class related to setup rather than a class that launches smurfs. If there is an open and shut way to deal with either of these that would be great. If not, what are some common practices to mitigate their annoyance?

    Read the article

  • I can not download anything

    - by Jason Machen
    I am very new to ubuntu but decided to wipe my windows 7 and install it. I can not download anything from the software center. This is the error message I get. I can use the web in all other ways including this site. What can I do? Thanks, Jason W:Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/source/Sources 404 Not Found [IP: 91.189.91.13 80] W:Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted Plus about 20 other lines.

    Read the article

  • Why is Lubuntu default desktop environment

    - by John
    So I just wanted to try things out on 14.04, so I did sudo apt-get install lxde sudo apt-get install lubuntu-desktop When I get to the greeter, it reads Lubuntu (Default) Lubuntu Netbook LXDE Openbox Ubuntu Why is Lubuntu default? I don't know if its because its the last thing I installed or if its because it is in alphabetical order. I'm tempted to test this theory by installing Xubuntu and see if it becomes default. I'd like it to read Ubuntu (Default) and have the Ubuntu splash instead. When I open lightdm.conf, there is no line "user-session" nor "greeter-session". They are missing. Is this normal and I have to add it manually?

    Read the article

  • m not able to connect to wifi network

    - by Broken Heart
    i had tried every code every idea every thing but i failed wiireless driver broadcom bcm43412 but when i checked pci-id it show not supported my pci id is 14e4:4365 and chip id is BCM43142 i tried edit connection myself to olso but i cannt wat to put in clone mac adress place? device mac adress is the router mac adress but what is clone mac adress i had placed my laptop mac adress in place of clone mac adress bt it doesnot work tried every thing but it not work checked additional driver by going system settings it doesnot contain any drivers,tried internet by cable then it connects then how sholud i correct this plz tell

    Read the article

  • Switching To Ubuntu 14.04 from Windows 8.1

    - by Asangam
    everyone i am newto these linux stuffs. Currently i'm a user of Windows8.1 . When windows 8 was roling out i was like i'm never going to leave and will be always stick to windows8 but now i think it's time to switch linux because being in windows forever i don't think i can do something very good .I wanted to be OpenSource :) . So i really dont have any idea about linux . For me the best distro is Ubuntu and Kubuntu offcourse the latest release . So what i'm afraid of switching to linux is its compability .The compatibility i'm talking about is with the hardware's and driver's . For eg sometime after fresh install of windows we need to install the display,usb and wifi drivers to function . For some computer or brands those driver's are hard to find and i can't even think of linux how hard are they to find if it needs installing drivers. So my main question is that do i need to install the drivers for my wifi adapters display and some other stuffs or the distro i choosed i.e Ubuntu 14.0.4 consists of those dirvers and what about the 64 and 32bit . My machines is 64bit aso do i need to install the 64bit one . I mean i know the advantages of installing the 64 bit one but like windows is it kinda hard to find softwares for the 64 bit one . Or the 32 bit is recommended . And Yes I will be highly appreciated for the answers to my questions . Thank You :)

    Read the article

  • How do I remove Skype 4.3 from Ubuntu 14.04 LTS (32-bit)

    - by Lucas W
    I installed Skype on my nephew's new Ubuntu 14.04 LTS machine, and now we've decided to remove it. But I'm not able to locate it in my Installed programs section of Ubuntu Software Center. I'm able to call it up by opening the debian package, Software Center opens it up, but where I would normally see the "Remove" button, I have a "Reinstall" button. For the life of me, I can't figure out how to uninstall Skype. Any suggestions? In case you're wondering I used the version of Skype designed for 12.xx, as there was no option available for Ubuntu 14.xx.

    Read the article

  • how to set environment variable in eric IDE

    - by ng0323
    I have no problem running a python script from the terminal, but in eric IDE, I am getting this error: ImportError libcudart.so.6.0: cannot open shared object file: No such file or directory Perhaps it's an enviroment variable that needs to be set. In eric, when I run script, I filled in the environment option as follows. I tried set PATH = usr/local/cuda-6.0/bin or PATH = /usr/local/cuda-6.0/bin or just /usr/local/cuda-6.0/bin and they all didn't work.

    Read the article

  • HP Chromebook 14 Crouton = Broken packages

    - by Robin Perry
    I'm completely new and inept with ubuntu. I've recently purchased a chromebook 14 by Hewlett-Packard and today find out how to install Crouton for it. My goal is to be able to use steam on the chromebook for small time-killing games. My issue is that no matter what kind of application I attempt to install, it always tells me it has "broken dependencies" I also tried installing debian versions of "Firefox", "Chrome", "Opera" as well as "Cave Story+" from humble bundle. I've tried to do the sudo apt-get install -f as well as loads of other commands but nothing works What can I do, I can post any specs you need and am ready to use another way to get to steam such as ChrUbuntu if my issue is unfixable

    Read the article

  • Problem running apt-get DPKG broken?

    - by nekochan7
    Problem when runing apt-get debian av # sudo dpkg --configure -a Setting up libgdata2.1-cil (2.2.0.0-2) ... mono: ../nptl/pthread_mutex_lock.c:80: __pthread_mutex_cond_lock: Assertion `mutex->__data.__owner == 0' failed. Native stacktrace: /usr/bin/mono() [0x4ac5a1] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8f0) [0x7fee2c0e88f0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7fee2bd65407] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fee2bd68508] /lib/x86_64-linux-gnu/libc.so.6(+0x2e516) [0x7fee2bd5e516] /lib/x86_64-linux-gnu/libc.so.6(+0x2e5c2) [0x7fee2bd5e5c2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113f6) [0x7fee2c0ea3f6] /lib/x86_64-linux-gnu/libpthread.so.0(pthread_cond_wait+0x150) [0x7fee2c0e5140] /usr/bin/mono() [0x6058b3] /usr/bin/mono() [0x5fdd25] /usr/bin/mono() [0x604077] /lib/x86_64-linux-gnu/libpthread.so.0(+0x80ca) [0x7fee2c0e10ca] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fee2be1605d] Debug info from gdb: ================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= Aborted mono: ../nptl/pthread_mutex_lock.c:80: __pthread_mutex_cond_lock: Assertion `mutex->__data.__owner == 0' failed. Native stacktrace: /usr/bin/mono() [0x4ac5a1] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8f0) [0x7fcec8eef8f0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7fcec8b6c407] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fcec8b6f508] /lib/x86_64-linux-gnu/libc.so.6(+0x2e516) [0x7fcec8b65516] /lib/x86_64-linux-gnu/libc.so.6(+0x2e5c2) [0x7fcec8b655c2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113f6) [0x7fcec8ef13f6] /lib/x86_64-linux-gnu/libpthread.so.0(pthread_cond_wait+0x150) [0x7fcec8eec140] /usr/bin/mono() [0x6058b3] /usr/bin/mono() [0x5fdd25] /usr/bin/mono() [0x604077] /lib/x86_64-linux-gnu/libpthread.so.0(+0x80ca) [0x7fcec8ee80ca] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fcec8c1d05d] Debug info from gdb:

    Read the article

  • Address Book Authentication

    - by Gus E
    I just upgraded to Ubuntu 14.04.1 and run Gnome Shell. I am consistently getting a pop up window prompting me for my Gmail address book authentication. The window pops up the moment I type something into gnome shell after hitting the super key. I'm assuming that Ubuntu wants to search my address book for people to include in the search. I have opened up the settings and deleted my account from the online accounts section and rebooted, nothing seems to stop the popup. Where is it getting my email address from? Most importantly, how to I stop this super annoying popup from appearing?

    Read the article

  • Cannot compile GDB7.8 with Python support

    - by j0h
    I am trying to install GDB7.8 with Python support. From the source folder, I am running ./configure --with-python When I did tab-complete from --with- I did not see Python in the list. But when I ran configure with that flag, it did not baulk. When I run make, it complains that Python is not found. checking for python2.7... no but Python is installed: $ which python python python2.7 python2.7-dbg-config python2 python2.7-dbg $ which python2.7 /usr/bin/python2.7 I compiled GDB without --with-python and things installed without error. I was under the impression that GDB7.8 had Python support without the need for special flags. But when I run: $gdb python (gdb) run test.py I get some sort of cannot import gdb Import error So then I tried calling "pi": (gdb) pi printf.py Python scripting is not supported in this copy of GDB. So... how do I get Python support in GDB7.8? is it actually not supported? Or should I not call "pi"?

    Read the article

  • Ubuntu 14.04 LTS AMD64 randomly uninstals packages / applications

    - by Jacob Lindeen
    I am having a strange issue. Occasionally when installing new packages, I will get a system crash notification which I will report. The environment then becomes unstable, unity crashes and all open windows, loose title bars, and the main launcher shuts down. I usually have to run the command unity --replace to restore functionality, but ultimately end up having to reboot. Upon booting back up I find all of my user-installed packages are gone and I have to reinstall them via apt. Please tell me someone else is having this issue, because this is the second system and third install I have had this issue on.

    Read the article

  • What is the best freeware app for Windows to mount EXT4 partitions (from a GPT 4TB Disk) as RW, safely without corrupting the EXT4 partition?

    - by Bran
    My Computer is set up as Dualboot Windows and Ubuntu. I have 1 OS drive, and 1 hard drive with a /backup partition (which has all my family photos and data) and it is ext4. Also note... it is EXT4, and it is GPT, and it is 4TB size. Anyway, Windows can not mount the /backup ext4 partition. What software/freeware do you reccomend for Windows? Preferrably looking for someone with experiance using it for a long time and not have problems with EXT4 partition which is a 4TB, GPT Disk. Thank you for your advice and guidance! Always, appreciate everyones help at askubuntu, you guys are the best. Any ideas?

    Read the article

  • No GUI after upgrading from 12.04 to 14.04.1

    - by Kalpit
    Yesterday I upgraded Ubuntu version from 12.04 to 14.04 from update manager. After upgrading it, my system got automatically restarted and now I am not able to switch to GUI mode. Its showing me command prompt mode only. I have tried ctrl + alt + f7 & sudo apt-get install Ubuntu-desktop And all but its not responding. I am newbie in Ubuntu so I don't have much idea that what's going wrong with it. How can I switch to GUI mode now.

    Read the article

  • Volume control keyboard shortcuts not working in 14.04?

    - by user295481
    I run Ubuntu 14.04 on a Sony Vaio CS series laptop. Normally, the volume is controlled by pressing Funcion+F2, F3, and F4 for mute, volume down, and volume up respectively. I accidentally reassigned the volume up keyboard shortcut to a different key. I tried resetting the keyboard shortcut by going into the keyboard shortcuts editor in Ubuntu and pressing Function+F4, but that didn't work. My mute function and my volume down functions both work flawlessly, but volume up doesn't work at all. Please don't answer telling me to change the keyboard shortcut in the Keyboard Shortcuts manager, as I have already tried that. Thanks for your help!

    Read the article

  • Problem with the installation of VirtualBox

    - by Antonis Grigoriadis
    I am trying to install virtualbox and make it work but it doesn't seem I can. In the image you can seem the output. If I run VBoxManage --version I get: WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this problem is fixed. 4.3.10_Ubuntur93012 But virtualbox-dkms is already installed and at the latest version. So I tried to reinstall it and i got this: Any help will be appreciated. EDIT: The output after reconfigure (@M.Tarun suggestion): EDIT 2: Also installed the sources as @Hmayag instructed, purged virtualbox and installed it again but I got the same problem.

    Read the article

  • Automatically revert to laptop screen when external monitor unplugged

    - by Ryan
    I regularly use an external monitor with my laptop, so when I use it, I usually have the laptop screen disabled when the monitor is connected, and this seems to cause problems when the monitor is disconnected. If the monitor is connected while the laptop screen is disabled, I can't get the X session to show up at all: I can Ctrl+Alt+F1 to open a terminal, and that works fine.. ..but Ctrl+Alt+F7 does nothing. The display is blank, and stays blank. The same thing happens whether I put the computer to sleep with the monitor connected, or if I disconnect while the computer is still awake. Rebooting the computer fixes the issue, as does killing Xorg and starting it again, but both of those are sub-optimal since I lose my current session. I'm currently using the open source graphics driver (xserver-xorg-video-ati). This question looks like it might answer my question, but unfortunately hwinfo is no longer available in the apt repository. Is there a way with current tools to automatically detect when the external monitor is disconnected and switch to the laptop display?

    Read the article

  • Architecture - 32-bit handling 64-bit instructions

    - by tkoomzaaskz
    tomasz@tomasz-lenovo-ideapad-Y530:~$ lscpu Architecture: i686 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 23 Stepping: 6 CPU MHz: 2000.000 BogoMIPS: 4000.12 Cache L1d: 32K Cache L1i: 32K Cache L2: 3072K I can see that my architecture is 32-bit (i686). But CPU op-mode(s) are 32-bit and 64-bit. The question is: how come? How is it handled that a 32-bit processor performs 64-bit operations? I guess it's a lot slower than native 32-bit operations. Is it built-in processor functionality (to emulate being 64-bit) or is it software dependent? When does it make sense for a 32-bit processor to run 64-bit operations?

    Read the article

  • What is the keyboard shortcut to minimise a window to launcher in unity?

    - by uzi3k
    In 10.10 that I was using before 12.04 you could use alt+F9 to minimise a window to the task bar. In 12.04 meta+ctrl+ cursor up down maximises and unmaximises a window. If you have a numeric keypad you can use ctrl+alt+0 to minimise to launcher. On my netbook I don't have a numeric keypad and the normal numbers do not work with the above shortcut. How can I minimise windows with a keyboard shortcut?

    Read the article

  • pages still show up in google search even after disallowed in robots.txt [duplicate]

    - by Jota Onasys
    This question already has an answer here: With Robots.txt disallow all, why was my site still getting traffic? 5 answers Why is it that some pages still show up in google search even though disallowed in robots.txt? Is the best solution here to remove the Disallow from Robots.txt and just add noindex, nofollow meta tag to those pages you want blocked? Or should I submit a request to Google directly to remove those pages?

    Read the article

  • Making own clothes website [on hold]

    - by Manjushree
    I am BSc student in Mathematics but i would like to create own clothes website. Can anyone help me how can i design the clothes website. I never have any background knowledge about making the webpage online. The clothes website does not have to look professional but simple enough where i can put my clothes to show the items to people or customers. Once I created the clothes website then i can open the business account and starting selling the goods online with that account. Do i need to buy any domains to create the website? Please help me?

    Read the article

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