• Breaking News

    Monday, June 4, 2018

    Programmers of Reddit: with the recent acquisition of Github by Microsoft, how many of you are considering to leave the platform and why? Ask Programming

    Programmers of Reddit: with the recent acquisition of Github by Microsoft, how many of you are considering to leave the platform and why? Ask Programming


    Programmers of Reddit: with the recent acquisition of Github by Microsoft, how many of you are considering to leave the platform and why?

    Posted: 04 Jun 2018 08:53 AM PDT

    How would I write a program to scrape ID3 tags and sort according to ID3 info?

    Posted: 04 Jun 2018 07:35 PM PDT

    I have a unique situation.

    My brother, who is now blind and has very limited mobility, knocked over his HDD containing ALL his music. Approximately 1.5 TB's of music. The HDD died. We sent it off to a Data Recovery service and we were able to salvage 80-85% of the MP3 files.

    The problem we now have is that the data recovery company dumped all the mp3's into a SINGLE folder named, aptly, "mp3". The files are not labeled in the filename by Artist or Label. Simply the numbering scheme from the CD from which it was ripped and the title of the song, e.g. "01 - Night of Dalliance.mp3"

    EVERY mp3 is formatted like this. The only upside is that the ID3 tags are still intact.

    Is there anyway to write a program that would scrape the ID3 tags and then sort the mp3's into separate folders according to the album name ripped from the ID3 tag?

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

    Using tables in HTML, how can I have two columns side by side, but with rows of different sizes

    Posted: 04 Jun 2018 03:06 PM PDT

    For an example, the two cells on the left column will be taller than the two on the right side, and it's fine if the right two don't line up.

    But if I do it like

    Column 1 Cell 1 Stuff Column 2 cell 2
    Column 1 Cell 2 More stuff Column 2 cell 2

    The columns on the right are going to match the size of the ones on the right. I don't need them to, I just need them to be next to each other on the page at the top as if they are part of the same table, which ever ends first can just end, I don't need it to stretch out to keep matching the length of the one on the left

    I can't use CSS or div tags on this stupid software for work, so I have to do it all using freaking tables -_-

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

    Clarifying question: Is the benefit of open source code only that people are free to review it or is there a vetting process that all open source programs actually go through before being made available?

    Posted: 04 Jun 2018 06:17 PM PDT

    I understand the basics of open source vs commercial code. What I don't understand is the supply side of the equation where I (as a consumer) am supposed to magically assume that Joe Shmoe's open source code has AS many eyes on it as Linux. I, at a basic level, also understand the security tradeoffs of well-vetter open source code vs commercial alternatives that get the same job done, but Joe Shmoe is asking a lot of me to trust that something potentially malicious only has had the opportunity to be doublechecked. Is there a marketplace, best practices, or certificate that the industry uses to tell the world what all is up to snuff?

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

    How can I create an installer for an exe I created?

    Posted: 04 Jun 2018 09:54 AM PDT

    Not sure if this is the right place to ask but maybe someone will know. So I managed to create an executable game that works which includes various folders plus an exe, but just for fun I would like to create one of those 'fancy' installers as I call it, that you run the file, it downloads everything needed, and creates a shortcut on the desktop. How would I go about doing something like this?

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

    Show Reddit: Convert HTML to PDF documents in just a few lines of code. Easy peasy, lemon squeechy!

    Posted: 04 Jun 2018 07:38 AM PDT

    Hi everyone!

    When I create a payment system for one of my (too many) side projects, I end up having issues for generating a PDF invoice.

    There are a lot of possibilities out there - using a library in your preferred language, using an online API, etc - but none of the possibilities where great for me.

    I wanted something simple that could do the job in three lines of code.

    That's why I created PDFShift.io, an online API to convert HTML to PDF, focused FOR developers.

    I've also built packages for a few languages; Node, Python and PHP.

    I'd be curious to know what you think about it, and what can I do to make you to the switch :)

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

    Why GitLab over Bitbucket or self-hosted?

    Posted: 04 Jun 2018 04:38 AM PDT

    I tried to Google it, but Gitlab's tedious copy looks like it was created by a marketing department to impress other marketing departments, and no one else seems to have any relevant technical info. As far as I can tell Gitlab is self hosted but with corporate jargon tacked on.

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

    Looking for help looping through a list of data frames in R

    Posted: 04 Jun 2018 11:54 AM PDT

    I'll preface with the stackoverflow link: https://stackoverflow.com/questions/50686241/looping-through-a-list-of-data-frames-in-r?noredirect=1#comment88382498_50686241

    Hey all, I'm having trouble looping through a list of data frames. I'll attach my full code below with my file pathways redacted and then explain specifics.

    # load packages ---- xlib <- c("rnoaa","devtools","dplyr","plyr","hydroTSM","chron","gdata","date", "rowr") lapply(xlib, require, character.only = T) rm(xlib) # se token ---- # get this from NOAA site - https://www.ncdc.noaa.gov/cdo-web/token options(noaakey = "QlzFUrMWVrLFKkZijFohYRmbtVvEaqUB") # set working folder ---- setwd("filepathway") # read weather station information statns <- read.csv(file = "filepathway/weather_station_locations_v1.csv", header = T) # define dates ---- st.date <- as.Date("1950-01-01") end.date <- as.Date("2018-04-30") date1 <- data.frame(date = dip(st.date, end.date)) date1$year <- as.numeric(format(date1$date, "%Y")) date1$month <- as.numeric(format(date1$date, "%m")) date1$day <- as.numeric(format(date1$date, "%d")) date1$jday <- as.numeric(format(date1$date, "%j")) n1 <- 1 #n1 <- 100 for(id1 in (1:n1)) { # pull data from NOAA server ---- # 1. precip prcp.pull <- meteo_pull_monitors(monitors = statns$STATION[ id1 ], keep_flags = T, date_min = st.date, date_max = end.date, var = "PRCP") prcp.pull$prcp <- prcp.pull$prcp / 10 # convert to mm/day # 2. max. temperature tmax.pull <- meteo_pull_monitors(monitors = statns$STATION[ id1 ], keep_flags = T, date_min = st.date, date_max = end.date, var = "TMAX") tmax.pull$tmax <- tmax.pull$tmax / 10 # convert to dec. C #3. min. temperature tmin.pull <- meteo_pull_monitors(monitors = statns$STATION[ id1 ], keep_flags = T, date_min = st.date, date_max = end.date, var = "TMIN") tmin.pull$tmin <- tmin.pull$tmin / 10 # convert to dec. C statns2 <- split(statns, statns$"STATION") colnames(prcp.pull)[1] <- "STATION" colnames(tmin.pull)[1] <- "STATION" colnames(tmax.pull)[1] <- "STATION" prcpA <- rbind.fill(statns2, prcp.pull) tminA <- rbind.fill(statns2, tmin.pull) tmaxA <- rbind.fill(statns2, tmax.pull) prcpB <- cbind.fill(statns2, prcpA) tminB <- cbind.fill(statns2, tminA) tmaxB <- cbind.fill(statns2, tmaxA) tminC <- merge(tminB, statns2, by.x = 2, by.y = 2) tmaxC <- merge(tmaxB, statns2, by.x = 2, by.y = 2) prcpC <- merge(prcpB, statns2, by.x = 2, by.y = 2) colnames(tminC)[2] <- "A" colnames(tminC)[3] <- "B" colnames(tminC)[4] <- "C" colnames(tminC)[5] <- "D" colnames(tminC)[6] <- "E" colnames(tminC)[7] <- "G" tminD = subset(tminC, select = -c(A, B, C, D, E, G )) colnames(tmaxC)[2] <- "A" colnames(tmaxC)[3] <- "B" colnames(tmaxC)[4] <- "C" colnames(tmaxC)[5] <- "D" colnames(tmaxC)[6] <- "E" colnames(tmaxC)[7] <- "G" tmaxD = subset(tmaxC, select = -c(A, B, C, D, E, G )) colnames(prcpC)[2] <- "A" colnames(prcpC)[3] <- "B" colnames(prcpC)[4] <- "C" colnames(prcpC)[5] <- "D" colnames(prcpC)[6] <- "E" colnames(prcpC)[7] <- "G" prcpD = subset(prcpC, select = -c(A, B, C, D, E, G )) # save output as text file fout <- paste("filepathway", c("prcpD", "tmaxD", "tminD"), statns$STATION[ id1 ], ".csv", sep = "") # 1. precip if (nrow(prcpD) > 0) { write.table(file = fout[1], x = prcpD, col.names = T, row.names = T, append = F, sep = ",", quote = F) } # 2. tmax if (nrow(tmaxD) > 0) { write.table(file = fout[2], x = tmaxD, col.names = T, row.names = T, append = F, sep = ",", quote = F) } # 3. tmin if (nrow(tminD) > 0) { write.table(file = fout[3], x = tminD, col.names = T, row.names = T, append = F, sep = ",", quote = F) } } } 

    After this line:statns2 <- split(statns, statns$"STATION") I get a list of data frames and would like to run the loop through each of these individual data frames - as in, when id1 (a number from 1 to 13926) matches FID + 1 (FID starts at 0 and goes to the end of the list), such that the commants after the split are run through the list one at a time making sure to match the info between my precipitation, temperature data, and weather station

    Without the split into the list of data frames, it just gives each weather station one row of data whereas I'd like a row identifying the station then one for every date from start to end. Below is a small subset of the list of data frames I am trying to loop through.

    $`CA003030525` FID STATION LAT LON ELEV NAME CODE 1 0 CA003030525 49.8 -112.3 824 AB BARNWELL AGDM 71346 $CA003030720 FID STATION LAT LON ELEV NAME CODE 2 1 CA003030720 49.5667 -113.05 980 AB BLOOD TRIBE AGDM 71517 $CA003030768 FID STATION LAT LON ELEV NAME CODE 3 2 CA003030768 49.7333 -111.45 817 AB BOW ISLAND 71231 
    submitted by /u/illiter-it
    [link] [comments]

    How to choose a suitable database solution?

    Posted: 04 Jun 2018 01:38 AM PDT

    First I would like to describe my use case. I am working in IOT industry and my data are usually related to time and large volume. My back-end runs on a single server, no replicate or cluster.

    For example, there will be some devices which reports back to my back-end periodically or when event happens. if there is 5000+ devices and report every 5 minutes, there will be over 200,000,000 records needs to be store in less than a year.

    I have worked with MSSQL, MySQL, MongoDB and PostgreSQL. I don't fully understand all of them, also I am a back-end developer not a DBA. Here are some problems I've encounter over the course of development.

    MSSQL is not open source and is not free. It has some partitioning features which I did't do any benchmark. The overall performance is acceptable. But I have switch from .NET to Java platform. So I move on to MySQL and MongoDB.

    Back when I was testing MySQL, version 8 has not yet release. I mostly use default settings and MySQL defaults are terrible. MyISAM table lock is really unacceptable. Didn't waste more time to test InnoDB. MongoDB is great for JSON style data. But JPA does not have good support to change relational data back and forth to JSON. There is Mongoose ODM, but I am having a hard time adapting it. Didn't spend more time on MongoDB to test its performance. I move on to PostgreSQL.

    PostgreSQL (9.6) works great with Hibernate and have better performance than MyISAM right off the bat. I have over 900kk data in one table and it starts to have problem.

    The table has at least 1 insert every 60 ms. And the count() takes more than 60 seconds. I am using count() for pagination, Hibernate and JPA does the exact same. Right now I am using PostgreSQL 10.4+ timescaledb to tackle the problem.

    I want to run some benchmark to compare PostgreSQL 10 against MySQL/MariaDB, but PostgreSQL is executing its plan in a complicated way. If I run the same query twice, the second one will finish almost instantaneously. Maybe it has a query cache. Therefore I have to come up with a random query generation and a insert generator to simulate the production environment.

    Before I jump into that, I want to know what are potential candidates which could beat PostgreSQL under this use case. MySQL 8? MongoDB? Cassandra?

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

    How do i get the complete URL that arrive at my servlet?

    Posted: 04 Jun 2018 10:34 AM PDT

    I scour around for answers and in general the answer would be like this

    public static String getFullURL(HttpServletRequest request) { StringBuilder requestURL = new StringBuilder(request.getRequestURL().toString()); String queryString = request.getQueryString(); if (queryString == null) { return requestURL.toString(); } else { return requestURL.append('?').append(queryString).toString(); } 

    }

    My question is, how exactly do i call this method? Seeing how the method require HttpServletRequest to be passed on to it

    I tried the following :

    String fullurl = getFullUrl(request.getHeader()); HttpServletRequest request = new HttpServletRequest() {....}; 

    But it doesn't work

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

    Program which synchronizes date

    Posted: 04 Jun 2018 10:22 AM PDT

    I have got this annoying problem that the date is changing randomly to 1/2/ .. months in the future quite often, but not always, after standby mode. My BIOS date is right, but it seems to be changed all the time because of the problem. I have already replaced the CMOS battery. Here is the log. 1) Clicking standby. 2) "The active system time is 46252345 seconds." This seems to be the point where the time changes all the time while the PC is turning off. 3) Actual standby mode reached. 4) Turning PC on again. Time "officially" changed. "System time synchronized with the hardware clock." -> now it is synchronizing with the wrong date set before standby mode. Because I wasn't able to solve the problem for weeks now, does anyone know a program which checks the date after a restart and synchronizes it online rather than with the BIOS date? Turning "automatic time" on on Windows is not helping either.

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

    Amateur programmer here: Is there an easily referenced library of English words and/or English names?

    Posted: 04 Jun 2018 09:45 AM PDT

    Long story short: I want to brute force a cipher and while I have the necessary skills to write the actual code, I need to be able to check answers to see whether the are actual english words and/or english names, and I don't know where I would look to find something like that.

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

    Can anyone recommend me a good C++ book?

    Posted: 04 Jun 2018 03:20 AM PDT

    Hey it's been almost a year of C++ for me and sometimes I just don't seem to be able to keep up. I want to truly commit into learning and would appreciate it if anyone can recommend me a good programming book/ textbook, preferably a C++ book/ textbook since that's what I am learning right now.

    Is there any good tutorial video out there for C++ learning? Much appreciated and thanks in advance.

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

    OSX - Can I make a folder undeletable and readable at the same time?

    Posted: 04 Jun 2018 09:00 AM PDT

    I really need to fix in place a folder so even with admin password, I won't be able to delete. I'd greatly appreciate your help!

    Thanks.

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

    I need to write a script to remove unused imports in Python

    Posted: 04 Jun 2018 07:19 AM PDT

    any pointers on how I can do this?

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

    If xxx word appear on screen then program is playing alarm

    Posted: 04 Jun 2018 07:03 AM PDT

    Hi, I have 5 days to create program in visual studio(best writen in java)

    Program should work like this: If xxx word appear on screen then program is playing alarm

    I couldn't find any program like this, Does anyone have better searching skills and can find it?

    What steps should i make to achive goal in 5 days?

    I am begginer in programing.

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

    Pass ReactJS data to .net core controller

    Posted: 04 Jun 2018 06:46 AM PDT

    I have created an application with .netcore & reactjs where my team can select data from the database in a human readable way but more powerful than the tool we currently use (a lot of functionality is missing) however its at a stage now where we want to be able to specify the database rather than being forced to use which one I have put in the configuration file.

    My idea is two text boxes that will send the values to my connection string in the controller/DAL however I'm not sure how to send data to the controller from react, could you please give me some reference materials or an example I can go from?

    I don't require any validation.

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

    JobDesc of A Software Engineer in Test

    Posted: 04 Jun 2018 02:09 AM PDT

    I'm about to start an internship period as a Software Engineer in Test
    Wondering what kind of job this position will have ? is there any principal concept or basic knowledge that i should have?my experience in testing before is applying tdd for a medium-sized project (test cases and all of that)
    Any answer is appriciated.
    Thanks

    Note : I've been told that this is very similiar to QA but there are QA Engineer and SE In test in my team , so i guess there should be some difference.

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

    Can't Find a Data Visualization library.

    Posted: 03 Jun 2018 11:03 PM PDT

    Hi, some time in the past (within the past year) I stumbled across a website for a library/framework for creating amazing-looking charts and graphs. For the past 3-4 hours I've been trying to find this site again. I had assumed that it was called D3, but it isn't. D3's site hasn't changed in years and isn't on par with what I remember.

    I remember a site with a side-menu to the far left, in which you could click on the various type of charts and graphs and see an example. I remember that it had a reddish orange coloring. I think it was a JavaScript library, but I've been looking through so many JS libraries and I can't find it at all.

    It's bugging the hell out of me to not be able to find this site again. It's modern-looking, clean, and has the best looking charts/graphs For some reason, "D3" stuck with me - or maybe it was the "3". Maybe it was mentioned on the site, maybe it was part of the name - but from what I can remember the site had no landing page or need to signup/login. It was a as simple as click on the type of chart/graph that you wanted, see an example of it and how to implement it.

    If you know the website, please share.

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

    Is there an image library similar to Icon libraries?

    Posted: 03 Jun 2018 10:23 PM PDT

    I have spent the last 2 weeks or so googling and asking around..with nothing found.
    I'm looking for a referenceable image library, like an icon library. My thoughts are, if there are enough default images...it could be as useful and quick to implement images as it is to currently implement icons. For example, Google Material design icons are referenced like

     <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <i class="material-icons"> train </i> 

    or IonIcon:

     <link href="https://unpkg.com/ionicons@4.1.2/dist/css/ionicons.min.css" rel="stylesheet"> <i class="icon ion-md-heart"></i> 

    What I'm looking for is a image library like this. To allow for developers in my organization to link to default/stock images within their code with an icon tag. Like this:

     <link href="https://imagelibrary.com/here.min.css" rel="stylesheet"> <i class="icon default-image1"></i> 

    I'm not a developer/coder, so perhaps there is something basic I'm missing, but this seems like a quicker way to link and change out default images rather than copying/finding a lengthy image url. (As long as the image file size is about the same as an icon.)

    Thank you!

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

    No comments:

    Post a Comment