• Breaking News

    Thursday, April 19, 2018

    What and what not to learn for a self taught computer programmer ? Ask Programming

    What and what not to learn for a self taught computer programmer ? Ask Programming


    What and what not to learn for a self taught computer programmer ?

    Posted: 19 Apr 2018 12:33 PM PDT

    Hello guys ! I have been coding for 1 and a half years now (self education). I guess i am decent at it. I have made multiple projects in django and android. I now feel comfortable in these. But there are multiple subjects taught by top universities of the world which I don't know much about (for example concept of proof in computer science, advanced algorithms etc.) . What difference will these make if I learn them and how important are these things? By the way what else should a self taught programmer learn if he wishes to be really good at programming.

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

    Help with picking a degree

    Posted: 19 Apr 2018 09:51 PM PDT

    Hi all, I am not sure where else to turn. I am self taught, mostly js. I want to go back to school to make myself more marketable and hopefully fill in some holes. I have mostly picked out Penn State World Campus' software engineering bs, but am second guessing myself and wondering if I should find a more traditional degree (cs/is/etc).

    I want to build awesome stuff using modern technologies, preferably advancing the field in time. I don't know how much I would get out of any degree program, and see it mostly as a foot in the door with employers.

    Any advice is welcome!

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

    locally convert xlsx to json using console

    Posted: 19 Apr 2018 09:42 PM PDT

    I am trying to:

    1. Setup Node express server and routes
    2. Upload file, using Multer
    3. Read and convert xlsxl to json using this node module (excel-as-json)

    I can do steps 1 and 2. I am asking for help on how to configure step 3. specifically what changes do i need to make to my app.js file to have it use that module to convert my xlsx after upload?

    What I have done so far:

    Setup Node express server and routes

    npm init --yes npm install express --save npm install multer --save npm install body-parser --save mkdir uploads touch app.js 

    And in my app.js file

    var express = require('express'); var app = express(); var bodyParser = require('body-parser'); var multer = require('multer'); app.use(bodyParser.json()); var storage = multer.diskStorage({ //multers disk storage settings destination: function (req, file, cb) { cb(null, './uploads/') }, filename: function (req, file, cb) { var datetimestamp = Date.now(); cb(null, file.fieldname + '-' + datetimestamp + '.' + file.originalname.split('.')[file.originalname.split('.').length -1]) } }); var upload = multer({ //multer settings storage: storage }).single('file'); /** API path that will upload the files */ app.post('/upload', function(req, res) { upload(req,res,function(err){ if(err){ res.json({error_code:1,err_desc:err}); return; } res.json({error_code:0,err_desc:null}); }); }); app.get('/',function(req,res){ res.sendFile(__dirname + "/index.html"); }); app.listen('3000', function(){ console.log('running on 3000...'); }); 

    Next, I create a INDEX.HTML file

    <form id = "uploadForm" enctype = "multipart/form-data" action = "upload" method = "post"> <input type="file" name="file" />Upload <input type="submit" value="Upload" name="submit"> </form> 

    Next, I add in the node module excel-as-json

    npm install excel-as-json --save 

    Now I am at a loss. How do i update my app.js file to use the excel-as-json node module?

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

    JSON to .TXT live converter

    Posted: 19 Apr 2018 08:02 PM PDT

    Hi all,

    So FIBA has changed to JSON from XML. I am using OBS Studio, which only reads .txt files and displays them live when they change. I want to know if it's possible to write a code that reads the URL (http://www.fibalivestats.com/data/848382/data.json), and takes a string or line of data and converts it to a text file.

    Cheers!

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

    Basic HTML question.

    Posted: 19 Apr 2018 07:52 PM PDT

    I'm trying to get something to print within a defined label area (62x100mm) and I can't seem to figure out how to do it, I managed in the past, but I can't re-do what I did before. Here is the code that I need to have output onto

     {% if shipping_address %} <div style="padding: 1.5mm; border: 1px solid black; height: 210px; width: 320px; font-size: 20px"> <h2 style="margin: 0 0 0.2em 0;">Send To</h2> <strong>{{ shipping_address.name }}</strong><br/> {% if shipping_address.company %} {{ shipping_address.company }}<br/> {% endif %} {{ shipping_address.street }}<br/> {{ shipping_address.city }} {{ shipping_address.province_code }}<br/> {{ shipping_address.zip | upcase }}<br/> {{ shipping_address.country }} </div> {% endif %} 
    submitted by /u/cactusplants
    [link] [comments]

    Best coding interview style?

    Posted: 19 Apr 2018 07:14 PM PDT

    Hi everyone.
    I've been recently thrust into a leadership role at my current job. This is new for me, and one of the requirements is that I need to add bodies to our team asap.

    I want to make sure I use this opportunity to improve on my own past experiences, and make the interview more streamlined. I have no idea where to start though. It seems like each article describing a method is immediately followed by another describing why it doesn't work.

    Can anyone lend me some advice? What should I be looking for in a potential employee?

    submitted by /u/pre-medicated
    [link] [comments]

    Token-Based Security and Authentication for a Mobile App and a web API with Google Identity Platform

    Posted: 19 Apr 2018 06:37 AM PDT

    Hi!

    We are building an Android application, which relies on an API to store and receive data. We want users to be able to authorize and authenticate with their Google account. We also want to protect our API from unauthorized access. We came up with two different ways how to implement it and we cannot decide which one is more solid, or maybe none of them is the way to go. Here are both approaches described:

    Approach 1. We treat both mobile app and our API as a single OIDC Client. We use a callback endpoint of the API as a redirect target, so that we can receive the authentication code and exchange it for id and access tokens on the API side. Then we use the id token for authentication and generate our own JWT access token (possibly also a refresh token). Then we respond to the redirect call from the user's browser with our new token. The client app receives it and stores somewhere. Then it can access our protected resources, attaching our own JWTs to requests. With this approach, we only use Google for authentication and we do not need to use Google to validate its access tokens, we use our own tokens for API protection instead. Yet, we keep the responsibility to complete the authorization code flow, when the user authorizes.

    Diagram of Approach 1

    Approach 2. We want to treat the mobile app as the OIDC Client and our API as the protected Resource Provider. Thus, the app will handle the authorization code flow itself, and use google-issued access tokens to access protected resources on our API. The API will validate these tokens with Google's help and exchange them for user info. With this approach, we pass the responsibility of all the authorization handshakes with Google to the user and his smartphone, but we still need to validate access tokens on the API side. Question: would it be ok to send both access token and id token to the API for authentication purposes (so that we can skip querying Google for user info), or is it a big no-no?

    Diagram of Approach 2

    Which approach looks more correct and in line with current best practices? Maybe none of them? What would you change?

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

    What programming languages are used to create visualizations of data?

    Posted: 19 Apr 2018 02:49 PM PDT

    Hi. What programming languages are typically used when one wants to represent some data visually?

    I am not talking about some x-y plot or anything simple like that. I mean literally any sort of data and any sort of visualization that you could dream up in your head.

    Typically people use software like Adobe Illustrator, but the problem is that it cannot be automatized and it cannot process data. For simple x-y plots I know of R and ggplot, but that is obviously very specific and math/stat oriented, while I am looking for a more abstract graphical language.

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

    Does anyone like programmatically manipulating C# Expression Trees?

    Posted: 19 Apr 2018 01:52 PM PDT

    If so, here is one for you!

    Given:

    IQueryable <int> intermediateResults

    A type T with an int property named IntProperty.

    Convert:

    Expression<Func<T,int>> input = x => x.IntProperty

    To:

    Expression<Func<T,bool>> output = x => intermediateResults.Contains (x.IntProperty)

    I'll post results tomorrow if anyone doesn't know how but wants to know. I CAN do it, but don't relish the task.

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

    Javafx observableArrayList & tableview issues

    Posted: 19 Apr 2018 01:27 PM PDT

    I'm using JavaFX FXML.

    I'm having trouble writing to a tableview using a observable array list that contains information from a class. I have a class called person and another called job that extends person. I can write data to the classes fine using get and set. on my button event when I take info from textfields to the classes, I also do a get to a label with the info from the class(to see if it actually goes there). I've been trying to use an observable array list to put the data into the class and write to a tableview. I'm having no luck. any advice or pointers would be great.

    Here's what I have in my click event...

    @FXML private TableView tableView;

    ObservableList<job> data = FXCollections.observableArrayList();

    job job = new job(name.getText(),

     age.getText(), address.getText(), title.getText(), job.getText(), location.getText()); 

    data.add(job);

    tableView.setItems(data);

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

    Reg: student becoming a professional

    Posted: 19 Apr 2018 04:57 PM PDT

    Hey guys!

    I'm about to graduate in a few months and I wanna know what I should expect.

    I excel above and beyond my peers at c++. I learned the basics of python, ruby, JavaScript, C, HTML, CSS on my own (not that great at them). I've taken algorithm courses.

    If I wanna be a great coder, what should I learn next and how would well/poorly would I be paid right now in the real world as a programmer?

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

    Typecasting error while developing Ceaser's Chiper

    Posted: 19 Apr 2018 09:39 AM PDT

    Cipher increases the ASCII value of each char in a string by 1

    So A becomes B B becomes C And so on

    Here's my code for the cipher

    Ceaser cipher

    Here's my output when the input is H
    1 col - (int)string2[i]
    2 col - n
    3 col - string2[i]

    Output

    the (int)string2[i] value randomly jumps from 70 to 97

    cant think why

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

    PHP specific question: Help me by working through what i need to do...

    Posted: 19 Apr 2018 12:02 PM PDT

    This is a continuation of : https://www.reddit.com/r/learnprogramming/comments/8cvnmu/help_me_out_conceptually_with_implementing/

    To get the text conversation going, I have implemented a multidimentional array and the format is like this:

    $greetings = array( array( 'favor' => '2', // To implement weightage 'message' => 'Hello World!', 'timeofday' => 'Morning' // Could be General, Morning, Afternoon or Evening ) ); 

    So, beyond that i am completely out of my depth.

    Here is my breakdown of the solution.

    1 ) Search through array based on time of day. Eg. If time is before 12pm, get the arrays that have timeofday as General and Morning. I manage to get the keys to the arrays via with this bit of code:

    $keys = array_keys(array_column($greetings, 'timeofday'), morning); var_dump($keys); 

    2) So i got the array keys, how do i covert the keys into array data?

    3) With the array data, how do i use the data and implement the phrases?

    submitted by /u/leo-g
    [link] [comments]

    Help

    Posted: 19 Apr 2018 07:39 AM PDT

    Hi, i wanted to ask the programmers in here, is it nessessary to study systems engineering to be a programmer, because i am in my first semester and its not going well, and i dont understand why i need to learn advanced math if i only need basic math for programming( sorry for bad english)

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

    Simple calendar programs for multiple users

    Posted: 19 Apr 2018 06:05 AM PDT

    Trying to code a simple yearly calendar that tracks when people are on call in work allowing people to organise themselves and swap on call times etc. I am able to code the front end but not actually make it function. If anybody can point me in the right direction it'd me much appreciated

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

    Can I make an application to automatically adjust settings another? (Programmatically)

    Posted: 19 Apr 2018 06:31 AM PDT

    EDIT: Typo in title, apparently I can't edit it anymore. Shold be "Settings of another application".

    Hello! I'm struggling with a first world problem.

    Little background info: I have Razer Synapse enabled for my headphones, along with it's audio settings and so on. Whenever my PC turns on, it automatically sets the audio output device to a one I don't want to use, instead of my headphones.

    I'd like to make a program that autonomously switches the output device with a push of a button (and upon startup), without any user interaction.

    I know how to make it do it automatically, though. All I need to know is, how can I make my program switch the setting?

    One way to do it would be to simulate mouse clicks, but that sounds iffy and I'm gonna assume there are far better ways to doing it.

    (If it's of any help; this is the window the setting is on, under "Select Audio Device")

    https://gyazo.com/a58a2a03d0c37cbcb080d7d8bbaa3adf

    I can execute this with either Java or C#, whatever fits the job better. I have experience in both, and only thing I need to do is to somehow change the setting programmatically; I have everything else sorted out.

    Any help on how to achieve this is much appreciated!

    NOTE: I don't want code handed to me, I want to learn how to actually do it with other applications as well in the future! Also, if this isn't possible in either language, which language should I go for?

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

    How can I automate my business in code?

    Posted: 19 Apr 2018 05:33 AM PDT

    I don't want to setup too much infrastructure, and want a simple hosted platform.

    I've been looking at tools like https://zapier.com and https://www.process.st/. Is there anything else people use?

    EDIT:

    I agree this sounds vague. However, I want to automate business processes generally, of the kind you see in Zapier or another tool: https://www.process.st/checklist/

    For example, with process.st there are processes for employee onboarding, but also processes for support tickets.

    However, with process.st the processes are checklist; I can't edit the logic in code.

    submitted by /u/darwins-bulldog
    [link] [comments]

    Relational data instead of JSON?

    Posted: 19 Apr 2018 05:32 AM PDT

    Would it be useful for websites to respond with relational building blocks versus forcing API users to reconstruct data relationships and types from JSON? There's probably a huge number of sites based on PostgreSQL that could send you an SQLite database, or DDL plus a subset of the data your interested in, instead of forcing everyone to try to infer the types and relationships, or deal with a denormalized tree version of the data. Things like GraphQL and JSON schema are sort of addressing this, but it seems redundant to a large degree.

    It seems like quite a lot of energy goes into reverse engineering the data anytime I'm interacting with a web service. Maybe Datomic is similar to this approach in that it's, "give me a copy of the database, and I'll query it locally."

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

    Attempting to make a Supreme Bot

    Posted: 19 Apr 2018 03:51 AM PDT

    So I've been buying Supreme for some time now, unfortunately I can't get it anymore as everyone seems to be using bots, I have some experience programming in Visual Basic but don't really know how to interact with a website like that, was just wondering if anyone could point me in the general right direction.

    Thanks In Advance

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

    I know, I know, I know... but please hear me out...

    Posted: 19 Apr 2018 11:14 AM PDT

    ... I kind of feel like arrays should start at 1... WAIT WAIT WAIT HEAR ME OUT!

    ok, so here's my logic.

    • Zero is a number, BUT it's not a value, it's the lack of a value. The same way that black is not really a color, but a lack color
    • in many areas of programming, Zero is synonymous with null / undefined
    • retrieving the first element in an array is essentially asking for the first 'value'
    • asking for the 'NULL-th' value doesn't make any sense (yea this one isn't actually logic, but i think it helps for understanding the mindset of the argument)
    • in mathematics, zero is also considered null/valueless
    • you cannot increment by zero

    To sum it up, I feel like Zero is the starting point of an array, but not an array item in itself. it's like the '[' char of the array

    Now here's my question. Is there anything illogical / intrinsically wrong with this argument?

    I'm not trying to denounce starting arrays at zero. I feel like BOTH ways are correct, and it's really more of a subjective matter than it is objective. I agree with many points made for starting arrays at zero, but this is not a situation where proving "A" true also proves "B" untrue. But maybe i'm completely wrong in this, and all the points I've made have counterpoints, and if so, PLEASE correct me.

    Anyways, if you didn't just click away when you saw it was an "arrays start at 0 vs 1" post, I thank you, and reward you with some sexy photos https://imgur.com/a/eCRjAdR

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

    How can I toggle Dark Theme of YouTube with one click?

    Posted: 19 Apr 2018 12:28 AM PDT

    I am using Google Chrome as my browser and I use Tampermonkey which is an extension of Chrome to run JavaScript. Basically, I want a button at the top right of YouTube that when I click it, it will toggle Dark Theme on and off. By default, you have to click the profile icon, then Dark Theme, and then the switch. So, instead of 3 clicks, I want 1 click.

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

    [C++] Trying to create a circle within a 2D array using for loops

    Posted: 18 Apr 2018 10:51 PM PDT

    Hi, I'm trying to write a program for creating .pgm and .ppm and am trying to draw a circle using a 2D array of numbers. Using a given center location (x,y) and the radius. Here is what my code looks like for the drawCircle() function.

    void drawCircle(unsigned char pgmImage[][WIDTH], int height, int centerX, int centerY, int radius, unsigned char grayLevel) { for (int rowIndex = centerY; rowIndex < 50; rowIndex++) { for (int colIndex = centerX; colIndex < 50; colIndex++) { if ((pow(colIndex - centerX, 2)) + (pow(rowIndex - centerY, 2)) <= pow(radius, 2)) { pgmImage[rowIndex][colIndex] = (grayLevel); } } } 

    the greyLevel is for what shade of grey I want the circle to be. and I am attempting to draw the circle using the formula (x-a)2 + (y-b)2 =r2 where a and b are my center x and y.

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

    No comments:

    Post a Comment