Daily Archives

Articles indexed Wednesday June 4 2014

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

  • Javascript Implementation Patterns for Server-side MVC Websites

    - by tmo256
    I'm looking for information on common patterns for initializing and executing Javascript page by page in a "traditional" server-side MVC website architecture. A few months ago, my development team began, but abandoned, a major re-architecture of our company's primary web app, including a full front-end redesign. In the process, there was some debate about the architecture of the Javascript in the current version of the site, and whether it fit into a clear, modern design pattern. Now I've returned to the process of overhauling the front end of this and several other MVC websites (Ruby on Rails and MVC.net) to implement a responsive framework (Bootstrap), and in the process will again need to review then revamp and update a lot of Javascript. These web applications are NOT single-page Javascript applications (in fact, we are ripping out a lot of Ajax) or designed to require a Javascript MVC pattern; these apps are basically brochure, catalog and administrative sites that follow a server-side MVC pattern. The vast majority of the Javascript required is behavioral, pre-built plugins (JQuery and Bootstrap, et al) that execute on specific DOM nodes. I'm going to give a very brief (as brief as I can be) run-down of the current architecture only in order to illustrate the scope and type of paradigm I'm talking about. Hopefully, it will help you understand the nature of the patterns I'm looking for, but I'm not looking for commentary on the specifics of this code. What I've done in the past is relatively straight-forward and easy to maintain, but, as mentioned above, some of the other developers don't like the current architecture. Currently, on document ready, I execute whatever global Javascript needs to occur on every page, and then call a page-specific init function to initialize node-specific functionality, retrieving the init method from a JS object. On each page load, something like this will happen: $(document).ready(function(){ $('header').menuAction(); App.pages.executePage('home','show'); //dynamic from framework request object }); And the main App javascript is like App = { usefulGlobalVar: 0, pages: { executePage: function(action, controller) { // if exists, App.pages[action][controller].init() }, home: { show: { init: function() { $('#tabs').tabs(); //et. al }, normalizeName: function() { // dom-specific utility function that // doesn't require a full-blown component/class/module } }, edit: ... }, user_profile: ... } } Any common features and functionality requiring modularization or compotentizing is done as needed with prototyping. For common implementation of plugins, I often extend JQuery, so I can easily initialize a plugin with the same options throughout the site. For example, $('[data-tabs]').myTabs() with this code in a utility javascript file: (function($) { $.fn.myTabs = function() { this.tabs( { //...common options }); }; }) Pointers to articles, books or other discussions would be most welcome. Again, I am looking for a site-wide implementation pattern, NOT a JS MVC framework or general how-tos on creating JS classes or components. Thanks for your help!

    Read the article

  • Email Content creation | Proper design

    - by Umesh Awasthi
    Working on an E commerce application where we need to send so many email to customer like Registration email Forget Password Order placed There are many other emails that can be sent, I already have emailService in place which is responsible for sending email and It needs an Email object, Everything is working find, but I am struck at one point and not sure how best this can be done. We need to create content so as it can be passed to emailService and not sure how to design this. For example, in Customer registration, I have a customerFacade which is working between Controller and ServiceLayer, I just want to delegate this Email Content creation work away from Facade layer and to make it more flexible. Currently I am creating Registration email content inside customerFacade and some how I am not liking this way, since that means for each email, I need to create content in respective Facade. What is best way to go or current approach is fine enough?

    Read the article

  • How many copies are needed to enlarge an array?

    - by user10326
    I am reading an analysis on dynamic arrays (from the Skiena's algorithm manual). I.e. when we have an array structure and each time we are out of space we allocate a new array of double the size of the original. It describes the waste that occurs when the array has to be resized. It says that (n/2)+1 through n will be moved at most once or not at all. This is clear. Then by describing that half the elements move once, a quarter of the elements twice, and so on, the total number of movements M is given by: This seems to me that it adds more copies than actually happen. E.g. if we have the following: array of 1 element +--+ |a | +--+ double the array (2 elements) +--++--+ |a ||b | +--++--+ double the array (4 elements) +--++--++--++--+ |a ||b ||c ||c | +--++--++--++--+ double the array (8 elements) +--++--++--++--++--++--++--++--+ |a ||b ||c ||c ||x ||x ||x ||x | +--++--++--++--++--++--++--++--+ double the array (16 elements) +--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--+ |a ||b ||c ||c ||x ||x ||x ||x || || || || || || || || | +--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--+ We have the x element copied 4 times, c element copied 4 times, b element copied 4 times and a element copied 5 times so total is 4+4+4+5 = 17 copies/movements. But according to formula we should have 1*(16/2)+2*(16/4)+3*(16/8)+4*(16/16)= 8+8+6+4=26 copies of elements for the enlargement of the array to 16 elements. Is this some mistake or the aim of the formula is to provide a rough upper limit approximation? Or am I missunderstanding something here?

    Read the article

  • Serious error on first attempts to dual boot Ubuntu 14.04 with Win7

    - by beetle
    I downloaded Ubuntu 14.04 from the website which I saved to my desktop with WinRar. My trial with winrar had expired so I have now tried it with Active@Isoburner but I'm getting no further. I eventually got it burnt onto a DVD(4.7gb) and tried to boot from DVD and normally. Neither way works. It looks like its about to boot but then a message appears saying that a serious error has occurred...the disk drive for /tmp is not ready yet or not present...press I to ignore, s to skip or m for manual... At this point I'm lost and unsure what to do. My laptop Toshiba Equium A210-17I is over 5 or 6 years old. Available space on the Hard Drive is 24gb. 2gb RAM. It originally came with Windows Vista Home Premium edition but about a year ago or more a friend wiped it clean for me as I was having no end of problems with Vista. He installed Windows 7 Ultimate(which I don't have a disc for). How can I resolve this issue and get Ubuntu to boot up? Do I have to install a previous version of Ubuntu first? Any advice or help would be greatly appreciated. Kind regards. Beetle.

    Read the article

  • Kubuntu desktop icons disappearing on reboot

    - by 3mpty
    I recently installed Kubuntu 14.04. I have the desktop layout set as Folder View and everything is fine, but sometimes when I reboot it shows this: So all I can see is a scrollbar and no icons. If I go to Desktop Settings and switch to another layout and then switch again to Folder View everything is fine and the icons (and the "normal" desktop) reappear. This happens often when I reboot but not every time. Any ideas? Thank you very much.

    Read the article

  • Iptables Issue can't SSH Remote Machines

    - by Lonston
    I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's cos i need to apply the same rules in Production VPS I have applied the below iptables in my machine 192.168.1.99, Now i can't receive any packets from Outside and i can't send any packets Outside, While applying the Below Chain iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP After the above CHAIN i have added the Below rules and it want to allow ssh from machine to 192.168.1.15 to access the 192.164.1.15 but still i can't access 192.168.1.15 iptables -A INPUT -p tcp -i eth0 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp -o eth0 --sport 22 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT Any one Please Check Weather my Rules are Wrigt. Still i can't access the machine 15

    Read the article

  • Set default pulseaudio volume

    - by MrUser
    When I reboot, the volume on the PulseAudio sinks is set to 100%. I know how to change the volume using pactl set-sink-volume, but that is only set temporarily. I could write a script that is run at startup, but it will not be applied if I connect a sink later. (i.e. a Bluetooth speaker) Is there a config file where I can set the default volume that is given to a device when it is first loaded by PulseAudio? Or even the master volume at startup? Clarification: The application is for a headless linux box, so the system shouldn't have to be rebooted and should be able to accept new devices without having to connect via ssh to adjust volumes, etc.

    Read the article

  • Multi-Finger Gestures in 14.04

    - by Alex Mundy
    I'm running 14.04 on a Lenovo Y500. I want to get multi-touch gestures running, specifically a three-finger swipe to switch desktops. I would like to keep using the Unity interface, so I can't use touchegg, and I have a buttonless touchpad, so easystroke is not a good candidate either. Is there another third party program that will allow me to use buttonless three finger gestures, or some config hack that will accomplish the same thing?

    Read the article

  • how to disable usb storage in ubuntu 13.10?

    - by user288289
    I want to block my all my USB mas storage and allow only devices like keyboard and mouse . I'm able to do so by following the KB. But the issue is that when I connect devices like mobile phones & TABS, I'm able to access the mass storage & able to copy & paste. Disable usb mass storage Kindly advise me how could I block these mobile storage devices. Please note that I only want to block mass storage the other features like charging & android apk execution to mobile should work as usually. Please help...

    Read the article

  • Sudo apt-get update problem 12.04

    - by user288291
    Please Guys help me to fix this issues with update my Ubuntu 12.04 desktop: Get:38 http://us.archive.ubuntu.com precise/universe Translation-en [3,341 kB] Fetched 24.5 MB in 7min 9s (57.1 kB/s) W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/main/i18n/Index No Hash entry in Release file /var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_i18n_Index E: Some index files failed to download. They have been ignored, or old ones used instead.

    Read the article

  • looking for dark, high contrast theme

    - by d3pd
    I am looking for a dark, contrast theme. Most dark, high-contrast themes I have tried do not give sufficient contrast to many edges, such as the edges of buttons, tabs, windows and other borders. Could you recommend themes that would provide such features? Alternatively, could you recommend a guide to changing a fairly dark theme, such as Numix-Cyanogen, such that it would feature light button, tab, window and other borders? Roughly visually, what I mean is to from this: to something like this:

    Read the article

  • Is Ubuntu MAAS free? Will it remain like that?

    - by Bruno Pereira
    Ubuntu MAAS, very cool, awesome in fact, looks like a unique tool for several jobs. It looks free, but part of its documentation starts already with clauses that would scare anyone with interest in it: Documentation is copy righted by Canonical; Documentation must be used only for non-commercial purposes; If documentation is distributed within the non-commercial clause you must retain copyright; It just sounds a lot for a guide on how to install MAAS + Juju + Openstack and that scares me a bit. Under what license is Ubuntu MAAS distributed and what would be the reasoning for being so worried about copyrighting a guide like that so heavily? Is Ubuntu MAAS free? Will it continue like that?

    Read the article

  • Include Binary Files in DEB package

    - by user22611
    I need to build a DEB package from mainly Node.js Javascript files, but it should include some binary files as well. They are listed inside debian/source/include-binaries. Otherwise I get the error message dpkg-source: error: unrepresentable changes to source The command in question is: bzr builddeb -- -us -uc After adding the file include-binaries, when running bzr builddeb -- -us -uc again, now I get a different error: It says dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/mailadmin_0.0-1.diff.n6m5_6 I have no idea how to get rid of this. In the next line of output it tells me dpkg-source: info: you can integrate the local changes with dpkg-source --commit But if I run this command in the build area of my package, it gives me the unrepresentable changes to source error message again, even though debian/source/include-binaries is present in the build area as well. I am missing the way out of this... I tried deleting all files that are produced by the build process, still no success. Further details: The target directory is /opt/mailadmin. Since this directory is unusual, I listed it in the file debian/mailadmin.install (which contains one line:) opt/mailadmin opt/ The bzr builddeb process uses this file as expected.

    Read the article

  • Unity Launcher and Menu Bar disappeared in 14.04

    - by Justice2497
    The menu bar and Unity launcher have disappeared in Ubuntu 14.04. Also cannot access the terminal via ctrl + alt + t. I have tried every solution for this issue that I can find, from re-installing untiy and compiz to resetting Unity and everything. I've gone into the compiz manager and reactived Unity. Nothing has worked. When trying to reset Unity, or do anything with it really, I get this message (process:6332): dconf-WARNING **: failed to commit changes to dconf: Could not connect: Connection refused EDIT: Installed 14.04 a day ago. The issue happened after a reboot. After installing virtual Box

    Read the article

  • Grub options are not visible on booting on Samsung ATIV Book 9 Lite running Ubuntu 14.04

    - by mjwittering
    I've managed to install Ubuntu 14.04 on my new Samsung ATIV Book 9 Lite ultrabook. After updating some configuratiosn in the UEFI installation was very easy. The only questions and issue I believe I'm still experience is when booting. I believe when the laptop would be displaying the grub boot options I see the following. There is a black screen with a purple border of 10px around the screen. I'd like to know how I can update my system so that I see the grub boot manager. I've run these commands: sudo cat /etc/default/grub # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" The command was not possible, sudo efibootmgr.

    Read the article

  • dbus error on 14.04 after system is left idle for a few hours

    - by user281513
    I did a clean install of 14.04 on a crucial M4 64gb ssd. The system boots in less than 30 seconds now! but.. when I leave it idle for a few hours and log back in nothing works .. if I do a simple command like df ..I get a dbus error message. I also have a toshiba sata disk mounted for general storage since the ssd is so small .. nothing appears to be damaged when I reboot but it is extremely annoying .. any ideas on how to correct this will be appreciated.

    Read the article

  • How to compile FFmpeg with x265 support?

    - by Levan
    Today I found out that x265 is already present in ffmpeg so I compiled ffmpeg with this guide Sadly libx265 did not work on ubuntu, however on windows I tried the same thing with zeranoe ffmpeg build and it worked without a problem. So do you think i did something wrong or it is not yet implemented in linux build (using that guide)? The results of the command ffmpeg -codecs | grep -i hevc show: ffmpeg version 2.1.git Copyright (c) 2000-2014 the FFmpeg developers built on Feb 19 2014 19:00:17 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --prefix=/home/levan/ffmpeg_build --extra-cflags=-I/home/levan/ffmpeg_build/include --extra-ldflags=-L/home/levan/ffmpeg_build/lib --bindir=/home/levan/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab libavutil 52. 64.100 / 52. 64.100 libavcodec 55. 52.102 / 55. 52.102 libavformat 55. 33.100 / 55. 33.100 libavdevice 55. 10.100 / 55. 10.100 libavfilter 4. 1.102 / 4. 1.102 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 libpostproc 52. 3.100 / 52. 3.100 D.V.L. hevc H.265 / HEVC (High Efficiency Video Coding) Thank you for your time

    Read the article

  • Installing MetaTrader 4?

    - by user6498
    can someone tell me what I need to do... I downloaded MetaTrader4 setup.exe onto my computer with a new harddrive and new install of ubuntu. I have downloaded wine, and 7zip... I right clicked the setup file... selected "open with Wine Windows Program loader" ... It looks like its going to open and then it closes the icon on the launcher that had appeared as it went to open... What are the settings i need to change? How do I get to "software sources? I am new to linux and new to ubuntu... so please don't assume anything... I am an idiot... lol

    Read the article

  • Ubuntu 14.04: Fine tuning Touchpad for ThinkPad S431

    - by ramgorur
    I am using Ubuntu 14.04 on Lenovo ThinkPad S431. The touchpad is very bumpy, tricky to use. Slides down with a small touch, sometimes jerks erratically. I have tried to modify the settings in /usr/share/X11/xorg.conf.d/50-synaptics.conf file as below -- Section "InputClass" Identifier "touchpad catchall" Driver "synaptics" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Option "JumpyCursorThreshold" "250" Option "VertResolution" "100" # Option "HorizResolution" "65" # Option "MinSpeed" "1" # Option "MaxSpeed" "1" # Option "AccelerationProfile" "1" # Option "AdaptiveDeceleration" "8" # Option "ConstantDeceleration" "1" # Option "VelocityScale" "128" Option "HorizHysteresis" "150" Option "VertHysteresis" "150" EndSection There are lots of options here, does anyone know how to get a fine-tuned values for the above options (for ThinkPad S431)? The Hysteresis values seems to alleviate the problem a little bit, but failed to get a perfect result. EDIT: According to this bug report for ThinkPad X230 (+X230t), I set these values and quite good for now -- Option "VertResolution" "100" Option "HorizResolution" "65" Option "MinSpeed" "1" Option "MaxSpeed" "1" Option "AccelerationProfile" "2" Option "AdaptiveDeceleration" "16" Option "ConstantDeceleration" "16" Option "VelocityScale" "32" Option "HorizHysteresis" "50" Option "VertHysteresis" "50" and then you need to increase the cursor speed manually from the Unity mouse settings. But I am still looking for a fully functional (possibly with all the gestures) and a fine-tuned touchpad settings for S431. Further help is appreciated.

    Read the article

  • Remote Desktop from a ubuntu 13.04 to an Ubuntu 13.04 machine so the user on the second machine can see my movments

    - by user163169
    I would like to remote desktop/VPN from an Ubuntu 13.04 computer (a) to an Ubuntu 13.04 computer(b) so the user(s) on the second machine can see my movements. I would like something a lot like team-viewer or Join.me but these machines do not have Internet but that are attached on a local network and I can VPN to them but that can not see what I am doing and I need them to be able to see my movements.

    Read the article

  • How do I start the GUI (Window Manager?) over VNC?

    - by Maarx
    I have a netbook and a server, to both of which I installed the identical Ubuntu 10.04 LTS distribution. On the server, I had the foresight to install and enable the SSH server before disconnecting the monitor and keyboard and mouse. I then ssh'ed in and enabled the VNC server as well. Now I want the full server experience on the netbook, but when I VNC in, I am greeted with the displayed screen. (names have been redacted) How do I start the rest of the default Ubuntu GUI experience? (the toolbars at the top) ((is that the window manager?))

    Read the article

  • What does a beginner need to know before switching to Ubuntu? [closed]

    - by Natrium
    I have never worked with Linux before. I always used Windows. But I'm considering installing Ubuntu on my machine. I read installing Ubuntu should be very easy. But are there any thing I need to keep in mind during the installation? What are the first things I have to do when I completed the installation? (I wanted to tag this with 'beginner' but I am not allowed, so I tagged with 'installation')

    Read the article

  • SEO and JavaScript since Google admits JS parsing

    - by schlingel
    We're planning on building a HTML snapshot creation service to provide the Google crawlers with static HTML of our JS driven single page application. Is this still necessary and/or encouraged since Google openly admits it is parsing JS now? How should I tackle this evaluation? Are there tools to provide data on when it's needed to provide snapshots and when google has sufficent parsing? Is it better because it would be much faster in comparison to the JS incremental rendering?

    Read the article

  • Convert vector interpolation to quaternion interpolation? (Catmull-Rom)

    - by edA-qa mort-ora-y
    I have some existing code which does catmull-rom interpolation on two vectors (facing and up). I'm converting this to use quaternions instead (to replace the two vectors). Is there a general way to convert the vector based interpolation to a quaternion one? The approach I'm using now is to exact the axis and angle from the quanternion. I then interpolate each of those independently and convert back to a quaternion. Is there a more direct method?

    Read the article

  • How to swap row/column major order?

    - by 0X1A
    I'm trying to get a sprite sheet clipped in the right order but I'm a bit stumped, every iteration I've tried has tended to be in the wrong order. This is my current implementation. Frames = (TempSurface->h / ClipHeight) * (TempSurface->w / ClipWidth); SDL_Rect Clips[Frames]; for (i = 0; i < Frames; i++) { if (i != 0 && i % (TempSurface->h / ClipHeight) == 0) ColumnIndex++; Clips[i].x = ColumnIndex * ClipWidth; Clips[i].y = i % (TempSurface->h / ClipHeight) * ClipHeight; Clips[i].w = ClipWidth; Clips[i].h = ClipHeight; } Where TempSurface is the entire sheet loaded to a SDL_Surface and Clips[] is an array of SDL_Rects. What results from this is a sprite sheet set to SDL_Rects in the wrong order. For example I need a sheet of dimensions 4x4 to look like this: | 0 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | | 8 | 9 | 10| 11| | 12| 13| 14| 15| But instead I get this order: | 0 | 4 | 8 | 12| | 1 | 5 | 9 | 13| | 2 | 6 | 10| 14| | 3 | 7 | 11| 15| Columns and rows order does not match. What should I do to fix the order?

    Read the article

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