• Breaking News

    Saturday, May 4, 2019

    What are your embarrassing developer secrets? Ask Programming

    What are your embarrassing developer secrets? Ask Programming


    What are your embarrassing developer secrets?

    Posted: 04 May 2019 02:48 PM PDT

    Personally, I've been a backend developer for about a decade, using MacOS and Linux primarily, and I still can't remember if a shebang is #! or !# until I write it out.

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

    What programming language do you find to be the most beautiful / elegant / creative / interesting? Why?

    Posted: 04 May 2019 06:48 AM PDT

    Help me with editing a text file PLEASE

    Posted: 04 May 2019 07:56 PM PDT

    I am currently using a program called REPLACEGENIUS https://www.rlvision.com/genius/about.php

    It's awesome, but I am not very technologically smart so I've done everything okay up until now.

    Basically How would I have a documet with many of these questions, so there are more than 100 questions like the example below in the document I have.

    How would I remove do something to autoremove everything except for the Question prompt and the Correct answer, but instead of the correct answer displaying the numerical value of 4 I'd like it to be replace by the Answer line like So:

    FROM THIS:

    Question 13

    What happens at the end of Of Mice and Men? 1. The main characters decide to go racing 2. The little girl dies 3. The little girl travels along with the main characters 4. They live happily Correct Answer: 2

    TO THIS:

    What happens at the end of Of Mice and Men? The little girl dies

    or

    What happens at the end of Of Mice and Men? Correct Answer: The little girl dies

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

    What is expected of junior developers at work? I'm going to be starting soon, and I am really nervous.

    Posted: 04 May 2019 01:49 PM PDT

    I was able to get hired at a company that I respect very much. Needless to say, I really really don't want to fail them and want to live up to expectations and even go beyond that. The past couple of days leading up to my first day at work have been so mentally taxing and stressful that I've lost sleep.

    To give some context, I've never had a job. This will be my first job. Ever. I've never had part-time work or anything like that. That, in itself, has been a cause of feeling nervousness, but, overall, again, the pressure is mainly due to how much I respect the company and the last thing I'd want is to tarnish their reputation or not live up to their expectations.

    Anybody got some tips and tricks / and/or realistic advice / information for this little nooby nervous wreck?

    submitted by /u/yoon-ho
    [link] [comments]

    How to write a programming language

    Posted: 04 May 2019 01:20 PM PDT

    I'm IOS developer i program in (objective-c , swift) , i know a little bit of (assembly, c , python , javascript, html, css ..) and i started programming in about like 2 and a half years ,And i don't know how to write my own programming language , i mean i know how compiler works but i don't know how to write it

    if you all ready know , Swift is a open source programming language, what should i know to add future for instance to swift or to understand what the hill is going on when i download the source code ?

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

    What is the Stockfish of the poker world?

    Posted: 04 May 2019 12:56 AM PDT

    I like stockfish because it is somewhat 'explainable'. There is a hard coded process to find good moves. Nevertheless, the data structures used are very clever: magic slider bitboards are so cool.

    AlphaZero is a different kind of amazing but it's hard to say 'this move was picked because...' - less 'explainable'

    What strategies are there for writing poker engines other than overfitting a model with a crazy number of parameters?

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

    MySQL connector for Visual Studio 2019?

    Posted: 04 May 2019 01:46 PM PDT

    I'm a CS studend and I've worked exclusively with Java in the past. I now have to do a project using Visual Studio, I'm required to use the 2019 version but when I try to install MySQL for visual studio, it says I need the 2017 version. Is there a workaround?

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

    Improve c++ solution

    Posted: 04 May 2019 09:52 AM PDT

    I am trying to solve the following problem: https://app.codility.com/programmers/lessons/7-stacks_and_queues/fish/

    Can somebody point me whats wrong with my solution and also how should I change my thinking process while solving these kinds of problems. I pass the test case given in the question and the following test case as well: A[] = [4,3,2,1,5,5,6] B[] =[0,1,0,0,1,0,1]

    But I fail all other hidden test cases, but more importantly I want to know how to change my thinking process while doing these questions. Here is my solution:

    int solution(vector<int> &A, vector<int> &B) { // code in C++14 (g++ 6.2.0) unsigned int numberOfFish = A.size(); unsigned int eater,eaterIndex; if(numberOfFish == 1) return 1; for(unsigned int i = 0; i < A.size(); i++ ){ if(B[i]){ while(B[i]) ++i; eater = A[i-1]; eaterIndex = i-1; while((eater>=A[i]) && !B[i]) { ++i; --numberOfFish; if(i > A.size()) break; } if((A[eaterIndex] < A[i]) && !B[i]) --numberOfFish; } } return numberOfFish; } 
    submitted by /u/bbugsbunny
    [link] [comments]

    How to delay a webpage's loading until everything inside has loaded?

    Posted: 04 May 2019 08:28 AM PDT

    I have a page with html videos, but when they preload, the page looks weird until all of them are loaded. When preload is set to none, a video takes a long time to load, so I thought this would solve the problem.

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

    I have a vision for an app/program that would make my job much easier to be perfect/better at. How do I go about it?

    Posted: 04 May 2019 11:50 AM PDT

    There are programs similar to my vision, but they are bullshit expensive and directed towards brokers and not independent contractors like myself. I need a much more bare bones version, but a better version.

    What I do:

    I research surface and mineral title ownership. I take hundreds of property conveyance documents, interpret them and calculate ownerships in surface, minerals, wells etc.

    What I want:

    To create a multi-layer flow chart and improve the way I use excel. I don't believe that what I want to do can be done on excel. I want the flow chart to either automatically export to excel or be capable of doing so in a designated order.

    There are lots of if-thens for each block in the chart chain and it will become quite a tree at the end, hundreds of blocks with layers.

    I could probably draw what I want better than describe it, but I don't even know where to start or what language to learn and attempt this on. Just point me in the right direction if you can. This is going to be a passion project and I have lots of time.

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

    How do you get better at UI design?

    Posted: 04 May 2019 11:40 AM PDT

    So I have been programming for 15 years, 5 of those being professionally and I think I'm pretty good at what I do, which is mostly backend. I've always worked with other people who specialize in front-end and add the animations and colors and such.

    Basically, I've never really learned how to make a UI that people want to use.

    How do you go from knowing the tech to making a UI people actually want to use?

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

    Is there a reason why Apply started adopting Swift before it was production-ready?

    Posted: 04 May 2019 10:23 AM PDT

    What Do I Add And/Or Change On This Java Code For A Vending Machine So That It Can Execute The Mentioned Operations

    Posted: 04 May 2019 10:02 AM PDT

    My question is WHAT code should I add and/or change in this Java code so that the vending machine program can execute these extra operations below:

    1. The user can buy more than one type of item at the same time. Prompt user whether he/she would like to add something else to his selection after selecting the item, if yes then he is asked to enter item index number of the next item, and it continues until user says no and then purchase of all items is made.
    2. A VAT of 10% is charged on every purchase and change given after purchasing an item, all shown on a receipt.
    3. An admin pin code should be entered and then transition to a sub-menu where all the admin operations are numerically listed. Customers can only use the landing page menu and these 3 options, 1. INSERT MONEY NOTE 2.DISPLAY PRODUCTS 3.PURCHASE PRODUCT/S 5.EXIT
    4. The user can choose to insert an amount of money between 10, 20, 50, 100, and 200 Namibian dollars.

    The landing page menu would finally look like this:

    **** Welcome To SuperC Vending Machine ****

    **** Office Building - NUST Main Campus ****

    Please Select An Option From Below

    Option 1: Insert Money Note

    Option 2: Display Products

    Option 3: Purchase Product

    Option 4: Enter Admin Pin Code - Once correct pin is entered, the user is shown a Sub-menu with these options: 1. Add new product, Remove product, Restock product, Remove Money, Add Money, Display Products, Exit)

    Option 5: Exit

    AND

    The receipt AFTER purchasing a product/s should display this:

    ** X Vending Machine **

    ** NUST Office Building **

    (The following should be aligned in a kind of TABLE LAYOUT, that we can easily do just by spacing the words in the System.out.println() functions )

    Name QTY Price Total

    Coke 330ml 3 12.45 37.35

    S/Chips 750g 1 24.95 24.95

    Bar one 1 8.70 8.70

    VAT@15% - 10.65

    Total - 81.65

    Tendered - 200.00

    Change - 118.35

    **********************************CODE IMAGE

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

    Who are the people who determine the language of javascript?

    Posted: 04 May 2019 09:21 AM PDT

    It seems every so often ECMA comes out with new versions of javascript. Is there a committee that decides on it? Furthermore, where do they receive funding? As far as I know, I thought everything about javascript was free.

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

    Octree Data Structure

    Posted: 04 May 2019 06:49 AM PDT

    Hello! I'm trying to create an octree data structure. I'm encountering some problems with struct SmallPosition and accessing it in my main octree class. Can someone point out how I should change it? Any help would be appreciated. Here is the code: https://pastebin.com/aqzKNmBj

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

    I urgently need a vending machine console application coded

    Posted: 04 May 2019 12:29 PM PDT

    The system is meant to help the vending machine's owner in managing its stock and finances, with this in mind the application should then allow for the user to enter a code which is either linked to an item or the pin code used by the owner. If an item code is entered the balance/cost for that item is displayed prompting the user for how many items they what to buy, however if the owner's pin is entered then an admin menu is displayed.

    The landing page should give a brief description of the vending machine such as the Name, address and random items in stock and prices, a sample landing page is as follows:

    (decorations up to your own choosing):

    **** Welcome to X Machine ****

    **** Office Building - NUST Main Campus ****

    **** <<information here>> ****

    ******************************

    Enter an item code:

    The application should prompt the owner for a login confirmation code after their have

    enter the pin (this is used as a security measure king of a two stage authentication).

    Once logged in system will then offer the following options to the admin:

    The privilege to restock/ add new items to the vending machine

    Change prices

    Cash out certain amounts from machine

    Cash in certain amount

    Print out a summary of all items in stock

    Print out amount of cash in categories(How many 100s, 50s up to 5cs)

    Print out only items that need restocking (all items below 25 need to be restocked, hence the quantity of 25 is the re-order level)

    Exit

    Create a menu for these options.

    [NB:When cashing out/in amounts the owner indicates how many 100s, 50s and so on, this information is recorded since it is used when giving change.]

    The customer should be able to buy items and get a receipts with all details of items

    bought, remember this is an advanced vending machine hence one can buy more than

    one item.

    The printed receipt contains the following details: the item name, quantity, price and

    total, it should also give a description of the change given out, see below example

    (decoration up to your own choosing):

    **** X Vending Machine ****

    **** <<information here>> ****

    ***********************************

    Name

    Coke 330ml : QTY = 3 Price = N$12.45 : Total = N$37.35

    S/Chips 750g : QTY = 1 : Price = N$24.95 : Total = N$24.95

    Bar one : QTY = 1 : Price = N$8.7 : Total = N$8.70

    -------------------------------------------------------

    VAT@15% / N$10.65

    Total = N$81.65

    Tendered = N$200.00

    Change = N$118.35

    **********************************

    Date: 20 – April – 2019/15:35:20

    **********************************

    Thank You For Your Support

    Please call Again

    **********************************

    Your change is disbursed as follows: N$100 X 1, N$10X1, N$5X1 , N$1X3 , 10cX3 and 5cX1

    Please note the change is linked to the amount of cash in the machine, that is if there

    are no hundreds then the user gets 2 x 50, and that should be recorded to indicate the

    remaining 50s in the machine has decreased. The same applies to when a customer

    pays with a 100 then the count for 100s in the machine increases.

    Below are guidelines I outlined to follow:

    Planning in forms of Pseudocode and Flowcharts.

    Different menu levels: Landing page, Owner Menu and Customer Menu.

    Two stage authentication for owner.

    Data storage using data Structures such Arrays etc.

    Receipt information calculations and formatting.

    Change calculations and print out.

    Management options by Admin.

    Customer options and and interactions

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

    HELP PLEASE

    Posted: 04 May 2019 01:50 PM PDT

    PLEASE HELP ME WITH THE 2ND AND 3RD FUNCTION. YOUR ATTENDANCE MUST BE ABOVE 75% I'M USING TURBO C++

    #include<iostream.h>

    #include<stdio.h>

    #include<conio.h>

    #include<string.h>

    #include<stdlib.h>

    void attendanceDetails(float x,float y)

    {

    float z=(x/y)*100;

    if(z<75)

    {

    cout<<"Attendance percentage is "<<z<<"%\n";

    cout<<"Must attend more lectures or you will be debarred\n";

    }

    else if(z==75)

    {

    cout<<"Attendace percentage is "<<z<<"%\n";

    cout<<"On the border line must attend more classes to be on the safer side\n";

    }

    else if(z>75 && z<85)

    {

    cout<<"Attendance percentage is "<<z<<"%\n";

    cout<<"Good job you have a good attendance\n";

    }

    else if(z>=85)

    {

    cout<<"Attendance percentage is "<<z<<"%\n";

    cout<<"Excellent job you have great attendance\n";

    }

    }

    void debarDetails(float x, float y)

    {

    float z=(x/y)*100,a=x,b=y;

    int v,v1,i,c=0;

    v=z;

    if(v>=75)

    {

    cout<<"You are not debarred:";

    }

    else if(v<75)

    {

    while(v>=75)

    {

    x++;y++;c++;

    }

    cout<<"You need to attend "<<c<<" more lectures";

    }

    }

    void skipDetails(float x,float y)

    {

    float z=(x/y)*100;

    int v=z,i,a,b=y,c=0;

    if(v<75)

    {

    cout<<"You can't skip any classes ";

    }

    else

    {

    float z=(x/b)*100;

    while(a>=75)

    {

    b++;

    c++;

    }

    cout<<"You can skip "<<c<<" more lectures";

    }

    }

    int main()

    {

    clrscr();

    int ch;

    float n,a;

    char c[55];

    cout<<"Attendance check for the students of Amity: \n";

    cout<<"Enter the course name: ";

    cin>>c;

    cout<<"Enter the number of classes conducted: ";

    cin>>n;

    cout<<"Enter the number of classes attended: ";

    cin>>a;

    cout<<"What would you like to know ?";

    while(1)

    {

    cout<<"\n1.Attendance Percentage \n2.How many classes more to attend to avoid being debarred \n3.How many more classes can I skip? \n4.Exit\n";

    cin>>ch;

    switch(ch)

    {

    case 1:

    attendanceDetails(a,n);

    break;

    case 2:

    debarDetails(a,n);

    break;

    case 3:

    skipDetails(a,n);

    break;

    case 4:

    exit(0);

    default:

    cout<<"Wrong choice";

    }

    }

    getche();

    return 0;

    }

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

    VS Code - programs prints to command line no problem, unicode error when it is run directly from VS Code

    Posted: 03 May 2019 10:42 PM PDT

    I didn't know the terminal tab and output tab were all that different, is this something I can fix in the settings?

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

    how to translate lines of colour hex codes into immediate colour/images?

    Posted: 04 May 2019 05:12 AM PDT

    i published a survey online yesterday through jotform in regards to my MA studies about colour vs. sound. i've already received about 400+ responses.

    about 15 out of 17 of the questions resulted in a colour hex-code response. i want to map the results in an infographic... but obviously, 15x400 = 6000 different hex-code responses i would have to generate manually, by myself.

    below is how the survey answer forms look. each response has been emailed to me.

    here's a sample of one of the forms

    is there any way i can take all these hex code answers as a list - probably per response form, so 15 at a time - and immediately generate their colours? an actual visual representation for each form?

    i didn't know how to query this, so i apologise if the wording is confusing!

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

    HTML video source empty but video can load

    Posted: 03 May 2019 11:48 PM PDT

    In the title. Can online videos play if the URL in the src attribute in the HTML video tag leads to a 404? I thought not, but I found an instance where this happens ( https://www.myvi.top/idu37o?v=ce7o35g9e55w7cifpop1r1bnsy#watch ). If so, how?

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

    Python Task help (basic 1st year stuff)

    Posted: 04 May 2019 02:41 AM PDT

    Hi there, im currently working on a task assigned to make a dice poker game against the computer and stuck on a question regarding lists and looping. I know it might be basic but just kinda stuck. Ive already created a loop in which it adds random numbers between 1 and 6 (like a dice) to a list. Now i need to add a count how many times in those 5 rolls did each side land on and display in a list

    im mostly just lost on how to update the die_count list to display number of sides each dice landed on, or atleast where to start (beginner here)

    here is the question i am given

    "Add code to count how many times each die face value was rolled. Hint: Use a list in order to store this information.

    To define a list in order to count how many times each die face value was rolled: die_count = [0, 0, 0, 0, 0, 0, 0] d Given that die face values are 1 – 6 inclusive, we create a list with seven elements but ignore the zero element of the list. This will make it easier to increment the appropriate list element. That is, die_count[1] should contain the number of 1s that were rolled, die_count[2] the number of 2s rolled, etc.

    To access and update the appropriate list element (using the value of the die as an index):

    die_value = player_hand[0] die_count[die_value] = die_count[die_value] + 1

    For example: If die_value is assigned the value 3. die_count 0 0 0 1 0 0 0 0 1 2 3 4 5 6 Hint: You should use a loop in order to count how many times each die face value was rolled. In the example above, this would mean that player_hand[0] would then be player_hand[index] if placed within a loop."

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

    CMV: Work Hard Play Hard Lifestyle

    Posted: 04 May 2019 01:31 AM PDT

    What's your opinion about the work hard play hard lifestyle? Is it natural human instinct in your opinion? Why?

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

    No comments:

    Post a Comment