• Breaking News

    Monday, April 30, 2018

    Can someone explain git rebase to me? Ask Programming

    Can someone explain git rebase to me? Ask Programming


    Can someone explain git rebase to me?

    Posted: 30 Apr 2018 08:34 PM PDT

    I swear the more I read about git the more confused I get. I want to use git rebase to squash some commits together and rename some. How does it work I've tried git rebase Head~4 and after dealing with merge issues it told me my directory was no longer merged or something like that and I don't get why.

    My directory at work is a branch which has some commits that it made itself before a commit that was made in both a branch and master. Not sure if that's making it worse

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

    Twitch: "getClip() is deprecated. Use getPlaylist().getClip() instead." then changes quality 4 times and then blacks to E3000

    Posted: 30 Apr 2018 08:52 PM PDT

    3player.js:28 getClip() is deprecated. Use getPlaylist().getClip() instead. 21537697:1 PUT https://api.twitch.tv/v5/resumewatching/user/21537697 404 () undefined:1 Uncaught (in promise) Response {type: "cors", url: "https://api.twitch.tv/v5/resumewatching/user/21537697", status: 404, ok: false, statusText: ""…} 11player.js:28 getClip() is deprecated. Use getPlaylist().getClip() instead. 

    Had this for weeks now and it won't go away, tried inspecting the site to see what the error-logs say during it happening.

    getClip() is deprecated. Use getPlaylist().getClip() instead. 

    Failed to parse SourceMap: https://www.twitch.tv/service-worker.js.map service-worker.js:1 GET https://www.twitch.tv/service-worker.js net::ERR_FILE_EXISTS Failed to parse SourceMap: https://www.twitch.tv/service-worker.js.map player.js:28 getClip() is deprecated. Use getPlaylist().getClip() instead. service-worker.js:1 GET https://www.twitch.tv/service-worker.js net::ERR_FILE_EXISTS Failed to parse SourceMap: https://www.twitch.tv/service-worker.js.map player.js:28 getClip() is deprecated. Use getPlaylist().getClip() instead.

    These two logs are how it looks most of the time, Twitch themselves wont help for shit as they usually don't, which is weird because I'm far from the only one to have this but oh well.

    Anyone who could help or give me any suggestion as to how I can redeem this? Whenever I tab back to that tab, or if I'm on that tab I just press "play", it starts the stream again to once again do this whole quality-changing into Error 3000, sometimes 2000 or 4000. It's annoying as fuck and pretty much makes it impossible to have streams going in the background.

    Any help would be great! Hell if anyone solves it I can donate a videogame or two on steam if anyone wants incentives

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

    How does local localhost work?

    Posted: 30 Apr 2018 03:49 PM PDT

    I am trying to understand how networking functions on your local machine in regard to 'localhost'. I understand that you can map IP addresses to host names in your /etc/hosts file, and am familiar with the fact that 127.0.01 goes to localhost.

    When you use things like XAMPP, or Docker, how is it serving to localhost? If I added something like the following to /etc/hosts:

    127.0.0.10 example.test

    How could I then serve a web application to that IP/host? Looking for some good videos, resources, articles, or key words to figure this out or help me ask a better question.

    Do you have to setup your own DNS server or something?

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

    Detective style question: Trying to pass a byte array through tcpip and some numbers are different on arrival.

    Posted: 30 Apr 2018 05:03 PM PDT

    Hello,

    I think this question has something to do with incompatible charsets or something.

    My byte array has say values: 20,0,0,0,174,159,88,48,66,193,124

    When I send it over the TCPIP connection, the values are: 20,0,0,0,65533,65533,88,48,66,65533,124

    Detective work: I feel like its one of those things where if the number is 128 or higher, its flipping a bit and just making it 65533

    The rest of my server is working and has been working for a year. It was just when I tried to send some raw data(Steam auth key), I'm having trouble rematerializing it on my server.

    I'm using Unity3d on client, and Java for server.

    Any help is appreciated, Jim

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

    Can't seem to get multiple threads working with mandelbrot.

    Posted: 30 Apr 2018 08:48 PM PDT

    Been killing myself over here for the last 9 hours. https://pastebin.com/TFCgNktz

    This is my full code if you'd like to have a look. It's a bit messy as I've tried 100 things. I can't seem to got mandelbrot compute using all the threads which is a requirement for me. Slicer seems to be doing 8 part 8 times and sometimes renders the same slice twice even though I've tried surrounding every possbile bit in a mutex. And the old slicer only speeds it up by half. I also couldn't figure out how to make mandlebrot display colors properly but that is not nearly as important. Example of how I'd like it to look I followed this tutorial for the imrpoved mandlerbot where he explains how to do it but I've tried many things and it just doesn't work.

    I would give my left hand for help haha.

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

    Solving systems of equations that there isn't an exact answer to how do I get a good answer?

    Posted: 30 Apr 2018 11:20 AM PDT

    I have 9 equations in the lines of

    A_1*x*y = C_1

    A_2*x*y = C_2

    A_3*x*y = C_3

    A_4*x*z = C_4

    A_5*x*z = C_5

    A_6*x*z = C_6

    A_7*x*k = C_7

    A_8*x*k = C_8

    A_9*x*k = C_9

    Where A and C are values I have measured and as such are real world imperfect values but I would like 4 values that are as close to able to solve my equations as possible. I've used linalg.lstsq() To do this for a system of linear equations but I'm not sure how I would format my current data to do that now. Thanks for any help or advice you can provide.

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

    What is a good resource to learn about assembly and hex editing for the arm chip?

    Posted: 30 Apr 2018 06:34 PM PDT

    I'm trying to program in assembly on my raspberry pi, with my eventual goal being to make my own little OS to show off. It's more for fun than practicality.

    submitted by /u/LXIV-LXXXI
    [link] [comments]

    What's your biggest gripe with Scrum?

    Posted: 30 Apr 2018 08:45 AM PDT

    Looking for some honest feedback from development team members on a Scrum team. What's that one thing regarding your Scrum process that makes you shake your head? Why does it make you shake your head? And what have you done to discuss/solve it in the open with your Scrum team?

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

    Why won't my collision detection work.

    Posted: 30 Apr 2018 08:49 AM PDT

    Hello I am doing a fishing game and I don't seem to find the reason behind my collision not working: void collision(Hook Hook1) { if(x>Hook1.x && x<Hook1.x+60 && y>Hook1.y && y<Hook1.y+60) {

    println("crash"); }

    } this is the code in Processing void collision its in the Fish class So basically me fish is in a 2d array. My hook and fish are both a png image. When the hook is in contact with the fish the console should say crash, it doesn't, any ideas why?

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

    How to page data that constantly changes in order?

    Posted: 30 Apr 2018 08:22 AM PDT

    Let's say we have a list of 100 items that are ranked based on how many views each content piece has

    As people view certain content the view counts update and thus the list order changes

    Now comes along our user who wants to view the list and so we fetch the data in pages of size 10

    But when they come to fetch the next 10 the order has changed, meaning it's possible we show them the same items or we don't show them some items at all making the list not total to 100 in the end

    The solution that comes to my mind is to generate a cached list when the user requests and then serving the next page from that but this means occupying space on backend to store the cached list for every user for a certain period of time

    To improve this we can generate and cache the top 100 every few minutes and serve the most recent list to any new user who comes along with some cachedlistid which they will send to us when getting the next page so we know which version of the list to fetch the next 10 from so that the data doesn't change for them. And then expire each cached list after a certain period of time where it would be safe to assume the users are done consuming the list

    What is the proper way to do this?

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

    Linux Socket Library

    Posted: 30 Apr 2018 06:06 AM PDT

    I am trying to connect to a server (as a client) on a particular address (lets call it ADDR) on port 4000. I can talk over telnet to it no problem but I want to be able to do it in c/c++. Here is what I call so far:

    getaddrinfo(ADDR,"4000",&hints,&servinfo); sock = socket(servinfo->ai_family,servinfo->ai_socktype,servinfo_ai_protocol); connect(sock, servinfo->ai_addr,servinfo->ai_addrlen); bytes_sent = send(sock, msg, length, 0); bytes_recv = recv(sock, buffer, buffenlen, 0); 

    Lots of initialization I kept out to keep this more breif. what happens is, it gets all the way down to bytes sent without issue and it gets held up in recv() function.

    1) If I want to connect to a server on a IP ADDR and port, did I do that correctly?

    2) Where do I specifiy (if necessary) where I want to listen on MY computers port?

    3) Why does the recv function get held up?


    edit: For anyone stumbling here, I simply had an issue that the server required a new line '\n' after each command being sent. As for a typical client, this was all the code I needed.

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

    CSS/HTML, How to make a single/double scroll of the mouse wheel move directly to the next <div>?

    Posted: 30 Apr 2018 06:05 AM PDT

    How to export jQuery correctly; testing JavaScript with mocha and chai

    Posted: 30 Apr 2018 10:44 AM PDT

    I'm confused how to export jQuery correctly in order to test several functions with mocha and the assertion library chai. Hopefully this is a beginner's error...

    Here is the code I am testing, with the branch add_tests:

    https://github.com/mskilab/gGnome.js/tree/add_tests

    I'm having trouble with the functions in https://github.com/mskilab/gGnome.js/blob/master/js/misc.js

    with the tests here: https://github.com/mskilab/gGnome.js/blob/add_tests/test/miscTest.js

    So, in order to export jQuery, I include the following line:

    https://github.com/mskilab/gGnome.js/blob/add_tests/js/misc.js#L2

    const $ = require('jquery'); 

    However, I'm still getting errors when I try to use the functions in miscTest.js, whereby I'm running mocha or npm test, I get a TypeError:

    TypeError: $.ajax is not a function 

    This is from trying to run

    console.log(Misc.metadata); 

    within misc.js

    How do I correctly export jQuery so it's recognized?

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

    What Language/IDE/resources would you recommend to teach an 11 year old programming (Java/Clojure/Python/Ruby/JavaScript/Scala)?

    Posted: 30 Apr 2018 01:48 PM PDT

    I'm thinking of teaching my 11 year old some programming this summer, and I can't quite decide on the language. Partly it's the language, and partly it's the IDE tooling that's available. I think he's little old for Scratch (which we played with last summer) and some of the other languages for young kids.

    Here are some of my thoughts:

    Java - It's popular, and I know Java so that makes it easier, plus there are some nice IDEs for kids/beginners like BlueJ. On the other hand Java is heavy on syntax and kind of a steep learning curve.

    Clojure - I really like the bit of Lisp I know, and wonder if Clojure might be a good way to go. It's low on syntax/precedence rules/etc, and has a REPL.

    JavaScript - I don't know too much about it, but it can run in a browser which is a plus.

    Python - Seems popular, I kind of think of it as the Pascal of today, in the sense it's a bit of a serious learner language.

    Ruby - Another one I don't know much about but has some appeal.

    Scala - There is a nice IDE for kids called Kodu that seems fun.

    Others - Besides other languages, there are also IDEs like Alice and Greenfoot that I don't know too much about, but seem to use their own languages.

    Any thoughts or similar stories to relate?

    Part of my dilemma, besides the IDE and resources (books, videos), is being able to make something fun, and not just lecture on how an Animal class can be inherited by a Dog class and print out "woof". On the other hand, I'd like whatever he learns to be useful in the future, but I'd tend to err on the fun side to keep his interest.

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

    What kind of pay can a dev with 2 yrs experience expect in Vienna, Austria?

    Posted: 30 Apr 2018 02:56 AM PDT

    First of all sorry if this is the wrong place to ask this, but I'm new to reddit and couldn't find a more suitable subreddit.

    So as the title says, I'm a Java full-stack developer of 2 years with a job opportunity in Vienna for which I'm asked to give an expected yearly salary (keep in mind Austria has 14 salaries per year), the problem is I have no idea how much an average programmer earns there. I have tried searching for info but it varies greatly from 30k EUR to 80k EUR, for a junior-mid position, and doesn't state if the amount is netto or brutto (gross or net).

    Can anyone with experience there help out?

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

    Selenium/Python script that does some stuff on a website used to work. Opened it for the first time in a few months and now its giving me errors?

    Posted: 30 Apr 2018 12:25 PM PDT

    So I'm pretty novice with this stuff but I made a script in Python using the Selenium package that goes to this one website and clicks around, does a couple standard automated tasks. But when I opened it the other day for the first time in awhile it totally doesn't work. It opens chrome and goes to the site but then it tweaks out and I really don't know what these error codes are telling me.

    I never updated python or selenium or anything in the in-between time. This script is all I really used either of those for anyway. That makes me suspect that maybe the problem is with the website, not with the code-- as in maybe the site set up some stuff to prevent automated access. The stuff i'm doing isn't malicious but it was basically a way for me to automate the boring part of a job I have to do through the site so I can get to the real meat of it faster. Besides it being something server-side, I don't know what it would be.

    Here's a picture of the error message I'm getting: https://imgur.com/a/twuPTzW

    Thanks to anyone that gives any help/ideas

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

    Interthread communication vs. Database query

    Posted: 30 Apr 2018 10:50 AM PDT

    Hi there, I'm relatively new to programming. Right now I'm working on a C server that serves multiple users. Each user session is contained within a thread(pthread). At the start of a session, user data is retrieved from database(mysql), during the session it is modified and at the end of the session it is updated into the database.

    The problem is some user needs real-time data from another user, which is stored on the user's thread's stack. I can think of two methods for this:

    1. implement interthread communication (which to my knowledge, pthread is not very good at). (Maybe have a master thread to gather process and distribute the data among slave threads which are only in charge of internet session?) This probably will result in a lot of communication overhead.

    2. have threads updating to database more often, maybe everytime it is modified on stack, it should update itself in the database. And when thread A needs information from thread B, it can just query the database. This also comes with a lot of overhead as database access is increased dramatically.

    Which method should I go with? Is there a more elegant way to do this? Should I scrap pthread for something else? Thank you !

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

    Bluetooth Buttons assigned to show images

    Posted: 30 Apr 2018 10:46 AM PDT

    I'm currently working towards creating an exhibition experience for my final year degree show of a BA Photography degree. To show my work, I want a projector displaying my images, with small prints surrounding the outside of the projectors 'frame'/image. I have been looking at cheap bluetooth buttons (camera shutters) - would there be a way to assign a button to each small print, so that when you press it, it tells the projector/pc to show that image for a set amount of time before reverting back to a normal slideshow or perhaps an empty frame? I don't know if this is the correct place to ask but if anyone could help or point me in the right direction that would be so incredibly helpful. Thanks

    submitted by /u/m-w-m-e
    [link] [comments]

    Android Studio: How to do a color gradient on a canvas?

    Posted: 30 Apr 2018 10:26 AM PDT

    So, I'm new to Android Studio and java in general and I have not quite gotten the hang of using drawables and what not.

    I have a canvas and instead of having it just one color I want it to have a gradient, but I cannot get it to work. After some googling I found two ways to do a gradient:

    1. Having an XML-file under drawable like this. When I then try to either set that as a paint color or drawing the color directly on the canvas I just get a dark blue constant hue (Interestingly enough I get two different hues from the canvas.drawColor and paint.setColor as seen here (Ignore the red line)). How can I use an XML-file to draw my gradient?

    2. Using Java's GradientDrawable. I can create a GradientDrawable but I do not know how to make my paint except it. How do I "paint" using GradientDrawable with Java?

    Got other ideas for making a gradient? I'm thankful for any kind of help.

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

    How to upload Web project online?

    Posted: 30 Apr 2018 05:04 AM PDT

    Hello, I am quite a noob at web. I know the basics of html/css/javascript and just a little bit of Java.

    I'm currently using NetBeans and my question is how to upload the server that I'm seeing under localhost:xxxx online so the others can access it as well. It's not a fully functional site, I just want to share it with a friend who doesn't have NB. I figured static site hosting (github for example) to upload simple (html/css/js) things without server side, but I can't really do that in this situation

    Probably this question sounds like "umm how to connect my pet stone to the internet" and I'm sorry about that.

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

    C# Method to get random double in range with doesn't overflow

    Posted: 30 Apr 2018 02:34 AM PDT

    I'm using this method for generating a random double in a range:

    public static double NextDouble(this Random random, double minValue, double maxValue)

    {

    return random.NextDouble() * (maxValue - minValue) + minValue;

    }

    It works fine except if I do random.NextDouble(double.MinValue, double.MaxValue), it returns Infinity. For generating random longs in (long.MinValue and long.MaxValue) i can use unsigned longs like this:

    public static long NextLong(this Random random, long minValue, long maxValue)

    {

    return (long)(NextUlong(random) % (ulong)(maxValue - minValue));

    }

    But there is no unsigned double. I properly would use an BigDecimal if it would exist, but it doesn't.

    So basically I need an method that I can call with double.MinValue and double.MaxValue that doesn't overflow / returns infinity

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

    How to generate large number (approx 500 million) of MAC IDs ?

    Posted: 30 Apr 2018 12:50 AM PDT

    I need to generate a dataset that contains device id ( 0 <id <=N, where N can be upto 500 million), This is the function i am using to generate single macid.

    def randomMAC(): #set the locally administered and clear the multicast bit mac = [ random.randint(0x00, 0xff), random.randint(0x00, 0xff), random.randint(0x00, 0xff), random.randint(0x00, 0xff), random.randint(0x00, 0xff), random.randint(0x00, 0xff) ] return ':'.join(map(lambda x: "%02x" % x, mac))

    So, for now this is my approach, Create a sqlite DB with a unique column for macid, generate a random mac id , Insert that mac id to the table, if there is an sqlite3.IntegrityError Exception, then Generate a new mac id, and again try to insert it in DB, but the problem with the approach is that i am only able to generate 1000000 macids in time, anything upper then this, and my program takes too long

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

    No comments:

    Post a Comment