• Breaking News

    Sunday, May 17, 2020

    How Does MySQL Web Frontend Even Work? Ask Programming

    How Does MySQL Web Frontend Even Work? Ask Programming


    How Does MySQL Web Frontend Even Work?

    Posted: 17 May 2020 03:34 PM PDT

    Hi all!

    By accident, I got into a kind of technical position at the company I work with without any prior experience or formal education and in a year or so it came to the point where I need to figure out how to upgrade our systems from Google Sheets and Apps Script to something more advanced, practical, powerful and faster, so my choice was MySQL.

    I'm on the course right now, learning the basics, but there's one thing that hasn't been mentioned and it's kinda annoying me and I can't find the exact answer - can you make your database accessible from any remote PC even if you're using a local machine as a server?

    Is it possible to have a dedicated PC, perhaps with some Linux distro such as Ubuntu Server 18.04 serving as a server and still have my database accessible via web app?

    What should I look for (which resources to search) to learn how to achieve this (I honestly don't know how to google this as all searches kinda end with not what I was looking for)?

    Is there any specific benefit to using PHP for the front end (as it kinda seems the most commonly mentioned option)? Can I substitute PHP with Python for example (I have experience with C# and Java, so Python seems closer to home than PHP)?

    Can I use my web front end to update the database using .csv imports and do .csv exports for the user?

    Can I make different types of users with different permissions?

    Thanks, and sorry for the wall of text!

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

    JSON or record for multi languages?

    Posted: 17 May 2020 09:26 PM PDT

    Hi guys, I'm working on the multi languages feature, the data I need to deal with is something like:

    - id: "app.hello",

    - values: {

    "EN": "Hello",

    "FR": "Bonjour",

    ...

    }

    - ...

    I'm considering 2 ways to store this data:

    1. Using only 1 table, which has the "values" column as JSON type
    2. Create 3 tables in the database: 1 is for id and other attributes (id: "app.hello", ...), 1 is for language code (id: 1, code: "EN"; id: 2, code: "FR", ...), and the last one is joining table (table1_id: "app.hello", table2_id: 1, value: "Hello", table1_id: "app.hello", table2_id: 2, value: "Bonjour, ...")

    My question is, which one is better for the system? Those data will be access and edit frequently, and from what I've heard, JSON is not a good idea if you need to edit data often.

    Sorry for my bad english, I'm tried my best :D

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

    What Are Some Good Books/Resources for Learning About Language Binding?

    Posted: 17 May 2020 09:08 PM PDT

    I want to learn how language bindings are created for programming languages. So far I've only come across resources that describe what the process is, but not how it's implemented or the theory behind it.

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

    Not sure if this is the right sub but, can anyone tell me where I can go to get information on the history of game development as a business model?

    Posted: 17 May 2020 05:15 PM PDT

    Best way to manage user accounts for a basic CRUD app?

    Posted: 17 May 2020 04:37 PM PDT

    What's the best way to manage user accounts? This is for a public-facing CRUD app that doesn't manage financials or anything but does need user registration, logins, etc.

    I've tried Auth0 but the login module takes a really long time to load on some machines so I thought I'd maybe just make my own, but I'm afraid I'll overlook something since it'll be the first user account system I've ever made.

    Wondering if there's a tried-and-true method for doing this or if I should just go in and follow a guide for making one from scratch.

    Stack is Vue, Express, Postgres.

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

    How do we work simulatenously with my team on a Git repository?

    Posted: 17 May 2020 04:36 PM PDT

    Ok, now. Here comes a beginner question.

    There's something I don't understand, and nobody appears to be explaining correctly to me. When you work on a repository in Git/GitHub, is it not possible to work on different features at the same time?

    Let me explain. We have a Unity3D project uploaded into our GitHub repository. So I make a new branch from the master branch and add a new feature. Before I push it back into master, some other member of my team also made his own branch from the master branch and added his own feature. So now I finally push it, but now my team member can't push it himself because he has a conflict with the version of the master branch he had originally cloned.

    So is it necessary to wait until I finish, before my team member can create a branch and start working on his own feature? I'm confused. How do people work on the same project at the same time?

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

    How should I go about deploying my scalable website?

    Posted: 17 May 2020 10:39 PM PDT

    I wrote this NodeJS website thing. It is compounded of:

    1. A central postgreSQL database.
    2. A central Redis Database (mostly for pubsub).
    3. Node Clusters which each are made of one nginx, one redis, one node manager instance, and as many extended instances as possible.

    It works this way, nginx is just handling the traffic and loading it into the nodes, the manager node is in charge of talking to the central redis database to copy and keep synchronized data from postgreSQL into the local redis; data is copied and kept locally on demand, in order to keep most operations local; that way I can launch a EU cluster, USA cluster, Russia cluster, etc... basically CDN'ing logic.

    My current issue is, I need a thing that does this:

    1. Launch the manager node and keep it alive, if it dies, revive it.
    2. Launch as many extended nodes as it sees fit, ensure there's not port collision, extended nodes can be from 0 to infinite.
    3. Launch (or not depending on configuration) a redis instance and keep it alive.
    4. Launch (or not depending on configuration) a postgreSQL instance and keep it alive.

    Nginx is kept separate from this, mainly because all it does is proxy traffic and do HTTPS, that's like, one configuration file away, it can run at host level.

    I am able to do each right now with docker, but only one instance at a time, one port at a time, and if it dies, it dies, I need to keep all these instances together but I check on the internet and my brain explodes with contradicting information.

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

    Stringstream trouble taking first character

    Posted: 17 May 2020 10:02 PM PDT

    So I am simply trying to reverse a string and store that into a stringstream. My problem is that the stringstream won't take in the first initial character I try to input.

    void PrintReverseString(const string& str, ostream& output){

    if(str.size() == 0) { return; } else { output << str[str.size() - 1]; PrintReverseString(str.substr(0, str.size() - 1)); } 

    }

    First word I test with is "hello" and output ends up being "lleh". The annoying this is if I output str[str.size() - 1] it will output each character of "hello", so output simply doesn't take in the first character I try to input into it.

    Here's the code for my test:

    for (int i = 0; i < TESTS; ++i) { out.clear(); out.str(""); PrintReverseString(strings[i], out); if (out.str() == reverses[i]) cout << "\tPassed " << ++passed << " tests" << endl; } 

    Any help is appreciated, thanks a lot.

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

    How likely will a programmer develop software for percentage rights?

    Posted: 17 May 2020 09:57 AM PDT

    My extent of programming is having watched Silicon Valley. Well, I made a skiing game on a floppy disk in 1992.
    Anyway, I write professional business plans for extra money. A month ago, I wrote the first one where I had to sign an NDA (and something else). It was my first internet start up business, and the first business model to wow me. One month later, I'm at the very least, a part of the team.
    For software, there will need to be a website and unique software that interacts with the site. We will need an app as well. This start up is a large endeavor and I wonder if there are programmers out there who would work in a home for 3-15 months building this business for percentages of the company.
    If yes, I'd appreciate any advice.
    My main questions would be:
    Will a programmer from my city work, or since this is large-scale and intricate, should I get someone from California who has worked in the industry?
    Is there a large benefit having programmers work in a "pod" versus working remotely?

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

    Wifi/Lan bridge Raspberry Pi 4b (Raspbian) and Network Display

    Posted: 17 May 2020 07:53 PM PDT

    TLDR; Want to automate a command, and want to display internet sharing speed on built-in display (first request is more time sensitive, second is just something i'm wondering about)

    I have my raspberry pi 4b set up to share my wifi connection to its ethernet port so that I can use it as a WAN and connect things that don't have wireless capabilities—

    (Obviously I could run an ethernet cable from my router or get a powerline adapter but I really want to set this up just to see it working)

    —That was simple enough, and I only have one dumb question about it. It automatically runs the whole script except for the verryyy last command which is simply

    sudo service dnsmasq start

    and I would like that command to automatically run on every reboot. There seems to be solutions but there's so much noise that i'm not sure which to use.

    The real question I have is related to displaying network stats on the 3.5 inch MHS display I have set up. Currently, when the pi is on, the little display just shows the GUI home screen. I was wondering if it was possible to show, in real time, the internet speed that the Pi is providing. I just think it would be cool, especially for devices that aren't a literal computer and can't run a speed test.

    I'm a simple electrical engineering student so coding outside of C or verilog is rough lmao, so if anyone has a solution that they'd like to explain i'd be more than happy to read it, but please provide the actual code as well

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

    system() calls in different languages more likely to succeed?

    Posted: 17 May 2020 07:41 PM PDT

    I wrote a little backup utility and tried to call rsync or scp with a c system() call to copy a file to a remote server and it just doesn't work. So I am thinking maybe I should just do the remote copying from a bash script which I am sure will work, but for me bash is like a last resort. I would really prefer to use another language like Python, but is Python basically just doing the same thing that C is doing when calling the command shell?

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

    How to count the occurence of a word in a specific column in Unix?

    Posted: 17 May 2020 03:46 AM PDT

    How do I count the number of times the word 'house' appears in my 'building' column in column 3?

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

    Software for making iOS apps on Windows?

    Posted: 17 May 2020 07:19 PM PDT

    Software for making iOS apps on Windows? Not like running a macOS machine on the cloud, just straight up software that is meant for Windows.

    submitted by /u/8blackears
    [link] [comments]

    [C#] How was the arithmetic shift performed with the right shift operator?

    Posted: 17 May 2020 10:49 AM PDT

    https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#code-try-1

    "If the left-hand operand is of type int or long, the right-shift operator performs an arithmetic shift: the value of the most significant bit (the sign bit) of the left-hand operand is propagated to the high-order empty bit positions. That is, the high-order empty bit positions are set to zero if the left-hand operand is non-negative and set to one if it's negative."

     int a = int.MinValue; Console.WriteLine($"Before: {Convert.ToString(a, toBase: 2)}"); int b = a >> 3; Console.WriteLine($"After: {Convert.ToString(b, toBase: 2)}"); // Output: // Before: 10000000000000000000000000000000 // After: 11110000000000000000000000000000 

    Not sure if I understand the thing. Which ones are high-order empty bit positions? 1000 - the last three 0s? And they were replaced by 1 which is the value of MSB? But it also say they will be set to zero if the left hand operand is non negative

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

    i need help

    Posted: 17 May 2020 04:23 PM PDT

    how can i calculate percent in python?

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

    Weird results using SFML (having files using SFML in my project folder makes my code run differently)

    Posted: 17 May 2020 11:49 AM PDT

    Hi, I wanted to simulate the path of a robot running into a maze. I have a code finding a path into the maze which works perfectly. But when I wanted to use SFML to draw a maze, the path wasn't correct and the results was different for each run of my code. So I tried to run my path finding code again (without trying to draw a maze) and the results were the same : not correct and not the same each time I ran the code. This is weird because with the same main file with the same code, the results are different depending on if I have the files using sfml in my project folder or not (If I have them it doesn't run as expected it's random but if I remove them from the folder it works perfectly) Thanks you for any help !

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

    How to convert this recursive function to a tail-call optimized one?

    Posted: 17 May 2020 03:24 PM PDT

    This is Java code, lets pretend Java has tail call optimization.

    Here is some code to compute the sum of all big children (where a big child is the bigger child of the 2 children of a binary tree node) in a binary tree. Assume for simplicity that a node either has 0 or 2 children:

    int calculateSum(Node root) { if (root == null) { return 0; } if (root.left == null && root.right == null) { return 0; } return Math.max(root.left.value, root.right.value) + calculateSum(root.left) + calculateSum(root.right); } 

    The 2 ways that I've been taught to convert a normal recursive function to TCO are to either create an accumulator (like with a tail call optimized fibonacci) or to use CPS. CPS I understand, but how to create an accumulator here?

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

    How do i take notes effectively for programming.

    Posted: 17 May 2020 03:24 PM PDT

    I am learning java and I like to take notes on a computer with google docs. The problem is, it that it is difficult to write code because of autocorrect and improper spacing directly in docs. I dont want to turn these off because i like them, except when it interferes with coding.I dont want to type code in a compiler and copy it over. Is there some note taking software where it allows me to write normally, but then quickly switch over to code in the same window?

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

    What are things you wish you have in your everyday work life that will help you?

    Posted: 17 May 2020 08:49 AM PDT

    So I think I need to be more specific, as a developer or a tester, or anyone involved in the industry, what is something that you have or would like to have to help you. Like for me anything that can pop up everyday on my laptop and tell me the tasks that I have to do compared to what I did yesterday would be helpful.

    What about you guys?

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

    Using express middleware while react is doing the routing?

    Posted: 17 May 2020 02:19 PM PDT

    I am using React for the front. But unfortunately, my express server only fires all the middleware when I'm making post requests to the server. For example:

    server.use((req, res, next) => {

    console.log(req.session);

    console.log(req.user);

    next();

    });

    This middleware will not run untill I make a post request, but I want to recognize the session as soon as someone visits my page.

    currently, I use react for routing. I assume that the problem occurs because of that since moving between pages doesn't really uses express (?):

    <Router>

    <Switch>

    <Route path="/success" component={Success} />

    <Route path="/exists" component={Exists} />

    <Route path="/error" component={Error} />

    <Route path="/404" component={PageNotFound} />

    <Route path="/register" component={Register} />

    <Route path="/login" component={Login} />

    <Route path="/dashboard" component={Dashboard} />

    <Route path="/:userId" component={Form} />

    </Switch>

    </Router>

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

    Why isn’t the full code needed when implementing it as a class variable? #Java

    Posted: 17 May 2020 01:40 PM PDT

    I was under the impression that for array lists you always had to set it up as:

    Private static arrayList<string> myArrayList = new ArrayList<String>();

    But for a program that links the arrayList to a class called Contact with two String variables I see it's implemented like:

    Private ArrayList<Contact> myContacts;

    And that's all. My question is why isn't static needed. And why isn't half of the array code needed past the = needed . As in "new ArrayList<Contcact>();"

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

    How to store my sensitive environment variables

    Posted: 17 May 2020 03:15 AM PDT

    Hey guys.

    This morning i poundered the question:

    Where do you store sensitive env variables ?

    I use to have my dotfiles in a repo (files included .bashrc) and i'm currently working on some scripts for automatisation that use API key with environment variables.

    In my case i don't want to push my .bashrc update that include export TRELLO_API_KEY="kjhskjhs" for example.

    My first idea was to create a special file .env_secret and add it to my .gitignore file.

    How do you guys tackle this need ?

    Just for information, i use to store all my private stuff in Keepass 2

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

    Ffmpeg help

    Posted: 17 May 2020 11:58 AM PDT

    Hey I'm in desperate need of help I want to batch trim 7 seconds off 100 mp4 videos Please can some help me by writing the correct command to do it, I will cmd from the correct folder. I did try a command I found but kept getting the error For %a in ("*. Mp4") do Also I have the ffmpeg downloaded and extracted to the root of the folder with the . Bat and mp4s is that correct? Or do I need to some how install it

    Please help I'm at a loss

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

    Alert on Website or Email

    Posted: 17 May 2020 09:34 AM PDT

    Hi guys,

    I have a website for a pizza place where you can order pizza. My problem is how to get loud and repeated alert when someone orders? I have free wordpress theme and I was thinking to get alert by email. But Gmail has very little options and extensions I used are not repeating. Just one alert and that's it. I am afraid the workers won't hear it. Do you have some simple suggestions?

    Thank you so much!

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

    Which algorithm to encode string into shorter string (and vice versa)?

    Posted: 17 May 2020 05:36 AM PDT

    I need an algorithm which can shorten string from a narrow pattern to a broader pattern ( similar to hashids.org but they only accept integer as input).

    For example I have this string: "cgaol5bc0hk41qgt5sxh" (/[a-z1-9]/)

    I want to encode this into another string which is shorter: "92y!Xm80" (/[a-zA-Z1-9!~.<>-_]/). (this is just an example).

    So using hashids.ord, I can only set output alphabet, I want something which I can set both input alphabet and output alphabet.

    I am pretty sure this is possible but I don't know the name of this algorithm

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

    No comments:

    Post a Comment