• Breaking News

    Monday, January 7, 2019

    [Algorithms] Am I supposed to run it for 1 hour? Ask Programming

    [Algorithms] Am I supposed to run it for 1 hour? Ask Programming


    [Algorithms] Am I supposed to run it for 1 hour?

    Posted: 07 Jan 2019 05:01 PM PST

    I'm reading the very first section (Basic Programming Model) of Algorithms (4th Edition) by Sedgewick. Exercise 1.1.19 asks to run the following program (original one is in Java):

    #!/usr/bin/env perl6 sub F( Int $N --> UInt ) { return 0 if $N == 0; return 1 if $N == 1; return F($N-1) + F($N-2); } sub MAIN() { for 0..^100 -> $N { say $N, " ", F($N); } } 

    and gives a response to the question: What is the largest value of N for which this program takes less 1 hour to compute the value of F(N)?

    Up to this point there hasn't been any discussion about analysis of algorithms and their time efficiency in the book so my question is: Am I supposed to let the program run for 1 hour and check which value of N answers the question?

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

    Creating website for Fathers small Construction Company

    Posted: 07 Jan 2019 03:08 PM PST

    I have never made a website before and wanted to do this as a small project over winter break now that I am out of classes but I am unsure what technologies I would need to use to get this done. I would want the website to be able to have reviews, examples of projects my father has done, an option to send him emails directly from the website, and possibly a way to pay him directly from the website but if thats too complicated I may not add that in. I am a 3rd year junior majoring in Computer Science and think I have enough experience to do this I just never have used JavaScript before but I feel like I can figure it out. I have experience in Java and C. What technologies should I use? I have heard of React, React-Native and others but I don't really know where to start because I don't know what I'll need. Also if you have any other ideas for the website that would be helpful as well. Thanks!

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

    Suggestions for Javascript project?

    Posted: 07 Jan 2019 07:46 PM PST

    I recently uploaded a simulation "life of a cube" feel free to download and give feedback

    https://github.com/tannman726/Life-of-a-Cube

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

    Problems loading things with pygame

    Posted: 07 Jan 2019 01:00 PM PST

    So, I'm using pygame, but I don't think this is really a programming problem but an IDE problem.

    So I've got this line: font = pygame.font.Font('font.ttf', 36)

    I am using the Atom IDE, and it runs perfectly fine on my windows 10 computer.

    Now I switch over to mac, and I get this error using Atom:

    OSError: unable to read font file '28DaysLater.ttf'

    So my first thought is mac is stupid, but then I open the exact same thing in IDLE, and it once again runs perfectly fine. So I'm thinking there is a problem with the path in atom somehow, but I don't know what it would be. Is there a way to maybe specify the path of the py file that is running (the font is in the same folder as the file by the way)?

    Using atom-python-run package in atom.

    Edit: Figured it out. Had to specify the path for some reason which is a bit annoying but I guess would be fine in the end.

    Added:

    path = os.path.abspath(file)

    path = path[0:-10]

    The =10 simply cuts off the name of the file like 'name.py' so rather than folder/program.py it gives me folder/

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

    Accountant - need to data scrape for work

    Posted: 07 Jan 2019 12:57 PM PST

    Hello r/AskProgramming

    I've been posed with a challenge at work - my team spends hundreds of hours annually pulling Excel files from my company's Oracle tool: Agile Produce Lifecycle Management

    My manager has asked me to automate this process. Our technical teams at my company are unable to get these files for us directly.

    I got a minor in computer science but I haven't programmed anything in a few years.

    I have been googling this, and I have made a simple scraper in Python using BeautifulSoup4 that can download files, but it relies on the fact that the URLs of the pages I'm pulling from are predictable.

    The pages I'm using are interactive. They all end in '.aspx' and they have URL parameters (I think that's the right word) that tells the web app where to go. These parameters seem to be generated as I move around the site; I think the URL I see when I'm on a particular project page changes whenever I start a new session with the site.

    I'm certainly not asking anyone to do my job for me, but I would sincerely appreciate some leads.

    1. Is this possible?
    2. What tools or programming language should I learn to accomplish this?
    3. Where can I go to learn how to do this?
    submitted by /u/20190107-Program
    [link] [comments]

    Learning Git

    Posted: 07 Jan 2019 06:26 PM PST

    Ok, folks be gentle...

    I've been coding for decades but never worked in a Git shop. I need/want to learn how to use it. Any good Git 101 resources?

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

    Is there a way for me to open a image file with a keypress in html

    Posted: 07 Jan 2019 01:57 PM PST

    [PowerShell] Export Event Logs Error

    Posted: 07 Jan 2019 11:37 AM PST

    Ok, so I know next to nothing about powershell scripting, but I'm trying to figure it out.

    I'm trying to run this:

    $App = get-wmiobject win32_nteventlogfile -filter "logfilename = 'Application'" $App.BackupEventlog("c:\LogBackUp\Application.evtx") $Sec = get-wmiobject win32_nteventlogfile -filter "logfilename = 'Security'" $Sec.BackupEventlog("c:\LogBackUp\Security.evtx") $Sec = get-wmiobject win32_nteventlogfile -filter "logfilename = 'Setup'" $Sec.BackupEventlog("c:\LogBackUp\Setup.evtx") $Syst = get-wmiobject win32_nteventlogfile -filter "logfilename = 'System'" $Syst.BackupEventlog("c:\LogBackUp\System.evtx") pause 

    and I get:

    __GENUS : 2 __CLASS : __PARAMETERS __SUPERCLASS : __DYNASTY : __PARAMETERS __RELPATH : __PROPERTY_COUNT : 1 __DERIVATION : {} __SERVER : __NAMESPACE : __PATH : ReturnValue : 0 PSComputerName : You cannot call a method on a null-valued expression. At C:\Users\j\Desktop\test.ps1:4 char:1 + $Test.BackupEventlog("c:\LogBackUp\Security.evtx") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Users\j\Desktop\test.ps1:6 char:1 + $Test2.BackupEventlog("c:\LogBackUp\Setup.evtx") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull __GENUS : 2 __CLASS : __PARAMETERS __SUPERCLASS : __DYNASTY : __PARAMETERS __RELPATH : __PROPERTY_COUNT : 1 __DERIVATION : {} __SERVER : __NAMESPACE : __PATH : ReturnValue : 0 PSComputerName : Press Enter to continue...: 

    So, what simple mistake am I making?

    Edit: The Application and System logs are working correctly, but Security and Setup are not.

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

    Calculus: Early Transcendental Functions 7th Edition

    Posted: 07 Jan 2019 05:28 PM PST

    who can hook me up with a pdf of this book

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

    How would you teach a junior to perform high quality code reviews?

    Posted: 07 Jan 2019 10:10 AM PST

    I currently work on a team with 1 senior dev and 6 junior devs. The junior devs come from bootcamps and this is their first job in the industry. I am trying to come up with a way to systematically help the juniors learn how to perform effective code reviews and receive feedback on the reviews they perform.

    Are there resources out there to help a team like this develop a process to learn how to perform code reviews?

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

    Still in old version of PHP 5, never kept learning the updates and new versions, should i invest my time in learn PHP 7 or should i keep what i know from PHP and learn NodeJS ?

    Posted: 07 Jan 2019 01:57 AM PST

    This happened because in last 2 years i've been doing more front end (mostly javascript) in just worked sometimes on PHP. Now that my best language is JS i feel like its more efficient o learn from the bottom NodeJS and keep the basics that i know of PHP. Suggestions?

    submitted by /u/Don-g9
    [link] [comments]

    A java programmer for 13 years, what should I try?

    Posted: 07 Jan 2019 09:48 AM PST

    Hi. I 've been programming in java for 13 years already, also doing front end stuff for web apps, lately doing some ansible, bash script. Would it be better to apply for some job that uses another programming language (scala, go) or continue doing java stuff?

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

    How to company company data duplication from in system database when you cannot control user input?

    Posted: 07 Jan 2019 10:55 AM PST

    I have an enterprise system with multiple applications connected to one database that supports desktop software sales (online store, single sign-on, CRM, ERP system, user portal, and employee support portal).

    A user client (not staff) needs to create an account via web form to get a demo or purchase a product on an e-commerce website. Those are done in 2 separate websites.

     

    When the client user (not staff) creates an account via web form we ask for personal fields such as name, address. Currently, the email address is being used as the unique primary key to identify an account via SSO. Accounts can have others account linked to (a team account with multiple people under one admin).

    Example from the store:

      https://i.stack.imgur.com/dE3yT.png  

    Question: how to minimize company field duplication in my database when client user is submitting company information via web form? As an example, the user can type: Wald Disney, Wald Disney Company, Wald Disney Company Inc, Walddi Disney, Disney Company when purchasing the product. That will result in multiple company entries that are in fact the same company.

     

    These are the current methods being tried:

     

    1-Same email address cannot be used in multiple accts. We use an SSO with email sign as a primary key to manage identity in multiple platforms. Restrict company owner as one per company.

     

    2-I currently ask for Company Name, but this is not enough and we already have duplication. Another option is to provide a drop-down list with search, so all existing records of companies that exist in the database are displayed as drop-down which forces the user to see the existing options before submitting new records. Like in this form: https://www.contentful.com/contact/sales/

     

    Note: the user can still ignore the dropdown and make a new entry.

    https://i.stack.imgur.com/If2QX.png

    3-Ask for company website address. So I can identify company by using part of the string as unique identifier for company.

     

    note: a lot of clients do not have their own company website but do have social media. Most companies are group of freelancers. It's unlikely that they will provide social media. I'm not sure if this will be redundant with the company website link.

     

    4-My erp admin will have to accept new company entries manually on the admin portal as a task.  

    Are there any other methods to prevent this type of duplication?

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

    How can I make each circle colorful?

    Posted: 07 Jan 2019 07:42 AM PST

    strokeWeight(2.5);

    noFill();

    for (var i=0; i<20; i++) {

    // fill(random(0.255), random(0,255), random(0,255));

    ellipse(200, 200, i*20, i*20);

    }

    translate(200,0);

    rotate(45);

    rect(0,0,280,280);

    I was thinking of doing something to fill(); but I'm not sure since it is already random. What should I search for on the net to learn more myself?

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

    Open Mist VoD Stream Server; stream not having video

    Posted: 07 Jan 2019 01:18 AM PST

    Hi, I'm trying tu set up a VoD stream server using the Open Mist software package. I've set up everything so far, and the video works, except I have no image. Sound is being played, but no images. It seems like, to hav it work properly, the video track has to be encoded using H264, while still using .flv format for the source.

    I cannot find anything to use a .flv file to be encoded with h264, most of the software I've found makes h264 files, but in mp4. The Open mist server only supports mp4 as the paid pro version, is there any workaround?

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

    Buying programming books for the team

    Posted: 07 Jan 2019 04:46 AM PST

    I'm wondering about the legal implications of buying books to share with the whole team. I'm mostly thinking of the digital versions. Often there's a DRM-protected version 1:1 of the book and you need eg. a personal Adobe-account to get the book onto your reader of choice. In that case I think it's very clear that the use case of creating a "corporate" adobe-account and sharing the book for a complete team is breaking the ToS. But I just bought the physical copy of the new edition of Fowler's Refactoring and a big part of that is that the "web edition" is the canonical version. But there's the same wording in the ToS for getting access to the Web version "personal" and "non-commercial". Is the idea that you should buy a personal copy for each developer and then throw the book out (figuratively) when the developer quits?

    I don't know maybe buying physical copies in the first place and letting interested developer take them home if they are interested in reading them is equally problematic in legal terms?

    How do you do this at your workplaces?

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

    Anyone happen to know how many mAh are used by a phone camera after 2015? Even just ballpark guess?

    Posted: 06 Jan 2019 09:53 PM PST

    I just need to do a power comparison for a hardware module vs built in phone camera for work. Doesn't have to be exact, just a ballpark. I can't find any sources online

    mAh by the hardware and the rendering on screen

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

    What are your thoughts on the idea that if someone goes to Stack Overflow or similar sites for help with their code, it's because they just don't understand the programming language their using well enough and can't figure out problems on their own?

    Posted: 07 Jan 2019 05:04 AM PST

    No comments:

    Post a Comment