• Breaking News

    Friday, December 11, 2020

    Which language to use Ask Programming

    Which language to use Ask Programming


    Which language to use

    Posted: 11 Dec 2020 12:37 PM PST

    So i am working on a pos system. I used html5 with indexed db and a service worker. (PWA)

    It all gets synced with mysql in the background. I just want it reliable and even to work if internet is down.

    Now i noticed there are 300 clients in the database with relations to other tables and indexeddb already becomes slow and instable.

    I really feel that javascript is not the right path right now as my fast pc has no troubles but slower pcs do.

    What language should i use with a pos system that i want to work on a android tablet, ipad tablet and on a windows pc?

    Any pointers will work and that it works offline with a database (preferably sql) is a must.

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

    Very simple question: How to run .js and css files from a repo?

    Posted: 11 Dec 2020 01:22 PM PST

    Silly question ahead, but first a bit of background: I'm (semi) proficient in python and been using linux for years, so I'm ok (and only ok) and I have vague notions of other stuff but not too much as yo will see.

    I found a repo with code to visualize audio and the files are all javascript and css:

    https://github.com/mtytel/lissa

    This is a webapp so I suspect I have to run it in my localhost, but not sure how to proceed, which file to run (I'm guessing under js/*.js), which commands etc.

    The readme is pretty sparse, and I'm ok with reaching out to the author but first I want to understand if I'm just not seeing something obvious given my lack of experience with these languages.

    See? Told you it was a silly question :) Any pointers appreciated.

    Cheers!

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

    Looking for an programmer for my school (questions, no programs)

    Posted: 11 Dec 2020 10:05 AM PST

    Yup, you read that right. I'm a dutch "middelbare school" student that needs help with their school. It will only take about 15 minutes of your life, as I would like to ask you about 10 questions about your job. It does not matter where you currently work, as long as you have the two qualifications below:

    - Has done an programming/coding study with an MBO diploma.

    - Currently works as an programmer.

    If you have BOTH the above qualifications, please DM or mail me!

    Email: quinnhegeman@outlook.com

    Discord: quinnyboy04#5115

    Reddit: u/quinnyboy04

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

    Why nothing comes out when there's supposed to be a chart?

    Posted: 11 Dec 2020 10:15 PM PST

    The problem is to parse a series of commands that instruct a robot arm on how to manipulate blocks that lie on a flat table. Initially, there are n blocks on the table (numbered from 0 to n − 1) with block bi adjacent to block bi+1 for all 0 ≤ i < n − 1 as shown in the diagram below:

    https://ibb.co/WpWQBYT

    The valid commands for the robot arm that manipulates blocks are:

    • move a onto b

    where a and b are block numbers, puts block a onto block b after returning any blocks that are stacked on top of blocks a and b to their initial positions.

    • move a over b

    where a and b are block numbers, puts block a onto the top of the stack containing block b, after returning any blocks that are stacked on top of block a to their initial positions.

    • pile a onto b

    where a and b are block numbers, moves the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto block b. All blocks on top of block b are 0: 0 1: 1 9 2 4 2: 3: 3 4: 5: 5 8 7 6 6: 7: 8: 9: moved to their initial positions prior to the pile taking place. The blocks stacked above block a retain their order when moved.

    • pile a over b

    where a and b are block numbers, puts the pile of blocks consisting of block a, and any blocks that are stacked above block a, onto the top of the stack containing block b. The blocks stacked above block a retain their original order when moved.

    • quit

    terminates manipulations in the block world. Any command in which a = b or in which a and b are in the same stack of blocks is an illegal command. All illegal commands should be ignored and should have no effect on the configuration of blocks.

    Input:

    https://ibb.co/pWJ9c7Q

    Output:

    https://ibb.co/Nt03mm3

    [I only type the first command for now.]

    my code:

    #include<stdio.h> #include<string.h> int main(){ int noi=0; printf("please input n:"); int n; scanf(" %d",&n); int arr[n][n]; int i,j; for(i=0;i<n;i++){ for(j=0;j<n;j++){ arr[i][j]=-1; } arr[i][0]=i; } char str1[5],str2[5]; int s,d; while(strcmp(str1,"quit")!=0){ s=0; d=0; while(!(s>=1&&s<=n&&d>=1&&d<=n)){ scanf(" %s %d %s %d",str1,&s,str2,&d); } if(strcmp(str1,"move")==0){ if(strcmp(str2,"onto"==0)){ //empty s for(i=0;i<n&&arr[s][i]!=-1;i++){ arr[arr[s][i]][0]=arr[s][i]; arr[s][i]=-1; } //empty d for(i=0;i<n&&arr[d][i]!=-1;i++){ arr[arr[d][i]][0]=arr[d][i]; arr[d][i]=-1; } //now move s to d i=1; while(arr[d][i]!=-1){ i++; } arr[d][i]=arr[s][0]; arr[s][0]=-1; }else if(strcmp(str2,"over")==0){ }else{ continue; } }else if(strcmp(str2,"pile")==0){ }else{ continue; } } //print results for(i=0;i<n;i++){ printf("%d:",i); for(j=0;j<n&&arr[i][j]!=-1;j++){ printf("%d ",arr[i][j]); } printf("\n"); } } 
    submitted by /u/JacksonSteel
    [link] [comments]

    Can I learn competitive programming and web development at the same time?

    Posted: 11 Dec 2020 08:34 AM PST

    How would I check for a new GitHub release from my React app?

    Posted: 11 Dec 2020 08:10 PM PST

    I have created a React app which I regularly release new versions of on Github. Whenever a user opens the Admin panel I want the page check if there are any new releases of the app on GitHub. How would I go about doing this? Is there some kind of api available for GitHub releases? Thanks.

    submitted by /u/g-e-walker
    [link] [comments]

    Are there IPV4-mapped / embedded IPV6 addresses that end with an IPV6 suffix?

    Posted: 11 Dec 2020 07:38 PM PST

    So I know there are IPV4-mapped IPV6 addresses such as ::ffff:0:1.2.3.4 - but I'm wondering whether there are addresses like ::ffff:0:1.2.3.4:: ? (I know that example in particular isn't valid, but I want to know whether there are such examples that are actually valid?)

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

    First language?

    Posted: 11 Dec 2020 11:41 AM PST

    Which language should I learn first?
    Something simple yet fun

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

    I keep getting 0% in analysis.txt

    Posted: 11 Dec 2020 05:50 PM PST

    https://repl.it/@owningbigbro/Sensor-Person-Co-Sim#main.cpp

    This is handled by the criticalPercent function in main.cpp and I'm not sure why i keep getting 0%

    submitted by /u/Lil-sam
    [link] [comments]

    How to write in code for brother as a christmas gift?

    Posted: 11 Dec 2020 01:10 PM PST

    Hi everyone! I'm super new to reddit, so this may be the wrong sub (please point me to a different direction if necessary!)

    My brother, Jake, has has been working a programming job for a couple years now. I've been searching for Christmas gifts for him and found this mug on Etsy. It's a coffee joke in C++ (I only half-know what that means), and he LOVES mugs, coffee, and programming jokes, so I'm planning on ordering it for him.

    I want to use the personalized option for him (it puts whatever text you want on the back), but i want to make it similar to the code on the front. I want to basically say: [if Jake's cup is empty] [fill it], but I have NO IDEA how to put that in the right format/language. Would anyone be willing to help me out? His favorite coding language is Python, so I was thinking maybe in that.

    Once again, I'm very new to Reddit, so if I'm in the wrong place, please let me know!

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

    Birthday present for daughter?

    Posted: 11 Dec 2020 04:32 PM PST

    I have no idea if this is the place to ask, and I'll delete it if it isn't. My daughter is 11 for reference. A while back (sometime last school year) she was bored so I told her to dismantle an old computer that died a blue screened death, just for funsies. Well she enjoyed it, and continues to ask for another computer to dismantle. We originally got her a birthday gift that would compliment the gift her dad got her, but that is now happening for Christmas. Her birthday is Sunday, and I'm just wondering if you have any in store ideas for something she could put together herself and maybe program? She got bored with the little robots, so I'm hoping for something more involved. TIA

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

    How important is it to have experience in different programming language?

    Posted: 11 Dec 2020 06:15 AM PST

    I started my job as a ios developer 3 months ago . One of my co-workers who is very experienced said that to succeed in it field , one should have a good experience in lot of different technologies. How important is that?

    submitted by /u/PIKa-kNIGHT
    [link] [comments]

    Char ** problem in c

    Posted: 11 Dec 2020 02:50 PM PST

    Hi, i am trying to read a file line by line from a txt file. Program supposed to read the line till "\n" and assign each line to a char ** array. In the while loop it seems that i can assign each line to a different index of array successfully but when i try to print a random index it always prints the last line from the file. Can anyone help me understand why ?

    char c[100];
    FILE *fptr;
    char * a[MAXA];
    scanf("%s",a);
    char ** test[MAXA];
    if ((fptr = fopen(a, "r")) == NULL) {
    printf("Error opening file");
    }
    int counter=0;
    while ((fscanf(fptr, "%[^\n]", c))!= -1)
    {
    fgetc(fptr);
    test[counter]=c;
    printf("%d",counter);
    printf(test[counter]);

    counter++;
    printf("\n");

    }
    fclose(fptr);

    printf(test[3]);

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

    Jupyter Question: exporting to static HTML

    Posted: 11 Dec 2020 02:10 PM PST

    I have a jupyter notebook in which I used ipywidgets interact (which, itself, uses ipywidgets.Output) and some text entry (ipywidgets.IntText, ipywidgets.Text), some container widgets (ipywidgets.HBox, ipywidgets.Tabs, ipywidgets.TwoByTwoLayout) and button (ipywidgets.Button) widgets. How can I export the notebook to static HTML capturing this output. I have already tried such things as saving widget state in the notebook before exporting with

    jupyter nbconvert --to html --template lab --HTMLExporter.exclude_code_cell=True my_notebook.ipynb 

    The output HTML has all my markdown, but none of my input widgets, nor the output produced by interacting with them. It looks like the notebook, with the code cells removed, and no output cells. The data is such that I cannot use Binder. Also my audience is looking to consume the analysis as a DOCUMENT (even if as an html document) and does not have the capability to execute the notebook for themselves (it queries a database they do not have access to).

    To be clear: I am not asking how to export the notebook to html such that the interactivity of the widgets and the output is preserved. I just want the widgets to render into the STATIC, NON INTERACTIVE document so that the reader can see what the input values were that produced the output, as well as the output itself. Basically I just want an html view of how my notebook appears when I open it in Jupyter after executing it.

    I feel like this shouldn't be so difficult, but it is.

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

    An app lost all my (and many other users’) data upon updating; how did this happen?

    Posted: 11 Dec 2020 07:42 AM PST

    I have a medical condition and an app that monitors my info. I've been using the app since 2013. Recently, when I logged in, the app had been taken over by a new company, and all my data was gone :(

    I didn't have to make an account or provide a phone number or other identifying info when I downloaded it in 2013. The company's been unable to retrieve my data (and the data of many other users). They offered to look for my account but were unable to find it despite my giving ample info.

    Shouldn't there have been a way to update the app and not lose the data? I guess I want to know what likely happened on the programming side from their end. Is losing all the data negligent or something hard to avoid?

    Also, can anyone think of a way it might be restored? I downloaded an iPhone backup extractor program and extracted files from an earlier version and sent it to them, but they still couldn't locate it. However, they were able to find another user's account simply from their dog's name being listed in one of the notes.

    Edit: Is there anything on iOS like system restore on Windows that could revert to an earlier version? Idk :(

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

    I have been stressing over my owl-carousel slider for days now and don't know how to fix it. Can someone please help?

    Posted: 11 Dec 2020 10:10 AM PST

    My slider looks like this:

    https://imgur.com/a/sUdjjyt

    The slider needs to display the photos side by side, instead it shows each photo one by one, with an enormous amount of space in between. I have played with every Owl Carousel script option (stagePadding, Margin, Items) and cannot for the life of me get this to work. I changed the CSS options too. One thing that might be an issue and I'm not sure how to resolve is the fact that these pictures are dynamically added into the slider based on what the user uploads on their listing page.

    I'd really appreciate if someone could help or guide me on what may be the issue.

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

    Need help on aggregation in NOSQL

    Posted: 11 Dec 2020 08:18 AM PST

    Can anyone please tell me how I get the outcome I want from the below.

    I have a database of managers past and present with players bought and how much they cost they club. e.g

    "_id" : "MN03",

    "first_name" : "Louis",

    "last_name" : "Van Gaal",

    "year_joined" : 2014,

    "at_the_club" : "N",

    "year_left" : 2016,

    "year_born" : 1951,

    "place_of_birth" : {

    "town/city" : "Amsterdam",

    "country" : "Netherlands"

    },

    "cups_won" : [

    "FA Cup"

    ],

    "coach_licence" : "Licence Trainer",

    "pref_formation" : "3-5-2",

    "average_term_years" : 2.21,

    "agency" : "Retired",

    "players_bought" : [

    {

    "first_name" : "Angel",

    "last_name" : "Di Maria",

    "cost_millions" : 57.5,

    "at_club" : "N"

    },

    {

    "first_name" : "Ander",

    "last_name" : "Herrera",

    "cost_millions" : 32.4,

    "at_club" : "N"

    },

    {

    "_id" : "SN09",

    "first_name" : "Anthony",

    "last_name" : "Martial",

    "cost_millions" : 54,

    "at_club" : "Y"

    },

    {

    "_id" : "SN23",

    "first_name" : "Luke",

    "last_name" : "Shaw",

    "cost_millions" : 33.75,

    "at_club" : "Y"

    }

    ]

    "_id" : "MN02",

    "first_name" : "Jose",

    "last_name" : "Mourinho",

    "year_joined" : 2016,

    "at_the_club" : "N",

    "year_left" : 2018,

    "year_born" : 1963,

    "place_of_birth" : {

    "town/city" : "Setubal",

    "country" : "Portugal"

    },

    "cups_won" : [

    "EFL Cup",

    "Europa League",

    "English Community Shield"

    ],

    "coach_licence" : "UEFA Pro Licence",

    "pref_formation" : "4-2-3-1",

    "average_term_years" : 1.87,

    "agency" : "Gestifute",

    "players_bought" : [

    {

    "_id" : "SN06",

    "first_name" : "Paul",

    "last_name" : "Pogba",

    "cost_millions" : 94.5,

    "at_club" : "Y"

    },

    {

    "first_name" : "Romelu",

    "last_name" : "Lukaku",

    "cost_millions" : 76.23,

    "at_club" : "N"

    },

    {

    "_id" : "SN31",

    "first_name" : "Nemanja",

    "last_name" : "Matic",

    "cost_millions" : 40.23,

    "at_club" : "Y"

    },

    {

    "first_name" : "Alexis",

    "last_name" : "Sanchez",

    "cost_millions" : 30.6,

    "at_club" : "N"

    }

    ]

    I want to be able aggregate to show me the managers name and how total cost of transfers. I've spent a while but I'm not doing it right.

    db.managers.aggregate(

    [

    {$match: {} },

    {$group: {_id: "$first_name", total: {$sum: "$value_millions" }} }

    ]

    )

    has an outcome of :

    { "_id" : "Ole Gunnar", "total" : 0 }

    { "_id" : "Jose", "total" : 0 }

    { "_id" : "Louis", "total" : 0 }

    which isn't right, anyone able to help me please?

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

    Where does this military analogy regarding types of software developers come from?

    Posted: 11 Dec 2020 06:09 AM PST

    I remember having read the following simplified analogy regarding types of software developers.

    • Kamikaze: A Person who fearlessly tries out new approaches and technology.
    • Soldier: A person who builds and maintains solidly working things.
    • Sniper: A person who chimes in when things become very tricky.

    Right now, I don't care if it makes sense or misses something important, I just want to know where it originates from, i.e., who wrote about it.

    I've searched for it but up to now did not find the source. Does anybody know or is able to find out? :-)

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

    How does one evaluate Flutter and dart vs Swift

    Posted: 10 Dec 2020 11:57 PM PST

    Hello, I am a high school student writing an essay comparing the app development process on flutter and swift. However, I am stuck on the metrics on how I would be able to compare the 2. Intuitively, performance and build time occur to me.

    However, as I am not an experienced programmer by any means, I do not what other feature people look at when deciding to use one language over the other(In this case flutter and dart vs swift and its own SDKs, in order to help me build my argument.

    Also, it would help me a lot if you guys could recommend a few reading materials to me. Thanks in advance!

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

    Is it always necessary to follow the SOLID principles when developing a system or are there times people tend to not follow that?

    Posted: 11 Dec 2020 04:54 AM PST

    I'm just a student wondering if the lessons that I learned in class is strictly followed by professionals or there could be times where they ignore that.

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

    Need help about Google Text to Speech

    Posted: 11 Dec 2020 12:37 AM PST

    Hello, When i use google text to speech, i need to know what it says in every 3 seconds. What i mean by that is, i just need a marker or something after every 3 seconds when google converts audio to text since i cant understand which second is it converting currently. I tried parse the audio file into chunks and send it to google but success rate was too low. Is there any way to do it? Thank you in advance.

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

    Prevent Multiple form submits using a Counter ?

    Posted: 10 Dec 2020 11:11 PM PST

    Now, what I tried doing is as follows :-

    Profile Page

    Email : [example@example.com](mailto:example@example.com)[Edit Details Button]

    Edit Details Page //user is sent here if s/he clicks on *Edit Details Button*

    <form id='inputform'>

    <input type="text" name="email" id='email'>

    <button type="submit" id='submitform'>Submit</button>

    </form>

    <script>

    //Script part below

    </script>

    Script

    //validation part here

    var noofsubmits = 0;

    $('#submitform').on('click',function(e){

    e.preventDefault();

    noofsubmits++;

    if($('#inputform').valid()){

    if(noofsubmits == 1){

    $('#inputform').submit();

    //redirect users to a different page on successful form submission

    }

    }

    });

    On every form submit, the user is redirected to the profile page (which shows updated info). Now, everytime the user tries to edit details , the varialbe `noofsubmits ` is set to `0`.

    I am not having any problem with this method, but is there any problem with this method? Like what if the user disables Javascript in the browser, so would this method not work?

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

    No comments:

    Post a Comment