• Breaking News

    Wednesday, June 6, 2018

    Is it neurotic to spend a lot of time 'naming' things? Ask Programming

    Is it neurotic to spend a lot of time 'naming' things? Ask Programming


    Is it neurotic to spend a lot of time 'naming' things?

    Posted: 06 Jun 2018 03:48 PM PDT

    Sometimes I will spend a few hours just fiddling around renaming things, and I am not satisfied until I feel the name is as simple and direct as possible (without being cryptic, of course).

    Sometimes I will even refactor working code just to make the name seem more sensible.

    Is this a phase new programmers go through? Do more experienced programmers learn to do this more quickly? I'm an amateur, only 2 years of personal experience.

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

    Do you use any fora/devlogs to discuss your side projects?

    Posted: 06 Jun 2018 08:59 PM PDT

    A lot of developers, myself included, have a bunch of side projects they tend to work on. Most of them never get finished. I was wondering if there was a place where people often discuss them while they are in active development; through devlogs or something similar. All I've found so far are sites to either showcase finished projects (usually with a strong startup vibe) or sites focused on hiring people.

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

    What language offers the highest average salary?

    Posted: 06 Jun 2018 10:46 PM PDT

    I have done a decent amount of research on the topic and my answer has come to Ruby and Python. I have a friend who has been coding for 2 + ish years and he claims that this research is "just wrong". I wanted to hear your opinion. He knows html, javascript, and CSS a tiny bit of each.

    Is there a site that shows the average salaries with sources of the research?

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

    How hard was your first programming job ?

    Posted: 06 Jun 2018 08:08 AM PDT

    I got my first job this week and I have some real issues to work on my project.

    It's an internal software that's in a continuous development for like 10 years, it's a realy big C# project which interact with a huge database.

    I have to implement new features and I'm struggling to do my job. Hard to understand how the software works, hard to understand this awful DBs structure. I feel like a total incompetent.

    In college I wasn't the best student, but I was able to understand and finish any project in time. Here I feel like I'being a burden for my team.

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

    Swift or React Native?

    Posted: 06 Jun 2018 10:12 PM PDT

    I'm working on my first fully fledged app that is essentially a social media app. Over saturated I know, but my target demograph will most likely be iOS users. I'm not strong in either Swift or React Native but I find that I tend to prefer Xcode and Swift. The thing is, I feel I can build a much better app in Swift than in React Native. It has much better documentation and it's native so fine tuning is super easy. However, RN is cross platform so if the app works out, I wouldn't need to re-create it from scratch for Android. Any thoughts?

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

    Exploring serverless. How many functions should call a DB?

    Posted: 06 Jun 2018 08:27 PM PDT

    I'm coming from a microservices background so I find this FaaS stuff a little confusing.

    Lets say I have a GET /user/:userId endpoint which called getUser lambda/function which calls the user table in the DB. There's a POST /user endpoint which calls a createUser function along the same lines. In the microservice world I'd call that a User Service.

    My application is some kind of leaderboard so I also have a POST /score endpoint. Now to calculate a score for a user I need to see if that user is a premium member because they get 1.5x the points or something. So in the microservice world my ScoreService would call GET /user/123 and then have some kind of conditional that says

    if(user.isPremium) score *= 1.5 

    What's the deal in the serverless world? Do I still treat those other functions as a service and call them via the API? Do I invoke the getUser function from within my createScore function? Do I call the user table directly from my createScore database?

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

    What’s the best language to create a product selector?

    Posted: 06 Jun 2018 07:28 PM PDT

    I'm looking to enhance my github portfolio for potential ecommerce websites. A large force that I have noticed that can increase sales is product selectors. I am curious where I should begin for a product selector that would be either a questionnaire format, or a format that could show embedded pictures. Any ideas on where to start?

    I have a strong understanding of about all the top professional languages used in the current workforce meta but I am curious what might be the best option for a portfolio example ?

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

    Out of loop, can someone explain this github/Microsoft situation?

    Posted: 06 Jun 2018 07:26 PM PDT

    Okay so I understand that Microsoft bought GitHub, but I'm seeing other stuff about a gitlab? What is that? Will GitHub go to crap? What else is going on?

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

    How would you go about patching a program remotely and automatically upon initialization?

    Posted: 06 Jun 2018 07:24 PM PDT

    I honestly think I've been over-thinking this but I've been running into a problem where I'm not quite sure how to go about updating an existing program with updated features, new files to reference, etc. One thought that came to mind was to create an additional executable that remotely called to see what version was available by using a REST call and would consequently update the affected folder as necessary. Is there a recommended/better way to accomplish this problem?

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

    What's an example of a bug such that, because of the kind of bug it is, it is extremely hard to discover how to reproduce it?

    Posted: 06 Jun 2018 07:01 PM PDT

    If we think of pimples as a kind of bug of the body, it would be an example of what I have in mind. It can befall you at any time and you may have some theories as to how they are caused but can never know enough to reproduce it.

    Have you ever come across any bug in your software and think "it's gonna be huge pain to find out how to reproduce it?"

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

    Android/Java: How to create an update function for multiple ImageViews?

    Posted: 06 Jun 2018 01:28 PM PDT

    I'm trying to create an update function for multiple imageViews but kept running into issues. I'm currently passing individual imageView to the updateBlobPosition function inside a timer, which works fine for one imageView. But as soon I pass a second imageView (blob2), now both imageviews mimic each other as they have the same trajectory and velocity. In addition, when one imageview hit a wall and bounces back, the other one does the same. What I want is for each imageview to be independent of each other. Any help would be appreciated.

    ... blob1.setX(generateRandomNumber(0, 930)); blob1.setY(generateRandomNumber(0, 1750)); blob2.setX(generateRandomNumber(0, 930)); blob2.setY(generateRandomNumber(0, 1750)); ... //start the timer timer.schedule(new TimerTask() { @Override public void run() { handler.post(new Runnable() { @Override public void run() { playerMovement(); updateBlobPosition(blob1); updateBlobPosition(blob2); collision(blob1); collision(blob2); } }); } }, 0, 20); ... protected ImageView updateBlobPosition(ImageView blob) { blobX = blob.getX(); blobY = blob.getY(); blobX += blobVelocityX; blobY += blobVelocityY; //left if ((blob.getX() + blobVelocityX < 0)) { blobVelocityX = -blobVelocityX; } //right else if (blob.getX() - blobVelocityX > 930) { blobVelocityX = -Math.abs(blobVelocityX); } //top if ((blob.getY() + blobVelocityY < -20)) { blobVelocityY = -blobVelocityY; } //bottom else if (blob.getY() - blobVelocityY > 1750) { blobVelocityY = -Math.abs(blobVelocityY); } blob.setX(blobX); blob.setY(blobY); return blob; } 
    submitted by /u/Learninghowtoprogram
    [link] [comments]

    How to quickly learn a new codebase?

    Posted: 06 Jun 2018 09:36 AM PDT

    Following a recent question on here I was wondering how you guys go about learning a new codebase quickly?

    For context I'm about to start my second web development job. It'll be at a much larger company and I want to get to grips with everything fast and start contributing.

    Any advice would be awesome!

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

    Global variable in python not changing

    Posted: 06 Jun 2018 12:48 PM PDT

    I set two global variables in python as so (with following code):

    global scope

    a = 0.0 b = 0.0 def function_a() { a = time.time() } def function_b() { b = time.time() print (b-a) } 

    I call function a and then function b but for some reason, it still keeps a as 0 and won't subtract the two. I am so confused why this isn't working, it seems so simple. any idea?

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

    How to make my game stop at a certain score?

    Posted: 06 Jun 2018 09:04 AM PDT

    I"m making a pong game for a school project and i can't figure out how to make the game stop and display an image at a certain score, i would like to stop the game and display a image when a player reach a score.

    I'm using phaser 2*

    Here is my js:

    /*global Phaser,*/

    var clavier, Joueur2, Joueur1, Balle, texte, Point1_text, Point2_text,

    Point1, Point2, style, jeu = new Phaser.Game(684, 410,

    Phaser.AUTO);

    var etat = {

    preload: function () {

    "use strict";

    this.load.image("back", "images/blue.png");

    this.load.spritesheet("Joueur1", "images/gpaddle2.png", 40, 134, 1, 1);

    this.load.spritesheet("Joueur2", "images/Purplepad.png", 40, 134, 1, 1);

    this.load.spritesheet("Balle", "images/77.png", 0, 0, 0, 0);

    this.load.audio("Point1!", ["Sons/Wow.wav"]);

    this.load.audio("Point2!", ["Sons/Oops.wav"]);

    jeu.load.audio("Ping", ["Sons/Pingvoice.wav"]);

    jeu.load.audio("Pong", ["Sons/Pongvoice2.wav"]);

    this.game.scale.pageAlignHorizontally = true;

    this.game.scale.pageAlignVertically = true;

    this.game.scale.refresh();

    },

    create: function () {

    "use strict";

    texte = jeu.add.text(270, 1, "", style);

    jeu.world.setBounds(0, 0, 684, 410);

    this.background = this.game.add.sprite(0, 0, "back");

    this.background.addChild(texte);

    Joueur1 = this.add.sprite(3, 130, "Joueur1");

    this.physics.enable(Joueur1, Joueur2, Balle, Phaser.Physics.ARCADE);

    Joueur1.body.immovable = true;

    clavier = this.input.keyboard.createCursorKeys();

    Joueur1.body.collideWorldBounds = true;

    Joueur1.scale.x = 1;

    Joueur1.scale.y = 1;

    Joueur2 = this.add.sprite(650, 100, "Joueur2");

    this.physics.enable(Joueur2, Phaser.Physics.ARCADE);

    Joueur2.scale.setTo(1, 1);

    Joueur2.body.immovable = true;

    Joueur2.body.collideWorldBounds = true;

    Balle = this.add.sprite(0, 0, 'Balle');

    jeu.physics.enable([Joueur1, Joueur2, Balle], Phaser.Physics.ARCADE);

    jeu.physics.arcade.collide(Balle, Joueur1, function () {

    jeu.sound.play("Ping");

    });

    Balle.body.collideWorldBounds = true;

    Balle.body.bounce.setTo(1, 1);

    Balle.scale.x = 0.1;

    Balle.scale.y = 0.1;

    Joueur1.body.immovable = true;

    Balle.body.velocity.setTo(400, 400);

    this.cursors = Joueur1.game.input.keyboard.createCursorKeys();

    Point1_text = jeu.add.text(240, 1, "0", {

    font: "64px Gabriella",

    fill: "#37BCCD",

    align: "center"

    });

    Point2_text = jeu.add.text(jeu.world.width - 272, 1, "0", {

    font: "64px Gabriella",

    fill: "#37BCCD",

    align: "center"

    });

    Point1 = 0;

    Point2 = 0;

    },

    update: function () {

    "use strict";

    Point1_text.text = Point1;

    Point2_text.text = Point2;

    jeu.physics.arcade.collide(Joueur1, Balle, function () {

    jeu.sound.play("Ping");

    });

    jeu.physics.arcade.collide(Joueur2, Balle, function () {

    jeu.sound.play("Pong");

    });

    if (Joueur1.body.blocked.right) {

    jeu.sound.play("Ping");

    }

    if (Balle.body.blocked.right) {

    Point1 += 1;

    jeu.sound.play("Point1!");

    } else if (Balle.body.blocked.left) {

    Point2 += 1;

    jeu.sound.play("Point2!");

    } else if (clavier.up.isDown) {

    Joueur1.body.velocity.y = -800;

    } else {

    if (clavier.down.isDown) {

    Joueur1.body.velocity.y = 450;

    }

    Joueur2.body.velocity.setTo(Balle.body.velocity.y);

    Joueur2.body.velocity.x = 0;

    Joueur2.body.maxVelocity.y = 175;

    }

    if (Point1 === 2 || Point2 === 2) {

     Balle.body.velocity.setTo(0, 0); 

    introText.text = 'Game Over!';

    introText.visible = true;

    jeu.image("Game over", "images/2.jpg");

    }

    }

    };

    jeu.state.add("etat", etat);

    jeu.state.start("etat");

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

    Using rdpcap (scapy) to send packets to client

    Posted: 06 Jun 2018 11:07 AM PDT

    I am trying to recreate a phenomenon that occurs when a client connects to a particular host and gets bombarded with packets.

    I do not have access to the host any longer... but I do have pcap files that I wish to replicate.

    Right now I have the two files connecting to one another like so;

    s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.bind(("10.0.2.15",80)) #my local host IP s.listen(10) while 1: conn, addr = s.accept() 

    Next I am trying to use rdpcap to read a pcap file and send them to the client. The host is expecting these particular packets and I want to send them across the same way.

    I have connected to the server successfully on the client side. I have tried the follow code:

    pkts = rdpcap("pcapfile.pcap") for pkt in pkts: sendp(pkt) 

    However, do I need to change the destination IP address or port? I would think that I need to but I am not entirely sure.

    If I had to do that, how can I? I saw online you are supposed to do: pkt[IP].dst = "new ip" but that gave me errors.

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

    What is the difference between Windows 7 and Windows 10 for software migration point of view?

    Posted: 06 Jun 2018 07:14 AM PDT

    I have been searching about differences between Windows 7 and Windows 10 for software but I cannot really find anything useful. Some company is looking for a C++ guy to port their software stack from Windows 7 to Windows 10. What differences can I expect while porting the software stack?

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

    What sort of license should I be including with my source files?

    Posted: 06 Jun 2018 10:26 AM PDT

    I've been working for a few months on an application for my clients which we are embedding into their website from my production server. Contractually they own what I have produced, but what if any sort of license should this have (for their sake)?

    It's not open, so I'm not even sure where to begin here. Something proprietary- and would I need to display this license somewhere on the site, beyond source?

    Any advice would be hugely appreciated. Thank you!

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

    Convert a SOAP message into a Rest Get?

    Posted: 06 Jun 2018 07:55 AM PDT

    I have 2 pieces of software that I have little control over and I want them to talk to each other. The one will only send outbound messages as SOAP and the other will only receive Rest get. I am thinking I need to make some middleware to convert it. Is there an easy way to convert SOAP into rest?

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

    java spring question~

    Posted: 06 Jun 2018 10:00 AM PDT

    I want to set the address = 123.123.123.123 and port = 8888 so I edited server.port = 8888 server.address = 123.123.123.123 but it's giving me the "java.net.BindException: Cannot assign requested address: bind". It works fine when I set the address to localhost. How can I make it work sending to http://123.123.123.123:8888/name through the postman to my java server? Thank you!!!

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

    [c++]is it possible to assign a method to an instance of an object ? Similar to when you create a button and assign a specific method for the pressed .how can I imitate this behavior?

    Posted: 06 Jun 2018 09:28 AM PDT

    Googling turns up nothing related ...

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

    I'm considering a career in IT Consulting, what do I need to know?

    Posted: 06 Jun 2018 09:25 AM PDT

    Hello, Reddit. I've been looking at ways to advance my career and I think consulting is the right direction in that regard. I've got about 3 years of development in the C# stack with both WPF and angularjs/html/css on the front-end. I really want to eventually become a CIO, so I think consulting is the best idea because it would give me a chance to expand my network and work on a variety of products throughout my career.

    I'd love to hear anyone's experiences with switching from a specific company to consulting or vice versa! Otherwise some more pointed questions are 1. Are my expectations of consulting inaccurate? 2. What are some challenges you regularly face with consulting? 3. What kind of attributes should I be looking for in a good consulting company?

    Again, any experience/advice is helpful. Thanks in advance for taking time to reply.

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

    [ASP.NET Core] ¿Consume REST API from same or different solution?

    Posted: 06 Jun 2018 11:55 AM PDT

    Hello, guys.

    I'm making a website in ASP.NET Core. I made an REST API and I'm currently implementing the view in another solution, so the front-end and the back-end are separated projects.

    So, I was wondering what would be the best way to consume the REST API.

    Thanks in advance!

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

    How to survive working with really bad code?

    Posted: 06 Jun 2018 08:01 AM PDT

    I am a junior dev and I recently joined a team which works on a product with really terrible code (spaghetti code, magic numbers and strings everywhere, no unit or integration tests, no DB constraints, etc).

    I am finding it very difficult to work with this. Any change I make is like walking on a minefield, which causes multiple issues. I think the code is beyond the point where it can be refactored without doing a complete rewrite.

    Given my situation what are tips/suggestions that can help me get through this?

    submitted by /u/badcode-taway
    [link] [comments]

    How to send packets to test rx code

    Posted: 06 Jun 2018 07:51 AM PDT

    I have written some code to processes packets coming over a socket but at the moment, the host i connect to can't send anything. I want to test my code.

    I want to initially send a packet or two but then I'd like to bombard it with a ton of packets to see how it handles.

    Is there some way I can make a host to connect to on my own machine and send mass packets? How can I send tons of packets at once?

    I am using Centos7 Linux.

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

    Is anybody here good with Ruby and Alfred Workflows for Mac? I need your expertise.

    Posted: 06 Jun 2018 06:36 AM PDT

    I've got an Alfred workflow that someone wrote for me that chooses a number of random files from a folder and places them in a different folder. The problem is that it doesn't support sub-folders, and I need it to.

    I don't know anything about programming, otherwise I'd figure it out myself. The person who wrote it isn't able to help.

    I'm told that the workflow uses Ruby. If anyone here knows Ruby and is willing to take a crack at it, I'd be so grateful. If you think you can help, let me know and I'll send you the workflow.

    Thanks!

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

    No comments:

    Post a Comment