• Breaking News

    Saturday, January 16, 2021

    how can i make an application for your friend without their antivirus having an aneurism? Ask Programming

    how can i make an application for your friend without their antivirus having an aneurism? Ask Programming


    how can i make an application for your friend without their antivirus having an aneurism?

    Posted: 16 Jan 2021 06:20 PM PST

    i've tried so many times to make a simple python program into an executable and each fucking time i have to convince them i'm not trying to steal their credit card info.

    i doubt this is possible as if it was malicious programs would use this technique too, but is there any sort of license or authentication i could add to my things to make me seem sane???

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

    Why should I use Nginx over Tomcat, Gunicorn or IIS?

    Posted: 16 Jan 2021 10:37 AM PST

    So this is something I don't understand. When you're creating a web app, you can use stuff like Gunicorn for Python, Tomcat for Java and IIS for C#.

    Those are all usable in production and utilize multiple threads to serve requests.

    However, I see people choosing to use Nginx at times. I know that you can use Nginx as a load balancer and and API gateway but that can't be the only reasons to use it.

    Also, if you're running your stuff on Kubernetes does it really make sense to use Nginx as a load balancer/reverse proxy?

    I would appreciate it if someone could clear this up for me.

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

    Would an IDE plugin that comments out all console.log calls in your code be useful?

    Posted: 16 Jan 2021 03:23 PM PST

    Many times I would have found it useful, yet I've never seen the ability and was thinking of making one. Maybe it's just me that runs into this tho.

    My scenario: Thinking mostly JS/TS (used in FE frameworks). Building some overlapping functionality, eg auth. Finished the login, don't need most of the console logs anymore, but create account/forgot password uses some of those pieces also, so I don't want to delete all them. Comment out all, then find the few left you need until the piece is complete.

    Yes, find and replace works, but right click on a folder or project and comment all would be quicker.

    Break points in the browser code have their place, but I almost always find logging to the console better, but maybe that's just me.

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

    How to design for my need - A dynamic array to hold the state of a grid?

    Posted: 16 Jan 2021 05:38 PM PST

    I'm programming a game in unity and I made a Grid class. Whatever game object this Grid component is applied to, it will automatically build a grid on top of it.

    For a moment, imagine that you have a 2d square on screen of dimension 10x10. Once you apply this Grid component, it will overlay cells on it based on the grid "size". Let's set size to 1. You will have 10 evenly spaced grid spaces on top of your square.

    Now the hard part... I want to position other game objects on the center of the cell positions simply by calling grid.GetNextCellCenter(). Default behavior will start in the bottom left and fill in right and up.

    I want to see this list in the editor, with each game object that is occupying that grid space at the moment. Game objects can exit the space at any time, but a new object entering it must start on the bottom left as much as possible.

    What im struggling with is that I feel like I need both an array and list functionality in one:

    1. I need the array to be of a set size (calculated by the dimensions of the object the grid component is on and the cell size)
    2. I need to add and remove the game objects that are occupying the grid spaces at any time (like a list).

    Does anyone have any suggestions on how to do this, or do it by simpler means?

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

    Looking for some API projects

    Posted: 16 Jan 2021 09:16 PM PST

    I'm looking for some simple API projects to complete. Nothing too elaborate and fancy. Just something to practice my JS skills.

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

    Difference between SOFTWARE DEVELOPER and SOFTWARE ARCHITECT

    Posted: 15 Jan 2021 10:12 PM PST

    I wanted to know what is the difference between a software developer and a software architect, and what roles do they play in a company.

    I also have another doubt, is a systems software engineer the same as a software architect?

    NOTE: I humbly request members of this subreddit to understand I am not a very educated person, but very curious and willing to learn about programming. If my question seems stupid please forgive me.

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

    Java Builder cosmetic changes, any downsides?

    Posted: 16 Jan 2021 02:57 PM PST

    Hi Everyone!

    I tend to use the Builder pattern a lot and I really like it.
    However, I notice that most of the times, the actual Builder object is implicit when wanting to create a new object. Since builders are often written using a fluent api, I almost never have to store them in a variable.
    e.g:
    BuiltObject o = new BuiltObject.Builder().withInt(10).withString("string").build();

    That is why, lately I've been writing builders a little differently, leveraging that implicit nature. Consider an object to be built that has an int as a mandatory parameter.
    Instead of:
    ``` public class BuiltObject {

    private final int intParam; private final String stringParam; private BuiltObject(int intParam, String stringParam) { this.intParam = intParam; this.stringParam = stringParam; } private static class Builder { private int intParam; private String stringParam; public Builder(int intParam) { this.intParam = intParam; } public Builder withString(String stringParam) { this.stringParam = stringParam; return this; } public BuiltObject build() { return new BuiltObject(intParam, stringParam); } } 

    } ```

    I would combine them with some static factory methods and write something like this:

    ``` public class BuiltObject {

    private final int intParam; private final String stringParam; public static Builder withInt(int intParam) { return new Builder(intParam); } public static BuiltObject newBuiltObject(Builder builder) { return builder.build(); } private BuiltObject(int intParam, String stringParam) { this.intParam = intParam; this.stringParam = stringParam; } private static class Builder { private int intParam; private String stringParam; private Builder(int intParam) { this.intParam = intParam; } public Builder withString(String stringParam) { this.stringParam = stringParam; return this; } private BuiltObject build() { return new BuiltObject(intParam, stringParam); } } 

    } ```

    Notice that the Builder constructor is private and also the build() method, so that they can't be called outside this class.

    Uses are something like (when static methods are statically imported):

    BuiltObject o = newBuiltObject(withInt(10).withString("string"));

    What do you think? Do you see any downsides? Do you like it? Thanks!

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

    How do I edit the font style of my site title for my wordpress theme?

    Posted: 16 Jan 2021 05:33 PM PST

    the tricky thing is that two letters in my site tittle need to be regular and three (in the middle) need to be italic.

    I know HTML, CSS, and some PHP basics. I am looking at the stylesheet document and I'm just not sure where/what to change.

    I'm aware about child themes etc. I will copy/paste the code her if you want to point out specifically what/where to make changes.

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

    Why doesn't here need clearerr for feof?

    Posted: 16 Jan 2021 05:25 PM PST

    https://ibb.co/zGNcCZp

    #include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int i=0; int arr[100]; while(1){ scanf("%d",&arr[i]); if(feof(stdin)){ break; } i++; } int j; for(j=0;j<i;j++){ printf("%d ",arr[j]); } i=0; printf("\n"); while(1){ scanf("%d",&arr[i]); if(feof(stdin)){ break; } i++; } for(j=0;j<i;j++){ printf("%d ",arr[j]); } } 
    submitted by /u/JacksonSteel
    [link] [comments]

    Game dev’s, how do game engines and coding tie together.

    Posted: 16 Jan 2021 06:03 AM PST

    I know very little about game development and want to try to get into it but am pretty confused. When making a game I know you use an engine, I just don't know what that is and how it ties into coding. Also which engine would you prefer, I know that unreal uses c++ and I think unity uses c#? Thank you for all the replies.

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

    Environmental Variables in cmd to python.

    Posted: 16 Jan 2021 05:08 PM PST

    In the cmd prompt in windows I have SET multiple variables to value however, when I try to interact with those environmental variables by import os and using os.environ[''] I get a Keyerror.

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

    Why am I getting this error message?

    Posted: 16 Jan 2021 07:52 AM PST

    Please see my code snippet below.

    menu.addDishToCourse('appetizer', 'salad', $4.00);

    menu.addDishToCourse('appetizer', 'duck', $4.50);

    menu.addDishToCourse('appetizer', 'soup', $3.50);

    menu.addDishToCourse('main', 'steak', $24.00);

    menu.addDishToCourse('main', 'fish', $16.00);

    menu.addDishToCourse('main', 'pork', $20.00)

    menu.addDishToCourse('dessert', 'pie', $7.00);

    menu.addDishToCourse('dessert', 'icecream', $6.00);

    menu.addDishToCourse('dessert', 'cheesecake', $9.00);

    const meal =

    menu.generateRandomMeal()

    console.log(meal);

    I am getting the following error message:

    /home/ccuser/workspace/learn-javascript-objects-meal-maker/app.js:48 menu.addDishToCourse('appetizer', 'salad', $4.00);

    ^^ SyntaxError: missing ) after argument list

    at createScript (vm.js:53:10) at Object.runInThisContext (vm.js:95:10) at Module._compile (module.js:543:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.runMain (module.js:605:10) at run (bootstrap_node.js:427:7) at startup (bootstrap_node.js:151:9)

    I can't figure out why because all the ) are there!? I've tried commenting out the first line of code but then the error message just moves onto the next line with the same message about the missing ).

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

    Does git submodule add automatically pulls a repository's files?

    Posted: 16 Jan 2021 12:59 PM PST

    AFter git init in a project, if you make a git submodule such as

    git submodule add -f git@github.com:rbenv/rbenv.git .rbenv will it clone the requested repo or do you need to git pull origin manually??

    can someone clarify thanks

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

    What would be the easiest language to learn for a complete beginner?

    Posted: 16 Jan 2021 12:56 PM PST

    CSS for custom google search box

    Posted: 16 Jan 2021 12:56 PM PST

    On the site I'm trying to build: https://www.dynomotion.com/test/index-search.htm the cursor does not focus within the search box. Does anybody know I have done wrong?

    For the styling of the search, I use the following css:

    #cse-search-form { position: relative; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; background: #f2f2f2; padding: 3px; } .gsc-search-box-tools .gsc-search-box .gsc-input .gsc-input-box, .gsc-search-box-tools .gsc-search-box .gsc-input .gsc-input-box-focus { height: 15px; -webkit-border-top-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; -moz-border-radius-topleft: 3px; -moz-border-radius-bottomleft: 3px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; border: 1px solid #dadada; padding: 3px; } 
    submitted by /u/CellFirm
    [link] [comments]

    What language(s) allow more control for parallelization?

    Posted: 16 Jan 2021 11:57 AM PST

    The main challenge I'm facing is that I have an "if" statement which, if triggered, needs to tell the other workers in a parallel process to wait. What language would be nice for this? I only have experience programming in MATLAB/Octave and a little bit of python, and the extent of my parallel programming experience is just parfor-type commands. The particular process I need to do is outlined below (sorry for bad formatting, I'm new here)

    I want to program an iterative method, where at every iteration n, I am running several operations in parallel, say T_1, T_2, ..., T_m. Some of these functions require drastically different times to evaluate; some of them require the same amount of time to evaluate. The way we take advantage of parallelism is by not waiting for everything to complete at every iteration; we allow for a lag term, which is M below. Here is a rough pseudocode; also evaluation of F is very cheap in my context.

    • Initialize: x_old, and for each i between 1 and m, set t_i = T_i(x_0).

    for n in 1, 2, ..., N (for some large N)

    • (parallel) for i in 1,...,m, If worker i is available, evaluate t_i=T_i(x_old), and store the index n_i=n.
    • If M iterations have passed since the process t_i=T_i(xold) started *(i.e. if n>M+n_i), wait for that process to complete.
    • Once some number, k, of these processes finishes (and we are not waiting for something to complete, as in the clause above), do: x_new = F(t_1,t_2,...,t_m,n_1,n_2,...,n_m); x_old=xnew.

    The bulk of the work in this algorithm is evaluation of the T_i's. I suppose I'm not really sure how to code the M statement above, or how to even check the number of processes which have completed.

    submitted by /u/Z-Math
    [link] [comments]

    Transition from Laravel to spring boot

    Posted: 16 Jan 2021 11:32 AM PST

    I live in an area where there are few php related jobs in place. Most of the companies are looking for java developers. So I'm going to do a quick transition from Laravel to spring boot in the upcoming weeks. Due to some personal reasons. I know it is hard to learn a full framework in few weeks. But in my situation I have to try hard.

    I have like 3 months of experience in java and servlets with jdbc. And 3 years of experience in Laravel building REST APIs and Web projects. I want to know how to map my current Laravel and java knowledge for a quick learning approach to spring boot. If anyone can give a path it will be really helpful.

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

    Can't figure out this error message.

    Posted: 16 Jan 2021 11:14 AM PST

    I'm getting an error message for the code below which says 'unexpected token . '. And it's the . after this .

    getRandomDishFromCourse(courseName) {

    const dishes = this._courses[courseName];

    const randomIndex = Math.floor(Math.random() * dishes.length),

    return dishes[randomIndex];

    },

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

    "Graph-oriented" programming language

    Posted: 16 Jan 2021 04:44 AM PST

    Wich programming languages do you know except FORTRAN, R and Python, which are well suited for working with graphs? ( I'm interested in graphs like in graph-theory and not function-graphs)

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

    Another error message...

    Posted: 16 Jan 2021 08:23 AM PST

    I am getting the error message:

    this._courses[courseName].push(dish);

    TypeError: Cannot read property 'push' of undefined

    for the following code.

    addDishToCourse (courseName, dishName, dishPrice) {

    const dish = {

    name: dishName,

    price: dishPrice,

    };

    return this._courses[courseName].push(dish)

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

    I need help with extracting a number using a function without loops or cmath in C

    Posted: 16 Jan 2021 08:06 AM PST

    #include <stdio.h>

    int countDigit(int n)

    {

    if (n == 0)

    return 0;

    return 1 + countDigit(n / 10);

    }

    int digitExtract(int n, int d){

    }

    int main(void)

    {

    int n,d;

    scanf("%d",&n);

    scanf("%d", &d);

    printf("Number of digits : %d", countDigit(n));

    printf("The digit on number %d is %d", d, digitExtract(n,d));

    return 0;

    }

    So if the user enters 3555 and 3 for example the code prints

    Number of digits: 4 and The Digit on number 3 is 5.

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

    What would happen if you "coded your own" debit card?

    Posted: 16 Jan 2021 12:51 AM PST

    I'm guessing something like this would PROBABLY be illegal without first acquiring permits and everything so dont get any funny ideas- It's just a thought experiment.

    Lets say you understood how chip readers work, meaning you know what information they request from the chip and all the necessary steps needed to finish the transaction.

    You go home and create a shoddy debit card that has a chip you assembled that mimics the necessary steps.

    Now what if you made the chip tell the card reader that you have $25 in your account instead of $15 or whatever.

    There is no account obviously, it just sends dummy data in a correct way so the chip reader thinks everything is hunky dory.

    I feel like that could not possibly ever actually be a thing that could work... but I honestly dont see why it theoretically wouldn't.

    You could even set up some weird online "bank account" that the chip tells the chip reader where to look to see if there is enough money in the account-- you could obviously set that number to whatever you wanted.

    PSA!! I dont advocate that ANYONE even attempt to try that because its probably fraud lol. It's just a weird what if thought.

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

    Should globals be avoided at all costs?

    Posted: 16 Jan 2021 12:17 AM PST

    I'm building an MVP and an advisor who's built 90+ apps advised to just get the MVP out then fix it later or hire a team. "There will be security risks you can't simulate regardless"

    For context, I keep running into problems that could easily be solved via globals, however the past week I've been trying to solve a single non-complex problem which would take a second if I use a global variable.

    I'm well aware of the benefits of not having globals however I'm not sure running away from it to the point where it impacts the deadline of product is a good idea, unsure how to gauge the situation.

    Would appreciate opinions.

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

    No comments:

    Post a Comment