Daily Archives

Articles indexed Tuesday June 3 2014

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

  • Chemical alternatives to caffeine / coffee for mental clarity and alertness? [on hold]

    - by einsteinx2
    Currently I drink about 2 cups of coffee or tea a day (one in the morning and one in the afternoon usually). However I'm very sensitive to stimulants and drinking caffeine regularly keeps my resting heart rate really high, causes occasional heart palpitations, and sometimes trouble sleeping. I've tried going without coffee, and while I can do it, I have trouble concentrating at work and even just enjoying my work. I'm borderline ADD (or possibly full on ADD, but haven't been checked). And I tend to lose focus easily if I don't have some coffee or tea in me. For health reasons, I'd like to cut it out completely, but when I do my work performance seriously suffers. I already work out (cardio and/or weight lifting) 5 - 6 days a week, and get an average of about 8 hours of sleep, but I still can't focus throughout the day without caffeine. Are there any over the counter chemical or supplement alternatives for mental clarity that you've used with success don't cause the additional unwanted physical side effects that come with regular stimulants like caffeine?

    Read the article

  • Web Developer Portfolio - Role Definition

    - by GSTAR
    I'm just putting together a portfolio that lists all the websites I have developed / worked on during the past year. Now this has become quite a long list - simply because 60% of the websites I have listed are ones where I have developed certain sections of the site, or maybe re-developed a certain section of an existing site - but not actually developed the whole site. So basically you could say I made a 20-50% contribution on those particular sites. I don't want to give the false impression to a potential employer that I have actually fully developed all the sites listed on my portfolio. Therefore I am after a neat way to indicate this fact. On the websites that I have fully developed, I have put a small label next to the name which reads "Lead Developer". What would be the equivalent label to put on the sites I have partially developed, or projects where I have been amongst multiple people developing? I suppose what I'm asking is, how would you define, in 2-3 words a non-lead developer role within a project?

    Read the article

  • How to make a non-english clone of CoffeeScript?

    - by Ans
    I want to make a non-english programming language that is identical to what CoffeeScript is to JavaScript. What I mean is that I don't want to build my own design or syntax. Just want to have a non-english programming language that compiles to JavaScript. I want to follow everything CoffeeScript fellows so I don't really want to make any design decisions. For example: This is coffeescript: number = 42 opposite = true number = -42 if opposite I want my language to be something like: ??? = 42 ??? = ???? ??? = -42 ??? ??? that get compiled to: var number, opposite; number = 42; opposite = true; if (opposite) { number = -42; }

    Read the article

  • How can Swift be so much faster than Objective-C?

    - by Yellow
    Apple launched its new programming language Swift today. In the presentation, they made some performance comparisons between Objective-C and Python. The following is a picture of one of their slides, of a comparison of those three languages performing some complex object sort: There was an even more incredible graph about a performance comparison working on some encryption algorithm. Obviously this is a marketing talk, and they didn't go into detail on how this was implemented in each. I leaves me wondering though: how can a new programming language be so much faster? In this example, surely you just have a bad Objective-C compiler or you're doing something in a less efficient way? How else would you explain a 40% performance increase? I understand that garbage collection/automated reference control might produce some additional overhead, but this much?

    Read the article

  • How to have an emacs function called when display size changes?

    - by Alex K
    I'm trying to define an emacs function that will be called when the display size changes, currently I'm not finding any hooks that I can use for this. I an NOT trying to notice when the emacs window changes size. My use case is that I have emacs open on my laptop, then I close it and bring it to work and plug it into a bigger monitor and turn it on via the keyboard. After logging in my windows are all in the top left corner. I want emacs to notice the screen size change and call my function allow me to reposition the window and change the font size. yes, I know about stay but I also want to change the font size. I'm running emacs 24.3.1 from emacsformacosx.com under OSX Mavericks

    Read the article

  • Designing javascript chart library

    - by coolscitist
    I started coding a chart library on top of d3js: My chart library. I read Javascript API reusability and Towards reusable charts. However, I am NOT really following the suggestions because I am not really convinced about them. This is how my library can be used to create a bubble chart: var chart = new XYBubbleChart(); chart.data = [{"xValue":200,"yValue":300},{"xValue":400,"yValue":200},{"xValue":100,"yValue":310}]; //set data chart.dataKey.x = "xValue"; chart.dataKey.y = "yValue"; chart.elementId = "#chart"; chart.createChart(); Here are my questions: It does not use chaining. Is it a big issue? Every property and function is exposed publicly. (Example: width, height are exposed in Chart.js). OOP is all about abstraction and hiding, but I don't really see the point right now. I think exposing everything gives flexibility to change property and functionality inside subclasses and objects without writing a lot of code. What could be pitfalls of such exposure? I have implemented functions like: zooming, "showing info boxes when data point is clicked" as "abilities". (example: XYZoomingAbility.js). Basically, such "abilities" accept "chart" object, play around with public variables of "chart" to add functionality. What this allows me to do is to add an ability by writing: activateZoomAbility(chartObject); My goal is to separate "visualization" from "interactivity". I want "interactivity" like: zooming to be plugged into the chart rather than built inside the chart. Like, I don't want my bubble chart to know anything about "zooming". However, I do want zoomable bubble chart. What is the best way to do this? How to test and what to test? I have written mixed tests: jasmine and actual html files so that I can test manually on browser.

    Read the article

  • Writing a spell checker similar to "did you mean"

    - by user888734
    I'm hoping to write a spellchecker for search queries in a web application - not unlike Google's "Did you mean?" The algorithm will be loosely based on this: http://catalog.ldc.upenn.edu/LDC2006T13 In short, it generates correction candidates and scores them on how often they appear (along with adjacent words in the search query) in an enormous dataset of known n-grams - Google Web 1T - which contains well over 1 billion 5-grams. I'm not using the Web 1T dataset, but building my n-gram sets from my own documents - about 200k docs, and I'm estimating tens or hundreds of millions of n-grams will be generated. This kind of process is pushing the limits of my understanding of basic computing performance - can I simply load my n-grams into memory in a hashtable or dictionary when the app starts? Is the only limiting factor the amount of memory on the machine? Or am I barking up the wrong tree? Perhaps putting all my n-grams in a graph database with some sort of tree query optimisation? Could that ever be fast enough?

    Read the article

  • Architecture for a template-building, WYSIWIG application

    - by Sam Selikoff
    I'm building a WYSIWYG designer in Ember.js. The designer will allow users to create campaigns - think MailChimp. To build a campaign, users will choose an existing template. The template will have a defined layout. The user will then be taken to the designer, where he will be able to edit the text and style, and additionally change some layout options. I've been thinking about how best to go about structuring this app, and there are a few hurdles. Specifically, the output of the campaign will be dynamic: eventually, it will be published somewhere, and when the consumers (not my users, but the people clicking on the campaign that my user created) visit the campaign, certain pieces of data will change, depending on the type of consumer viewing the campaign. That means the ultimate output of the designer will be a dynamic site. The data that is dynamic for this site - the end product - will not be manipulated by the user in the designer. However, the data that will be manipulated by the user in the designer are things like copy, styles, layout options, etc. I'll call the first set of variables server-side data, and the second client-side data. It seems, then, that the process will go something like this: I'll need to create templates for this designer that have two dynamic segments. For instance, the server-side data could be Liquid expressions, and the client-side data Handlebars expressions. When the user creates a campaign, I would compile the template on the back end using some dummy data for the server-side variables, and serve up a handlebars template to the Ember app. The user would then edit the template, and the Ember app would save all his edits to the JS variables that were powering the template. This way he'd be able to preview the template. When he saves, he'll send back the selected template, along with all the data and options he's made. When it comes time to publish, the back-end system will have to do two things: compile the template with Handlebars using the campaign data, and then compile the template with Liquid using the server-side data Is my thinking roughly accurate about this, or is there a simpler way?

    Read the article

  • Neural network input preprocessing

    - by TND
    It's clear that the effectiveness of a neural network depends strongly on the format you give it to work with. You want to preprocess it into the most convenient form you can algorithmically get to, so that the neural network doesn't have to account for that itself. I'm working on a little project that (surprise!) is going to be using neural networks. My future goal is to eventually use NEAT, which I'm really excited about. Anyway, one of my ideas involves moving entities in continuous 2D space, from a top-down perspective (this would be a really cool game AI). Of course, unless these guys are blind, they're going to be able to see the world around them. There's a lot of different ways this information could be fed into the network. One interesting but expensive way is to simply render a top-down "view" of things, with the entities as dots on the picture, and feed that in. I was hoping for something much simpler to use (at least at first), such as a list of the x (maybe 7 or so) nearest entities and their position in relative polar coordinates, orientation, health, etc., but I'm trying to think of the best way to do it. My first instinct was to order them by distance, which would inherently also train the neural network to consider those more "important". However, I was thinking- what if there's two entities that are nearly the same distance away? They could easily alternate indexes in that list, confusing the network. My question is, is there a better way of representing this? Essentially, the issue is the network needs a good way of keeping track of who's who, while knowing (by being inputted) relevant information about the list of entities it can see. Thanks!

    Read the article

  • Sprite Sheets in PyGame?

    - by Eamonn
    So, I've been doing some googling, and haven't found a good solution to my problem. My problem is that I'm using PyGame, and I want to use a Sprite Sheet for my player. This is all well and good, and it would be too, if I wasn't using a Sprite Sheet strip. Basically, if you don't understand, I have a strip of 32x32 'frames'. These frames are all in an image, along side each other. So, I have 3 frames in 1 image. I'd like to be able to use them as my sprite sheet, and not have to crop them up. I have used an awesome, popular and easy-to-use game framework for Lua called LÖVE. LÖVE has these things called "Quads". They are similar to texture regions in LibGDX, if you know what they are. Basically, quads allow you to get parts of an image. You define how large a quad is, and you define parts of an image that way, or 'regions' of an image. I would like to do something similar to this in PyGame, and use a "for" loop to go through the entire image width and height and mark each 32x32 area (or whatever the user defines as their desired frame width and height) and store that in a list or something for use later on. I'd define an animation speed and stuff, but that's for later on. I've been looking around on the web, and I can't find anything that will do this. I found 1 script on the PyGame website, but it crashed PyGame when I tried to run it. I tried for hours trying to fix it, but no luck. So, is there a way to do this? Is there a way to get regions of an image? Am I going about this the wrong way? Is there a simpler way to do this? Thanks! :-)

    Read the article

  • If the model is validating the data, shouldn't it throw exceptions on bad input?

    - by Carlos Campderrós
    Reading this SO question it seems that throwing exceptions for validating user input is frowned upon. But who should validate this data? In my applications, all validations are done in the business layer, because only the class itself really knows which values are valid for each one of its properties. If I were to copy the rules for validating a property to the controller, it is possible that the validation rules change and now there are two places where the modification should be made. Is my premise that validation should be done on the business layer wrong? What I do So my code usually ends up like this: <?php class Person { private $name; private $age; public function setName($n) { $n = trim($n); if (mb_strlen($n) == 0) { throw new ValidationException("Name cannot be empty"); } $this->name = $n; } public function setAge($a) { if (!is_int($a)) { if (!ctype_digit(trim($a))) { throw new ValidationException("Age $a is not valid"); } $a = (int)$a; } if ($a < 0 || $a > 150) { throw new ValidationException("Age $a is out of bounds"); } $this->age = $a; } // other getters, setters and methods } In the controller, I just pass the input data to the model, and catch thrown exceptions to show the error(s) to the user: <?php $person = new Person(); $errors = array(); // global try for all exceptions other than ValidationException try { // validation and process (if everything ok) try { $person->setAge($_POST['age']); } catch (ValidationException $e) { $errors['age'] = $e->getMessage(); } try { $person->setName($_POST['name']); } catch (ValidationException $e) { $errors['name'] = $e->getMessage(); } ... } catch (Exception $e) { // log the error, send 500 internal server error to the client // and finish the request } if (count($errors) == 0) { // process } else { showErrorsToUser($errors); } Is this a bad methodology? Alternate method Should maybe I create methods for isValidAge($a) that return true/false and then call them from the controller? <?php class Person { private $name; private $age; public function setName($n) { $n = trim($n); if ($this->isValidName($n)) { $this->name = $n; } else { throw new Exception("Invalid name"); } } public function setAge($a) { if ($this->isValidAge($a)) { $this->age = $a; } else { throw new Exception("Invalid age"); } } public function isValidName($n) { $n = trim($n); if (mb_strlen($n) == 0) { return false; } return true; } public function isValidAge($a) { if (!is_int($a)) { if (!ctype_digit(trim($a))) { return false; } $a = (int)$a; } if ($a < 0 || $a > 150) { return false; } return true; } // other getters, setters and methods } And the controller will be basically the same, just instead of try/catch there are now if/else: <?php $person = new Person(); $errors = array(); if ($person->isValidAge($age)) { $person->setAge($age); } catch (Exception $e) { $errors['age'] = "Invalid age"; } if ($person->isValidName($name)) { $person->setName($name); } catch (Exception $e) { $errors['name'] = "Invalid name"; } ... if (count($errors) == 0) { // process } else { showErrorsToUser($errors); } So, what should I do? I'm pretty happy with my original method, and my colleagues to whom I have showed it in general have liked it. Despite this, should I change to the alternate method? Or am I doing this terribly wrong and I should look for another way?

    Read the article

  • Learning a new concept - write from scratch or use frameworks?

    - by Stu
    I have recently been trying to learn about MVVM and all of the associated concepts such as repositories, mediators, data access. I made a decision that I would not use any frameworks for this so that I could gain a better understanding of how everything worked. I’m beginning to wonder if that was the best idea because I have hit some problems which I am not able to solve, even with the help of Stack Overflow! Writing from scratch I still feel that you have a much better understanding of something when you have been in the guts of it than if you were at a higher level. The other side of that coin is that you are in the guts of something that you don't fully understand which will lead to bad design decisions. This then makes it hard to get help because you will create unusual scenarios which are less likely to occur when you working within the confines of a framework. I have found that there are plenty of tutorials on the basics of a concept but very few that take you all the way from novice to expert. Maybe I should be looking at a book for this? Using frameworks The biggest motivation for me to use frameworks is that they are much more likely to be used in the workplace than a custom rolled solution. This can be quite a benefit when starting a new job if it's one less thing you have to learn. I feel that there is much better support for a framework than a custom solution which makes sense; many more people are using the framework than the solution that you created. The level of help is much wider as well, from basic questions to really specific, detailed questions. I would be interested to hear other people's views on this. When you are learning something new, should you/do you use frameworks or not? Why? If it's a combination of both, when do you stop one and move on to the other?

    Read the article

  • xset: unable to open display

    - by user287878
    for the longest time after about 5 minutes my screen would blank out. Now the screen will go blank after 5 minutes but then 2 seconds after that it will light up white and keep the laptop backlighting on. I didnt change any settings to my knowledge it just happened randomly after powering it on one day and has occurred since then. I wish to resort back to blanking the screen out completely since i leave this computer on all the time and its hard to sleep with a huge white light all the time. "xset dpms force off" just yeilds me ---- xset: unable to open display ""

    Read the article

  • Weird internet connection issue on Ubuntu 14.04

    - by user287876
    I have an old Gateway PC with Windows 7 installed alongside the original (XP, I think?). A while ago my friend walked me through and helped me install Ubuntu 14.04 alongside the others because my Win7 was having issues with the display driver (it would unexpectedly crash while trying to watch videos on YouTube or other places). And I can't update it because the original computer settings are for XP or something, not Win7. :( We recently switched from AT&T U-Verse to Comcast. I would have stayed with Ethernet, but somehow the adapter I have wouldn't connect to Comcast's thing during their installation. So I was given a wireless USB adapter. It worked fine, up until the last few days. It's not a problem on Win7 (using it right now). Connection's strong, things load. On Ubuntu though, it SAYS it connects even before I login to my account, but when I login and bring up Firefox, it will load the homepage, and maybe one or two other pages I venture to before suddenly just... endlessly trying to load the page. I would normally go in and manually select 'disconnect' from the connections options menu to refresh/restart it like I've done a few times already. But lately, it won't respond, and then a little while later an error message comes up saying the request timed out/failed. Restarting my computer doesn't help it. The other weird thing is that I've noticed the signal (when it's actually working properly before the last few days) is comparitively weaker than when I'm on Win7. But my location doesn't change. It's the same computer, same connection.

    Read the article

  • Sound distortion in Ubuntu 14.04

    - by Aditya Shah
    I recently installed Ubuntu 14.04 on my Dell XPS 15 (L502X). Previously I had Ubuntu 12.04 installed on the laptop along with Windows 8.1 dual boot. The sound worked perfectly fine in Ubuntu 12.04 and is working fine in Windows 8.1. Of late, I have been experiencing sound distortion coming from the subwoofer at moderately high volume levels. At the same level I am unable to reproduce the same effect in Windows 8.1. Also, I did a clean install of Ubuntu 14.04 over 12.04. Can anyone please confirm this and help me with this? Thanks

    Read the article

  • (12.04 vm/server) Dist-upgrade to 3.2.0-63 wants to remove git (1.9.2) and git-core - is that the correct behavior?

    - by YellowShark
    was wondering if anyone knows dist-upgrade wants to remove git. FWIW, this is a pretty simple box, mainly used for web dev. $ uname -a Linux precise64 3.2.0-61-generic #93-Ubuntu SMP Fri May 2 21:31:50 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ git --version git version 1.9.2 $ sudo apt-get dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be REMOVED: git git-core The following NEW packages will be installed: linux-headers-3.2.0-63 linux-headers-3.2.0-63-generic linux-image-3.2.0-63-generic The following packages will be upgraded: git-man linux-headers-server linux-image-server linux-server phpmyadmin 5 upgraded, 3 newly installed, 2 to remove and 0 not upgraded. Need to get 58.8 MB of archives. After this operation, 199 MB of additional disk space will be used. Do you want to continue [Y/n]?

    Read the article

  • How to run php with Eclipse and XAMPP?

    - by Patterson
    I'm using eclipse kepler on ubuntu 14.04, and I want to know how do I run a php project? I already installed the plugin in eclipse for php and when command run the project, the page does not load in the browser. I know this is why I have to save the php pages in the xampp directory: / opt / lampp / htdocs. My PHP files are in the eclipse workspace in my home folder, how can I run from the workspace if that is possible?

    Read the article

  • Ubuntu 12.04 partial freeze

    - by user1550594
    While working on the system suddenly if i open a random file or start browsing and on other random moments the system starts hanging or start responding slowly. In this situation, i can able to open the virtual console using the Ctrl + Alt + F1-F6 and type the top and list the processes. Due to urgency, i will kill the long running processes or the over memory utilizing process to recover the screen back. Can anyone give me a permanent fix.!

    Read the article

  • Unity session goes to lock on app launch, and won't unlock with password

    - by really
    Has been happening on every Ubuntu machine I've used to date, which is a total of 4. Started in 12.10 as far as I know, but it might have happened with 12.04, 12.10, 13.04, 13.10 and now 14.04. It doesn't seem to matter what I'm doing, but what always seems to trigger it is opening a web browser or some other application first from the sidebar. Firefox was was the most recent trigger. Instead of opening my browser, which it acts like it's going to do... the session locks, goes to the login screen, and won't unlock with the correct password. By 'won't unlock' I mean it unlocks then immediately locks again without first restoring unity, it does not produce 'incorrect password' I suspect this is a virus or password snooping software because of the fact it won't unlock with correct password information and I think if this IS a security issue, it should be fixed asap considering it's widespread throughout multiple versions. It's probably not a virus, but it is certainly suspicious behaviour to see your pc do that... wouldn't you think?

    Read the article

  • NVIDIA 560 TI driver install ubuntu 14.04 leads to "missing on display" error

    - by allthosemiles
    Currently on my Ubuntu 14.04 install, I boot it up install the latest updates and attempt to install the NVIDIA drivers from xorg-edgers while following the top answer on this post Installing Nvidia Drivers It installs 304 for my card and when I check the "glxinfo | grep OpenGL" I have about 8 lines that read Xlib: extension "NV-GLX" missing on display ":0". I did the "sudo apt-get install nvidia-current" to get the latest. I install it but didn't see any errors in the terminal. I'm not sure what I'm doing wrong here. I'm not a complete beginner with Linux so I can find my way around just fine but I can't find a solution to this issue. Should I have done one of these two instead? sudo apt-get install nvidia-304 sudo apt-get install nvidia-graphics-drivers-304

    Read the article

  • apt-get -f install removed software center and several other files

    - by user287858
    I ran sudo apt-get -f install and several files and programs were removed including software center. Is there a way to re-download everything as if ubuntu was new again without a cd? This computer does not have a cd-rom drive. I'd be fine with losing all the data on this computer. Also, when I run sudo apt-get install (almost anything) I get errors about dependencies and files not being available. Thanks to anyone who can help.

    Read the article

  • How to get Wifi Working Properly - I am Noob

    - by user287853
    I'm a noob to Ubuntu, but not computers. I installed a full version of Ubuntu version 12 whatever it is. I run it on a machine that has Win7/Win8 on another hard drive. My wireless adapter is some tiny USB stick I got on eBay - it works great in Windows, but I can't get it to work in Ubuntu. More precisely, Ubuntu is providing me a list (sometimes) of wireless networks in the area and when I try to connect to mine it just keeps password prompting me even though the one I use is correct. I looked over all the settings multiple times and don't believe there is anything in error regarding what it takes to connect to my network. So, I thought maybe it is a driver issue and came across NDIS. I thought I should try installing it, but I don't know how when I can't connect the Ubuntu machine to the Internet. I tried some commands to no avail. I have the Ubuntu installation disc and it shows a NDIS common and utils .deb files in there. Can someone out there help me out to get this wireless setup so I can get online?

    Read the article

  • Ubuntu 14.04 Slow, High CPU Usage

    - by user273012
    I experienced CPU strange behavior after installing Ubuntu 14.04, at 5 or 10 minutes, CPU usage suddenly increased about 50%, that's really slow my laptop down (Ubuntu 13.10 worked fine by the way) Here is my laptop specs : ASUS A43SA Intel Core i3-2330M 2.20 GHz 4 GB of RAM I noticed this when the first installation, even after I disabled online and file search, even after I switch to GNOME 3, and even after I used GNOME Fallback Session, how to solve this?

    Read the article

  • How to connect Nokia Lumia 520 to Ubuntu 12.04

    - by pavankumar
    I have done the following steps: sudo add-apt-repository ppa:langdalepl/gvfs-mtp sudo apt-get update and updated some packages from update manager. After doing above steps I am able to see lumia phone name in file system. But when I try to mount device I am getting following errors: Unable to mount RM-914|Nokia Lumia 520 Unable to open MTP device '[usb:001,010]' Is there any way to solve these problem?

    Read the article

  • mulktiple domain names and site behind one ipaddress/gateway

    - by RandomOzzy
    looking to host a handful of sites for myself, family and a couple of friends. i'm running ubuntu 14.04, with a bind9 authoritative name server, apache2, mysql, php5, postfix/dovecot... i have everything running with a single domain i'm already paying for. looking to run multiple sites, some with their own domains, with out having to pay for more ip address's or 3rd party services, other then the individual dns names. thanks andrew

    Read the article

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