• Breaking News

    Tuesday, March 5, 2019

    SQL Versus SQL (crosspost - AskTechnology) Ask Programming

    SQL Versus SQL (crosspost - AskTechnology) Ask Programming


    SQL Versus SQL (crosspost - AskTechnology)

    Posted: 05 Mar 2019 04:43 PM PST

    I had a job interview today and I was asked if I had ever used SQL. I told them "I used it on a website". The interviewer quickly said SQL can't be used on websites, and "you must be talking about MySQL". I just said "yeah...of course", but is that true? I know that MySQL is the database management system, but wouldn't 'SQL' code used in conjuction with PHP just be considered 'SQL'? Which would make my statement true.

    The guy was kind of rude about it and really made me doubt myself for the rest of the interview. So which is right?

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

    Graphql App using Node (Apollo Server) with typescript, KOA framework and Elasticsearch Client

    Posted: 05 Mar 2019 10:34 PM PST

    Interview Question

    Posted: 05 Mar 2019 10:33 PM PST

    Hi Reddit! My company is hiring a backend dev, and we're digging deep into creating creative programming questions. The criteria we've boiled it down to is:

    1. It should give applicants a chance to demonstrate strong grasp of writing scalable, clean code, tackling logic-requiring programming questions and the ability to work with GCP/AWS
    2. It should take a terribly long time for inexperienced devs, but only ~ 1 hour for someone good.
    3. It should be fun! Something that makes you feel accomplished towards the end.
    4. The answer to the challenge should not be online (as in something that could just be copy/pasted)

    I'm not asking for an answer here, but maybe more to be pointed in the right direction. How does one go about creating such an interview question? How to I find/create something that's not easily found online.

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

    You can improve your programming skills by reading other people's code : how, where (exactly) ?

    Posted: 05 Mar 2019 04:04 AM PST

    Hi !

    I wondered where i should start when reading other people's code, how do i find quality code that isn't too much obfuscated for a beginner ?

    Is there anyone who kinda sorted the resources and gave some tips on what material to read and how to read it ?

    Thanks !

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

    [Angular] Having trouble reapplying a text search to material table when the datasource has been updated

    Posted: 05 Mar 2019 07:52 PM PST

    So, I have a Material table with sort, pagination, and a text search. Everything works fine except for when I text search for something, and then update any of the results, the table will go back to all items. It does update the item changed correctly, and the text is still in the input. If I change one character in the input, it will reapply. I just want to know if there's a way to apply the filter after an update occurs so that the filtered data will stay filtered.

    HTML

     <form class="search"> <mat-form-field class="searching"> <input matInput placeholder="Search..." (keyup)="applyFilter($event.target.value)" [(ngModel)]="text" name="text"> </mat-form-field> </form> 

    component.ts

     applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } ngOnInit() { let data = this.inventoryService.getAllItems(); data.snapshotChanges().subscribe(item => { this.itemList = []; item.forEach(element => { let json = element.payload.toJSON(); json["$key"] = element.key; this.itemList.push(json as Item); }); this.dataSource = new MatTableDataSource(this.itemList); this.dataSource.sort = this.sort; this.dataSource.paginator = this.paginator; }); } 

    Sorry, I'm having trouble with the code formatting, so I put it inside quotes. Basically what I've tried is adding the applyFilter(this.text) function to the end of any thing that edits the datasource. My service functions only edit the data, they don't return anything. I've also tried putting in this.dataSource.filter = this.text.trim().toLowerCase(); at the end of any edit functions as well.

    I've tried looking around, but I don't know if I'm just not searching for the right thing or if I'm the only one not having troubles? I'm not sure what else to post here, so if there's anything I need to add to give more info, let me know. I didn't want to flood this with a wall of code.

    Thanks for any help.

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

    Where can I find resources for developing a Safari extension?

    Posted: 05 Mar 2019 07:52 PM PST

    I am interested in developing a Safari extension for my own use. I have experience with programming GUI applications but I am unfamiliar with swift/xcode. Where can I find resources to help me make a Safari extension?

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

    How to setup Textpad 8?

    Posted: 05 Mar 2019 07:39 PM PST

    I installed Textpad 8 on my computer and when I wanted to run a .java file, tHERE'S NO COMPILE BUTTON?? Σ('◉⌓◉')

    am I retarded or am I blind?

    do I need to install anything else before installing Textpad?

    Thanks (´・á´—・ ` )

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

    in MARIE how do you store in a specific memory location

    Posted: 05 Mar 2019 07:08 PM PST

    Hi sorry if this is a stupid question I've been trying to make an array in this and can't figure this part out sorry .

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

    When writing an api, how do I return a sql query that has embedded results? I am using sql server and express.js.

    Posted: 05 Mar 2019 09:40 AM PST

    I'm trying to return data from my database that I will then json "Stringify" and I need the it to be in this format

     { "id": 1, "name": "test2 course", "abbrev": "TEST", "people": [ { "id": 1, "children": [ { "id": 1, "relatives": "bla bla bla bla", "pets": [ { "id" : 1, "prompt" : "bla bla bla bla", }, { "id" : 2, "prompt" : "bla bla bla bla", } ] } ] } ] } 

    How do I go about writing a query for this? Or do I need to handle the data on the front end? If so, how do I handle it javascript? (I'm a front end noob)

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

    Should I learn another 'language' at this stage?

    Posted: 05 Mar 2019 06:07 PM PST

    Hello, all, I am currently in my fourth year (of a 5-year program) studying computer engineering, thus my curriculum although it includes a lot of programming, is evenly focused on electrical engineering and low-level stuff. I currently know very well Java, HTML, and CSS. I was considering either spending some time learning Android development or JavaScript, which route would you pick? How's today market for Android devs?

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

    [VBA] Need advice with logic for a Search function

    Posted: 05 Mar 2019 04:56 PM PST

    So i have 2 sheets:

    • Sheet1 - Where the searching happens and where the table to show the search results is

    • Sheet2 - Data source

    For the searching criteria, we have like 8-10 fields like ID, Name, Hire Date, Country, Level, etc. The problem here is that all of these fields are not required fields to fill in when the user wants to search.

    The user can search with just Name + ID. Or Name + Country + Level or even ID + Hire Date. So when coding this, i cant use AND in my IF statement.

    This is the table/fields where the user can input criteria and search: https://imgur.com/a/baQtq60

    Here's the columns of the data source (A-BY): https://imgur.com/a/mhXNr1E

    Any advice how should my logic/code look like to handle this type of problem?

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

    I have a 1-d array of strings. How can I turn this into an array of chars?

    Posted: 05 Mar 2019 04:12 PM PST

    Let's assume I have an array:

    string Groups[i]

    where

    Groups[0] = "ABC"

    for instance.

    Is there a way I can transmit this information into a char array so that

    char Individual[i][3];

    Individual[0][0] = 'A'

    Individual[0][1] = 'B'

    Individual[0][2] = 'C'

    so that I can apply logic to each character individually?

    Edit: Actually, in reviewing my pre-code there is no reason I can't set it up as a 2-d char array in the first place. I'll leave this up as a reminder to myself for whenever I get back to working on the project.

    Edit 2: According to a comment below I don't have to do that either. Yay!

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

    Java- reading file from user input

    Posted: 05 Mar 2019 02:48 PM PST

    i have been trying to prompt the user to input a file name within the system and then convert that string to the file and print it. Here is what i have got:

    public static void analyze() throws IOException

    {

     System.out.print("Enter file name: "); Scanner title = new Scanner(System.in); String input = title.next(); File file = new File(input); Scanner inputFile = new Scanner(file); while (inputFile.hasNextLine()) { System.out.println(inputFile.nextLine()); } 
    submitted by /u/Stateofstupid
    [link] [comments]

    Help with Orientation programming

    Posted: 05 Mar 2019 11:00 AM PST

    Hi, so for my Senior Design project my group and I are creating Electronic Drum Sticks that uses a BNO055 sensor, connected to a Raspberry Pi Zero W, to get orientation data. Using this data we're going to do some data processing before it is sent via WiFi to a server on a PC/laptop that will output sounds based on what "drum" in our set has been "struck" by a user. Our current design is that when the user is operating the sticks that the space in front of them will be divided into 4 45 degree slices/sections. These sections are meant to emulate a physical drum set. Using the BNO055 sensor we determined that the heading value would be how we create the "drums". This image( Top Down View ) should help you understand the reason behind the code below and why we chose those values.

    NOTE: This is all contained in a infinite while loop (which will probably need to change) and is being written in Python

    if (heading > 0 and heading <= 45): print("Drum_A") # These print statements will be changed to function calls that send data to our # server elif (heading > 45 and heading <= 90): print("Drum_B") elif (heading > 270 and heading <= 315): print("Drum_C") elif (heading > 315 and heading <= 360): print("Drum_D") else print("Not in Range") 

    The next step we're trying to take is to use the pitch to determine if the surface of one of our "drums" had been "struck". Basically we wanted to play, for instance Drum A, when pitch was 35 degrees and heading was between 0 and 45. We have the issue that the drum noise will play twice because there are two instances where the pitch is 35 degrees, i.e when the user raises the stick up passing 35 and then on the way down when we actually want to strike our "drums". This issue is minor as we have thought of some possible solutions. This picture ( Side View ) I hope helps you guys visualize what I'm saying here.

    The bigger issue that we are facing is that the roll of the drum stick will mess up our algorithm as it is currently designed. I want to preserve the sections of space in front of the user such that if the stick rolls that we can somehow offset the heading and pitch so that the correct "drum" is played. Knowing the roll, is there any way I can use that to preserve the heading and pitch?

    I hope this is a clear question and that there's enough information for you guys to understand what Im asking. I'd really appreciate any input you guys have or suggestions!

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

    What is the best way to run multiple web frameworks on same nginx server?

    Posted: 05 Mar 2019 02:16 PM PST

    I already know how to run an individual framework (django or spring mvc) on an nginx server, but I would like to run django and spring mvc on an nginx server at the same time, and I don't really know how. I have seen some online tutorials on running multiple frameworks on nginx, but I was wondering if there was a certain way that would be considered optimal to do this. I also don't quite understands workers and background proccesses and have looked around online, but can't quite understand how I would run multiple background workers for different web services at the same time. Any information on this subject would help me a lot. Thank you!

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

    How to create dummy variables for a set of keywords.

    Posted: 05 Mar 2019 09:48 AM PST

    Hello ask programming I have the following project and I would like to know if someone could bounce some ideas on how could I make this. In my country some public hospitals lack medicines. I am able to extract tweets with several keywords that can mostly identify tweets that report this shortage. I also have a list of all the municipalities and all the states in my country. So what I wanted to do is to relate a vector of tweets and somehow create an automatized code that creates binary variables for every state and municipality and that gives the value of one if a state or a municipality is mentioned in the Tweet. In this way I could make some aproximation of where there is a problem of medicine supply problem.

    So basically I wanted to know trough which software, package or whatever could I save time so that the code puts the creates a variable for every state and municipality and puts the ones where they should be. I can make this manually in Stata but it would take a whole lot of time considering that there are hundreds of municipalities any better ideas?

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

    [LF Help with Lang choice) Using C# for Web Frontend, backend AND for Gamedev. Bad comparing to Javascript+node ?

    Posted: 05 Mar 2019 01:19 PM PST

    ME:

    My deep desire is to use 1 language for everything, if i dont lose on perfomance and if its not too hard (like coding website in C ).

    About:

    Been studying node, express, js, etc, basically whole frontend + backend of webdevelopment (yeah that all can be done with javascript).

    I have also interest in gamedev and been using c++, since javascript is not the way to make games cuz of its single-threaded high level language nature.

    But:

    But some redditor suggested me webdev c# (with asp.net) as theres a [popular estabilished c# game engine.

    Truth:

    i hoped for speed

    I even checked some benchmarks and asp net loaded plain html much faster (btw this is type of websites i make) than nodejs did.

    i did read a lot of buzz articles, posts, etc, about node async feature(thats supposed to SPEED UP things), but either that feature is not working with showing .html page to user, or these benchmarks dont use it, or its just not that fast comparing to asp net).

    ===The QUESTION===

    So my question is, is ASP. NET (for both frontend and backend if its possible, i did read it is, altrhough i dont know how) worth changing from nodejs or is it just some ancient, hard to use tool?

    js was easy to me and im not sure if asp.net will be too.

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

    Fractals

    Posted: 05 Mar 2019 11:55 AM PST

    Hello, I have recently started my journey with programming i have a problem with one of tasks. One of the problems is that, instead of giving my shortened fractal, it gives me numbers from two.Init(3, 4);

    The task is: Create program, first has to be integer, second has to be integer. Use the Reduc() to reduce the fractal. Use the boolean Great(const Frac&) and Great(const Frac&, const Frac&) that will compare the fractals and chose which of the fractals is bigger ( if first it has to be true, if second is has to be false). Could you help me and tell me what I have done wrong?

    #include <iostream>

    using namespace std;

    struct Frac {

    int first;

    int second;

    void Init (int a, int b);

    void Scan();

    void Print();

    int Reduc();

    bool Great(const Frac&);

    };

    void Frac::Init(int a, int b) {

    first = a;

    if (b) second = b; else second = 1; 

    }

    void Frac::Scan() {

    cout<<"Enter numerator; : ";

    cin >> first;

    cout<<"Enter denominator: ";

    cin >> second; while (second == 0) cin >> second; 

    }

    void Frac::Print() {

    cout << first << "/" << second << endl;

    }

    int Frac::Reduc() {

    while(first!=second)

    if(first>second)

    first-=second;

    else

    second-=first;

    return first;

    }

    bool Frac::Great(const Frac &one) {

    if((first )>(one.first))

    return true;

    else return false;

    }

    void Print(Frac *one) {

    cout << one->first << "/" << one->second << endl;;

    }

    bool Great(const Frac &one, const Frac &two) {

    if((one.first )>(two.first))

    return true;

    else return false;

    }

    Frac make_Frac( int a, int b) {

    Frac t;

    t.Init(a, b);

    return t;

    }

    int main() {

    Frac one, two;

    two.Init(3, 4);

    one.Scan();

    two.Print();

    cout<<"fractal 1="<<one.Reduc()<<endl;

    cout<<"fractal 2="<<two.Reduc()<<endl;

    if(two.Great(one)) cout<<"fractal 2 is bigger"<<endl;

    else cout<<"fractal1 is bigger"<<endl;

    return 0;

    }

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

    If millions of computers each broadcast 1 bit 16 bits per second, 1 when talking in massively multiplayer voice chat, and 0 when not talking, and volume you hear others depends on statistics of which sets of people less interrupt eachother, then of the (1million choose 10) groups of 10 computers...

    Posted: 05 Mar 2019 10:48 AM PST

    Imagine you start some program using microphone and speakers and a conversation without any visuals (no usernames etc) starts, and depending on your patterns of talking (who interrupts or doesnt interrupt others) you navigate millions of other people's conversations like a high dimensional crowd space.

    How can I efficiently find a bunch of small groups of people/computers who tend to not talk at the same time as anyone else in the group recently, and tell all the computers in that group about the top few hundred groups to watch and possibly navigate toward that part of the massively multiplayer voice conversation? (1million choose 10) is a very big number, and the bandwidth just to stream a few bits from each of million computers is big, but it doesnt have to be exact, just find approximations. Also I want to avoid computers lying about their bigger data of sound stream matching the 1 bit of that 1/16 of a second if their volume is above or below some quiet level meaning not talking.

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

    What are the best technologies/ languages for writing an idle browser-game(like Tanoth or Shakes and Fidgets)?

    Posted: 05 Mar 2019 04:58 AM PST

    I'm a last year computer science student and as the title says, I've decided to do a browser game like Tanoth or Shakes and Fidgets for my thesis. Could you please tell me what are the best technologies for doing that? I'm currently working at my job in Angular and Java(Spring) but I don't think they're the best for this task.

    submitted by /u/ShadowFiend-
    [link] [comments]

    A dumb question, I'm sure, but how do you create multiple options in cpp?

    Posted: 05 Mar 2019 07:16 AM PST

    So, I'm fairly new to C++ (actually, programming in general) and I need to make a little console program for a school project. Here is the code, the question I have will be under it (don't mind the language I'm writing in (Croatian by the way) it is just for the *cout* function and function names):

    #include <iostream>

    using namespace std;

    void zbrajanje() {

    int a,b,c; cout<<"U ovom primjeru cemo zbrajati dva prirodna broja."<<endl; cout<<"Operacija ce glasiti a+b=c, a brojeve 'a' i 'b' cete vi upisati."<<endl; cout<< "Upisite varijablu a - "; cin>>a; cout<<"Upisite varijablu b - "; cin>>b; c=a+b; cout<<"Zbroj brojeva "<<a<<" i "<<b<<" je: "<<c<<"."<<endl; 

    }

    void oduzimanje(){

    int a,b,c; cout<<"U ovom primjeru cemo oduzeti dva prirodna broja."<<endl; cout<<"Operacija ce glasiti a-b=c, a brojeve 'a' i 'b' cete vi upisati."<<endl; cout<<"Upisite varijablu a - "; cin>>a; cout<<"Upisite varijablu b - "; cin>>b; c=a-b; cout<<"Razlika brojeva "<<a<<" i "<<b<<" je: "<<c<<"."<<endl; 

    }

    void mnozenje(){

    int a,b,c; cout<<"U ovom primjeru cemo pomnoziti dva prirodna broja."<<endl; cout<<"operacija ce glasiti a\*b=c, a brojeve 'a' i 'b' cete vi upisati."<<endl; cout<<"Upisite varijablu a - "; cin>>a; cout<<"Upisite varijablu b - "; cin>>b; c=a\*b; cout<<"Umnozak brojeva "<<a<<" i "<<b<<" je: "<<c<<"."<<endl; 

    }

    void dijeljenje() {

    int a,b,c,d; cout<<"U ovom primjeru cemo podijeliti dva prirodna broja i dobiti ostataka ako ga ima."<<endl; cout<<"Operacija ce glasiti a/b=c, a brojeve 'a' i 'b' cete vi upisati."<<endl; cout<<"Upisite varijablu a - "; cin>>a; cout<<"Upisite varijablu b - "; cin>>b; c=a/b; d=a%b; cout<<"Kolicnik brojeva "<<a<<" i "<<b<<" je: "<<c<<" ,a ostatak je "<<d<<"."<<endl; 

    }

    int main() {

    cout<<"U donjim primjerima cu vam prikazati aritmeticke operacije."<<endl; cout<<endl; zbrajanje(); cout<<endl; oduzimanje(); cout<<endl; mnozenje (); cout<<endl; dijeljenje(); cout<<endl; cout<<"Hvala na suradnji!"<<endl; return 0; 

    }

    Now, the question I have is this: How do I make a small menu to include all of the previous *void* functions? I want the user to be able to pick any of the functions above in any order they want. For instance: "a" for "zbrajanje" and "b"for "oduzimanje". If this post is too messy, tell me how I can send the source code and I will do that.

    Thanks in advance!

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

    2D Array Randomizing

    Posted: 04 Mar 2019 11:42 PM PST

    I have a 2D array of an object that will incorporate 3 other objects: Cell, Trap, Hole.

    Cell represented by C

    Trap represented by T

    Hole represented by H

    Nulls represented by X

    Number of traps and holes is given by user.

    Cell objects are on the top left 4 corner pieces of the 2D array and the bottom right 4 corner pieces.

    The rest are null when you set up the array. If the user wants 2 holes and 2 traps within the remaining null values, how do I randomly change those nulls to those objects without changing the cell objects.

    Picture example:

    Array before (5x5 example):

    X X X X X

    X X X X X

    X X X X X

    X X X X X

    X X X X X

    and then it becomes

    C C X X X

    C C X X X

    X X X X X

    X X X C C

    X X X C C

    How would I randomly and evenly put those 2 traps and 2 hole objects within those X's

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

    What license managers implementations are used in the industry?

    Posted: 05 Mar 2019 02:17 AM PST

    Hi all,

    My team needs to implement a license manager for the software that we provide. I have no experience with license managers. We need to make sure that the customer is allowed to install the software on only one workstation. Probably the way that license managers work is that whenever the user enters a software key, the license manager installed on user's workstation connects to a database and checks whether the software key is already in use or not. I am looking for a solution that does not need to connect to a database to check the software key; just check the user's workstation. Can you please let me know what solutions are used in the industry for this?

    Thanks in advance, Anda

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

    No comments:

    Post a Comment