• Breaking News

    Thursday, November 21, 2019

    I think my ISP is fucking me over lol, I wanta write a little program to intermittently test my internet speed for a couple weeks to back this up. Any good ideas on how to do this beyond just making a web scraper that hits speakeasy or something? Because i feel like there has to be Ask Programming

    I think my ISP is fucking me over lol, I wanta write a little program to intermittently test my internet speed for a couple weeks to back this up. Any good ideas on how to do this beyond just making a web scraper that hits speakeasy or something? Because i feel like there has to be Ask Programming


    I think my ISP is fucking me over lol, I wanta write a little program to intermittently test my internet speed for a couple weeks to back this up. Any good ideas on how to do this beyond just making a web scraper that hits speakeasy or something? Because i feel like there has to be

    Posted: 21 Nov 2019 03:15 PM PST

    I'd love to hit this every like half hour or so, i want really good data.

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

    Should I put my code onto GitHub?

    Posted: 21 Nov 2019 12:20 PM PST

    I have decided to start a career in computer programming. I have no serious professional experience I can point to, nor a degree in programming. I've been programming since I was 10 though, and I love math. (I've been using python to do amateur number theory research)

    I have a program I am currently writing to solve an issue I have for my current project. Its a multiple non-linear regression solver using least-squares for polynomials of large size (9 independent variables, quadratic (or perhaps cubic) so thousands of terms) that can use multiple cores of a PC, instead of the single core that numpy's curve_fit only uses. (I've been trying to get NISTfit installed, but the dependencies have gone awry and I can't get it working.)

    If I were to be able to contain all of this code into a single python script, WITH GOOD DOCUMENTATION that even beginners could understand (something I wish existed for me 2 weeks ago), will that help my beginning career/resume? Or is something like that VERY valuable and I shouldn't opensource it to the internet?

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

    When starting at a new company, what are some red flags to watch out for?

    Posted: 21 Nov 2019 04:23 AM PST

    Which c style guide should I use?

    Posted: 21 Nov 2019 05:38 PM PST

    I mostly work with python, which has an official website with an official style guide, that's clearly marked as such. So I was slightly horrified when, upon googling c style guide, I found not one, but 20. How does anyone write standardized code in this language?? Should I just pick one and go with it? Which one is the most common? Are they even different?

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

    Are there any APIs that...

    Posted: 21 Nov 2019 09:01 PM PST

    Allow you to receive individual payments from a group of users, then create a sort of communal bucket for later redistribution to that group?

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

    I have an array of 100 images used in my android app? Whats the best practice or way to externalize them?

    Posted: 21 Nov 2019 07:36 PM PST

    I externalized an array of strings to XML, but not sure how I could do this to access the images. Right now it's in my main activity java file. Any suggestions?

    //array of images final int[] images = {R.drawable.f005, R.drawable.f001, R.drawable.f002,R.drawable.f003, R.drawable.f004, R.drawable.rushingcity, R.drawable.mistyforest, R.drawable.purplesky, R.drawable.galaxysky, R.drawable.mountainrange, R.drawable.tableflower,R.drawable.resizedstarry, R.drawable.img0, R.drawable.img1, R.drawable.img2, R.drawable.img3, R.drawable.img4, R.drawable.img5, R.drawable.img6, R.drawable.img7, R.drawable.img8, R.drawable.img9, R.drawable.img10, R.drawable.img11, R.drawable.img12, R.drawable.img13, R.drawable.img14, R.drawable.img15, R.drawable.img16, R.drawable.img17, R.drawable.img18, R.drawable.img19, R.drawable.img20, R.drawable.img21, R.drawable.img22, R.drawable.img23, R.drawable.img24,R.drawable.img25, R.drawable.img26, R.drawable.img27, R.drawable.img28, R.drawable.img29, R.drawable.img30, R.drawable.img31, R.drawable.img32, R.drawable.img33, R.drawable.img34, R.drawable.img35, R.drawable.img36, R.drawable.img37, R.drawable.img38, R.drawable.img39, R.drawable.img40, R.drawable.img41, R.drawable.img42, R.drawable.img43, R.drawable.img44, R.drawable.img45, R.drawable.img46, R.drawable.img47, R.drawable.img48, R.drawable.img49, R.drawable.img50, R.drawable.img51, R.drawable.img52, R.drawable.img53, R.drawable.img54, R.drawable.img55, R.drawable.img56, R.drawable.img57, R.drawable.img58, R.drawable.img59, R.drawable.img60, R.drawable.img61, R.drawable.img62, R.drawable.img63, R.drawable.img64, R.drawable.img65, R.drawable.img66, R.drawable.img67, R.drawable.img68, R.drawable.img69, R.drawable.img70, R.drawable.img71, R.drawable.img72, R.drawable.img73, R.drawable.img74, R.drawable.img75, R.drawable.img76, R.drawable.img77, R.drawable.img78, R.drawable.img79, R.drawable.img80, R.drawable.img81, R.drawable.img82, R.drawable.img83, R.drawable.img84, R.drawable.img85, R.drawable.img86, R.drawable.img87, R.drawable.img88, R.drawable.img89, R.drawable.img90, R.drawable.img91, R.drawable.img92, R.drawable.img93, R.drawable.img94, R.drawable.img95, R.drawable.img96, R.drawable.img97}; 
    submitted by /u/ThisSoFrustrating
    [link] [comments]

    How to extract advanced search result pages from multiple pdf file to one new pdf file

    Posted: 21 Nov 2019 04:08 AM PST

    Hello, I work with 2000 pages or more per day. This task is very time consuming where i have to search for an ID of a client and print the page each at a time, and repeat for over than 300 pages. I tried to make an advanced search for all the IDs that need to be printed and print them, but i cant. I'm not very good with pdf so maybe i missed something you guys are familiar with. I tried to extract the search result but i cannot do anything to it, all i can do is view them so it doesnt help much. What i wish for is the ability to print the advanced search result or extract it to another pdf file so i can print it all with 1 click. If there is anything that can help, please tell me. Thank you

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

    For developing an app, is it easier to natively program for ios and android, or to use something like xamarin?

    Posted: 21 Nov 2019 06:36 PM PST

    Basically the question. I plan on making a larger scale (ideally) location-based app. I feel like with adequate design it wouldn't be too tough to do both, and if it ever took off I could hire separate developers for each platform, and it may be easier to find those people than to find xamarin (or other?) in the long term. Is this a valid concern? Is it easier to start with one platform?

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

    Trying to create a data.table in R, but autograder says "." is not recognized. What am I doing wrong here?

    Posted: 21 Nov 2019 06:22 PM PST

    The question asks to write a function called gradSummary() that takes in a data.table object called grads. The function should first replace any NA values in the Total column with zeros. Then, record the total number of college graduate in the data set (compute the sum of Total). Finally, using data.table, produce a table containing

    - grouped by Major_category,

    - the percentage of graduates represented (using the total you computed earlier) rounded to two digits,

    - the average Rank of the median starting salary (using the existing column Rank) rounded to a "whole" number, (i.e. to zero digits), and the average Median starting salary rounded to two digits.

    - sorted by the average rank in ascending order.

    My code is as follows:

    ```gradSummary <- function(grads) {

    grads$Total[is.na(grads$Total)] <- 0

    total.grads <- sum(grads$Total)

    data.table[, .(SchoolPerc = round(100*sum(grads$Total)/total.grads, 2), avgRank = round(mean(grads$Rank), 0), avgSalary = round(mean(grads$Median), 2)), by = grads$Major_category][order(grads$avgRank)]

    }

    ```

    Am I formatting the data table wrong (last line of code, it says "."(SchoolPerc...) isn't recognized? Don't hesitate to call out any mistakes as I'm still new to R.

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

    Storing anonymous records in a DB but having some link to the user?

    Posted: 21 Nov 2019 04:23 PM PST

    I'm working on a school project and I need to store anonymous records in a database but I also need to be able to serve up the record back to the user. I looked at hashing but I'm not sure if it is the best option. Does anyone know a good option for this?

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

    Is there anyone here who would be able to help me with this x86 function?

    Posted: 21 Nov 2019 04:16 PM PST

    I'm currently doing my Binary Bomb project in school, if you know what that is, and I am having trouble deciphering what is happening in this function. I can tell that it is a recursive function, but I cannot tell what it is specifically adding and outputting at the end. The initial inputs will be %edi = 8 and %esi = user input between 2 and 4. Any help would be appreciated!

    0000000000400fde <func4>:

    400fde: push %r12

    400fe0: push %rbp

    400fe1: push %rbx

    400fe2: %edi,%ebx

    400fe4: test %edi,%edi

    400fe6: jle 40100c <func4+0x2e>

    400fe8: mov %esi,%ebp

    400fea: mov %esi,%eax

    400fec: cmp $0x1,%edi

    400fef: je 401011 <func4+0x33>

    400ff1: lea -0x1(%rdi),%edi

    400ff4: callq 400fde <func4>

    400ff9: lea (%rax,%rbp,1),%r12d

    400ffd: lea -0x2(%rbx),%edi

    401000: mov %ebp,%esi

    401002: callq 400fde <func4>

    401007: add %r12d,%eax

    40100a: jmp 401011 <func4+0x33>

    40100c: mov $0x0,%eax

    401011: pop %rbx

    401012: 5d pop %rbp

    401013: 41 5c pop %r12

    401015: c3 retq

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

    I need your opinion about building a smart (ro)bot

    Posted: 21 Nov 2019 12:15 PM PST

    So my professional experience is 80% on Ruby, some JS (node, react) and some python.

    My goal is to build a system from the ground up, that will evolve and self-upgrade.

    First milestone is to setup an I/O interface tha will accept keyboard input and reply back like a chatbot.

    Second milestone to get smarter, i.e. be able to learn, predict and reply more humanish back.

    Third milestone will be to feed it with APIs and db's: wikipedia, wolphram alpha, imdb, weather, news, everything.

    Fourth to be able to scan, retrieve and connect information.

    ......

    Last milestone will be to create an autonomous assistant like JARVIS. I am aware of similar projects especially the failed ones, but I want to build this as a FUN project.

    I am researching If it's smart to use chatbots like lita or hubot to start building the system. What do you think? Please do not judge, this is fun and daydreaming..

    Thanks!

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

    Is there anywhere I can show my project's source code and get feedback from more experienced programmers?

    Posted: 21 Nov 2019 03:56 PM PST

    I'm a beginner programmer learning Java. I've been learning Java for around 3 months now and I'm starting to get a lot better. When I first started learning even just seeing "public static void main(String[] args)" overwhelmed me. It was completely foreign to me. Right now though I'm just getting to the point where Java and OOP concepts are starting to click in my head. I'm starting to move past easier beginner projects like roman numeral calculators and fake ATMs and onto creating programs that are harder to wrap my head. I'm guaranteed to write spaghetti code if I'm not careful.

    I've started my first "big" project. I'm creating a webpage image scraper using JSoup and JavaFX. It's my first time creating a GUI program and using a library (JSoup) that isn't standard. It's been pretty challenging, but I'm making progress and I've been trying my best to fix bugs that come up. Right now my program has a basic GUI and detects all the images on a webpage. Next I'm going to implement the actual image downloading part.

    Is there anywhere I could post my source code and have a more experienced programmer give me advice? Like bad habits that are noticed or how to improve the project in general? I'm a little worried about someone reading my code since it isn't well written, but as a beginner it'll help me get better.

    I know there's Github which I've already uploaded to, but it's no guarantee someone will see your code. Is there a subreddit or website dedicated to having someone more experienced review a beginner's code? /r/learnprogramming and StackOverflow seem like they're geared towards solving specific bugs or questions.

    Thanks in advance for the help!

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

    If you were offered a job at 100k a year, would you drop out of school?

    Posted: 21 Nov 2019 09:55 AM PST

    If today you were offered a jr role at 100k a year for a web dev, would you drop out of uni?

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

    When capitalizing i it gives an İ instead of an I

    Posted: 21 Nov 2019 09:20 AM PST

    I am using Java and when I capitalize something with the letter i using toUpperCase() method it makes it "İ". How can I make it give "I"?

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

    Help pls

    Posted: 21 Nov 2019 11:15 AM PST

    How do you check the type of input in python?? For example, If the input is a number, I want the code to do something. Else, I want it do do something else. I looked it up and everything said just use type, but idk how to. Can I just do: if type(input)==int : print("something")

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

    Why can't I just make my own passwordless login with sms from twilio.

    Posted: 21 Nov 2019 03:00 PM PST

    I'm aware that auth0, twilio and many others offer a full passwordless login setup but is the solution so complex that I cant simply implement it myself? What am I naively not seeing?

    1. generate random code
    2. store it in db with the user whos phone number was entered
    3. send the code via sms to the phone number
    4. when they enter the code on front end if it matches the one we sent to the phone number log them in
    submitted by /u/SumAlias
    [link] [comments]

    Just got out of high school and just started college, what's next?

    Posted: 21 Nov 2019 02:28 PM PST

    so I've graduated high school and right now I'm in community college getting my basics out of the way. I took comp sci classes all throughout high school and I know the basics of python, JavaScript, and HTML and CSS. this mostly what I learned in high school. however I want to learn more and gain some experience for myself so I can start out with a decent job later down the road. my high school comp sci teacher said I could start an online portfolio but he didn't exactly expand on it, so I am not entirely sure what that is or what it entails. I haven't gotten accepted into any internships. and I'd just like to know what all I can do to learn more. and what online resources would be helpful for me.

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

    parsing strings

    Posted: 21 Nov 2019 12:54 PM PST

    Hello, i have a relatively simple java question. I have a string that looks like this: "Anderson,T",CWS,SS

    I need to parse it in a way that i have

    Anderson,T

    CWS

    SS

    all as separate strings.

    Thanks!

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

    Library for ignoring files+folders like .gitignore? (C# .NET Core)

    Posted: 21 Nov 2019 06:49 AM PST

    Hello there,

    I'm wondering if there is such a library for valuating wildcards for files and folders (C# .NET Core)

    I want to print the contents of a directory recursively (which already works) but I also want to ignore some special folders or file by using a file similar to .gitignore. Sure, I could do this myself but why if there are people who worked meticulously on such algorithms.

    If something's out there what could help me, feel free to drop a comment.

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

    Should there be one model per controller, per business logic object, or per database table?

    Posted: 21 Nov 2019 05:12 AM PST

    I'm currently writing a small web api in golang. It has a controller layer, a service layer and a model layer. I was wondering how I should structure the model layer. I am using plain SQL and not an ORM, if it matters.


    Let's say we have a user table in our database with the following fields:

    • id int
    • username string
    • password string
    • created_at string

    Also we have endpoints for creating, reading and updating the user. The inputs and outputs of these endpoints will be models (they are also called DTOs in java afaik).

    Requirements:

    • When reading, the user should not see the password
    • when creating, the user cannot set the created_at and id fields
    • when updating, the user cannot set username, created_at and id fields.

    I have four options for making the model, all of which work. I want to know which of these is considered to be best practice.

    1) One model per database table

    There is one model User which contains all four fields of the database table. The user may supply the id field during an update request if he wants, but it will be ignored. When reading, all fields will be returned, but the password field will be empty, because it is ignored/not read from the database.

    This means more bandwidth is being consumed per request, since we're passing along useless data (namely the empty "password" field when reading). Also, it may be difficult when a controller needs data from two tables at once.

    2) One model per business logic object

    This is exactly like the previous one, except it solves the "fetching from multiple tables" problem.

    For example, if we have an additional endpoint for getting a detailed summary for an user (for example with metrics about how many comments he has made), then we can create an additional model - UserMetrics - which will additionally include fields about the user's metrics.

    We are still passing the empty "password" variable in the GET request for the user endpoint.

    There is no database table which corresponds to this, and it will be used by the user metrics endpoint

    3) Separate models for inbound and outbound requests

    It is just like the last one, except it separates inbound and outbound requests, and it leaves out data which is not needed.

    So in the user endpoint, in inbound requests it doesn't have the id and created_at fields, and in outbound requests it doesn't have the password field.

    4) Separate model for each endpoint

    Just like the last one, but in the model for the "update user" endpoint we leave out the username field, since it is not allowed to be modified.


    Which of these options is best? Or is there some other option which is better than all of these?

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

    My team and I will be taking over the development of an app (iOS and Android) that's currently under a very secretive company (I don't know much about how they build stuff). What should I expect and how should I prepare?

    Posted: 21 Nov 2019 04:59 AM PST

    Name of this data structure

    Posted: 21 Nov 2019 12:28 PM PST

    What's the name for a data structure that behaves as a set but doesn't allow items to be re-added?

    So if you add an element, then remove it, then try to add it again it won't be accepted.

    thanks

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

    plz help w/ discord.py bot (rewrite)

    Posted: 21 Nov 2019 12:24 PM PST

    @bot.command(pass_context=1)
    async def changecolor(ctx, NewColor, role):
    author = ctx.message.author
    #server = 647143387362885638
    dictOfColors = { '1' : discord.Color.default(),
    '2' : discord.Color.teal(),
    '3' : discord.Color.dark_teal(),
    '4' : discord.Color.green(),
    '5' : discord.Color.dark_green(),
    '6' : discord.Color.blue(),
    '7' : discord.Color.purple(),
    '8' : discord.Color.dark_purple(),
    '9' : discord.Color.magenta(),
    '10' : discord.Color.dark_magenta(),
    '11' : discord.Color.gold(),
    '12' : discord.Color.dark_gold(),
    '13' : discord.Color.orange(),
    '14' : discord.Color.dark_orange(),
    '15' : discord.Color.red(),
    '16' : discord.Color.dark_red() }
    #role = discord.utils.get(server.roles, name='New Member')
    #if NewColor in dictOfColors:
    await bot.edit_role(server, role, colour=dictOfColors[NewColor])

    ___________________________________________________________________

    console just returns discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'edit_role'

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

    Re-order html elements in multiple columns (From one column to another) using jquery or javascrip

    Posted: 20 Nov 2019 10:57 PM PST

    I have this html structure

     <div class="main"> <div class="column-1"> <div class="box" id="box-1"></div> <div class="box" id="box-2"></div> <div class="box" id="box-3"></div> </div> <div class="column-2"> <div class="box" id="box-4"></div> <div class="box" id="box-5"></div> <div class="box" id="box-6"></div> </div> </div> 

    And I have two arrays of numbers

    arr1 = [2, 4, 3] arr2 = [1, 5, 6] 

    I would like to re-position .box divs to given position.

    I found a way to sort, but that only works with single column

    var wrapper = jQuery('.column-1'), items = wrapper.children('.box'), arr = [2,1,0]; wrapper.append( jQuery.map(arr, function(v){ return items[v] }) ); 

    I can't figure out how to do this, with jquery or javascript!

    Expected output:

    <div class="main"> <div class="column-1"> <div class="box" id="box-2"></div> <div class="box" id="box-4"></div> <div class="box" id="box-3"></div> </div> <div class="column-2"> <div class="box" id="box-1"></div> <div class="box" id="box-5"></div> <div class="box" id="box-6"></div> </div> </div> 

    Thanks!

    EDIT:

    Got the solution for this on stack. You can check that here!

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

    No comments:

    Post a Comment