• Breaking News

    Friday, November 1, 2019

    Noob question about nesting Ask Programming

    Noob question about nesting Ask Programming


    Noob question about nesting

    Posted: 01 Nov 2019 05:22 PM PDT

    if you return a value to a function in a nest within a nest does it stop the rest of the function?

    For example;

    bool Function(const char*)

    for (int i = 0; i < 100; i++)

    for (int j = 0; j < 50; j++)

    if(SomeStatement)

    {

    return true;

    }

    Lets say it gets to the 20th iteration of the "j" loop within the 10th iteration of "i" loop and returns true, is this function going to go through the rest of the "i" iterations or will the entire function terminate and return true?

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

    When a game using DX12 says "Optimizing Shaders", what's it actually doing?

    Posted: 01 Nov 2019 08:42 PM PDT

    As in what kind of optimizations are being made to the shaders and why specifically the shaders

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

    Sphinx math support oddity in Spyder IDE

    Posted: 01 Nov 2019 03:41 PM PDT

    I am struggling with getting my code to be 'properly' documented with math equations because the oddness of the way that Sphinx is handling my object docstrings.

    An example of the oddness is the string ":math:`\sigma(x)= \frac{1}{1+e^{-x}}`". Now you would expect this to display the equation for a sigmoid function but in reality it displays the "\sigma(x)=" properly and on the following line "rac{1}{1+e^{-x}}`" in normal text. In order to get the entire formula to display properly I had to modify the formula to be ":math:`\sigma(x)= \\frac{1}{1+e^{-x}}`". Note that the \s does NOT require a double slash but the \f does. Is there a reason that this implemented? is this a bug in the handling of \f or \s or both? I am trying to copy paste formulas from a document written in latex and don't want to spend my time debugging each mathematical statement to make sure its displayed correctly. Any help would be nice.

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

    What are good tools for tracking a hierarchy of tasks?

    Posted: 01 Nov 2019 06:52 PM PDT

    I am working on a huge project whose parts are growing into a big tree of project --> task --> subtask --> subsubtask --> … It would be great if I had a tool to track all of this. That way I can just pick a branch and work on it till I get bored, jump to another branch, and so on. Are there good tools to do that?

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

    Computer Lab Update Automation

    Posted: 01 Nov 2019 12:18 PM PDT

    I work in a non-profit computer lab, and we have 18 computers. We also use 'faronic's deep freeze' on them all.

    I'm trying to make a script to handle opening the browsers (chrome, firefox & opera) and doing the updating.

    I've tried cmd scripting, then I went to autohotkey, now I'm thinking about pyautogui.

    I've made 'dummy' scripts, i.e. mouse goes to a point and clicks. But if something happens I can't deal with it. I can't make 'smart' autohotkey scripts.

    Is there a different thing I should be looking into? Should I stick with autohotkey, or check out Python (which I have experience in)

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

    [JAVA] How Do I Get The Current Source Code As A File In The Same Program

    Posted: 01 Nov 2019 11:47 AM PDT

    I have a file Source.java and I want to open the source code of it in itself. How would I do that?

    Using the Eclipse IDE.

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

    Counting number of unique elements in an array with Python

    Posted: 01 Nov 2019 07:44 PM PDT

    Deaf programmers - what particular challenges do you face in this industry?

    Posted: 01 Nov 2019 12:17 AM PDT

    I had a great chat with a deaf girl last night. She is not a programmer, she works in a factory but it got me thinking what life is like as a deaf programmer since that is something I can better relate to. She pointed out that since everyone communicates via text these days it's quite easy for her to communicate with most people without her deafness coming into play at all. I guess a lot of programming is text based and that must help. On the other hand, conferences and talks are audio. I have never seen an interpreter.

    I'm mostly just curious. Are there any and are there any ways in which your life is different? I guess office noise doesn't bother you and I guess you don't listen to music while working. I'm curious what else.

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

    Selling software without releasing code

    Posted: 01 Nov 2019 08:33 AM PDT

    Hi, I need a method of selling software without releasing the code to clients. Most people would pre-compile and release that, however that's very tedious for me because I'm releasing to a variety of Linux distributions. Any help or ideas are greatly appreciated.

    submitted by /u/Moist-Von-Lipvig
    [link] [comments]

    Need some general guidelines for a project i have in mind

    Posted: 01 Nov 2019 06:14 PM PDT

    Hello, i'm a beginner programmer and i recently had this idea for a project:
    A site, where you simulate a competitive "game show" type of application. What i have in mind is, there's gonna be a main display (e.x. a smart tv logged into the site's url) and the players will be able to join the game via their smartphones. Once the game starts, there will be some interactive phases, like everyone answering questions separately and collecting points.

    As of now, i know some programming languages like python and java, and also some basic web dev with html css and js, but i have no idea what type of frameworks/technologies are going to help create what i have in mind. I didn't manage to find anything online, so if anyone can offer some knowledge of how something like this can be accomplished, i would be very thankful!

    (also feel free to steal this idea and build the game yourself, it's not very original anyways : ) )

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

    Apache SSL trouble shooting

    Posted: 01 Nov 2019 04:00 PM PDT

    Apache web server.

    Port 443 fires up successfully + you can verify it works by mapping to the back end URL in a web browser. You see valid cert and our logs shows the connection was successful.

    when you map to the front end URL through the proxy server:

    • The proxy server receives 'ssl handshake error'
    • Our apache logs show:

    OpenSSL: Read: SSLv3 read client key exchange A

    [client] SSL library error 1 in handshake (server xxxx:443)

    SSL Library error: 336151608 error:14094438:SSL routines:ss13_read_bytes: tlsv1 alert internal error

    connection closed...

    Any ideas on what is causing this? Appreciate the help.

    submitted by /u/vanilla-blue
    [link] [comments]

    Programming an electric blood pressure monitor

    Posted: 01 Nov 2019 05:54 AM PDT

    Hi everyone. Ideally how hard would it be to program an electronic BP cuff to inflate and stay inflated at a certain pressure for 5 minutes at a time?

    I'm doing research on a type of ischemic conditioning and this would help the project immensely. Thanks in advance

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

    Node.js Passport Facebook authentication not working

    Posted: 01 Nov 2019 08:34 AM PDT

    I'm pretty new to programming, but I'm trying to figure out how application/websites can implement Facebook authentication for a paper I am writing, however when I try to implement it myself I can't get it to work. As stated at the bottom in their documentation ( http://www.passportjs.org/docs/facebook/ ), passport requires the following link to start the authentication process:

    <a href="/auth/facebook">Login with Facebook</a>

    But this link simply directs me to file:///C:/auth/facebook and gives me an error because the file it is looking for doesn't exist, instead of starting the actual authentication process.

    Can anybody help me out here?

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

    Double-tap mobile Javascript

    Posted: 01 Nov 2019 12:01 PM PDT

    My event listeners stopped working on mobile Chrome and Safari recently and now they just zoom in when double-tapping. I use 'touchstart' and compare the time to the last 'touchstart' event.....is there a new rollout of standards that I don't know about? Can someone point me in the right direction? Thanks

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

    How to limit pan restriction on a zoomed in svg using svgPanZoom?

    Posted: 01 Nov 2019 07:49 AM PDT

    Notice in this jsfiddle example, pan restriction is working while the svg is at scale or zoomed out. However when zoomed in you can no longer pan.

    Would like a way to zoom in and still be able to pan whilst keeping the edges of the svg locked to the edges of the viewbox.

    Link: https://jsfiddle.net/hefys2gc/

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

    What concept do I need to build complicated reports

    Posted: 01 Nov 2019 07:44 AM PDT

    So, I want to deal with a lot of data where a whole (an interest in real estate) can be divided in lots of different ways, which in turn can be divided and those smaller interests can be reunited.

    As as example, dad dies and gives each son a quarter, but two of them transfers back to the oldest so he now has three quarters and one brother has a quarter, etc.

    All my question is what kind of concepts should I be looking at? I'm pretty good at hacking together solutions, just got to know if there are good shortcuts rather than recreating the wheel.

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

    Unable to pass express-session from one route to another route

    Posted: 01 Nov 2019 07:28 AM PDT

    I am trying to log in user using express-session variable. I am not able to pass sessions on other routes.

    MY app initialization file (index.js) file: -

    const session = require('express-session');

    app.use(session({

    secret: config.get('secretKey.key'),

    resave: false,

    saveUninitialized: true,

    cookie: {

    maxAge: 6000

    }

    }))

    When someone clicks on submit after filling in username and passowrd, node redirects to this login controller page: -

    router.post('/', (req, res) => {

    let user_session = req.session;

    if(!user_session._id){

    Users.findOne({username: req.body.username}, (err, user) => {

    if (err) console.log("Database error: " + err);

    let passwordMatch = checkUser(req.body.password, user.password);

    if (passwordMatch) {

    user_session.userId = user._id;

    console.log("Successfully logged in: " + user_session.userId);

    } else {

    console.log("Login failed");

    }

    })

    } else {

    res.redirect('/admin');

    }

    })

    Once the login is successful, they will be redirected to this route. However, I am not getting logged in and instead, I am getting you need to log in the message as I have set below. This is my admin page code

    router.get('/', function (req,res) {

    let user_session = req.session;

    if (user_session.userId){

    console.log(session.userId)

    res.render('./../views/admin/admin.pug');

    } else {

    res.send("You need to login first!");

    }

    })

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

    OpenSSL state machine extensions

    Posted: 01 Nov 2019 04:31 AM PDT

    I am working on a project where, at some point, I need to modify the OpenSSL TLS state machine behavior (to be more precise, I need to add an implementation of a new behavior). The important thing about this is that my extension is currently not supported by the TLS spec.

    Do you know any opensource projects (OpenSSL forks, I guess) where people do such a kind of thing?

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

    Creating and sharing a large database of emails

    Posted: 01 Nov 2019 10:14 AM PDT

    Hi all, I havent worked much if at all with any databases, and I was wondering if it would be possible to somehow create a database to store semi-large amounts of emails and then look them up such that the created database is easy to share among co-workers?

    Basically, the issue is that at my work we store the names and emails of people who attended one of our workshops. We also regularly look these people up to confirm if they attended a workshop or not. The way we currently are doing this is just by saving all the emails in a massive google sheet, however its gotten to the point where the sheet is so large it takes a while for it to load and results to show up; an issue that will only get worse with time. I want to create a more efficient way to store everything, and for my co-workers to access/also edit the database without having to use the same computer.

    I have some limited experience in SQL, but im not opposed to working in it more. I also have experience in Java, bash and C as a second year compsci student as well as working for a bit with Django a few years ago. If anyone could point me in the right direction, or towards a tutorial that would help me flesh this out that would be great!

    Thank you so much

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

    A student interested in learning reprogramming and photoshop.

    Posted: 01 Nov 2019 09:50 AM PDT

    I'm a student who got bored of learning the useless Stuff in school and try learning something else. I want to learn more about programming and little photoshop. If u have any advice or a link in which I can go learn plz share

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

    Script for downloading monthly bills

    Posted: 01 Nov 2019 06:23 AM PDT

    Hello Folks,

    I am looking for a way to automatically download and save monthly bills to my home server which is a linux box. My main issue, is that I have found several tutorials on downloading files from a website with curl, but this does not include authenticating to the server or having to request the file from an ASP.Net handler. I know each website that I will be downloading from will have different ways that files are requested an authentication is done, but I am not even sure what I should be searching to get some examples or tutorials on how to do this.

    Ideally, I will have a script that will authenticate to the server, pass an HTTP request to the server, download and save the file in a defined format.

    Am I off base in even thinking this is possible?

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

    How do you deal with badly written user stories?

    Posted: 01 Nov 2019 06:21 AM PDT

    With badly written I mean 'create users microservice' and nothing else linked or specified. No requirements or acceptance criteria. They are pressuring me into finishing it for next friday.

    What would you do if you were in my place?

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

    So my wife wants to learn coding, but she is demanding she buy a book..

    Posted: 01 Nov 2019 06:20 AM PDT

    Hi, Just wondering your opinions on this

    My wife would like to learn coding, I've been a coder for a number of years now and I've been telling her to try an online course to see if she'll like it. She bought the course, but then left it unread. Next she wanted a coding book, so I downloaded the exact one she wanted on pdf form for her ipad, again - unread.

    She is saying, to learn programming she needs a physical book for the 'feeling'. She believes that a good feeling can help her learn better as she mostly learns from books. I think she's procrastinating and a book will not help, especially with programming

    What do you guys think

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

    What is wrong with my clone function? (C++)

    Posted: 31 Oct 2019 10:33 PM PDT

    I have this assignment where we need to make out own smart pointer and there is a clone function we need to write and it needs to set pointer of a smart pointer point to a new smart pointer and for some reason, I don't know what I am doing wrong.

    here is the code and the assignment

    https://gist.github.com/BimBimSalaBim/567ca2a12d4b9b65af1d31cc3bc9e3e0

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

    No comments:

    Post a Comment