Daily Archives

Articles indexed Thursday August 21 2014

Page 12/19 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Solving Kaggle’s Bike Sharing Demand Machine Learning Problem

    - by Gopinath
    Kaggle.com hosts a lot of interesting machine learning problems online and thousands of its members compete to solve them for a bounty. Problems hosted on Kaggle has varying complexity to accomodate newbies to rock star developers – few problems are good enough for  newbies to learn basics of machine learning and few of them challenge the best of machine learning developers. I’m learning basics of machine learning for the past few weeks and had an opportunity to solve Kaggel’s Bike Sharing Demand problem. Bike Sharing systems allows customers to rent a bike (or a cycle as it is called in many part of the world) for several hours and return them back . The problem provides historical information about the demand for bike sharing business and we need to forecast the demand. For more information on the problem, visit Kaggle.com website. Here is the solution I written using random forests algorithm using R programming language and you can download the source code from github.  With this solution I was able to score RMSLE of 0.70117, which placed me somewhere in the mid of the leader board.  This is the best score I could get by spending 4 hours of my time. Please feel free to fork the code and improve it.   Get Kaggle Bike Sharing Demand solution code from GitHub

    Read the article

  • Strategy to use two different measurement systems in software

    - by Dennis
    I have an application that needs to accept and output values in both US Custom Units and Metric system. Right now the conversion and input and output is a mess. You can only enter in US system, but you can choose the output to be US or Metric, and the code to do the conversions is everywhere. So I want to organize this and put together some simple rules. So I came up with this: Rules user can enter values in either US or Metric, and User Interface will take care of marking this properly All units internally will be stored as US, since the majority of the system already has most of the data stored like that and depends on this. It shouldn't matter I suppose as long as you don't mix unit. All output will be in US or Metric, depending on user selection/choice/preference. In theory this sounds great and seems like a solution. However, one little problem I came across is this: There is some data stored in code or in the database that already returns data like this: 4 x 13/16" screws, which means "four times screws". I need the to be in either US or Metric. Where exactly do I put the conversion code for doing the conversion for this unit? The above already mixing presentation and data, but the data for the field I need to populate is that whole string. I can certainly split it up into the number 4, the 13/16", and the " x " and the " screws", but the question remains... where do I put the conversion code? Different Locations for Conversion Routines 1) Right now the string is in a class where it's produced. I can put conversion code right into that class and it may be a good solution. Except then, I want to be consistent so I will be putting conversion procedures everywhere in the code at-data-source, or right after reading it from the database. The problem though is I think that my code will have to deal with two systems, all throughout the codebase after this, should I do this. 2) According to the rules, my idea was to put it in the view script, aka last change to modify it before it is shown to the user. And it may be the right thing to do, but then it strikes me it may not always be the best solution. (First, it complicates the view script a tad, second, I need to do more work on the data side to split things up more, or do extra parsing, such as in my case above). 3) Another solution is to do this somewhere in the data prep step before the view, aka somewhere in the middle, before the view, but after the data-source. This strikes me as messy and that could be the reason why my codebase is in such a mess right now. It seems that there is no best solution. What do I do?

    Read the article

  • How can I make sense of the word "Functor" from a semantic standpoint?

    - by guillaume31
    When facing new programming jargon words, I first try to reason about them from an semantic and etymological standpoint when possible (that is, when they aren't obscure acronyms). For instance, you can get the beginning of a hint of what things like Polymorphism or even Monad are about with the help of a little Greek/Latin. At the very least, once you've learned the concept, the word itself appears to go along with it well. I guess that's part of why we name things names, to make mental representations and associations more fluent. I found Functor to be a tougher nut to crack. Not so much the C++ meaning -- an object that acts (-or) as a function (funct-), but the various functional meanings (in ML, Haskell) definitely left me puzzled. From the (mathematics) Functor Wikipedia article, it seems the word was borrowed from linguistics. I think I get what a "function word" or "functor" means in that context - a word that "makes function" as opposed to a word that "makes sense". But I can't really relate that to the notion of Functor in category theory, let alone functional programming. I imagined a Functor to be something that creates functions, or behaves like a function, or short for "functional constructor", but none of those seems to fit... How do experienced functional programmers reason about this ? Do they just need any label to put in front of a concept and be fine with it ? Generally speaking, isn't it partly why advanced functional programming is hard to grasp for mere mortals compared to, say, OO -- very abstract in that you can't relate it to anything familiar ? Note that I don't need a definition of Functor, only an explanation that would allow me to relate it to something more tangible, if there is any.

    Read the article

  • Augmenting functionality of subclasses without code duplication in C++

    - by Rob W
    I have to add common functionality to some classes that share the same superclass, preferably without bloating the superclass. The simplified inheritance chain looks like this: Element -> HTMLElement -> HTMLAnchorElement Element -> SVGElement -> SVGAlement The default doSomething() method on Element is no-op by default, but there are some subclasses that need an actual implementation that requires some extra overridden methods and instance members. I cannot put a full implementation of doSomething() in Element because 1) it is only relevant for some of the subclasses, 2) its implementation has a performance impact and 3) it depends on a method that could be overridden by a class in the inheritance chain between the superclass and a subclass, e.g. SVGElement in my example. Especially because of the third point, I wanted to solve the problem using a template class, as follows (it is a kind of decorator for classes): struct Element { virtual void doSomething() {} }; // T should be an instance of Element template<class T> struct AugmentedElement : public T { // doSomething is expensive and uses T virtual void doSomething() override {} // Used by doSomething virtual bool shouldDoSomething() = 0; }; class SVGElement : public Element { /* ... */ }; class SVGAElement : public AugmentedElement<SVGElement> { // some non-trivial check bool shouldDoSomething() { /* ... */ return true; } }; // Similarly for HTMLAElement and others I looked around (in the existing (huge) codebase and on the internet), but didn't find any similar code snippets, let alone an evaluation of the effectiveness and pitfalls of this approach. Is my design the right way to go, or is there a better way to add common functionality to some subclasses of a given superclass?

    Read the article

  • What would you call the concept of CofeeScript or Sass to be?

    - by MaG3Stican
    There is this rising trend with web development of making new pseudo languages to extend the functionality of JavaScript, CSS and HTML given that those are static and their metamorphosis or evolution is painfully slow due to the variety of browser providers. So I am currently having a concept dilema on how to categorize them for a book I was made to write by my employer as no one seems to have a name for these pseudo languages. A tiny list of them : JavaScript: LiveScript, Metalua, Uberscript, EmberScript. HTML: Razor, Java Scriptlets. CSS : LESS, Sass. I believe the concept of these pseudo languages and a language or an extension of a language is quite different. First these languages do not extend any functionality currently existing on HTML or CSS or JavaScript, they simply work around it. And also they do not "compile" to an intermediate language, they are merely 1-1 translated to something that only then can be compiled. What would you call them?

    Read the article

  • In MVC, why can't a model create a view?

    - by MUY Belgium
    I have a web application written in Perl with a controller, some "views" and some "Models". Each "Model" is corresponding to one "View". The controller (one file) creates an Model object corresponding to each view (view is a CGI argument) then retrieve the view from the module it has just created. Indeed, this should be bad thing but can you argue a bit more about it. My first idea was that since the object "Model" depends upon the "view", then the "model" is actually a view. But also the fact that ALL the cgi parameters are passed to the Model causes the "Model" to become not truelly a view but to loose all interest, since it is only related to the current implementation of the web apps. On other words, that the "Model" keep model but loose its "comprehensiveness" ("Model" is not easily understandable). I'm am quite new in project analysis, so please do not be too harsh. Why is this bad? I have made a prototype with the main structures I have understood of this web application, made as short as possible. #Model.pm package Model; import { # this requires an attribute called "view" # and this require an argument which is the cgi params } ... #View1.pm package View1; ... #Model1.pm package ModelView1 ; base Model; use View1; sub new { my $class = shift; my $arg = shift; Model::DoSomething($arg); $self->view = new View1($arg); ... } #controller.cgi my $model = 0; ... $model = new Model1( cgi_param => params() ); #there is severall models here ... print $model->get_view()->get_html();

    Read the article

  • Git-based storage and publishing, infrastructure advice

    - by Joel Martinez
    I wanted to get some advice on moving a system to "the cloud" ... specifically, I'm looking to move into some of Windows Azure's managed services, as right now I'm managing a VM. Basically, the system operates on some data stored in a github git repository. I'll describe the current architecture: Current system (all hosted on a single server): GitHub - configured with a webhook pointing at ... ASP.NET MVC application - to accept the webhook from git. It pushes a message onto ... Azure service bus Queue - which is drained by ... Windows Service - pulls the message from the queue and ... Fetches the latest data from the git repository (using GitLib2Sharp) onto the local disk and finally ... Operates on the data in git to produce a static HTML website hosted/served by IIS. The system works really well, actually ... but I would like to get out of the business of managing the VM, and move to using some combination of Azure web and worker roles. But because the system relies so heavily on the git repository on the local filesystem, I'm finding it difficult to figure out how to architect in the cloud. I know you can get file system access, so in theory I could just fetch the repository if there's nothing on disk ... but the performance/responsiveness of the system sort of depends on the repository being available and only having to fetch diffs, which is relatively quick. As opposed to periodically having to fetch the entire (somewhat large) git repository if the web or worker role was recycled, or something. So I would love some advice on how you would architect such a system :) Ultimately, the only real requirement is to be able to serve HTML content that's been produced from the contents of a git repository (in a relatively responsive manner, from a publishing perspective) ... please feel free to ask any clarifying questions if there's something I omitted. Thanks!

    Read the article

  • Checking negative of a condition

    - by oym
    What is the (slightly pejorative) term for checking the negative of a condition (rather than the positive which is often more readable): e.g. if(!someVar) { return null; } else { return doSomethingInteresting(); } instead of doing this (which is arguably more readable) if(someVar) { return doSomethingInteresting(); } else { return null; } I vaguely remember there being a term for this; something in the same spirit as the term Yoda conditions.

    Read the article

  • App not showing up in Google Play search on app name [on hold]

    - by William Jockusch
    About 30 hours ago, I released an app on Google Play. I am concerned that if you search on the exact app name, it does not show up in the results, even if you click "show more". https://play.google.com/store/search?q=free+graphing+calculator&c=apps It does show up if you put the name in quotes. But that's awfully low discoverability. https://play.google.com/store/search?q=%22free%20graphing%20calculator%22&c=apps Possibly relevant information: I had an earlier version with a different bundle ID. It was up for just an hour or so, and probably never actually visible to users. How can I fix this?

    Read the article

  • Should I sacrifice code succintness to ensure the narrowest variable scope? [duplicate]

    - by David Scholefield
    This question already has an answer here: Is the usage of internal scope blocks within a function bad style? 3 answers In many languages (e.g. both Perl and Java - which are the two languages I work most with) it is possible to narrow the scope of local variables by declaring them within a block. Although it adds extra code length (the opening and closing block braces), and possibly reduces readability, should I create blocks purely to narrow the scope of variables to the statements that use the variables and to uphold the principle of narrowest scope or does this sacrifice succinctness and readability just to unnecessarily uphold an agreed 'best practice' principle? I usually declare local variables to functions/methods at the start of the function to aid readability, but I could not do this, and just create blocks throughout the function and declare the variables throughout the code - within those blocks - to narrow their scope.

    Read the article

  • Would this be considered Single Tenant or Multi-Tenant?

    - by Amy Anuszewski
    I'm sorry for this dumb, basic vocabulary question, but I've managed to confuse myself. As a company, we lease a managed server from a provider. In that sense, our server is a single tenant server. On this server, we have multiple customer databases. Each customer has its own database. We have been asked by a customer if we are a single tenant or a multi-tenant solution. From our perspective, we are the sole tenant of the server. But, what is the correct answer to the customer?

    Read the article

  • Coping with build order requirements in automated builds

    - by Derecho
    I have three Scala packages being built as separate sbt projects in separate repos with a dependency graph like this: M---->D ^ ^ | | +--+--+ ^ | S S is a service. M is a set of message classes shared between S and another service. D is a DAL used by S and the other service, and some of its model appears in the shared messages. If I make a breaking change to all three, and push them up to my Git repo, a build of S will be kicked off in Jenkins. The build will only be successful if, when S is pushed, M and D have already been pushed. Otherwise, Jenkins will find it doesn't have the right dependent package versions available. Even pushing them simultaneously wouldn't be enough -- the dependencies would have to be built and published before the dependent job was even started. Making the jobs dependent in Jenkins isn't enough, because that would just cause the previous version to be built, resulting in an artifact that doesn't have the needed version. Is there a way to set things up so that I don't have to remember to push things in the right order? The only way I can see it working is if there was a way that a build could go into a pending state if its dependencies weren't available yet. I feel like there's a simple solution I'm missing. Surely people deal with this a lot?

    Read the article

  • Are "skip deltas" unique to svn?

    - by echinodermata
    The good folks who created the SVN version control system use a structure they refer to as "skip deltas" to store the revision history of files internally. A revision is stored as a delta against an earlier revision. However, revision N is not necessarily stored as a delta against revision N-1, like this: 0 <- 1 <- 2 <- 3 <- 4 <- 5 <- 6 <- 7 <- 8 <- 9 Instead, revision N is stored as a delta against N-f(N), where f(N) is the greatest power of two that divides N: 0 <- 1 2 <- 3 4 <- 5 6 <- 7 0 <------ 2 4 <------ 6 0 <---------------- 4 0 <------------------------------------ 8 <- 9 (Superficially it looks like a skip list but really it's not that similar - for instance, skip deltas are not interested in supporting insertion in the middle of the list.) You can read more about it here. My question is: Do other systems use skip deltas? Were skip deltas known/used/published before SVN, or did the creators of SVN invent it themselves?

    Read the article

  • Combining position: relative with float in CSS

    - by user74847
    I have always thought of position: relative and float: left as different tools that should be used separately, with some features that overlap. position should be used for positioning things relative to the viewport and float used for floating things within a container. Today I saw someone combining float: left and position: relative also using top: 10px, when they could have used margin top on the floated element and not added the position relative at all. It is obviously not wrong to do it in this way because it works, but what is the best practice? Should position relative be used on an element as well as float?

    Read the article

  • how should I change the representation (not mimetype) of a resource?

    - by xenoterracide
    I'm looking at how I can change the representation of a payload at runtime for varied potential advantages, but I'm not sure how to do it. Specifically collections. Array of Pairs [{ <resource_uri> : { <entity> }, ...}] Array of Objects [<entity>,...] Array of Resources [<resource_uri>] Map of entities { <resource_uri> : { <entity> }, ... } My problem is, I'm not sure if I should put these different representations of the sets at different URI's, give them slightly varied mime types, e.g. application/foomap+json or perhaps use an optional query parameter ?format=map, or resource /entities/map. The UI is going to hide this, this is for programmatic web service access only (which the "UI's JS will have to call).

    Read the article

  • Sentence Tree v/s Words List

    - by Rohit Jose
    I was recently tasked with building a Name Entity Recognizer as part of a project. The objective was to parse a given sentence and come up with all the possible combinations of the entities. One approach that was suggested was to keep a lookup table for all the know connector words like articles and conjunctions, remove them from the words list after splitting the sentence on the basis of the spaces. This would leave out the Name Entities in the sentence. A lookup is then done for these identified entities on another lookup table that associates them to the entity type, for example if the sentence was: Remember the Titans was a movie directed by Boaz Yakin, the possible outputs would be: {Remember the Titans,Movie} was {a movie,Movie} directed by {Boaz Yakin,director} {Remember the Titans,Movie} was a movie directed by Boaz Yakin {Remember the Titans,Movie} was {a movie,Movie} directed by Boaz Yakin {Remember the Titans,Movie} was a movie directed by {Boaz Yakin,director} Remember the Titans was {a movie,Movie} directed by Boaz Yakin Remember the Titans was {a movie,Movie} directed by {Boaz Yakin,director} Remember the Titans was a movie directed by {Boaz Yakin,director} Remember the {the titans,Movie,Sports Team} was {a movie,Movie} directed by {Boaz Yakin,director} Remember the {the titans,Movie,Sports Team} was a movie directed by Boaz Yakin Remember the {the titans,Movie,Sports Team} was {a movie,Movie} directed by Boaz Yakin Remember the {the titans,Movie,Sports Team} was a movie directed by {Boaz Yakin,director} The entity lookup table here would contain the following data: Remember the Titans=Movie a movie=Movie Boaz Yakin=director the Titans=Movie the Titans=Sports Team Another alternative logic that was put forward was to build a crude sentence tree that would contain the connector words in the lookup table as parent nodes and do a lookup in the entity table for the leaf node that might contain the entities. The tree that was built for the sentence above would be: The question I am faced with is the benefits of the two approaches, should I be going for the tree approach to represent the sentence parsing, since it provides a more semantic structure? Is there a better approach I should be going for solving it?

    Read the article

  • Assuming "clean code/architecture" is there a difference in "effort" between PHP or Java/J2EE web application development?

    - by PhD
    A client asked us to estimate effort when selecting PHP as the implementation language for his next web-based application. We spent about a week exploring PHP, prototyping, testing etc., We are quite new to this language - may have hacked around it in the past but, let's go with PHP-noobs but application development experts (for the lack of a better, less flattering word :) It seems, that if we write, clean maintainable code, follow separation of concerns, enterprise architecture patters (DAOs etc.) the 'effort' in creating an object-oriented PHP based web-application seems to be the same for a Java based one. Here's our equation for estimating the effort (development/delivery time): ConstructionEffort = f(analysis, design, coding, testing, review, deployment) We were specifically comparing effort estimates in creating an enterprise application with the following: PHP + CakePHP/CodeIgniter (should we have considered others?) Java + Spring + Restlet It's an end-to-end application: Client: Javascript/jQuery + HTML/CSS Middle tier/Business Logic - (Still evaluating PHP/Java) Database: MySQL The effort estimates of the 1st and 3rd tier are constant and relatively independent of the middle tier's technology. At a high level with an initial breakdown into user stories of the requested features as well as a high-level SWAG on the sheer number of classes/SLOC that would be required for PHP doesn't seem to differ by much from what is required of the same in Java. Is this correct? We are basing our initial estimates on the initial prototyping/coding we've done with PHP - we are currently disregarding fluency with the language as a factor, since that'll be an initial hurdle and not a long term impediment IMHO (we also have sufficient time to become quite fluent with PHP). I'm interested in knowing the programmers' perspective with respect to effort when creating similar applications with either of the languages to justify choosing one over the other. Are we missing something here? It seems we are going against popular belief of PHP being quicker to market (or we being very fluent with Java have our vision clouded). It doesn't seem to have any coding/programming effort saving from what we/ve played around with.

    Read the article

  • Prevent APT from overwriting JCE jars

    - by Doc
    My server runs a Java application that requires I replace a few java library files with ones I downloaded on my own. This has to do with JCE security extensions and isn't really relevant to my question. I've found that these library files tend to get overwritten by apt when it later updates my java package. Is there a apt-friendly way of masking these specific files so apt won't touch them? Potential Solutions I'm considering just removing the write flag from the files, though I'm expecting this will cause apt to spew its guts everywhere when it later tries to overwrite them? Perhaps there's a java custom library directory I don't know of, where I can park my files and they'll be loaded instead of the package's defaults? The last-resort option I'm considering is writing a cron job to periodically replace the files with my versions. I hate this option.

    Read the article

  • Ubuntu and VirtualBox

    - by Sinan
    I have the following configuration, A host running Windows 7; A guest running Ubuntu 14.04 LTS (VirtualBox); I am connecting a Cisco router directly to my PC running Windows 7 and testing the router for netflow packets in the virtualBox I am having a difficulty capturing the traffic of the netflow from the Cisco device in my virtualBox using port 2222. I tried to use the many different networking modes provided by virutalBox (i.e. NAT, Bridged Adapter, Host only adapter) but I am not successful in capturing the netflow traffic. Could you please advise me on the configuration setup that need to be done on the virtual box to allow capturing the traffic coming from the router. I successfully capture the netflow traffic on my PC (windows 7). Thank you

    Read the article

  • Error installing Japanese game on lubuntu

    - by Daniel Choi
    So, I have a .iso file for a japanese game. so I used Furious ISO mounter to mount the image, and used wine loader to install the game, but when I try, there's this small windows with two options, most likely YEs and No, with weird symbols and squares in the area there shoudl be text. I installed Japanese Language, but doesn't work. I got the Fake Japanese for Winetrick, but I'm not sure how to use this. Does anyoneno know how to fix this problem?? THank you.

    Read the article

  • Trouble using Canon MG 2440 printer in UBUNTU 14

    - by user264795
    I connected usb serial cable from printer to computer. The drivers has been installed automatically. I printed the test page - it was printed. I tryed to print an image - it stays with status - processing... and dont work. Test page also cant be printed. What a problem? I dont know exactly, but I think I use "CUPS" manager and drivers... now status Waiting for printer to become available. And do not print.

    Read the article

  • Ubuntu 12.04 - after update it boots in command line only (no windows manager)

    - by ZSW
    I have Ubuntu 12.04, which has been working great for me since I installed it a year ago. Yesterday I ran the updates that update manager recommended. (Last time I ran updates before was about a week ago). After the updates were installed, it asked me to reboot. So I rebooted it, and then it stopped at login prompt (as a command line, with no windows). I logged in and tried to manually start the windows manager, and the screen went blank, and stayed blank I waited several minutes, and then turned it off. How can I figure out what is the problem? Which logs should I check?

    Read the article

  • Running a .bash file in Eclipse

    - by Anne Ambe
    I know this is really an Eclipse issue but I can't seem to login in their forum. I am running eclipse juno for some c/c++ development.However, I wrote a .bash script that initiate the entire program.As input argument to this script, I have a a configuration file which is one directory lower than the .bash file. In terminal I just do: ./startenb.bash ./CONF/ANNE it runs just fine. How can I configure the external tools in eclipse to take this file path as input argument? Any help or old thread vaguely addressing this issue is highly welcome.

    Read the article

  • Auto-starting a GUI application that requires sudo

    - by nanostuff
    Question: I need to auto-start a GUI application that requires sudo. I know I need to edit the sudoers file with: sudo visudo However, I don't know what to write in the file. What I already tried: sudo visudo and then added the following: nanostuff ALL = NOPASSWD: /usr/lib/AirVPN/AirVPN.exe I also tried with: nanostuff ALL = NOPASSWD /usr/bin/X11/airvpn and nanostuff ALL = NOPASSWD /usr/bin/airvpn None of those worked. By doing: ps aux | grep airvpn I get the following output: nanostuff 6805 0.2 0.4 483520 17384 ? Sl 17:13 0:01 /usr/bin/gksu -u root -m AirVPN Client needs administrative privileges. Please enter your password. mono /usr/lib/AirVPN/AirVPN.exe path=/home/nanostuff/.airvpn root 6806 0.0 0.0 78604 2392 ? Ss 17:13 0:00 /usr/bin/sudo -H -S -p GNOME_SUDO_PASS -u root -- mono /usr/lib/AirVPN/AirVPN.exe path=/home/nanostuff/.airvpn root 6808 3.2 2.0 1257532 83032 ? Sl 17:13 0:12 mono /usr/lib/AirVPN/AirVPN.exe path=/home/nanostuff/.airvpn root 6832 0.0 0.0 22652 3336 ? S 17:14 0:00 /usr/sbin/openvpn --config /home/nanostuff/.airvpn/384ef91f85df5ea2abc88c7416b95bbdf2bc4299edd2850614d4e343ba721ae3.tmp.ovpn nanostuff 6951 0.0 0.0 18932 932 pts/2 S+ 17:20 0:00 grep --color=auto airvpn Additional info: OS: Ubuntu 14.04 64bits Application: It's a VPN client

    Read the article

  • replacing Zorin OS 8 with ubuntu 14.04

    - by Paul John
    I was trying to replace Zorin OS 8 with ubuntu 14.04 (32 bits). What I have tried: I took an empty pen drive and downloaded Ubuntu 14.04 iso file on to this pen drive. I then restarted my laptop (Lenovo N 3000) and pressed F12 I then selected the USB drive in the boot options. After sometime I got the Zorin flash screen again. I know I am "fundamentally" wrong in the manner how I am executing this installation process. If you could please provide me a stepwise instruction.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >