• Breaking News

    Wednesday, May 9, 2018

    Is it feasible to write a program to count the number of bees on a small frame? Ask Programming

    Is it feasible to write a program to count the number of bees on a small frame? Ask Programming


    Is it feasible to write a program to count the number of bees on a small frame?

    Posted: 09 May 2018 07:51 PM PDT

    Just started a job where this pops up often enough. I have a little bit of experience (basic classes, haven't done any large scale projects) with c++, python, Matlab (kinda), and Java.

    The frames would look a lot like this, though making the background black or white wouldn't be too difficult, and i can get decently high resolution pictures)

    Is it worth it to try and write a program like this?

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

    How do you know if it's plagiarism or not?

    Posted: 09 May 2018 09:14 PM PDT

    When referencing code from online, how do you decide if what you're looking at is just standard procedure boilerplate code vs. something that needs to be cited/not copied at all?

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

    Tools for visualizing code quality.

    Posted: 09 May 2018 05:00 PM PDT

    So recently while listening to the podcast "Talk Python to Me" I came about the concept of the analysis of code quality through graphics. Quality of code isn't a subject strange to me, but I had before seen the concepts presented in such a graphical manner.

    I was wondering if anyone knows a program/tool that offers this, more specifically, I'm looking for something like this. The reason I don't really want to use the one linked is that it seems quite outdated and the project abandoned.

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

    Stratum documentation

    Posted: 09 May 2018 06:58 PM PDT

    Does anyone have the full stratum documentation? I've been doing programming and I need stratum to use with pools. I found some snippets across the internet but there doesn't seem to be an actual doc. I tried using wire shark and a monero miner to deduce something but got:

    {"id":1,"jsonrpc":"2.0","method":"login","params":{"login":"<LOGIN>","pass":"worker","agent":"XMRig/2.6.2 (Linux x86_64) libuv/1.8.0 gcc/5.4.0","algo":["cn/1","cn/0","cn/xtl","cn"]}}

    {"id":1,"jsonrpc":"2.0","error":null,"result":{"id":"","job":{"blob":"<What even is this>","job_id":"<job>","target":"711b0d00<Why is the target so small>","id":""},"status":"OK"}}

    I couldn't find anything to do with what the server was sending me. Can someone please help, this is driving me insane.

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

    Help with MRI image analysis using MATLAB

    Posted: 09 May 2018 06:49 PM PDT

    Hello

    I am trying to do some image analysis where I am using a pre-made MATLAB toolbox to get my MRI images seperated into a fat fraction. The code supplied to me wants a structure that looks like this.

    imDataParams.images: acquired images, array of size[nx,ny,1,ncoils,nTE] imDataParams.TE: echo times (in seconds) imDataParams.FieldStrength: (in Tesla) imDataParams.IsClockwise = 1 

    The problem I have is that I cannot create my .images. I have a file that can open using the dicomread function, and I can also convert the image to a jpeg. When I try this

     picture = imread('MRIm1.jpg'); Picture2 = im2double(picture); dataParams.images = [Picture2, 1, 1, 3]; 

    It says "Error using horzcat Dimensions of matrices being concatenated are not consistent."

    I can pm the matlab toolbox if someone is willing to help me out.

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

    Email automation

    Posted: 09 May 2018 09:55 PM PDT

    I'm trying to make a service that requires me to be able to receive emails, read and to things with the content of the emails. I never will have to send emails from here. How the hell do I do this? I'm currently looking at AWS SES and Mailgun, but I would prefer to be able to host this myself as I do not expect above 100-200 clients and will be processing less than 1mil emails a month.

    submitted by /u/6XAM
    [link] [comments]

    MySQL/Java: Adding the results of a SELECT COUNT to the result of another SELECT COUNT

    Posted: 09 May 2018 03:54 PM PDT

    This intro might seem long and unnecessary, but it is important to understand the conditions. I've been at this for several hours and I can't seem to find a solution. I'm using Java so using multiple queries and calculating it in Java is also a solution, but not the most efficient one. Keep in mind that I'm a mere IT student.

    I've ran into quite the headache of a problem with my SQL. My current project is a game of Mastermind. There is an option to challenge another player. In this mode, both players play the same game with the same solution and aim to solve it in the least amount of tries. To do this, you first select a difficulty level. With this information, you get a list of possible opponents. A difficulty level is only unlocked when you won at least 20 challenges of the previous difficulty level. A draw is in favor of the challenger.

    For each challenge, the usernames of both the challenger and challenged, the difficulty level, the number of tries needed for both and the solution. To get this list, we need to calculate the amount of won games for each player. If that player has more than 20 won challenges, they are added to the list. The difficulty in this is that you have to calculate both the amount of wins where the player is the challenger and where they are the challenged.

    The Create statement for this table:

    CREATE TABLE `Challenge` ( `numberOfTriesChallenger` int(11) NOT NULL DEFAULT '0', `numberOfTriesChallenged` int(11) NOT NULL DEFAULT '0', `difficulty` int(11) NOT NULL, `usernameChallenger` varchar(45) NOT NULL, `usernameChallenged` varchar(45) NOT NULL, `solution` varchar(100) NOT NULL, PRIMARY KEY (`difficulty`,`usernameChallenger`,`usernameChallenged`), KEY `usernameChallenger_idx` (`usernameChallenger`), KEY `usernameChallenged_idx` (`usernameChallenged`), CONSTRAINT `usernameChallenger` FOREIGN KEY (`usernameChallenger`) REFERENCES `Player` (`username`) ON DELETE NO ACTION ON UPDATE CASCADE, CONSTRAINT `usernameChallenged` FOREIGN KEY (`usernameChallenged`) REFERENCES `Player` (`username`) ON DELETE NO ACTION ON UPDATE CASCADE) 

    If done entirely in SQL, the ResultSet should be the list of usernames of the players that won more than 20 challenges.

    For those asking for the queries I've tried, none come even close to the result I need.

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

    Pre-screen for runtime ClassNotFoundException.

    Posted: 09 May 2018 05:36 PM PDT

    Is there anything other than regression testing to uncover all of the ClassNotFoundException issues? I've joined a group whose application was poorly managed and has lots of dependencies that are no longer needed. I've found what I can via the import statements, but of course that will not include the runtime exceptions.

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

    Are there any programs that will allow my clients to digitally sign emails.

    Posted: 09 May 2018 02:32 PM PDT

    Hi guys. Not sure if I'm in the right place but I was wondering if you guys knew of a program that will allow my clients to digitally sign emails that I send to them?

    Thanks.

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

    Long a** algorithms?

    Posted: 09 May 2018 04:11 PM PDT

    What are some popular algorithms used today that are greater than linear time or logarithmic time, is there any you know of that are o(n2) or greater?

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

    making a bot without an API?

    Posted: 09 May 2018 03:50 PM PDT

    there is this interesting twitter-like app, and it is only available for mobile. users can make text, audio, or image posts, and it is possible to share someone else's post via email. this link takes you to a webpage, which is otherwise not accessible. hypothetically, one might be interested in data mining.

    ideally, if there was an API, it should be possible to have a bot send an email for each post and another program scrape the email link. is this impossible without such an API? how might someone do this? I know that someone was able to figure out how the Tinder API worked, so maybe it is possible?

    asking for a friend.

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

    [Python] Trying to compare lines of 2 large files and keep lines that match, but no matches.

    Posted: 09 May 2018 03:01 PM PDT

    I have a dictionary file for a speech recognition engine that I'm trying to reduce the size of. The dictionary contains 133k+ lines like so:

    abella AH B EH L AH abeln AE B IH L N abelow AE B AH L OW abels EY B AH L Z abelson AE B IH L S AH N abend AE B EH N D abend(2) AH B EH N D 

    I'm trying to reduce it to only hold the most common words and names in the U.S. from a file with 15k+ lines like so:

    configurations poison james john robert 

    When I run the following script it results in a blank file, as if there no matches between the first token of lines in the dictionary and the lines of the common words dataset. Are my files too big for the way I'm doing this? What am I doing wrong?

    import os file_name = 'small_cmudict-en-us.dict' f = open(file_name, 'w+') with open('common_names_words.txt', 'r') as n: for line in n: line = line[:-1] #remove newline char with open('cmudict-en-us.dict', 'r') as d: for line2 in d: dict_entry = line2.split() #words with multiple pronunciations; abend, abend(2) if dict_entry[0][-3:] == '(': if dict_entry[0][:-3] in n: f.write(line) if dict_entry[0] in n: f.write(line) f.close 

    Thank you for your time.

    EDIT: Someone on SO helped me figure out what I was doing wrong (a lot). Here's the revised script that works if anyone is curious:

    file_name = 'small_cmudict-en-us.dict' with open(file_name, 'w+') as f: with open('common_names_words.txt', 'r') as n: common = [] for line in n: line = line[:-1] common.append(line.strip()) with open('cmudict-en-us.dict', 'r') as d: for line2 in d: # account for e.g, "abend" and "abend(2)" word = line2.split()[0].split('(')[0].strip() if word in common: f.write(line2) 
    submitted by /u/actualspaceturtle
    [link] [comments]

    Plotting a vector as a contour plot

    Posted: 09 May 2018 02:44 PM PDT

    This is a very simple question (conceptually), but I'm still inexplicably stuck....

    I have a data file consisting of (amongst other things), two columns of positions (x and y), and two columns of x and y velocities (u and v). I want to plot two contour plots of u and v.

    I'd like to get two matrices of u and v where i can just plot u and v as a contour plot with matplotlib or something. Basically, I have:

    x(i) y(i) u(i) v(i)
    a vector another vector a third vector a final vector

    whereas i want a matrices e.g. U such that U(i,j) = u(x(i), y(j)). This can't be hard- I've tried simple things using two nested for loops, but it doesn't seem to have worked....

    Oh, and there's added annoyingness because the vectors are 12,000,000 entries long

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

    Programming Coach?

    Posted: 09 May 2018 02:04 PM PDT

    Hello I am a highschool student(about to graduate) and I will be competing in a competition for programming.

    I was asking my friend in college for assistance with some advanced topics but he doesn't have the time to go through some advanced topics.

    He suggested I look for a coach. Is this a thing? How would I go about finding a person?

    Any information would be great. Thank you

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

    Personalization vs Caching

    Posted: 09 May 2018 06:29 AM PDT

    Hello,

    I'm looking for information on personalization vs caching when it comes to website development.

    I've read that personalization sells which is great but that's almost diametrically opposed to caching (and edge caching in particular).

    The more personalized your site is the less it can be cached (it seems).

    I've read some articles which say that you should be caching your pages and using ajax to show the personalized content. I'm trying to verify if that's the "standard" so to speak and or what other strategies, ideas and challenges people have come up against.

    Thank you

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

    Python Ignorant but trying to get and LED visualizer for twitch stream

    Posted: 09 May 2018 01:40 PM PDT

    So I asked a buddy of mine who knows how to script Python but he is getting caught up in IRL stuff. I do DJ streams on my twitch channel and I was trying to get an LED visualizer and then have it be able to interact with the chat as well. So if someone types !hype the LED does some crazy stuff or if anyone follows or subscribes it would also trigger it. Then maybe my logo when there is no input? I feel like this is a crazy idea but I want to swing it by you guys! :)

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

    Can anyone please help me with a simple problem?

    Posted: 09 May 2018 04:55 PM PDT

    https://studio.code.org/projects/applab/j-WVrftKRuytGJETZQKCOZF_8DDzdHH1jmkTQ4GYcQw/edit

    I'm trying to make the game restart. I've added the play again button which seems to clear the score and timer, but I can't for the life of me figure out how to make the game start a new timer so you can play again and again.

    Anybody got an answer?

    I would really appreciate any help. It's on a teaching programming website and you may have to register to see my code 😕

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

    help me gcc vs clang

    Posted: 09 May 2018 08:55 AM PDT

    What are the differences between gcc and clang in terms of structure, architecture, optimization technique, assembler and everything?

    submitted by /u/steve-ddit
    [link] [comments]

    Containers for multi-language development environments

    Posted: 09 May 2018 12:05 PM PDT

    Just about every modern language has a packaging format, package manager and (where required) a workspace / dev environment management tool. When it comes to large complex projects consisting of many sub-components, written in a mix of languages, there doesn't seem to be an obvious way forward.

    The project I am currently working on is one such example: we have a whole bunch of re-usable components which live in their own repos. Each component is comprised of many different languages (C++, C, Python, Tcl, Verilog etc.). All of this is compiled down to eventually form a single build artefact, which is our release.

    The way we currently manage these dependencies is entirely sub-optimal and very laborious. Has anyone experience with using containers for development workspaces? The primary advantages I see:

    • Ability to utilitise system package management tools without impacting global system state or getting stuck in dependency hell
    • Throwaway build environments
    • Completely deterministic builds (assuming underlying build system is deterministic)

    On a more general note – does anyone have good examples of complex, multi-language projects which could be studied?

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

    Transmitting + also storing via api form

    Posted: 09 May 2018 11:54 AM PDT

    Hey all,

    I've got a project where we're connecting our site via api to a third party company for fulfillment. Essentially they fill out a form on our site, it gives them the information and we also would house it, likely in our own database (which has not yet been produced, because initially the scope was just to connect via api and have them handle all information)

    What are my options here? How many hours typically would something like this take? (I'm the project manager)

    Thank you for your time!

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

    Couple of questions regarding a small project I've been appointed over. [Database creation]

    Posted: 09 May 2018 11:30 AM PDT

    So I have a client with a warehouse of various items: paintings, furniture, clothing etc. The client would like the items in the warehouse catalogued into a database that they can easily query. I have a few questions about what language/framework I should use given the following contraints.

    1. The database should have a GUI
    2. The user should be able to query the database offline. (Standalone application).

    Use case: I have various chairs. When I type in chair all chairs should pop up incluing their color,location etc.

    Should I use SQL or mySQL for this or do you guys have a better and easier idea?

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

    Machine Learning Question

    Posted: 09 May 2018 11:22 AM PDT

    So I just recently graduated and I never learned machine learning but I learned it a little online and had a thought

    If we had a video and let's say we stored each frame into an array. Can't we use machine learning where arr[i - 1] and arr[i+1] are the input and arr[i] is the answer? This would be helpful to increase fps in videos or even videos where it is missing small frames

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

    Best language to make the most trivial GUI programs asap?

    Posted: 09 May 2018 02:04 AM PDT

    I've almost finished my CS degree and haven't touched a bit of GUI other than some game design but I didn't have to work with any libraries myself so learned nothing.

    What's the fastest way, from installing compiler(ide?) to writing a simple Hello World and having the GUI show up in windows (or linux if it's easier).

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

    Can all C++ code be written in C?

    Posted: 09 May 2018 11:35 AM PDT

    Hi all,

    Sorry for the newbie question here.

    Can all C++ code/features be achieved in C, albeit with much more code, and being obviously much more time consuming?

    Thanks for reading.

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

    Python out of bounds

    Posted: 09 May 2018 07:11 AM PDT

    I made an 8 by 8 2D array in python but whenever I check something out of bounds the program still works. For example, If I write if grid[-1], [-1] == "bomb" ... the program still works and it doesn't display an out of bounds error message. Why is that?

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

    No comments:

    Post a Comment