• Breaking News

    Saturday, July 28, 2018

    does your beard impact your programming? Ask Programming

    does your beard impact your programming? Ask Programming


    does your beard impact your programming?

    Posted: 28 Jul 2018 12:23 PM PDT

    very oddball question: I have way more devtime cleanshaven otherwise i tend to fidget my beard depending on how groomed/long it is

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

    I need help writing a simple math algorithm in python (quick and easy)

    Posted: 28 Jul 2018 07:57 PM PDT

    I'm given two values, we'll call them x and y, and I need to determine z.

    The equation is as follows: x = z // (y^i), where i begins at 0 and gets infinitely larger.

    The goal is to calculate the lowest possible value for z, that will still eventually equal x when divided by (y^i) as seen in the equation.

    Here are some examples:

    x = 7, y = 2: z = 4

    x = 59, y = 9: z = 54

    The z value should be as low as possible, while still able to reach the x value. Any help is greatly appreciated!

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

    How to code the redirect portion of a captive portal?

    Posted: 28 Jul 2018 07:37 PM PDT

    Building a captive portal. I need to build the portion right now that intercepts client requests and responds. Any idea how to code this?

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

    I need to create a web app using Go, Postgres and Docker. I'm very lost

    Posted: 28 Jul 2018 06:01 PM PDT

    I've been asked by a company to create a very basic app with Go.

    Let's say I have a database with names and addresses. If my Go app receives an HTTP post request with a name, it needs to look up the name in the database and return the address.

    I started using Go just yesterday. I picked up the basics of the language and I got a basic server set up that handles post requests and can send JSON data back. I have web dev experience so this wasn't too hard.

    I also know SQL so that shouldn't be too bad either.

    However, I have never used Docker. I did some reading and I understand what it is and why we use it. I don't know how to deploy my app on it though. I also don't know how I will get something like Postgres running on it and how I'll have my app communicate with Postgres. I'm very confused about this and would be very grateful if someone could point me in the right direction or spam me with resources. I'm also looking for a Go mentor if anyone is interested :)

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

    Unity FixedUpdate doesn't seem to loop.

    Posted: 28 Jul 2018 02:12 PM PDT

    Hey, I've been learning C# for about a month now and was starting to feel pretty confident so I decided to dive in and attempt to make something in unity. About 10 seconds in I failed miserably. When I press W it adds the force once, this makes no sense to me. I won't be using this method anymore but it would help if someone could explain why this doesn't work: https://gyazo.com/9397585b2576d3a72da07dcef87b516a

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

    How to convert HTML, CSS and Javascript into wordpress plugin?

    Posted: 28 Jul 2018 04:04 PM PDT

    I am a nodejs developer and never written anything in PHP. I have made a QR CODE reader which is just a single page web application using HTML, CSS and Javascript. The company I work on asked me to make a QR code reader plugin for wordpress. How do I convert this HTML, CSS and Javascript code into a wordpress plugin?

    Thanks for you help in advance.

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

    Sliding Button Causing Problems

    Posted: 28 Jul 2018 03:38 PM PDT

    Hi.

    I'm trying to make a website as a project to learn about Web Development. Initially, I only planned to stay within the parameters of HTML and CSS. However, I soon realized that a lot of what I want to achieve will have to be done with jQuery as well. I have close to no knowledge of jQuery yet. But I'm going to add it to my to-do-list.

    Situation:

    I have placed an image on my webpage acting as a button. It is by itself and not contained in any sort of a container. It controls the navigation menu of my website. Hovering over it moves it a little to the right(10px). Moving the cursor from it takes it back to it's original location. Clicking it brings up the navigational links and transitions the image to the right. Clicking it again hides the navigational links(in a div) and takes the image back to it's original position. Using basic programming knowledge and other various resources I have managed to write some jQuery code to get this much going on a basic level.

    Problem:
    My problem starts once the transition animation kicks in. Once the image has moved to the right, if I hover over it, it still moves 10px to the right; which is understandable because there's no code to move it 10px to the left. But I'm not sure how and where to add the code that, when I hover over the image, will move it 10px to the left at this new location. Also, once on the right side(270px), when I click this image again, it first animates back to it's hover position(10px from left), pauses there for an instance and then goes to it's true position(0px from left). How can I make this stop? I want the image to go straight to the original location. Also, after the first cycle(one animation to the right and back), the image simply becomes a slider. It goes to the right and back to the original position again without stopping.

    Later on, I also intend to change the image to an arrow pointing in the opposite direction once the navigation menu is open to show that the user must click it to close it. I'm sure all of this will be done with jQuery. But I'm not knowledgeable about it as I said earlier. However, if I were to come up with a possible solution, I'd make a Loop and put the required code in it. The loop may contain any number of variables, but one that I would include would be a variable to track the position of the image. It could measure the length the animation covers(total distance). The code could then check when this value becomes true and when it does, it automatically changes the image to the required one and also change the direction in which the image moves when it is now hovered upon and clicked(at the new location). The image would then revert back to it's original state.

    My method seems lengthly and confusing so hopefully there's a better way to accomplish this. I'd appreciate any sort of help I can get.

    Thank You.

    Here's the jsFiddle for the webpage. You will have to open it in full screen mode for it to work properly:http://jsfiddle.net/Hamza_B/3mc7p1d2/5/embedded/result/

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

    Python, PrettyTable: How to add a column to an existing table in a file?

    Posted: 28 Jul 2018 02:11 PM PDT

    Trying to keep log of my workout routine. I first, write to a file, selecting "N" when asked if I would like to log a new week.

    from prettytable import PrettyTable f = open("Fierce_Five.txt", "a") t = PrettyTable() def main(): week = input("Week/Date: ") while True: routine = input("Routine A or B: ") if routine == 'A' or routine == 'B': break if routine == 'A': sqt = input("Squat: ") bch = input("Bench: ") pr = input("Pendlay row: ") fp = input("Face pulls: ") cr = input ("Calf raises: ") tp = input("Tricep pressdowns: ") lifts_a = ("Squat: " + sqt + "\n" + "Bench: " + bch + "\n" + "Pendlay row: " + pr + "\n" + "Face pulls: " + fp + "\n" + "Calf raises: " + cr + "\n" + "Tricep pressdowns: " + tp) column_names = ["Week", routine, routine] t.add_column(column_names[0], [week]) t.add_column(column_names[1], [lifts_a]) else: if routine == 'B': fs = input("Front squat: ") ohp = input("OHP: ") rdl = input("RDL: ") lpd = input("Lat pulldows: ") ab = input("Abs: ") bc = input("Bicep Curls: ") lifts_b = ("Front Squat: " + fs + "\n" + "OHP: " + ohp + "\n" + "RDL: " + rdl + "\n" + "Lat pulldowns: " + lpd + "\n" + "Abs: " + ab + "\n" + "Bicep curls: " + bc) column_names = ["Week", routine, routine] t.add_column(column_names[0], [week]) t.add_column(column_names[1], [lifts_b]) pt = str(t) f.write(pt) def appnd(): while True: routine = input("Routine A or B: ") if routine == 'A' or routine == 'B': break if routine == 'A': sqt = input("Squat: ") bch = input("Bench: ") pr = input("Pendlay row: ") fp = input("Face pulls: ") cr = input ("Calf raises: ") tp = input("Tricep pressdowns: ") lifts_a = ("Squat: " + sqt + "\n" + "Bench: " + bch + "\n" + "Pendlay row: " + pr + "\n" + "Face pulls: " + fp + "\n" + "Calf raises: " + cr + "\n" + "Tricep pressdowns: " + tp) column_names = [routine] t.add_column(column_names[0], [lifts_a]) else: if routine == 'B': fs = input("Front squat: ") ohp = input("OHP: ") rdl = input("RDL: ") lpd = input("Lat pulldows: ") ab = input("Abs: ") bc = input("Bicep Curls: ") lifts_b = ("Front Squat: " + fs + "\n" + "OHP: " + ohp + "\n" + "RDL: " + rdl + "\n" + "Lat pulldowns: " + lpd + "\n" + "Abs: " + ab + "\n" + "Bicep curls: " + bc) column_names = [routine] t.add_column(column_names[0], [lifts_b]) cnt = input("Are you appending data, or submitting a new week? A for APPEND, N for New: ") if cnt == 'N': main() else: if cnt == 'A': appnd() f.close() 

    If I want to append my routine day in the same week, I select "A" when asked. My output is this: https://pastebin.com/jU8PN4dM

    How can I append data, so that a new column appears next to my existing column?

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

    Why dont many programmers use linux?

    Posted: 28 Jul 2018 07:11 AM PDT

    This past semester in my programming class, I was sitting in the back and while everyone was working, I looked down and noticed out of about 110 kids, there was only 1 other person running Linux. Even though this was only in one class setting, it was still over 100 people. In the real world, is it common for other coders to use Linux? If not, why? I thought they would've been the biggest users.

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

    How to center a link using html/css?

    Posted: 28 Jul 2018 10:50 AM PDT

    I've tried a bunch of different things but every time I refresh the link just never goes to the middle of the page and there have been surprisingly few answers when googling. Thanks

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

    How does while loop work with mysqli_fetch_assoc() ?

    Posted: 28 Jul 2018 08:17 AM PDT

    This is probably a silly beginner question and i don't think it's limited to mysqli_fetch_assoc() so it's probably a general programming question.

    Anyways, i have this PHP code for getting data from a database using mysqli

    $sql = "SELECT name FROM table1"; $result = mysqli_query($conn, $sql); if($result){ if(mysqli_num_rows($result) > 0){ while($row = mysqli_fetch_assoc($result)){ echo "Name: " . $row["name"]. "<br>"; } } 

    What i don't understand is how the while loop there works. How does it iterates to the next element and know when to end? mysqli_fetch_assoc() returns a associative array which is stored in row variable which means it is not null therefore true and let's the while loop run. What i don't understand is how it iterates through the rows and ends when there are no more rows left. I'm not specifically doing anything to change the row to the next one so how does it do it on it's own?

    Also mysqli_fetch_assoc() returns a associative array so shouldn't "name" key contain 1 element? Or is it a array of all the rows in that column?

    (I hope you can understand what i'm trying to say, i'm not the best at explaining .-.)

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

    I am a student trying to make an IS for Researchers for managing and storing research, experiments, scheduling, ethics, and articles with multiple levels of authorization such as Lab Manager, Student, Lab assistant, etc... Can you give me some ideas to make it as generic as possible?

    Posted: 28 Jul 2018 07:01 AM PDT

    C# / MSAccess Help

    Posted: 28 Jul 2018 03:43 AM PDT

    How can you compare time you have inserted in database from the current time using c#?

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

    Are you a member of a union or professional body?

    Posted: 28 Jul 2018 02:29 AM PDT

    Why, or why not? Which union/body?

    Especially interested in answers from programmers working in the UK.

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

    Programing laptop

    Posted: 27 Jul 2018 11:55 PM PDT

    Im changing my laptop and Id like to know for sure - how will i5-8250u and sata SSD deal with everyday Java programmer tasks? Wont undervolted procesor and slower SSD have issues afrer few hours of work? I found decent laptop which is premium looking and has good build quality but i'm just not sure if i shouldnt aim for H procesor and NVMe?

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

    What are good non-trivial or uncontrived AI problems for beginners to work on?

    Posted: 27 Jul 2018 10:39 PM PDT

    The examples of problems that are solved in tutorials on AI are often just very trivial mathematical problems. For example, I am reading this great post on neural networks in Elixir but again, the example is not exactly inspiring. I appreciated that teaching a network to figure out this problem is not trivial, but I would like to have an idea of what lies beyond these kinds of problems.

    Previously I really enjoyed writing a genetic algorithm, but again, the fitness function was just minimising a mathematical equation that our lecturer had made up.

    Are there classic problems that are somewhat more interesting but within the reach of a beginner AI developer?

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

    No comments:

    Post a Comment