• Breaking News

    Wednesday, April 15, 2020

    I'm a junior Java dev and I got laid off due to Corona. I started looking for new jobs, and EVERY listing seems to be a bull**** "staffing" scam Ask Programming

    I'm a junior Java dev and I got laid off due to Corona. I started looking for new jobs, and EVERY listing seems to be a bull**** "staffing" scam Ask Programming


    I'm a junior Java dev and I got laid off due to Corona. I started looking for new jobs, and EVERY listing seems to be a bull**** "staffing" scam

    Posted: 15 Apr 2020 09:55 AM PDT

    I've been looking for jobs on Dice and Indeed. This is my very first time actually looking for a dev job, because I was already at the company in another position when I got the Junior Dev position.

    All of the jobs I'm seeing are listings by "SynergisticIT" and other weird-named staffing agencies. Basically, you pay them $10-20k for "training" and then they loan you out to companies on a project-term basis. If you look up the reviews for these agencies, a ton of them are poorly written shill posts about how great the company is. Then if you read the negative reviews, everyone says they're scammy and terrible.

    Am I doing something wrong? Should I look for jobs in another language? I'm only comfortable with Java, but I know Python at the junior-level.

    I've also checked Stack Overflow but most of those jobs are not junior-level.

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

    Why did data communication standard change from XML to JSON?

    Posted: 15 Apr 2020 07:42 PM PDT

    I'm a relatively new developer but I am curious about the history, older technologies and the context of modern development. Personally I've only worked with Ruby and ES6/Node and by extension JSON. I dabbled in PHP for an internship and done enough C++ to have a very basic idea of how things are working under the hood, that's about the extent of my knowledge.

    I've googled around and found comparisons and things but I guess I kinda want someone to just explain to me sort of how and why it happened or am I misunderstanding the purpose and use of XML?

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

    Total programming newb, help ya girl!

    Posted: 15 Apr 2020 08:08 PM PDT

    So, I'm looking to learn how to code and am completely new to this. I'm studying in my free time mainly, and just want a new skill.

    Basically, do you guys have any recommendations on the types I start with ? Python, Java, C++?

    Any advice is welcome!

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

    Python using import datetime

    Posted: 15 Apr 2020 07:37 PM PDT

    hello,

    im currently trying to have an input date be changed to the next day by creating a function that makes the date the next day. this is what it looks like so far:

    def tomorrow(self):

    dnew = Date(self.month, self.day, self.year)

    if dnew in datetime:

    self.day = self.day + 1

    ive imported datetime and it still seems to not work. Im getting the error "argument of type 'module' is not iterable" for the line "if dnew in datetime:"

    Anybody know whats wrong?

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

    Does anyone know how to input this problem into a compiler and make it work?

    Posted: 15 Apr 2020 06:08 PM PDT

    \** I've tried to code this problem multiple times but I keep getting an error with function definitions, or with brackets not being where they're supposed to be. I feel like I'm missing something but I can't point out what it is. This is the actual problem that I need to work with, and I was just wondering how to turn this into code (that actually executes)*

    int hidden (int num1, int num2)

    {

    if (num1 > 20)

    num1 = num2 / 10;

    else if (num2 > 20)

    num2 = num1 / 20;

    else

    return num1 - num2;

    return num1 * num2;

    }

    int compute (int one, int two)

    {

    int secret = one;

    for (int i = one + 1; i<= two % 2; i++)

    secret = secret + i * i;

    return secret;

    }

    What is the output of each of the following program segments?

    a. cout << hidden (15, 10) << endl;

    b. cout << compute (3, 9) << endl;

    c. cout << hidden (30, 20) << " " << compute (10, hidden (30, 20)) << endl;

    d. x = 2; y = 8;

    cout << compute (y, x) << endl;

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

    Bored... need a new language to learn... recommendations?

    Posted: 15 Apr 2020 08:55 PM PDT

    Old school IT guy with C, C++, HTML, Javascript, PHP, BASH experience that needs a new language to learn. I'm thinking Perl but was wondering if there's anything else people consider a resume essential? Thanks.

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

    Google Maps in Rest API

    Posted: 15 Apr 2020 05:52 PM PDT

    One of our lecturers has given us the task of creating a Rest API with spring and test it using Postman, one of the features that the API must-have is, the first few tasks were easy, just passing data through using the get put delete and post function in postman. However, I am stuck on how to do this functionality.

    return a (Google) map with the latitudinal and longitudinal coordinates of the brewery plotted on it.

    I know how to implement this functionality on an MVC by adding it to the JSP, however, this project must not have any JSP since its an API and needs to be tested using postman, how do I go about doing it? do i add code to the rest controller?

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

    Need Help for a mandelbot Program in python

    Posted: 15 Apr 2020 05:46 PM PDT

    If someone could hop in a discord call it would be aprreciated

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

    Should i learn Go or Rust as a replacement of C++?

    Posted: 15 Apr 2020 07:57 AM PDT

    I always been a C and a C++ guy, i like working with low level things, hacking the Linux kernel and programming embedded systems. For this kind of task i always relied on C: it's fast, stable and i've quite mastered it.

    Thanks to my attitude for C, a few of years ago i decided to learn C++ to develop desktop applications(mainly Qt apps, but also cli tools, audio/signal-processing tools and emulators ), however this language is becoming more and more difficult, full of new features(which is great) and a little bit bloated. The problem is that, after ~5 years of programming with this language, i feel like i know very little about it and every time i begin a new C++ project i wonder if i would obtain the same(or even better) result with Go or Rust.

    I already know C++ isn't going anywhere in the very next future, i'll continue to use it to maintain already started projects, so my next language would be used for new projects rather than to rewrite existing one.

    If you were me, what you'd choose?

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

    So, what is the difference between c++ and c#?

    Posted: 15 Apr 2020 07:09 AM PDT

    I never understood the difference. Is c# better for servers? Or it's just an evolved c++? Edit: Thank you all for answering, I really wasn't expecting such a feedback

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

    Word to Sting via loops

    Posted: 15 Apr 2020 04:46 PM PDT

    I have an array of ints with the first byte reserved. I need to convert this to a 32 char string, null-terminated. I can not use any libraries or pointers.

    I can not think up a loop that iterates properly without using pointers... I need a loop as the length of the conversion is variable between 1-32 bytes.

    EG:

    char[0] = word[0] >> 8; char[1] = to_byte(word[1] & 0x00FF); char[2] = word[1] >> 8; char[3] = to_byte(word[2] & 0x00FF); char[4] = word[2] >> 8; char[5] = to_byte(word[3] & 0x00FF); char[6] = word[3] >> 8; char[7] = to_byte(word[4] & 0x00FF); char[8] = word[4] >> 8; char[9] = to_byte(word[5] & 0x00FF); 

    This is a hardware message buffer where word[0] is byte[0]=length, byte[1] + word[n] is the message. The buffer is not flushed every message so I only want to pull off the requested length.

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

    Why do I need a local connection to run most of my scripts?

    Posted: 15 Apr 2020 04:36 PM PDT

    Why do I need a localserver to run my Scripts? I always thought about it as a matter of architecture of the applications, they simply work with server, so I need to run one, but is there more things to know about it? I have a lot of issues running multiple localservers in differents ports, specially using databases, I know that I could simply connect to the database and use it, burtfor some reason sometimes I need to do this type of project using a localserver, why?

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

    Best way to organise this? PHP, calendar for multiple users and admin

    Posted: 15 Apr 2020 04:16 PM PDT

    I have a uni project where I need to make a website for a fitness coach. One of the aspects is to allow the user to manage their own timetable, add/delete events etc. I also need to have an admin, that controls their own calendar too, so it should probably include/sync with each clients' calendar information.

    I don't know how best to do this. I have so far got a JS calendar that connects to a simple database (that holds an id, date, and title of the activity). I'll need to add time slots also. What would be the best way to implement all of this? Is having just the one table the best option, or several different tables? Am I right in thinking I'd need a foreign key to allow multiple users to use the same table? And can I disallow clashes in the schedule?

    I'm pretty overwhelmed by this project, there's quite a bit of 'stretch' involved and I'm struggling to find the best way, so I would really appreciate any advice! Thank you

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

    Created a python game, how can other people access it?

    Posted: 15 Apr 2020 12:20 PM PDT

    Hi all,

    Sorry if this is the wrong sub/question, this is all really new to me!

    I recently taught myself Python and have created a little game I'd like my friends and other people to play.

    Right now, it's a .py file that I run in my Python editor and can play.

    What are the next steps that I would need to take in order to allow people to play it on their computers (this will probably be easier than phones, as it's not a Java app or anything?)?

    Do you guys know of any good resources that will let me learn how to get my game out there?

    Thanks all!

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

    Help with making a basic website.

    Posted: 15 Apr 2020 12:10 PM PDT

    Hi. I have an html document and I want to attach to a domain that I have bought. I went via Godaddy to build my website which I think may have been a mistake, since I've paid ~£6 to buy the domain and ~£70 to host it for a year (is that what I should expect to pay?), and also because Godaddy seems to be about building a simple website quickly from templates, whereas I want to do as much of it from scratch as possible.

    Godaddy created me an account with cpanel. I think I should have just bought a domain name and then gone straight to cpanel and avoided GoDaddy.

    Anyway, now I have a file manager on cpanel. The home.html that was generated by Godaddy was in a directory called public_html. I have since deleted all the files that were automatically in public_html and put my index.html there instead, but now when I go to my domain I get the cpanel default page 'future of something quite cool'.

    What am I missing to make the domain show my html page?

    Thanks

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

    Good way to make a better word frequency counter?

    Posted: 15 Apr 2020 01:31 PM PDT

    current code in jsfiddle note do not run this because you cannot cancel the alerts

    better version no manual prompt, using a "stop word" list

    This is a JavaScript implementation, context is running it in console to pull text from DOM

    My goal/aim is to be able to run this script in console and just get a "most mentioned words" sort of deal

    One concern is the bias "what words matter", I'm generally trying to filter out regular words eg. "the, this", etc... but hard to know what counts/what doesn't. There's probably lists out there of common "word-bridging words"

    This implementation gets better over time

    My implementation is a basic click-target for scope then get all innerText inside/turn to array/store in ignore/keep count increment

    It sucks though, brutally slow haha

    edit: running the automated one, it is cool seeing something run on its own even if it's just a simple recursion/loop

    whooo reached the end this took a long time with 50ms delay run >>> 52267 100 %

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

    Does it make sense to use meaningless named constants?

    Posted: 15 Apr 2020 09:02 AM PDT

    For example, does it make sense to refactor the following code:

    a = a * 2; 

    as:

    const int INT_TWO = 2; // ... a = a * INT_TWO; 

    My question hinges on the fact that the new constant conveys no extra meaning (as opposed to calling it, say, FOOBAR_FACTOR).

    One thing I can think of is that the code becomes a little more DRY due to this, because if the constant has to be changed, it can be done so from one place. In the former scenario, such changes may be quite difficult (requiring a crafty find-and-replace).

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

    C# Timers

    Posted: 15 Apr 2020 12:12 PM PDT

    Hi all,

    I've been working on a C# project where I have a pole which contains multiple leds that I'm turning on and off with the command line console. Now, I am having issues using timers since it's the first time I'm using them; I want to be able to turn off a light after x seconds of being on and I thought a timer would be a the way to do it.

    Would love some ideas on how to go around it, because what I have written has not been working for me.

    This is a strip of my code:

    Timer aTimer; for (int j = 0; j < tArgs.Count; j++) { string tColor = tArgs[j].Substring(0, 1); int tTime = Int32.Parse(tArgs[j].Substring(2, 3)); runTimer(tTime, tColor); } // timer functions void runTimer(int tTime, string tColor) { aTimer = new Timer(); aTimer.Interval = tTime * 1000; aTimer.Elapsed += (sender, e) => TimerEvent(sender, e, tColor); aTimer.AutoReset = false; aTimer.Enabled = true; } // Function is called everytime timer has stopped void TimerEvent(object source, ElapsedEventArgs e, string tColor) { Logger.Log($"Turning off {tColor}"); //needs to change color state here checkColor(tColor, 0); setSignalState(); Usb_Qu_write(0, 0, lightSignal); } 

    Every time the TimerEvent does not get triggered, my console just closes and does not care about the time I set or anything.

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

    Change of Pace any recommended proportional fonts for programming?

    Posted: 15 Apr 2020 12:06 PM PDT

    I like programming in proportional fonts, what can I say. "Input" i good, but I really like those new font ligatures that `Fira Code` and `JetBrains Reshaper` Mono have to offer too. Any suggestions?

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

    [REACT] Edit state by using key as a const

    Posted: 15 Apr 2020 11:54 AM PDT

    Hello folks,

    I have a state called canEdit which contains an id and a value.
    I would like to change this state and I am trying using this code:

     handleEdit = (index) => { const idx = _.findIndex(this.state.canEdit, function (o) { return o.id === index; }); this.setState({ canEdit: update(this.state.canEdit, { idx: { value: { $set: false } }, }), }) }; 

    However it throws an error: Uncaught TypeError: Cannot read property 'value' of undefined

    And if I change idx to the index value, say 0 it works.

    I already checked and idx's type is Number(or Numeric).

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

    I’m a teacher struggling with an issue that I think could be automated...

    Posted: 15 Apr 2020 11:23 AM PDT

    I have no idea if this is the right place/way to ask this, so if not I'm really sorry. But I am wondering if someone would be able to help me with this or at least point me in the right direction.

    I am an elementary school teacher figuring out how to do this whole distance learning thing...

    I am creating small group zoom meetings for my students twice per week for every week going forward (7 or so weeks). The composition of the groups will change each time we meet. They're going to be social meetings so I want as much "change" or diversity from group to group as possible. Essentially I want each student to be able to be with as many other students as possible over time.

    Is there a program that can automate or an algorithm that can help me do this? It's breaking my brain trying to keep track of who's been with who already.

    Some other maybe helpful info:

    30 students in the class broken up into 7 groups 14 girls and 16 boys Ideally each group always has at least 2 girls and 2 boys

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

    Slides for python basics?

    Posted: 15 Apr 2020 11:11 AM PDT

    During COVID my girlfriend has been laid off and wants to learn the basics of python programming. I'm a software engineer. We went through the first few lessons okay. Covered some programming basics, but I'm finding that it would be useful to have slides to go off, but everything I have yet to find very basic slides that I like.

    It would be great if there were slides where concepts like "while loops" were a slide or two that I could just flip through. Anyone know of anything like that or have any suggestions?

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

    Advice about automaticaly accessing websites and extracting data

    Posted: 15 Apr 2020 05:04 AM PDT

    So I have been learning Python in the last couple of weeks and a few days ago i got to learn about the libraries "requests" and "BeautifulSoup". I was blown away by the possiblities and started my own project. I was curious about how hard it would be to use those tools to automate a process like collecting data. And with the goal to get more familiar with python and programming in general. So this programm that I wrote accesses a given website, extracts certain data (in my case phone numbers) and all the links to other websites. Those links are then used to access those other websites and to repeat this process. Until after a given amount of websites the data is printed in the console without beeing further used or stored.

    So I don't want to use this programm for anything else than to educate myself and for proof of concept. And I don't intend to run this programm for an extended period of time. But after seeing how many websites this simple programm can access and how much data it can collect I am having two questions:

    Is there any risk with accessing many websites with an automated system?

    Should I have any legal (living in switzerland if that helps) concern with collecting data even without selling or even storing it in the long term?

    btw I was shocked that it was possible for such a simple programm to collect that data without running into any defense machanism.

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

    React Render() not updating as expected

    Posted: 15 Apr 2020 10:09 AM PDT

    Hi all,

    I think I have a fundamental misunderstanding of how react works since I cannot figure this out.

    I am fetching data from an API using this code:

    class Fetch extends Component {
    constructor() {
    super();
    this.state = { result: [], promisePassed: false };
    }
    fetchAPI = () => {
    fetch(
    "https://cors-anywhere.herokuapp.com/api.wolframalpha.com/v2/query?input=x^2&appid=LWXRPY-52VLJGH47V&format=image"
    ).then(pe => pe.text()).then(pe => this.setState({result: pe, promisePassed: true}));

    };
    render() {
    return (
    <div>
    <button onClick={this.fetchAPI}>Click me</button>

    {this.promisePassed?<span>{this.result}</span>:<h1>Nothing</h1>}
    </div>
    );
    }
    }
    However, even after I fetch the data (and I can tell it worked from the browser:

    1) Before I click the button, I see this (components from DevTools):

    {

    "result": [],

    "promisePassed": false

    }

    After I click the button:

    {

    "result": "<?xml version='1.0' encoding='UTF-8'?>\n<queryresult success='true'\n error='false'\n numpods='9'\n datatypes=''\n timedout=''\n timedoutpods=''\n timing='3.493'\n parsetiming='0.166'\n parsetimedout='false'\n recalculate=''\n id='MSP6811i277c8c4878ccc00000ebbbi8610ic0h36'\n host='https://www5b.wolframalpha.com'\n server='7'\n related='https://www5b.wolframalpha.com/api/v1/relatedQueries.jsp?id=MSPa6911i277c8c4878ccc00003b7257d18cg10hd33455686461948748336'\n version='2...",

    "promisePassed": true

    }

    But for some reason, though I up[dated the state, the Render() function is not updating the dom? i.e I still see <h1>Nothing</h1> on screen.

    Does anyone have any advice?

    Thanks :)

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

    No comments:

    Post a Comment