• Breaking News

    Wednesday, March 20, 2019

    On the websites you make (front end), do you include your name as the author of the HTML/CSS/JS? Ask Programming

    On the websites you make (front end), do you include your name as the author of the HTML/CSS/JS? Ask Programming


    On the websites you make (front end), do you include your name as the author of the HTML/CSS/JS?

    Posted: 20 Mar 2019 10:15 AM PDT

    If so, how? Do you like to add it to the CSS or the HTML as a comment, citing your name, "Made by XXXXX" or something?

    submitted by /u/OrthographicCube
    [link] [comments]

    A version of this Prolog predicate that will work on sublists?

    Posted: 20 Mar 2019 02:53 PM PDT

    My current predicate eo will remove every other element in a list, starting with the first element. The code for eo is as follows

    eo([],[]).

    eo([_],[]).

    eo([_,X|L],[X|R]) :- eo(L,R)].

    that produces results like

    ?- eo([a,b,c,d,e,f],L).

    L = [b,d,f]

    and

    ?- eo([a,b,c,d,e,f,g],L).

    L = [b,d,f]

    But now, I want to create a "deep" version. This version will also affect sublists. So, for

    ?- eo([a,b,c,d,e,[x,y,z],L).

    the following will print:

    L=[b,d,[y]]

    Not sure what to do.

    submitted by /u/SuperLuigiSunshine
    [link] [comments]

    Question on Managing "Data heavy" scripts/mini-applications

    Posted: 20 Mar 2019 06:02 PM PDT

    Have a lot of excel files with data and a whole bunch of VBA with hard coded references to columns and rows on particular workbooks. Question: how do you organize "data heavy" applications? Database for hard coded variables? Just trying to add some organization/design to spaghetti

    submitted by /u/albertaengineer
    [link] [comments]

    What is the average cost for a small/personal website?

    Posted: 20 Mar 2019 05:21 AM PDT

    What would the average asking price be for a custom website design with say around 5 pages of minimal content (about, services, contact etc.), some JS/CSS transitions, mobile optimisation, basic SEO, but no custom graphics included.

    What about one with more advanced features such as an image gallery, blog, ecommerce stores and a content management system?This would be without factoring in server hosting costs.

    The target audience would be local businesses, so I'm not talking about a $100k project or anything.
    Edit: im looking at this as someone thinking about working in freelance web-design. So I'm wondering what the average going rate is for a custom website created for small businesses and such.

    submitted by /u/uhhDudeWhut
    [link] [comments]

    Is this android app possible?

    Posted: 20 Mar 2019 04:29 PM PDT

    Is an Android app that takes sopcast links and plays them directly in the app after tapping on the sopcast link possible? The current available apps make you install sop to http and a player like VLC then you open the app click on the link you want and then it will open sop app and at the end vlc with the stream. Is such an app allowed on google play? Thanks!

    Forgot to mention sopcast is a p2p video app on pc

    submitted by /u/KnownCommon
    [link] [comments]

    Can I have the Cuda graphics driver and a GameReady driver at the same time?

    Posted: 20 Mar 2019 03:49 PM PDT

    Data set of unit testing results

    Posted: 20 Mar 2019 03:23 PM PDT

    Hi All,

    I'm looking for a large data set of passing and failing tests for different builds. I haven't found anything other than the ones we have worked on ourselves. Does anyone know where I could find this?

    Thanks

    submitted by /u/invertednz
    [link] [comments]

    USB-PC-Kill when Removed

    Posted: 20 Mar 2019 09:22 AM PDT

    Hello everyone. I´ll cut it quick, I´m looking for a Software, wich allows me to Specify a certain USB Stick/ Port, wich, if removed, shuts down the entire System. I found this Software, but this one activates if Plugged in and out, and on any USB Port, wich is a nice beginning, but not really what I´m looking for. So my Question is: Is there already such a Software and when not; I´m a absolute pleb when it comes to programming; how do I programm such a thing, and where do I even start?

    Yours,

    Albert_Leary

    submitted by /u/Albert_Leary
    [link] [comments]

    Using SO Timeouts in Java Datagram Socket class

    Posted: 20 Mar 2019 02:28 PM PDT

    I have a question about implementing timeouts when creating a link emulation. I'm trying to implement a Go-Back-In (GBI) protocol; this protocol requires the use of a timer for each packet that I send from the sender to the receiver sockets. If the timeout occurs, I resend the packet and all subsequent packets I have sent since I sent the one that has now timed out. The only possible option I can find built into the classes that I am using (DatagramSocket, DatagramPacket, Datagram Channel) is the setSOTimeout() function in the DatagramSocket class. This was even the method my prof suggested using. However, I'm not sure how this helps me. The Oracle Java documentation for the method says this:

    public void setSoTimeout(int timeout) throws SocketException

    Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a call to receive() for this DatagramSocket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the DatagramSocket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.

    I'm not sure how this will help me track the individual timers on each packet that I'm sending. I'm also manually sending ACK packets from the receiver to the sender, so how will the socket receive these ACK packets if all calls to receive() are blocked before the timeout occurs???

    I know I'm thinking about this wrong, so any help would be appreciated. Thanks.

    submitted by /u/Bombadillo1229
    [link] [comments]

    Why are companies moving away from Oracle and Java?

    Posted: 20 Mar 2019 01:38 PM PDT

    I thought OpenJDK 11 was now the official version of Java. OpenJDK is free (libre). What's the catch?

    submitted by /u/SanitizedTeapot
    [link] [comments]

    Making a pow(x1, x2) function using only increments, decrements, loops, and =0.

    Posted: 20 Mar 2019 01:36 PM PDT

    Those are the constraints of my problem --- I'm trying to solve this using another computational method, but trying to solve it in java first. I can read other languages.

    This is what I have so far,

    ```

     public static int pow(int x1, int x2){ if(x1 == 0) return 0; if(x2 == 0) return 1; int exp = x2; int y = x1; exp--; int multi = x1; while(exp != 0) { int temp = y; while(multi !=0) { while (temp != 0) { y++; temp--; } multi--; } exp --; multi = x1; System.out.println(); } return y; } 

    ```

    pow(4,4) should = 256, but I'm getting 32. pow(5,4) should = 625, but I'm getting 40.

    submitted by /u/helptraviecode
    [link] [comments]

    Scrabble Algorithms

    Posted: 20 Mar 2019 01:02 PM PDT

    Hi there,

    Im currently doing my dissertation on scrabble algorithms and am wondering if anyone knew some good ones to look at. I have looked at minimax/alpha-beta pruning and they seem implementable. Ive also looked at genetic and simulated annealing algorithms but cant think of a way to implement them.

    Cheers in advance

    submitted by /u/oorkyy
    [link] [comments]

    How to add redirect url after submission in this code

    Posted: 20 Mar 2019 04:30 PM PDT

    <link rel="stylesheet" href="https://emailoctopus.com/bundles/emailoctopuslist/css/formEmbed.css"> <div class="email-octopus-form-wrapper"> <h2 class="email-octopus-heading">h2</h2> <p class="email-octopus-success-message"></p> <p class="email-octopus-error-message"></p> <form method="post" action="https://emailoctopus.com/lists/xxxxxx-4908-11e9-a3c9-06b79b628af2/members/embedded/1.3/add" class="email-octopus-form" data-sitekey="xxxxxx-ovRsPIJ_IftyivYBBhGvRV6" > <div class="email-octopus-form-row"> <label for="field_1">First name</label> <input id="field_1" name="field_1" type="text" placeholder=""> </div> <div class="email-octopus-form-row"> <label for="field_0">Email address</label> <input id="field_0" name="field_0" type="email" placeholder=""> </div> <div class="email-octopus-form-row-hp" aria-hidden="true"> <!-- Do not remove this field, otherwise you risk bot sign-ups --> <input type="text" name="hpc943cd8b-4908-11e9-a3c9-06b79b628af2" tabindex="-1" autocomplete="nope"> </div> <div class="email-octopus-form-row-subscribe"> <input type="hidden" name="successRedirectUrl" value=""> <button type="submit">Subscribe</button> </div> </form> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script> <script src="https://emailoctopus.com/bundles/emailoctopuslist/js/1.3/formEmbed.js"></script>

    Can anyone help ? I want to redirect to a specific url like abc.com after submission instead of showing a message

    submitted by /u/dubaitiger
    [link] [comments]

    What tasks would python be used for?

    Posted: 20 Mar 2019 12:21 PM PDT

    I have been learning Python and know it can be used for many things, but I have been wondering what it most often used for in jobs.

    submitted by /u/ThatLonelyTrash
    [link] [comments]

    Need Mars 4.5 for assignment but when trouble installing

    Posted: 20 Mar 2019 12:00 PM PDT

    I have been programming in MIPS using Mars for one of my classes. We are provided with computer that already have Mars installed on them but I have a report that is due tonight that require screenshots of MIPS output for my grade. I have java oracle installed on my computer but when I download Mars it ask me what I would like to open it with and does not give me an option for anything but word pad. The report is due tonight so any insight to how I can get Mars to work would be appreciated.

    Edit: I also have Java runtime environment installed

    If someone had Mars installed and sent me screenshots of my programs outputs that would also be awesome.

    submitted by /u/wearerofsweaters
    [link] [comments]

    Building a GUI for software

    Posted: 20 Mar 2019 10:53 AM PDT

    Hi! I've been tasked with building a GUI for an app that takes values and produces graphical drawings based on the inputs. A friend recommended windows presentation foundation but I've heard it's a bit dated. Can someone recommend the best way to go about this? The client wants to use SVG for the graphics.

    Thank you!

    submitted by /u/SignalButton
    [link] [comments]

    Clean refactoring of class methods

    Posted: 20 Mar 2019 10:26 AM PDT

    I've programmed for a while, and am in the planning phase of a large (at least for me) open source project that I've spent a lot of free time planning the past few years. One of my goals is to improve my API development skills and create something that's easy for others to use. To that end, I'm reading (or rereading) some of the "classics" -- right now, Uncle Bob's Clean Code. I've reached a section of that book that touches on something that's been in the back of my head for a while. The book emphasizes breaking up methods to keep their length short for readability purposes, and suggests a maximum length of around 20 lines or something.

    I do this refactoring now, and it feels comfortable when (1) I can give the method that I'm breaking out a logical, descriptive name; and (2) there are local variables to pass as parameters to the broken-out method. I'm talking about doing this in situations where my only reason is to make the initial class method more intelligible, and I have I guess a subconscious preference that the broken-out method be pure.

    So my first question is: does it ever make sense to pass a class property as a parameter to a method I'm breaking out for legibility purposes, in order to keep it pure? (my gut answer is no, and so I tend to not refactor when I'm in this situation).

    Next, it happens sometimes that I end up with long constructors, in the range of 100-200 lines, when I have some complex setup. If I apply the Code Complete advice, I end up with a few method calls in the constructor and the setup moved to methods with descriptive names. I've noticed that I often end up with something like a few lines of assigning constructor parameters to class properties, and then a few parameter-less calls to my longer setup methods (since they're usually acting on class properties that have been assigned).

    I don't know if I'm explaining my question very well, but it just looks and feels wrong to me to have a series of parameter-less calls to other class methods in a row in an otherwise fairly empty constructor. But I've been experimenting, applying this, and it seems like what I often end up with -- and in various kinds of code too.

    Any advice on being better?

    submitted by /u/calligraphic-io
    [link] [comments]

    What steps can I take to become a better technical programmer?

    Posted: 20 Mar 2019 10:09 AM PDT

    I used to be a full-stack node/react developer for the last 4/5 years - that included working on a number of other different stacks, some backend API work, some dev ops. I've created a few games in Unity, I've made some iOS and Android apps in Native and React Native, I've made some little apps and projects and web services and bots.

    I'm currently trying to pivot into being a backend focussed engineer and my new job is Elixir based and I'm learning Golang in my own time by building a simple API. My job title says I'm senior.

    I want to be a great developer but I don't think I am. I want to write beautiful, elegant and well tested code but I feel like I ask too many silly questions I should know the answers to and often my solutions aren't as performant or succinct as they could be despite me making everything readable and generic where possible.

    I think I'm an okay developer but I want to be a great one and I want to know how I can make myself better. My code is readable, I test things appropriately, I just want to take greater pride in my work.

    submitted by /u/bustyLaserCannon
    [link] [comments]

    How do I make services talk with each other?

    Posted: 20 Mar 2019 08:03 AM PDT

    Hello!

    A bit of background first. I'm mainly an Android dev, now writing a Node.JS server with Express framework.

    When designing an architecture of the app, I've decided to stick to the following architecture:
    My app has 3 modules. The 1st one is responsible for authorization, the 2nd one is responsible for a friends system, the 3rd one is for the key feature of the app. Here comes the problem. I have to do various kinds of checks. For example, I can't use a key feature of the app with someone who is not my friend.

    I've decided to fix it by implementing not just API classes for modules, but Internal APIs too (they are not public and are only available among the modules, i.e. you can't just call it from routes, only modules can call internal APIs of each other).

    The question is: Can I do better architecture-wise?

    submitted by /u/McMillanMe
    [link] [comments]

    How do I enforce a class to inherit from certain parent if it wants to use some specific feature?

    Posted: 20 Mar 2019 07:53 AM PDT

    Hello, I'm creating simple event manager in unity, I'm trying to keep perfect architecture from beginning. I have EventManager class that handles liste/stop/trigger events, some other classes will access EventManager and add listener/stop listening or trigger events. Now I want to avoid writing stop listening in OnDestroy function every time, so instead what I did was that I created ClassWithEvents parent class, than added stop listening to it in ondestroy function, so that all other classes that want to use events will have to inherit from ClassWithEvents and just start listening, than parent class will handle cleanup for it. But I want to ensure that noone will forget that they should inherit from ClassWithEvents, how do I ensure about that?

    submitted by /u/Longman1981
    [link] [comments]

    How to license my code

    Posted: 20 Mar 2019 06:32 AM PDT

    How to create android app or a website for my python script?

    Posted: 20 Mar 2019 04:30 AM PDT

    I'm a newbie to programming and this the first time i've created something. I wrote a python script to do something and currently am just running it on an aws free tier web server.

    Now i want to use the same script in a mobile application(android) or in a website.

    Do i need to rewrite the entire code in java for android app? What should i use to create a fully fuctional website? I have basic knowledge about html, css, a little bit of android and vanilla js.

    submitted by /u/its_shubzzz
    [link] [comments]

    help with if statements in batch

    Posted: 20 Mar 2019 01:35 AM PDT

    now, i m making a small game in batch so i was trying to get an if/else statement running,but when i open the batch file, go to where the if statement is needed the promt closes,no error is displayed or anything,here is the code,please help me find the error

    `cls

    if %stone%=<0(

    echo You do not have any more healing stones left,you can buy some from the market!

    pause

    goto :home ) else (

    set /A h=10

    set /A stone= %stone% - 1

    goto :home )`

    all variables are defined and stone is set to 10,if the stones are more than 0 then the stones should decrease by one and the person should be healed and be sebt back to :home else it should say " You do not have any more healing stones left,you can buy some from the market!" and sent to :home.if u cannot find the error another script which does the same is also welcome.

    submitted by /u/hacker_097
    [link] [comments]

    No comments:

    Post a Comment