• Breaking News

    Monday, September 3, 2018

    Not sure if I’m writing this in the right place but how can I teach a 5 year old about programming? Ask Programming

    Not sure if I’m writing this in the right place but how can I teach a 5 year old about programming? Ask Programming


    Not sure if I’m writing this in the right place but how can I teach a 5 year old about programming?

    Posted: 03 Sep 2018 09:44 PM PDT

    How did you young learners get into it? And is there like programmable mincecraft or something to make it more interesting?

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

    Is it feasible to write an IR-to-assembly compiler as opposed to an LLVM backend?

    Posted: 03 Sep 2018 05:51 PM PDT

    I've made a virtual processor with a simple instruction set and memory model as a learning exercise (and mostly just for fun). I can write programs in its assembly language, assemble them with my assembler, and successfully run them on a virtual machine.

    I've been wanting to write a compiler for a higher-level language that targets this machine so I don't have to write everything in assembly. I've heard of LLVM, a compiler project that supports multiple front-ends for different languages and outputs IR that is somewhat assembly-like. This IR is given to a platform-specific backend that turns it into assembly/machine code for a platform.

    I've looked into writing my own backend; I've seen LLVM's backend tutorial and the backend for Cpu0 tutorial, and, frankly, it looks a bit complicated.

    Is it feasible to write a compiler, external to LLVM, that reads LLVM's *.ll files and outputs assembler for my platform, as opposed to writing a whole new LLVM backend?

    I don't care much about my code running fast and being highly optimized right now, I just want to get real code compiling to it. I'm okay with figuring out the register allocation, et. al. on my own, I don't need it to be efficient.

    More answers on SoftwareEngineering.SE

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

    why not program all web stuff in javascript? why do we need css and html?

    Posted: 03 Sep 2018 07:31 PM PDT

    it would seem much easier to learn 1 language than 3.

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

    [HTML5/JQUERY] How to make noses a user can drag edges between.

    Posted: 03 Sep 2018 09:20 PM PDT

    Hi I'm trying to make a project which involves resizable cells, each containing some info and some bullet points.

    I want the user to be able to drag an edge between two bullet points to draw a connection between the associated info. What's the name for that?

    Ideally I'd like it so that you can see the line as it's being drawn too, from the node to the cursor during a drag. Could I have some help please? Thanks ^^

    EDIT: hahaha *NODES

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

    This might not be an AskProgramming question, but I hope you can indulge me. My buddy requested a pair of 3D printed bookends. What's the appropriate python code to start and end an array called "books" so that I can print him a pair of bookends that calls an array of his "books"?

    Posted: 03 Sep 2018 09:15 PM PDT

    Python - working with data and merging API data with MySQL database in memory limited environment

    Posted: 03 Sep 2018 02:22 PM PDT

    I have a pretty interesting programming problem at work. I use Python, for the record.

    So I have this external API for user related data from a vendor, and it has a crap ton of records separated by pages. I can query using REST API to separate by page # (ie ?page=1). This returns about 10,000 user records. I need to grab this user data and join it with my server (remote) MySQL instance.

    My machine is kind of limited... I can only load about 10% of the database and 10% of the API results at a time. How can I compute this? What's the most efficient way?

    What I've done so far is first fetch the number of rows in the SQL database, and spawn 10 threads for each block (roughly 10% of the rows in each thread). I have a lock which prevents more than one thread from running, so that only 10% of the rows are loaded. Then, that thread spawns a new thread to read each of the pages in the API and left joins it to my sql database. Is this approach bad?

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

    How would I set up search result alerts for depop.com

    Posted: 03 Sep 2018 09:07 AM PDT

    Hi there,

    I use an app / website called depop to buy clothes and was wondering if it is possible to set up an alert e.g. when my search result returns a new result to notify me. Roughly what would I have to do to set this up? (I know basic Python and very basic html but that's about it.)

    Thanks for any pointers you can give!

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

    What programming language would be the best for a p2p software that will run on Raspberry Pis? I was thinking about Rust or Go

    Posted: 03 Sep 2018 03:11 PM PDT

    Anybody know where this pic was taken, or at least what computer they're using?

    Posted: 03 Sep 2018 02:24 PM PDT

    https://render.fineartamerica.com/images/rendered/default/metal-print/48.000/36.125/break/images-medium-5/men-working-on-analog-computer-underwood-archives.jpg

    Want to get this as an acrylic print, but I want to make sure that the guy on the left is actually programming a computer and not just configuring something for the microscope on the right.

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

    Auth without exchanging plain text password with server

    Posted: 03 Sep 2018 07:57 AM PDT

    How would you go about simulating E2EE in a simple login scenario?

    Say client hashes the credentials somehow with bcrypt and sends it over with identification (email, username, etc) for which the server fetches matching credentials (already hashed with bcrypt during registration) and compares with the hashed form data and issues a JWT as handshake.

    I'm looking to bake a personal goto standard for authenticating SPAs on the fly for future projects and I'd like to learn how other devs would go about this as it would spell put flaws and optimisations early.

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

    Better way to access SQL-data with C#

    Posted: 03 Sep 2018 01:35 PM PDT

    Hi!

    I want to use an MSSQL server with Unity (hence C#). My approach is working but seems really strange. It is working and does what I want it to do but see for yourself.

    [...] ​"SELECT * FROM tblObject WHERE StartDate <= @SelectedDate AND EndDate >= @SelectedDate"; dbcmd.CommandType = CommandType.Text; dbcmd.CommandText = sql; dbcmd.Parameters.Add("@SelectedDate", SqlDbType.VarChar).Value = selectedSingleDate; dbcmd.Connection = dbcon; using (SqlDataReader reader = dbcmd.ExecuteReader()) { while (reader.Read()) { GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); ​ string xPosition = (string)reader["XCor"].ToString(); string yPosition = (string)reader["YCor"].ToString(); ​ string length = (string)reader["ObjectLength"].ToString(); string width = (string)reader["ObjectWidth"].ToString(); ​ string phase = (string)reader["PhaseID"].ToString(); ​[...] 

    Like I said, everything works but the part where I use (string)reader.ToString() seems really weird to me. Why do I need to use toString() for it to work? If I leave it out, I get errors. Furthermore the elements ObjectWidth and ObjectLength are stored as floats, but (float)reader does not work. I read up on the documentation but the methods GetFloat or GetDouble do not work either. What would the correct way to recieve float values from those fields look like? Thank you!

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

    Best option to add calendar alerts on a Flask-Angular app?

    Posted: 03 Sep 2018 09:18 AM PDT

    Hi, I'm making a simple ToDo list app using Angular 4 as Frontend and Flask as Backend. I successfully added Tasks to a database using POST requests but now I'm stuck while looking for the best way to remind the user that a Task must be done.

    I want to trigger an alert in the screen, but I don't know what's the most efficient method to do it. I thought of:

    • Making the frontend regularly perform GET requests to the Flask backend (and either store events in memory/cache or just check) and alert whenever a certain date is coming. I think this would be resource intensive and may slow down the app a lot.
    • Making the backend schedule events and send an alert to the frontend using Websockets or some other technology.

    I successfully implemented scheduling using Advanced Python Scheduler, but I still don't know if Websockets is the best technology to trigger alerts on the frontend or there's a more efficient and less resource intensive method. I also wonder how it would identify which frontend would get the alert since in the future, I want to try making it collaborative in a similar way to WhatsApp.

    Thanks a lot to those who can help me with this!

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

    Trying to make a simple python program, if 'end' is typed I want the program to stop

    Posted: 03 Sep 2018 02:42 AM PDT

    string = "hello"

    while 1 == 1:

    inp = input("[1/2/END]: ")

    if inp == '1':

    print(string)

    if inp == '2':

    print(string.upper())

    if input == 'END':

    print("Thank you")

    else:

    print("Thank you")

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

    Can i use the typescript features like typechecking errors in .js files? Or i need to write plain typescript in a .ts file?

    Posted: 03 Sep 2018 04:19 AM PDT

    No comments:

    Post a Comment