• Breaking News

    Sunday, November 4, 2018

    [beginners] Learn JavaScript By Creating 4 Games. learn programming

    [beginners] Learn JavaScript By Creating 4 Games. learn programming


    [beginners] Learn JavaScript By Creating 4 Games.

    Posted: 04 Nov 2018 03:34 AM PST

    I want to start a computer science club for my hs

    Posted: 04 Nov 2018 07:41 PM PST

    Our high-school got a new computer science teacher this year. This is also my first year in cs and I'm very passionate about it. I asked some people that were in the cs club last year and it was basically just the teacher assigning busy work. Are there any curriculums out there that the club can follow? How should I go about doing this? We are learning Java btw.

    Any suggestions would be appreciated. Thanks!

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

    45 and learning to code...again

    Posted: 04 Nov 2018 10:12 PM PST

    I graduated with an environmental engineering degree back when the internet was just exploding. Right out of college, I was able to get a job building websites for major gaming companies...Activision, Namco, Sony, Midway, and other brands like Energizer and Razer. Sadly, due to the dot-com bust, I ended up transitioning into a producer role for a mobile games company (at that time I was building prototypes for mobile applications that we wouldn't see for 10+ years). I experienced a small level of success in the role, my company was acquired by VERY LARGE EVIL GAME COMPANY (VLEGC) and I tried my hand in console development. That fell apart right around the recession era. I lost everything then and had to hustle for the past 8 years to find work. Unfortunately, I couldn't find any stability. I'd transitioned over to product management roles, but I have a hearing disability (70% loss), and wasn't performing all that well in this type of position. It's been crushing to my confidence, my motivation, and my finances. I moved out of games and into financial services a little while ago, and am finding it to be extremely challenging, particularly in the office politics arena. So I've decided to force myself back into learning a skill. I'm starting with Python and taking some classes online. I"d love to know others' thoughts on next steps. I'm not sure which direction I'd like to go, data science or frontend engineering as they both seem interesting to me. Would love to know thoughts here. I have some basic knowledge of programming (as I said I was a developer years ago), have taken java courses (also a while ago) but never moved from the "oh I can hack this thing together" to "I know how to build a thing".

    I'd love to know your thoughts on steps I might take to change my career path. I don't see myself staying in product management for much longer, as I've been taking some real beatings mentally and need to find more stability in my life.

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

    What are some fun, lesson oriented, things I can do with Raspberry Pi

    Posted: 04 Nov 2018 10:06 PM PST

    I'm relatively new to programming, but have a somewhat foundational grasp. I've found that I learn best by just jumping into a project or problem, so I bought a raspberry pi with absolutely no idea what to do with it.

    So...what should I do?

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

    Can you still learn a lot from Harvard CS50 if you already know the basics of programming?

    Posted: 04 Nov 2018 05:33 PM PST

    I went through the first two lectures and it seems pretty gradual, I was wondering if there is still some knowledge to gain from watching the lectures for someone who is a little bit above beginner?

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

    [Python, JS] Best way to display an image grid?

    Posted: 04 Nov 2018 11:34 PM PST

    Hi all, figured I'd attempt to try and learn Flask because I haven't build too many projects with Python. I'm also pretty inexperienced with webdev stuff in general, and hope to learn a few things from this. Essentially, I have a directory with about 5,000+ images on it, and would like to like to display 25-50 images at a time on a page (would love to figure out how to make arrows to go to next pages and whatnot, but whatever).

    Currently, this is my code, and emotes.html only contains a text header in it. https://hastebin.com/hudobesosu.py

    I can go to http://localhost:5000/emotes/emote.extension and it displays an image perfectly fine. Is my best bet just to do fetch() from the front end to the API endpoint I created, and create a new div for each image with the DOM? (Will worry about CSS later).

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

    How to create a blog site

    Posted: 04 Nov 2018 10:55 PM PST

    I want to create something similar to a clone of Medium I have working knowledge of python and java and familiar with html/css/javascript. Most tutorials I saw are just pasting a bunch of code and doesn't build from the ground up.

    If anyone get lead me to the right direction that would be helpful

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

    [C][UTF-16] c16rtomb() returns -1 on GCC 7.1, but works correctly on Visual C++.

    Posted: 04 Nov 2018 07:34 PM PST

    Corrected Title

    [C][UTF-16] c16rtomb() returns -1 and throws errono 84 when compiled with GCC 7.1, but runs and works correctly on Visual C++.

    Problem

    I'm using c16rtomb() to convert a char16_t string to UTF-8 multi-byte string. This is a standard function, under <uchar.h> for C11 and C++11 standards.

    The thing is, on Visual C++ 2017, the code runs perfectly fine on Windows. But in GCC 7.1, it compiles fine, but it doesn't run correctly.

    In the case of GCC 7.1, there is this amendment to the C11 standard, namely DR488.

    http://www.open-std.org/jtc1/sc22/WG14/www/docs/summary.htm#dr_488

    Which summarizes the effects seen when debugging the code in GDB, where c16rtomb() is returning -1 for the size of the proper UTF-16 character encoding in a string.

    Question

    How should I get GCC 7.1 to compile with the DR488 fix, so the program can run correctly on Windows and on Ubuntu?

    Source

    #include <stdio.h> #include <uchar.h> #define __STD_UTF_16__ int main() { char16_t* ptr_string = (char16_t*) u"我是誰"; //C++ disallows variable-length arrays. //GCC uses GNUC++, which has a C++ extension for variable length arrays. //It is not a truly standard feature in C++ pedantic mode at all. //https://stackoverflow.com/questions/40633344/variable-length-arrays-in-c14 char buffer[64]; char* bufferOut = buffer; //Must zero this object before attempting to use mbstate_t at all. mbstate_t multiByteState = {}; //c16 = 16-bit Characters or char16_t typed characters //r = representation //tomb = to Multi-Byte Strings while (*ptr_string) { char16_t character = *ptr_string; size_t size = c16rtomb(bufferOut, character, &multiByteState); if (size == (size_t) -1) break; bufferOut += size; ptr_string++; } size_t bufferOutSize = bufferOut - buffer; printf("Size: %zu - ", bufferOutSize); for (int i = 0; i < bufferOutSize; i++) { printf("%#x ", +(unsigned char) buffer[i]); } //This statement is used to set a breakpoint. It does not do anything else. int debug = 0; return 0; } 

    Expected Output

    Size: 9 - 0xe6 0x88 0x91 0xe6 0x98 0xaf 0xe8 0xaa 0xb0 

    Actual Output (Visual C++)

    Size: 9 - 0xe6 0x88 0x91 0xe6 0x98 0xaf 0xe8 0xaa 0xb0 

    Actual Output (GCC 7.1)

    Size: 0 - 
    submitted by /u/asperatology
    [link] [comments]

    How to access SQL databases on a locally run HTML page?

    Posted: 04 Nov 2018 04:40 AM PST

    I'm doing a project for my computer class, which can be anything, and having recently learned SQL search queries, I decided to make a website emulating an online shop, able to search for items, add items, maybe putting them in cart.

    What's confusing me is how to actually access the SQL database using PHP. I have read a lot of code online and I get how to access it, but it isn't like you can just attach an SQL file like how you attach a CSS file, right? Some places also say that I need to create an SQL database beforehand, but I have no way of doing this? I've tried downloading myphpadmin and MySQL and managed to create the database in MySQL but I don't get how I can access it via my HTML file.

    Do I need to download anything to use SQL or PHP? How will be able to retain the SQL database locally (entirely within my laptop) and transfer it elsewhere (the school system for submission)?

    Apologies if it is a stupid question. Thanks in advance.

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

    Can i use this device to code ?

    Posted: 04 Nov 2018 11:45 PM PST

    Hello, I'm currently learning python and I'm hoping to be able to freelance in the future in Web development using django for example, and probably HTML, CSS and maybe php and java. Is this device gonna cut it or do i need more of a traditional laptop ?

    The device is : Lenovo Miix 510-12IKB, 2-in-1 Laptop - Detachable Keyboard Dock/Tablet, Intel Core i5-7200U, 8 GB RAM, 256 GB SSD, 12.2", Windows 10

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

    NodeJS RPG Quests system

    Posted: 04 Nov 2018 11:38 PM PST

    So I have made a small RPG where you can create char, update skills, buy items, fight other users etc. Now to make the game more extended I need quests. And I need a little bit of help here.

    Right now I have these tables:

    Quests : id title etc

    ActiveQuests: id quest_id user_id (this table fills when user starts a quest)

    QuestBosses: id quest_id (Quests bosses)

    Now I need somehow to develop goals like I should have a quest_goals table and there store goals by quest_idI believe ? But then again every goal shuold be coded seperately and if I would want to make new quest through let's say admin panel this approach won't work. Maybe someone have any experience? I'm using NodeJS and Mongoose for this project

    Like quest would look something like this:

    1. Buy Item
    2. Go in the secret room
    3. Fight the boss
    4. Receive item
    5. Get reward

    But I just can't get my mind through this in the code. Like I could code this seperately (code every quest with it's own code) but not to make the code in which I could costumize these quests and make them through Admin CP.

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

    cin if there is no input for one variable but I need to input multiple variables at once

    Posted: 04 Nov 2018 07:30 PM PST

    So I'm trying to write a program where it will add, subtract, divide, and multiply two mixed fractions.

    Our inputs are like : 1 1/2 + 1 1/4

    I have a separate variable for whole number, numerator, denominator, and the division sign.

    If there is no whole number, then it would be: 1/2 + 1/4

    However, I do not know how to cin if there is no whole number, because currently i have:

    cout << "Please enter your operation --> "; cin >> w1 >> num1 >> divisionSeparator >> den1 >> operation >> w2 >> num2 >> divisionSeparator >> den2; cout << "Please enter your result --> "; cin >> resultWhole >> resultNum >> divisionSeparator >> resultDen; cout << endl; 

    I know what happens if I try to input without the whole number - my program crashes. I was wondering if there was a way to check to see if there is a whole number or not ? Or do I have to rely on putting the whole input in a string and checking that way

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

    What's the best way to program for Android / make apps?

    Posted: 04 Nov 2018 11:11 PM PST

    Java in Android Studio just seems way too complicated, imo. Is there some easier way to program for Android?

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

    How to fill empty cells in CSV with average value?

    Posted: 04 Nov 2018 07:19 PM PST

    How to quickly fill empty cells in CSV with average value? In excel or using python?

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

    HTML & Css Newbie here… can you help me?

    Posted: 04 Nov 2018 05:06 PM PST

    People, I need your help. I've been working on a mailing template for work, and I don't know how to work this out: How do you make it recognize different screen sizes? I need it to work on mobile and in windowed browsers. The main issue is in the title: when I minimize the navigator screen, it gets awful.

    So far, this is what I've got. Please consider I only have 1 week in this thing of html and css so every suggestion comes in handy. Thanks!

    PS: everything is in spanish, if you ask.

    Link: https://gist.github.com/murraywallas/ed3b92192c2bae76443123bf0a9adfb1

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

    I need help with a for loop, I need the loop to Exit when the "ENTER" key is hit in one of the Input lines.

    Posted: 04 Nov 2018 07:13 PM PST

    My problem is that the if statement after the first input line in the for loop inside the main is not exiting the loop when I hit enter. Does anyone know how to get this accomplished?

    #include <iostream>

    #include <math.h>

    #include <iomanip>

    using namespace std;

    /*program needs presetValue function that performs calculation the function should accpet the future value,

    annual interest rate and number of years as arguments. It should return the present value,

    which is the amount that you need to deposit today. Demonstrate the function in a program that lets the

    use experiment with different values for the formula's terms. */

    /* p= F / (1 +r )^n

    -p is present value

    -F is the future value

    -r is annual interest rate

    -n is the number of the years

    */

    double presentValueCalc(double futureValue = 0, double presentValue = 0, double annualInterestRate = 0, double numberOfYears = 0) {

    `presentValue = futureValue / pow((1 + annualInterestRate), numberOfYears);` 

    `return presentValue;` 

    }

    int main()

    {

    `int count = 0;` `double futureValue = 0;` `double presentValue = 0;` `double annualInterestRate = 0;` `double numberOfYears = 0;` 

    `cout << "Welcome to the program (press enter key for future value to exit program) \n";` `cout << "\n";` 

    `for (int counter = 0; counter == 0; counter++ )` `{` `count++;` `cout << "Please enter the desired future value of the account: \n";` 

     `cin >> futureValue;` `if (cin.get() == '\n'){` `counter++;` `break;` `}` `else` `{` `counter--;` `continue;` `}` `cout << "\n";` 

     `cout << "Please enter the interest rate: \n";` 

     `cin >> annualInterestRate;` `cout << "\n";` 

     `cout << "Please enter number of years: \n";` 

     `cin >> numberOfYears;` 

     `cout << "\n";` 

     `presentValue = presentValueCalc(futureValue, presentValue, annualInterestRate, numberOfYears);` 

     `cout << "----------------------------------------------------" << endl;` 

     `cout << "\n";` 

     `cout << "The amount you would need to enter is: " << right << setw(12) << presentValue << "\n";` 

     `cout << "\n";` 

     `cout << "----------------------------------------------------" << endl;` `}` 

    cout << "\n";

    `cout << "Thank you for using our calculator. You calculated " << count << " time(s) \n";` 

    `system("PAUSE");` 

    `return 0;` 

    }

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

    Big O If/Else

    Posted: 04 Nov 2018 07:10 PM PST

    How does if/else affect time complexity? Here is the pseudo code I'm writing. Would this be O(N) if I just have single for loop loops with O(1) statements in them?

    int function(Vector<int> v){ if (for loop to be evaluated){ "do something" } else if (...){ for loop; } else { for loop; } } 
    submitted by /u/jukitoyo
    [link] [comments]

    How to learn more advanced concepts?

    Posted: 04 Nov 2018 06:52 PM PST

    I'm looking for a way to continue my computer science education. I'm a grade 12 student currently, and don't feel like waiting a year to start university before learning anything new about programming. I don't have a computer science course this year because I took each computer science class a year early (there wasn't a grade 9 course) so there's a lot of time before I'll be learning this stuff in a class again. The problem is that all the tutorials and guides I can find online are mostly about things I already understand.

    Does anyone know of intermediate to advanced tutorials, books, etc that I could use to learn something new? I'm interested in almost anything computer science related

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

    I Can’t Debug C# in VSCode

    Posted: 04 Nov 2018 10:27 PM PST

    I have download Microsoft .NET. When I try to run a C# Program under "csharp.cs" it say "build not found" does anyone know how to fix this . I have also downloaded the c# package

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

    Help reading into 2D Char Arrays from a file.

    Posted: 04 Nov 2018 10:23 PM PST

    Hi, I am in need of help reading in from a file into a 2D char array. Im making a program that is like an ASCII painter. Im reading in from a previously saved painting but I cant read in the spaces. The function that im needing help with is below. Please help and Thank you so much for any help! :D

    void canvas::load_data(char str[]){ ifstream fin; fin.open( str ); fin >> rows >> cols; for( int i = 0 ; i < rows ; i++ ){ for( int p = 0 ; p < cols ; p++ ) { fin.get(arr[i][p]); } } fin.close (); } 

    This function first reads in how big the 2D char array is by means of rows and cols. Then the 3rd line in the text file is where the picture starts. Exmples of the file being read in below.

    5 5 XXXXX X X X X X X XXXXX 

    The next box is what i get when i run that function with the file above.

    XXX XXXX X X X X X X X 

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

    [C++] Linked Lists and Nodes question

    Posted: 04 Nov 2018 06:23 PM PST

    Hello I am working on something and I do not know why I cannot get it to work properly. Originally I had the program to be using a int value as the perimeter of the createnode function and the program worked the way that it should and properly displayed the nodes that I created. However I need to change the createnode function to create nodes in the list that are of Character type not of int type. So I changed that to the way that I thought it should be. However that does not work unfortunately I just get an error saying "invalid coversion from const char to char f-permissive". If anyone has a solution to my problem I would really appreciate it. Here is the code in question.

    #include<iostream> using namespace std; struct node { int data; node *next; }; class list { private: node *head, *tail; public: list() { head=NULL; tail=NULL; } void createnode(char value) { node *temp=new node; temp->data=value; temp->next=NULL; if(head==NULL) { head=temp; tail=temp; temp=NULL; } else { tail->next=temp; tail=temp; } } void display() { node *temp=new node; temp=head; while(temp!=NULL) { cout<<temp->data<<"\t"; temp=temp->next; } } }; int main() { list obj; obj.createnode("Mercedes"); obj.createnode("Mercedes"); obj.createnode("Mercedes"); obj.createnode("Blank"); cout<<"\n--------------------------------------------------\n"; cout<<"---------------Displaying All nodes---------------"; cout<<"\n--------------------------------------------------\n"; obj.display(); cout<<"\n--------------------------------------------------\n"; system("pause"); return 0; } 

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

    Alternatives to extracting text from a PDF

    Posted: 04 Nov 2018 08:57 PM PST

    After having issues with a Python library called PyPDF2, I am looking for alternative approaches.

    I have confirmed my PDF contains text and is not an image. I also confirmed the file is not encrypted.

    For some reason, I am getting binary jargon when I extract the file. I was wondering if anyone has any recommendations. I am not opposed to using something else other than Python.

    Thank you!

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

    Expanding this function in order to take more than 3 as the second dimension...?

    Posted: 04 Nov 2018 08:51 PM PST

    Take a gander at this:

    https://github.com/Chubek/CodingChallenges/tree/master/FlipAndReverse

    I couldn't make it so that the function takes more than 3 members for its second dimension. I tried to use flip_and_switch(int **array) but it didn't work, the function call said "No matching reference" or something like that. I want to know if it's possible to make this function take more than an array[2][4] or an array[3][6]. Thank you.

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

    [C#] What does this API endpoint thing mean? How do I interact with it? [HttpGet] [Route("{id:guid}")]

    Posted: 04 Nov 2018 08:35 PM PST

    So I have an API endpoint I need to interact with that is like this in C#.

    How do I invoke this? Sorry I know this is super basic but the syntax is VERY MUCH messing me up.

    [HttpGet] [Route("{id:guid}")] [ProducesResponseType(404)] [ProducesResponseType(200)] public string GetDocument(string id) { return "GetDocument with stringid invoked on " + id; } 

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

    Value of given string( see inside for more detail)

    Posted: 04 Nov 2018 08:19 PM PST

    Problem-

    Value of a=1,b=2,c=3...z=26.

    Given a string find the total value of string.

    For example if string is "abc" then value of string will be 1+2+3=6

    What I tried-

    s=input() P=0 for i in range(len(s)): if s[i]=='a': P=P+1 

    Same for b(P=P+2),c(P=P+3)upto z(P=P+26). Then print value of P.

    But this method is too long. Any other way to do it?

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

    No comments:

    Post a Comment