• Breaking News

    Wednesday, February 19, 2020

    Is PHP actually rare to use today? Ask Programming

    Is PHP actually rare to use today? Ask Programming


    Is PHP actually rare to use today?

    Posted: 19 Feb 2020 09:01 AM PST

    I met someone at my roommates birthday party that practically openly mocked me for learning PHP in the first semester of my College programming degree. As if I had a choice. They went on about how Facebook was originally using PHP and now they're solely using js, and how every web based startup is using react or whatever.

    I'm just curious if this guy knows what he's talking about. He was a total douche and I feel like he was just trying to be right.

    Thanks

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

    Question about making apps on Android and IOS

    Posted: 19 Feb 2020 10:22 PM PST

    Hi,

    I am interested in App Development, however, I was wondering if it would be better to try to learn how to use Flutter or Xamarin, or if I should just learn Swift and Java. And if this matters, I have previous programming knowledge as I have been programming with Python and JS for a while now.

    Thanks.

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

    I have no idea what to create

    Posted: 19 Feb 2020 12:07 PM PST

    I wanna code more and I've been learning for over 2 years now, but I can't think of anything to make. Any ideas for projects to test what I can do would be great.

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

    try/catch issues in a program

    Posted: 19 Feb 2020 09:45 PM PST

    The given program reads a list of single-word first names and ages (ending with -1), and outputs that list with the age incremented. The program fails and throws an exception if the second input on a line is a String rather than an Integer.A dd a try/catch statement to catch java.util.InputMismatchException, and output 0 for the age.

    Ex: If the input is:

    Lee 18 Lua 21 Mary Beth 19 Stu 33 -1 then the output is:

    Lee 19 Lua 22 Mary 0 Stu 34

    Here is my code: https://pastebin.com/W7HiZi14

    once it goes to the exception. The inputs are mixed up and it outputs the values stored in the catch statement.

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

    Software Developer vs Software Engineer

    Posted: 19 Feb 2020 02:42 AM PST

    Hi!

    I know this is going to create some debate among people on this community, but here I go:

    What is the difference between a software developer and a software engineer? Is there any difference?

    I have been researching online and people seem to get confused about it.

    What do you think?

    Thank!

    submitted by /u/Free-_-Yourself
    [link] [comments]

    Other than the basic html/css, what do I use for a backend or for programming?

    Posted: 19 Feb 2020 08:01 PM PST

    So the site will be hosted on an embedded linux board, connected to sensors. My part is the site to display the data, probably in text and some charts, and have some input controls.

    We haven't decided on the data storage yet, but my initial thought was some type of database, like MySQL or something. Suggestions for that?

    I can do the HTML layout and CSS just fine, but the act of getting the data to show up I'm unfortunately kinda clueless on (even as a CS grad..) I know there's PHP but last time I tried using it on something, I hated it, made no sense. I barely know JS and I know some basic Python, C# is probably my strong suite at the moment, but considering it's a Linux web app C# probably isn't the best option as it's on embedded Linux for a industrial product. I just don't know where to start, I always start to research stuff and then I get overwhelmed with well there's React, Express, and npm, and Golang and python, then there's flask and mongo and ruby, but don't forget about postgre or just use php for everything.

    Given the use case of the board/product, I'd probably need something stable and solid, database and language.

    Help

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

    Question about extracting data

    Posted: 19 Feb 2020 07:49 PM PST

    I really have no idea if this is where I should ask but I couldn't think of any where else.

    I help out with a website which involves me entering data from an image on to the website

    This is an example of an image I would use

    This is where I enter the information to

    My question is, is there an easy way to extract the data from the image and transfer it to the website without having to type everything out manually? Any advice would be appreciated.

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

    C problem

    Posted: 19 Feb 2020 06:28 PM PST

    Would love some guidance on this HW problem i have:

    "If the variable M holds some value that represents miles, define a variable called K and assigns it number of miles in M converted to kilometers (Hint: there are 1.609344 kilometers / mile)"

    Any help is appreciated, i dont even know where to begin

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

    Reprogramming Barcode Scanner for April Fool's

    Posted: 19 Feb 2020 05:50 PM PST

    I work in a laboratory/biorepository, where we use the Honeywell Xenon 1902h barcode scanner a LOT. For April Fool's, I'd love to reprogram my boss's scanner to make an unusual sound (e.g. mooing, a scream, fart noise, etc.) when it registers a barcode.

    Is this even possible? If so, where would I begin?

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

    [ADVICE] Please don't use custom regex for e-mail checking :)

    Posted: 19 Feb 2020 06:26 AM PST

    This is a screenshot from 9gag sign up form. As someone who has experience in e-mail systems and protocols, I can give you one advice. Don't use custom regex for e-mail. For all we know, an email address can be like somethingsomething@something.something.tld

    The only 100% valid way to check if an e-mail address is valid is to send an e-mail. And if you really want to use regex please use RFC5322

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

    Beginner working on Visual Studio C#

    Posted: 19 Feb 2020 03:43 PM PST

    Hi, I'm making a school project, it is basically an exam system project, well I decided to make my questions with GroupBoxes. I actually have 2 problems that I need to solve, my 1st problem is that the groupbox4 doesn't show up even tho I made groupbox4.Visible=true; on Form Load, my 2nd problem is that I want the questions to change from buttons(with the question number) for example if I'm on question 2 and I press the button (4) I want my 4th question to pop up. So far I've done only 3 questions and the button thingy works but I can't make the groupbox4 visible.

    I need help or suggestions.

    Thank you,

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

    [Poll] Programming a form of art, or engineering?

    Posted: 19 Feb 2020 03:39 PM PST

    I understand they are not mutually exclusive.

    But if you had to place yourself in a camp.

    Can you compare programming to poetry?

    Or is it better left a hard science that looks like math formulas?

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

    Handle Date Scheduling with different timezone

    Posted: 19 Feb 2020 02:51 PM PST

    Hi everyone. I have this problem with timezone. Right now, I built a scheduling app using laravel framework. By default all dates are stored as `UTC`.

    In my application, I have built an interface where Students can create a schedule template with list of task, each task has a time property which will be used to remind the students when is due.
    Note that, this schedule can be shared with other students .

    Let say John Doe with a UTC timezone, created a schedule template, called Learning programming

    - Learning Programming
    - Task 1 : Learn Variables : 06:00 AM
    - Task 2 : Learn Functions: 07:00 AM
    - and soon...

    This is stored in table 'schedule' and 'tasks'

    I have a cron job that runs, every 12 midnight UTC to generate the task for the next date. This will get the users and get the schedules templates they used and generate a daily task.

    I store the task in a different table called DailyTask like this, this will be access and will be used also as log when marked as completed

    id Title Time Scheduled AT Completed_at User Id
    1 Learn Variables 06:00 2020-02-19T00:00:00.000000Z NULL John Doe
    2 Learn Functions 07:00 2020-02-19T00:00:00.000000Z NULL John Doe

    Current this is perfectly fine since John Doe has a UTC timezone.

    Here is my problem now.

    Let's say we have Mark Doe with UTC +10, and Oliver Doe with UTC -10. That shares the schedule template Learning Programming

    When Mark Doe access the app by 06:00 AM, he will get an empty data, this is because Mark Doe is 10 hrs ahead of the cron job scheduled time, which the schedule was not yet generated

    For Oliver this seems fine, since he is behind the cron job scheduled time.

    Any idea what is the best way to handle this kind of problem?

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

    Runtime Questions

    Posted: 19 Feb 2020 02:42 PM PST

    I have a sorting algorithm that takes significantly longer at 1x10^8 (4 seconds) compared to the previous length (1x10^7) (.5)., but for every length, I compared before those the differences were minimal (.1 second), but now it has jumped to 8 times the time

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

    Help with implementation

    Posted: 19 Feb 2020 02:33 PM PST

    So there is basically this game where you spawn in a maze and the goal is to get to the end without ever getting into a room with the red boss (look at the gif). The end is the white boss. The inputs are left, right, up and down arrow and my question is what method i should use to if i want to create my program to be able to solve these kind of mazes. The languages i plan on doing this on is either Java, C# or Python.

    GIF: https://gyazo.com/7dfa3b843fe56941ce90c9321609501e

    Some help would really be appriciated! Thanks.

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

    I have a syntax question about c#.( Read discription)

    Posted: 19 Feb 2020 02:05 PM PST

    So I am unsure if this is the right sub and please tell me wich one is the right one if this is the wrong one.

    So I am learning c# and I am at this part:

    Void Update() {

     transform.translate ( new Vector3(0,0,1)); 

    }

    -I understand Vectors, but the "new" before Vector doesn'tmake sense to me.

    What does the "new" do?

    And

    Why is it called transform.Translate? Why isn't it only transform? What does "translate" mean?

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

    How to Program Venn Diagrams in Java?

    Posted: 19 Feb 2020 01:43 PM PST

    I have custom set implementation from LinkedHashSet. User can type in and do calculations and from there on, I would like to display Venn diagrams for the calculated sets.

    I am not big in Java graphics. Ideally, I am looking for ways to make 3-5 interlinked Venn areas, where each intersection and part is programmable for different colour and custom text and/or programmable for click listeners.

    Do you have any ideas where I could look to? Thanks

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

    I'm trying to crawl a website that needs login, is this the "normal" way to do it?

    Posted: 19 Feb 2020 01:39 PM PST

    Background (skip if you are not interested):

    I am trying to crawl a site. The site is actually my school's online platform where I can access a lot of resources (organised in a tree-like structure, where each node is a page and each leaf is a resource). The problem is, it's quite slow and the tree is quite deep. This means that every time I want to access a resource, I would have to go down the tree, and wait a long time for each page to load.

    The solution I came up with was to crawl and scrape the site so that I can save the whole tree (but not the resources themselves) onto my computer locally, so that I can navigate through the tree much more quickly.

    What I am trying to do:

    The site I'm trying to crawl requires a login, which I have. However, I found a more convenient way than programmatically sending an HTTP request with my login details (the login is via office 365 which makes it more complicated), and that is to directly send the session ID in the HTTP header field as a cookie.

    After sending a few requests in Postman, this seems to work. The server responds with the screen you see after login.

    Questions (in bold):

    Is this how you'd normally scrape a website that requires a login? My worry is that I'm kind of "session ID-spoofing" on myself. Someone not knowing what I'm trying to do could mistake this as some hacker pretending to be me. This "suspicious activity" can be easily detected, because the request I sent is very bare-bones (I don't send many headers), and looks nothing like a regular browser request... I don't know what would happen if someone did find out about this. What's the worst that can happen?

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

    C++ : Why doesn't this work ?

    Posted: 19 Feb 2020 01:29 PM PST

    I am really sorry, I can't detail my question more. I just don't get it...

    I am having an issue where I'm getting a "'<class>' does not name a type" error from GCC every time I try to compile.

    I've simplified the problem to 2 simple classes : Foo and Bar

    Foo.hpp :

    #pragma once #include "Bar.hpp" class Foo { private: Bar *bar; public: Foo(Bar *); ~Foo() {} }; 

    Foo.cpp :

    #include "Foo.hpp" Foo::Foo(Bar *bar) { this->bar = bar; } 

    Bar.hpp :

    #pragma once #include "Foo.hpp" class Bar { private: Foo foo = Foo(this); public: Bar(int); ~Bar() {} }; 

    Bar.cpp :

    #include "Bar.hpp" Bar::Bar(int size) { } 

    And when I run G++, I get this :

    zegolem@desktop:~/dev/cpp-test$ g++ src/*.cpp In file included from src/Bar.hpp:2, from src/Bar.cpp:1: src/Foo.hpp:7:5: error: 'Bar' does not name a type 7 | Bar *bar; | ^~~ src/Foo.hpp:10:12: error: expected ')' before '*' token 10 | Foo(Bar *); | ~ ^~ | ) In file included from src/Bar.cpp:1: src/Bar.hpp:7:23: error: no matching function for call to 'Foo::Foo(Bar*)' 7 | Foo foo = Foo(this); | ^ In file included from src/Bar.hpp:2, from src/Bar.cpp:1: src/Foo.hpp:4:7: note: candidate: 'constexpr Foo::Foo()' 4 | class Foo | ^~~ src/Foo.hpp:4:7: note: candidate expects 0 arguments, 1 provided src/Foo.hpp:4:7: note: candidate: 'constexpr Foo::Foo(const Foo&)' src/Foo.hpp:4:7: note: no known conversion for argument 1 from 'Bar*' to 'const Foo&' In file included from src/Foo.hpp:2, from src/Foo.cpp:1: src/Bar.hpp:7:5: error: 'Foo' does not name a type 7 | Foo foo = Foo(this); | ^~~ In file included from src/Foo.hpp:2, from src/main.cpp:2: src/Bar.hpp:7:5: error: 'Foo' does not name a type 7 | Foo foo = Foo(this); | ^~~ 

    There seem to also be problems with pointers, but that's not really the point of my question, and more to do with my quick and dirty minimalist recreation of the problem...

    I also tried forward-declaring the classes in the header files, which gave this :

    zegolem@desktop:~/dev/cpp-test$ g++ src/*.cpp In file included from src/Foo.hpp:2, from src/Foo.cpp:1: src/Bar.hpp:8:9: error: field 'foo' has incomplete type 'Foo' 8 | Foo foo = Foo(this); | ^~~ src/Bar.hpp:3:7: note: forward declaration of 'class Foo' 3 | class Foo; | ^~~ In file included from src/Foo.hpp:2, from src/main.cpp:2: src/Bar.hpp:8:9: error: field 'foo' has incomplete type 'Foo' 8 | Foo foo = Foo(this); | ^~~ src/Bar.hpp:3:7: note: forward declaration of 'class Foo' 3 | class Foo; | ^~~ 

    I also tried forward-declaring the class in the header file and including the header file in the source file, which solved the issue for Foo.hpp, but not for Bar.hpp

    Let me know if you need any more information, I'll try my best to answer, I'm not that good with C/C++, and I'm trying to learn...

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

    Where to start for a beginner in web development in 2020?

    Posted: 19 Feb 2020 12:13 PM PST

    Hello good people!
    I was always interested in technology, design and creating. After spending several years building my business in wedding photography and videography I recently got really excited about web development and web design(UI/UX). COMPLETELY have no idea where I would like to be and what to learn (leaning more towards design, apps, maybe games someday if I will find coding interesting for me) so I am here asking for advice and guidance.
    Where should I start, what is the best start point, what coding language or program should I start learning and why. I did some research and got really confused atm ;D I heard a lot about python and how useful and not that difficult to learn it is (is that true?). Any suggestions or tips? I have access to a huge University library, so any good books for beginners would be appreciated as well!
    Thank you all so much for the time spent reading and answering here and not ignoring another (possibly) new web dev.
    Have a great day everyone!

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

    Does non-cryptographic hash functions include meta-data when generating hash value?

    Posted: 19 Feb 2020 11:50 AM PST

    I have roughly 10k files which include picture and video formats from various Apple devices I've owned over the years. I had an issue a few years back where the filename increment value on the device kept being reset every time I synced new files to my device, which after taking more pictures and videos eventually caused my synced files to be overwritten without warning, so I wrote a small script to generate unique 32-character filenames for all newly synced files from PC to device.

    The issue now is that I know I have a lot of duplicates that were shared between my spouse and myself. I was thinking, maybe I could write a small script that would generate a hash based on the files binary data not the filename itself so that I can compare hashes later to locate any duplicates.

    It got me thinking though, files have meta-data and I'm sure that's part of the binary data. So, does there exist, or is there a way, to hash only the relevant binary data that is not part of the meta-data so I can actually detect duplicates?

    Thanks in advance.

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

    How to assign more memory to heap

    Posted: 19 Feb 2020 05:17 PM PST

    On a macbook in terminal.

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

    [HTML JS] What is the proper way to do "data binding", so you can change the data when you click on the element that represents the data?

    Posted: 19 Feb 2020 09:26 AM PST

    Ok friends,

    I had a lot of fun doing this today. I really love to make little examples instead of writing my actual program. I guess it's because one is playing with legos and seeing how they work, and the other is trying to build something, but not having any creativity. Whatever.

    Anyway, here are the links for my today's question:

    W3 link
    Fiddle link

    We have some data, and we create boxes with that data. EzPz.

    If we click on a button, we delete the data. .remove() is apparently just the thing I wanted. I thought it throws the element and its children into limbo outside of DOM like removeChild(), but apparently, it's hasta la vista baby, and we are actually deleting them, which is good.

    Not only do we delete the element, but we also delete the data. That's because we utilized the .dataset property of our element. At first, I didn't like the idea of it, because it converts any data you give it to a string, and being able to slap my own property directly onto the element object seemed like a power move. But some people told me this was no bueno, so I used the dataset thing:

    function deleteData() { for(var i=0; i<data.length; i++) { if(data[i].id == thisElement.dataset.id) { data.splice(i,1); } } } 

    As you see, we are doing some brute forcing, and we loop through all the objects only to find one with the same object.id as our element.dataset.id. Not too happy with this solution. That's why you gotta tell me whether this is how you do it, or if there is a better way.

    Finally, we slapped on some inputs so we can add a new element in the index we like.

     function insertAfter(parentObject, i, elementObject) { var sibling = parentObject.querySelector("div:nth-child(" + i + ")"); //sibling.after(elementObject); sibling.insertAdjacentElement('afterend', elementObject); } 

    I am also really dissatisfied with the querySelector("div:nth-child()") solution. Dabbling with CSS just to get the index of a child of a parent seems like a hack fix. Really weak. Also, I tried out both .after() and insertAdjacentElement() and they both worked, so I dunno which one is better. I used the one that my mentor told me to use.

    So yea,

    1. Is the dataset way of doing it good?
    2. Any better way to structure the data, or is looping through all the objects like I do in my deleteData() function the only way?
    3. Using only pure vanilla html css js (no jQuery, Bootstrap, React, and other stuff), is there any better solution than :nth-element() ?
    4. Is .after better or insertAdjacentObject?
    5. What other advice do you have for me?

    Tnx!

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

    Looking for a backend or BaaS solution

    Posted: 19 Feb 2020 06:13 AM PST

    No comments:

    Post a Comment