• Breaking News

    Saturday, March 28, 2020

    Any debate-like programming channels on youtube? Ask Programming

    Any debate-like programming channels on youtube? Ask Programming


    Any debate-like programming channels on youtube?

    Posted: 27 Mar 2020 11:29 PM PDT

    i would like to know if you guys know some programming channels on youtube that is about debates of programming languages or the programming field itself, computer science etc, like two people debating over a language (2 or more languages) or any topic on computer science?

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

    What does a bad code mean to you?

    Posted: 27 Mar 2020 10:46 AM PDT

    how to handle CORS in Expressjs

    Posted: 28 Mar 2020 12:19 AM PDT

    i'm at the point where all my google search links are purple.

    i've tried adding headers manually and used express cors.

    i've read this : https://expressjs.com/en/resources/middleware/cors.html

    followed the instruction, and all is good, every request [GET, PUT, POST,DELETE,PATCH] i send pass through, but. if i tried to upload files to the server CORS blocked me.

    the message :

    Access to XMLHttpRequest at 'https://api.example.xyz/api/post' from origin 'https://app.example.xyz' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    but the CORS BLock is gone if i removed anything that handle moving the files from the request body.

    i've tried multr , express-fileupload, and moving the image manually with node fs, cors always blocks me.

    please help. how do i upload file with express ? is this my server faults ? it works on locally.

    fuck cors.

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

    Do all python scripts need to be run from the same folder? How to structure files?

    Posted: 27 Mar 2020 09:58 AM PDT

    if i open jupyter notebook using miniconda it works fine and modules import ok doesn't matter where my notebook is stored

    now i downloaded a python script and when I run it, the idler can't import module.

    This is what i get from sys.path:

    python idle:

    Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 18 2019, 23:46:00) [MSC v.1916 32 bit (Intel)] on win32

    = RESTART: C:/Users/userm/Desktop/Trading/Main/dash-volatility-surface-master/delete.py



    miniconda:

    ['', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\python37.zip', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\DLLs', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32', 'C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages']


    please help

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

    Please help (Obj-c & iOS) development error: Unbalanced calls to begin/end appearance transitions

    Posted: 27 Mar 2020 11:17 PM PDT

    If anyone has experience with iOS development in objective-c, I'm having trouble making a solution for this problem I've been having. I will love you if you can help. https://stackoverflow.com/questions/60826188/unbalanced-calls-to-begin-end-appearance-transition

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

    Any good and free resources for adults to relearn math, specifically geometry and possibly physics?

    Posted: 27 Mar 2020 05:10 PM PDT

    Hey, title explains it all. I'm working on a simple game for my portfolio and the project has made me realize how much I forgot math.

    What are some of the best resources for relearning simple geometry concepts? Ty in advance.

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

    need help with AVLTree and I/O

    Posted: 27 Mar 2020 10:58 PM PDT

    i didnt understand this task correctly, and i have to use class Word as a type for AVLTree, the class word is a comparable and contains 2 variables :

    1-String word, 2-int count

    and the task is,

    Q#2-b : Your program in (a) above would have automatically discarded all duplicates of words since duplicates are not accepted in BST/AVL trees. Write another program, PrintWordCounts.java, that prints each word in the input file along with its count.

    Hint:For each word encountered, use it to create a Word object named target

    Search for target in the tree. If found, increment the count of the result else, insert target in the tree. At the end, traverse the tree using inorder() method.

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

    [Terminology] Name for functions that return a different value each time they are called

    Posted: 27 Mar 2020 10:40 PM PDT

    I'm looking for a concise (and hopefully standard) name for functions like random() or time() that take zero arguments and return a different value each time they are called.

    Another classic example comes from parsing, where you often have a function call "get_token()" or similar that returns the next token each time you call it.

    Some terms I already know that aren't what I am looking for:

    • "zero-arity" is too limited, it just means the function takes no arguments);
    • "impure function" is too broad, impure functions include anything with a side-effect;
    • the function isn't a constant function and doesn't have referential transparency because each time you call it you get a potentially different value;
    • for the same reason it's not idempotent (calling it twice is not the same as calling it once);
    • it may or may not be [reentrant](https:/idempotent/en.wikipedia.org/wiki/Reentrancy_%28computing%29).

    Basically I'm looking for a term to describe zero-arrity impure functions with no visible side-effects (aside from, perhaps, some internal change of state). Is there a standard term for this?

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

    How to clone a site?

    Posted: 27 Mar 2020 10:09 PM PDT

    Hi, was looking into making a gag wikipedia page but with the same format/css. Is there a way to do this besides recreating it in React?

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

    I'm a grocery store night sticker. What practical programming material can I read about or learn during my 30 min breaks

    Posted: 27 Mar 2020 01:26 AM PDT

    Some extra info: I have a degree in CS and I'm currently applying to sw dev jobs but im stuck here stocking until I land a real job. This pandemic has me tired af during my breaks but I want to be productive and learn whatever I can. Rather than learn/read about theoretical stuff, what are some real industry topics/skills that I can knock out in small increments daily?

    Edit: night stocker

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

    Getting into machine learning.

    Posted: 27 Mar 2020 07:27 PM PDT

    So I'm a decent programmer and before I could even write a hello world program I've been interested in machine learning. I think I understand the basic concepts but I cant find many comprehensive resources into actually programming advanced AI. I have a general interest but I'd like to write basic games and have the AI learn to play them. Does anyone suggest any resources on where to get started?

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

    Learning rate not having an imapct on convergence speed?

    Posted: 27 Mar 2020 05:31 PM PDT

    While implementing the behavior of a NAND gate using Rosenblatt's perceptron I was testing the impact of changing the learning rate and how many epochs would it actually need to converge. But changing the value had no impact and the algorithm always converged after 5 epochs.

    This is my implementation:

    import numpy as np n_inputs = 2 epochs = 10 # the loop is written to break once the algorithm converged so this represents max epochs #binary inputs training_inputs = np.array([[1,0,0],[1,0,1],[1,1,0],[1,1,1]]) #bipolar inputs #training_inputs = np.array([[1,-1,-1],[1,-1,1],[1,1,-1],[1,1,1]]) d = np.array([1,1,1,-1]) l_rate = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9] for learning_rate in l_rate: print('\n====================================\n') print('Learning Rate: ',learning_rate) w = np.zeros(n_inputs+1) previous_w = np.zeros(n_inputs+1) conv_epoch = 0 for i in range(epochs): for inputs, targets in zip(training_inputs, d): v_i = np.dot(inputs,w) if v_i > 0: y_i = 1 elif v_i == 0: y_i = 0 elif v_i < 0: y_i = -1 w = w + learning_rate*(targets - y_i)*inputs #logging the weights after each epoch and comparing it to the previous epoch's weights print('------------------------') print('end of epoch: ',i+1) print('weights: ', w) print('previous weights: ', previous_w) conv = np.array_equal(previous_w, w) #compare to previous epoch's weights to check for convergence print('Converged: ',conv) if(conv): if (conv_epoch==0): conv_epoch = i #it converged at the previous epoch print('weights: ', w) print('Converged at epoch: ',conv_epoch) print('------------------------') break #after it converged no need to continue with the remaining epochs print('------------------------') print() previous_w = w 

    is this impacted by the nature of the inputs being -1 and 1 or is there anything wrong with my code. I am testing it with both binary and bipolar inputs.

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

    Trying to help a family business in danger

    Posted: 27 Mar 2020 05:21 PM PDT

    First, I know this is a tiny worry in the grand scheme of all the pain out there today. It just happens to be my little bit of it, and the part that I might be able to do something about…

    My dad runs a greenhouse business that's been in the family for 100 years. He primarily grows flowers, but herb and vegetable plants, and perennials also. It's been a steady livelihood for years. He works hard, employs a couple people full-time and several seasonally, and always made enough to get by and raise my siblings and I, but definitely never got rich.

    Every year, in February through April, he spends $200-300k on seeds, seedlings, pots, tray, soil, heating greenhouses, fertilizer, etc. That money is pretty much sunk by this point in the year. Then May comes, and in about 6 weeks he makes probably 75% of his income for the year, selling plants retail direct to customers, and wholesale to various little garden centers in ~100 mile radius.

    As we're in central New York, we're not in the center of the NYC Covid explosion, but we've got >100 cases in the county currently and everyone's locked down. I really fear that people won't be able to get out this year to buy and plant in May and June. Without that big annual cash infusion, I'm afraid he won't be able to pay for all this spring's materials, keep himself afloat a year, and do it again next year.

    I know it can't be a normal year, but I'm trying to think of ways to help make it survivable. It's too busy a time to deliver a few plants here or there and make enough to have it work out, there'd have to be something like uber drivers doing deliver. I've been looking for something like a" grubhub for anything that goes in a pickup". I found postmates, but they aren't active in this area. I'm trying to figure out how I could quickly get him some sort of a web based system where people could at least order to pick up their plants easily without getting out of their cars, or pay independent 3rd parties to deliver.

    I'm technical, but not a web developer by any stretch. I haven't built a website in years, since it was html in notepad, pretty much, so I'm betting there could be some easier ways to build these kinds of things, or people for whom it'd be pretty quick. Just looking for recommendations on where to go from here. I can work some nights and weekends on the project, but have a full time job and kid of my own, so it's limited.

    Thanks for reading Again, I know a lot of folks are going through similar or worse… I appreciate any suggestions.

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

    PHP Mailer Server Error

    Posted: 27 Mar 2020 01:23 PM PDT

    i get this error occasionally randomly when using phpmailer

    End of script output before headers: controllertest.php, referer: http://webhosthaldgifax.2dgd12.ca/emailInstallerJobs/index.php

    heres my code

     $final_html = "<html><body style=' color:black;'><p>sdfsdfdsfsdf></p></body></html>"; $imapU = 'sajealerts@212.ca'; $imapP = 'GR@44yp@!'; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 0; $mail->Debugoutput = 'html'; $mail->Host = 'smtp.gmail.com'; $mail->Port = 465; $mail->SMTPSecure = 'ssl'; $mail->SMTPAuth = true; $mail->Username = $imapU; $mail->Password = $imapP; $mail->setFrom($imapU, 'Sender'); $mail->addReplyTo($imapU, 'Sender'); $mail->addAddress("aaguzzdfsdfdso777@gmail.com", "Recepient Name"); $mail->msgHTML($final_html); //Send HTML or Plain Text email $mail->isHTML(true); $mail->Subject = "Installer Work Order"; //$mail->AltBody = "<p>This is the plain text version of the email content<p>"; $mail->msgHTML($final_html); if(!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent successfully"; //print_r($decodeEquipmentArray); } 

    does anyone know why?

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

    Where do I attribute authors icon's from FlatIcon for Mobile apps?

    Posted: 27 Mar 2020 04:02 PM PDT

    I have a few questions on something I'm confused about for attributing an Author's icon I used in my app.

    1. Where do I put the attribution? On their website it says "Place the attribution on the credits/description page of the application. " Does that mean just at the bottom of my description in the google play store?
    2. If I edited the icon in any way, do I still attribute the author?
    3. I used a few icons from the website (https://www.flaticon.com/home) to combine them/edit them to make it my launcher icon, is that okay to do? Or am I just allowed to use them inside my app as images.

    Thanks!

    submitted by /u/Leading-Coffee
    [link] [comments]

    Seeking Guidance on Personal Project to Convert Text Input into MySQL Query and Display Query Results.

    Posted: 27 Mar 2020 03:59 PM PDT

    I collect and play many different card games (CCGs), and I have created a few MySQL databases for my collections. I've always wanted to have a script, or something, that would take a text input, be it copy/paste or a saved text file, and output data from my databases. An example of this would be:

    Input:
    2x <card\_1>
    3x <card\_2>
    1x <card\_3>
    etc...

    Output:
    2x <card\_1>, <field\_1>, <field\_2>, <field\_3>
    3x <card\_2>, <field\_1>, <field\_2>, <field\_3>
    1x <card\_3>, <field\_1>, <field\_2>, <field\_3>
    etc...

    I remember there was a site for one of the CCGs I used to play that had this, but I forget the site. I'm new to programming and have only done really basic things with C and Python. I'd like to be able to use either of those for this project, but I'm open to something else if it's a better fit. I also don't know what to Google to get started with something like this, so I'm asking here. Thank you in advance for your assistance.

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

    How do you outline a web application design?

    Posted: 27 Mar 2020 12:11 PM PDT

    How do you begin the process of laying out a web application? An analogy would be the story board for a movie. What do you do to outline your application and how do you break it down into individual chunks?

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

    What is going on here

    Posted: 27 Mar 2020 03:40 PM PDT

    A friend sent me this picture of a weird error he had today in Visual Studio while compiling. At first glance it seems like a simple error - there must be a curly bracket missing somewhere. But when checking the code all the brackets seem to match. What's even weirder is that he sent me the code and I compiled it with both gcc and g++ without a problem. What could be happening here?

    https://www.dropbox.com/s/m8dfrr7xg1i0cjk/what_even.png?raw=1

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

    Why doesn't it print the value for n it should?

    Posted: 27 Mar 2020 02:02 PM PDT

    So i have the following code:

    def sum_mobius(n): if n==1: return mobius(1) else: return mobius(n)+sum_mobius(n-1) for n in range(1,10000): if(sum_mobius(n))==(-37): print(n) print(n**1/3) else: print("No values found") break 

    But the problem is it won't print me out the value for n even though It can be seen here that there exist a value for n such that the sum is equal to -37... What can I do to fix the problem? (see title)

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

    Is it possible to change the emoji font on a Java project

    Posted: 27 Mar 2020 08:05 AM PDT

    I am working on a Java Maven project using Netbeans and JDK11 on Ubuntu that imitiates a chatting service, thus I need to use Emojis on the project. I think the project currently uses the default Ubuntu emoji font as the emojis look really ugly and they are using one color only. Is it possible to change the emoji font or is there any other way to make the emojis look like the ones in Whatsapp etc?

    I have tried many things by using CSS file to change the font for JavaFX but I seem to not get it right.

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

    Advice for developing front end Web Application

    Posted: 27 Mar 2020 07:38 AM PDT

    I have experience in mobile applications and have created multiple apps using a Ionic/Angular solution. I'm looking at creating a few webforms that need to be quick and responsive while handling large amounts of data (Roughly 5000+ SQL Rows) efficiently on screen. This data will be passed via REST APIs. Would an Angular webform make sense here or are there much better solutions such as VUE, React, etc? Maybe there are some entirely different solutions that are better? I can do the comparison research myself but wanted to get some opinions from people who have had real experience with these technologies.

    Project Structure is SQL backend, REST APIs, Windows PC Front end.

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

    What are the benefits of installing ubuntu or linux on your computer, and will one lose every data in it’s computer?

    Posted: 27 Mar 2020 10:54 AM PDT

    Numbers in parentheses in error messages?

    Posted: 27 Mar 2020 10:36 AM PDT

    Hi, I'm very much a beginner to programming. I'm currently working with C#, and was curious about what the numbers italicized below would mean:

    program.cs(6,40) : error CS 1022

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

    Are you having any (professional) "I told you so" moments, as a result of this crisis?

    Posted: 27 Mar 2020 10:16 AM PDT

    It could be positive ("I'm so glad I convinced Management to let us set up for working remotely" or "I'm so happy we tested for a ridiculous setting on scalability testing") or negative ("If you had let me set up the server to [whatever] we would not be in this pickle").

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

    Creating a Programming

    Posted: 27 Mar 2020 09:19 AM PDT

    I have an idea for a revolutionary program, where would I go in order to get help writing it, I have no clue what I'm doing when it comes to coding at all, and I highkey just wanna create a meme where would I go to colab?

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

    No comments:

    Post a Comment