• Breaking News

    Tuesday, December 3, 2019

    Looking for an auto-typing program for Mac Ask Programming

    Looking for an auto-typing program for Mac Ask Programming


    Looking for an auto-typing program for Mac

    Posted: 03 Dec 2019 05:25 PM PST

    I'm looking for a program that will automatically type specific messages every X minutes so that I don't have to. For example, every 30 minutes type "stretch", and every 60 minutes "break time".

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

    How do computers know how to interpret binary code/machine code?

    Posted: 03 Dec 2019 06:34 AM PST

    How does the computer 'know' that a = 01100001? It seems like some lower language is always needed to explain the significance.

    As in, 01100001 is inputted. Some language (A) presumably has to tell the computer how to interpret the binary. Then wouldn't a second language, B, have to tell the computer how to interpret the first language, A? So on and so forth... a never ending chain of lower level languages.

    Could someone ELI5 how this actually works? I'm struggling to wrap my head around it.

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

    Best stack for a simple web app

    Posted: 03 Dec 2019 09:38 PM PST

    I am trying to make a simple web app that contains a form where the user enters the ID of a league, and then I take that ID and make calls to another websites API to get information about the league, and then return a table.

    I could obviously just make an html file with the form and a js file that takes the ID and creates the get requests to the other API, but is that the best practice? For whatever reason I was under the impression that making lots of web requests from the client was frowned upon.

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

    Need help designing architecture for user permissions for my company's intranet

    Posted: 03 Dec 2019 03:46 PM PST

    So I have recently been given this huge project of designing and creating a brand new system to maintain and control user permissions on our internal site. This is being done because we have awful messes of ancient code (classic asp) where in the page load or for individual links or whatnot, there will be a string of

    if USER="name" or USER="othername" etc... 

    And for some of the pages, there are maybe 50-60 links with each link having code like that controlling who can see it.

    I currently have most of the base work done with putting together the tables of users and who has admin rights. One thing that I've done is create a groups table. Department admins have the ability to create groups and add people to them so that us developers don't have to go in and add new usernames to the gross lists every time they get someone new in their department or someone gets new job responsibilities and needs access to a new page/part of a page.

    The way it's been planned is that admins can have control/ownership of pages (like specific department managed pages). But not every page is all or none. Some pages have all those links that each link has a different group of people that need to be able to see it.

    I know for the page-level stuff, it'll be a simple function to check if that user (we can get the username when they enter the page) is mapped to that page or a group who has access to that page.

    So what I need help with is how should I control/check if a person viewing the page has access to view specific links within a page? I want to avoid having a table that has individual link/module names because that's going to get very messy very quickly. But I've been stuck on this for a few days now and I'm not sure how to proceed.

    Also worth noting, I am the only person working on this. The company I work for is not a tech company and there's only four developers total and this is my project given to me by my boss. So I have complete free control over how this is designed. I've just never done anything remotely like this (only a year into my career) and I need some outside guidance.

    I'll try to give any other relevant info as requested because I don't know if this is enough to go on. Thanks!

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

    Can we convert a Vert.x web application into a Tomcat Web Application?

    Posted: 03 Dec 2019 09:01 PM PST

    Hello, /r/AskProgramming

    I have a web-based project built with Vert.x Web (Which possesses a method like createHttpServer() ) and would like to see if that can be transferred into a Tomcat Server.

    What I usually do to run the project:

    • Open an IDE, preferably NetBeans
    • Right click the project, click Run

    What I aim for is for the project to be run on Tomcat, since most Servers/Domains seems to use that to host your applications and I don't need to run it from an IDE.

    Is this possible? If yes, then how? If necessary, I may as well copy the source code overall and share to you guys.

    Help will be most appreciated. Thank you!

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

    Thoughts ‘n ideass?

    Posted: 03 Dec 2019 08:29 PM PST

    what should I makeee??

    I'm a software dev, cs grad and I've got a few weeks of travel coming up..

    [extra stuff] Really wanna do something with a graph database (only really ever used relational)

    I've got solid angular(2+) and oo skills. I've worked in lisp, c, python, 'n stuff in schoo' but not since then.

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

    Is it possible to host a chess webapp made with React free that can support online gaming?

    Posted: 03 Dec 2019 07:16 PM PST

    Hello,

    I got into web development and took some courses on front-end programming and React.

    I made some basic webapps but have been difficulty how i can host and deploy an app that can support online gaming. Is this possible to do this free using Firebase or Github which i planned to use for deployment?

    Any directions would be great.

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

    How are hash functions verified?

    Posted: 03 Dec 2019 02:03 PM PST

    I've been wondering how major hashing functions are being evaluated before releasing to wider audience. How is it verified that their output is evenly distributed over entire space, that a minor change in input causes significant change in output, that patterns in the input don't induce patterns in the output, and that reverse function cannot be built.

    Some of these features, I imagine, are just subject of empirical testing over huge samples of data. But some are not. Are there any formal proofs of some key features of the popular hash functions?

    submitted by /u/e-mess
    [link] [comments]

    Question about scaling a value dependent on the size of another value in Business Intelligence

    Posted: 03 Dec 2019 01:54 PM PST

    Hi,

    I'm currently working on implementing a regression test suite for the data warehouse in the company I'm working for. I'm fairly happy with how I've gone about doing the project in general except for one part.

    As part of it, I'm trying to track if values have changed within X percentage. For Columns, If a row count has decreased within this percentage, it's classed as a warning, if it increases in this percentage, it's classed as a positive. If it falls outside of these bounds however, it's raised as an error.

    I've been struggling to come up with a decent way of adjusting this percentage dynamically based on the size of column. The rows in columns can range from single digit values to >10's of millions.

    In the example below specifically, I have it so that if a value is less than 100, it allows a tolerance of 0.5% change (Effectively no change is accepted for entries with less than 100 rows). This change peaks at 100'000 where a change of 10% is considered an anomaly. This percentage decreases down to the point where if a value is >1'000'000 it will reduce back down to a 0.5% tolerance.

    I was considering just taking an average increase/decrease of the data over time and using that, which would work great for our production environment, but our dev environment is updated generally once a month and the tests could also run multiple times a day potentially. \

    Does anyone have any advice about algorithms or libraries I could look into? I've just been racking my brains for a few weeks about this and can't really think of a decent solution

    I've attached the Python code for my mapping function below. The hardcoded values at the moment are just for testing during my proof of concept.

    Thanks in advance

    def get_val_perc(val): :param val: value to get the scale percentage value of :return: a scaled percentage between 0.5% and 10% based on input """ min_bound = 100.0 mid_bound = 100000.0 max_bound = 1000000.0 intended_bound_min = 0.5 intended_bound_max = 10 val = float(val) if val > max_bound or val < min_bound: return 0.5 elif val >= mid_bound: current_val_bound_min = mid_bound current_val_bound_max = max_bound return abs(intended_bound_min + (intended_bound_max - intended_bound_min) * ( (val - current_val_bound_max) / (current_val_bound_min - current_val_bound_max))) else: current_val_bound_max = min_bound current_val_bound_min = mid_bound return abs(intended_bound_min + (intended_bound_max - intended_bound_min) * ( (val - current_val_bound_max) / (current_val_bound_min - current_val_bound_max))) 
    submitted by /u/-Irish-Day-Man-
    [link] [comments]

    using multiple spaces as a delimiter in strtok such as strtok(token, " "); C language.

    Posted: 03 Dec 2019 10:18 AM PST

    so in my code i have a morse text with one space separating letters and three spaces separating words with a # to end sentence.

    when i use token=strtok(text," ") ; it only counts the first space so i only ever get a letter instead of a word.

    text sample:

    - .... . .-- . .- - .... . .-. .. ... --. --- --- -..#

    it reads "the weather is good";

    i am trying to add a space between words right now all my outputs are "theweatherisgood"; i cant change the way to search since its an assignment.

    here is the full function

    void translateMorse(morseNode *key, char *file){ morseNode *head = key; char *buff =NULL, *token,*token2,*letter; FILE *fp = fopen(file, "r"); if(fp!= NULL){ if(fseek(fp, 0L, SEEK_END)==0){ long bufsize = ftell(fp); buff = malloc(sizeof(char)*(bufsize+1)); if(fseek(fp,0L, SEEK_SET) != 0){ } size_t newLen = fread(buff,sizeof(char),bufsize,fp); if(ferror(fp)!= 0){ printf("\n error reading file"); } else{ buff[newLen++] = '\0'; } } fclose(fp); } int capitalize=1, space=0; char* rest = buff, *res2; //printf("\ntranslate: %s",rest); while((token = strtok_r(rest, "#", &rest))){ res2 =token; while((token2 = strtok_r(res2, " ", &res2))){ printf("%s\n",token2); if(token2 == " "){ *letter = ' '; } else letter = printleaf(head, token2); if(capitalize == 1){ letter[0]-= 32; capitalize = 0; } //printf("%s",letter); } capitalize = 1; printf("\n"); } } 
    submitted by /u/JoblessGymshorts
    [link] [comments]

    Building a chatbot from scratch

    Posted: 03 Dec 2019 12:19 PM PST

    I was given a task of designing architecture for our home-built chatbot. Without much previous experience with system design (and chatbots) I spent most of the day reading googling.

    Unlike most articles, we don't need (for MVP) a chatbot with NLP/AI.

    Instead a simple flow based chatbot (with questions and predefined answers) is sufficient. Most of the blogs don't cover this.

    I'm in doubt about two things. We are an AWS shop so most of the tools/services will be AWS related.

    Websockets or REST? Both seem like a viable option. Store the answers in Redis/Elasticache until the end of flow is reached, and then persist in database? Or store everything in database immediately. How to design the flow? A simple questions and answers table seems sufficient, but would need some working around to allow going back to previous question, having repeating questions etc.

    If anyone's built something similar it'd be great if you could share your process/architecture.

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

    [JS HTML CSS] For expanding tab-like behaviour on a dynamic website, is display:none best to toggle the content of each tab?

    Posted: 03 Dec 2019 03:33 AM PST

    What do people usually do in these situations?

    With display:none, you would basically have all tabs and all their content loaded in memory at all times, and you would just display them or hide them. Is there a better way to do this? I was thinking to myself - between wasting RAM, and wasting CPU, I would rather waste RAM. But I dunno all the details.

    Tnx!

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

    Price for a software development

    Posted: 03 Dec 2019 03:09 AM PST

    I am sorry if this is not the tread I should be writing on, but I really need your help, people. I ordered software that matches picture colors to special needlework (cross-stitching) tread colors with some minor picture adjustments and a symbol chart output as pdf for that picture, and the developer asked $15.000. Unfortunately, I agreed, signed the contract, and now he is late almost 6 weeks, I already lost so much money because I could not do advertising and take orders and the application is not finished and will not be for some time, he doesn't even say when. What should I do? Do you think this price is real? I could end the contract, but I paid $5000 upfront and he says he will not refund because he doesn't have the money.

    submitted by /u/my-pattern
    [link] [comments]

    How to represent a Yugioh Card in an Object-Oriented Way?

    Posted: 03 Dec 2019 09:06 AM PST

    One of my side projects is an editor for creating custom Yugioh cards (written in Java, then later I added some Kotlin. Either way, I'm just wondering in more general terms), and I've often wondered what the best way to actually represent the cards is. I've seen a couple of questions on the subject, but they were in the context of simulating the game (and thus on how to implement methods for the things they can do), in my case I want to know how best to handle them in respects to the different fields each of them have. For those that don't know, there are 3 main types of cards: Monsters, Spells, and Traps.

    Spells and Traps are rather simple and similar to each other, they have a Name, a Type, and an Effect.

    Monsters, on the other hand, have significantly more fields. Name, Type, Attribute, Level, ATK, DEF, and Effect. To make matters worse there are two sub-types of monsters: Pendulum monsters have a Left and Right Pendulum Scale, along with a Pendulum effect (in addition to their normal monster effect). Link monsters have a Link-Rating instead of Level, and a number of Link markers that can point in any combination of eight directions (Up, Down, Left, Right, Up-Left, Down-Left, Up-Right, Down-Right), and do not have DEF. While there hasn't been a combination Pendulum Link monster, it is entirely possible that one could exist in the future.

    Given that my program is an editor, I need access to each of the fields on the cards so that I can edit them, and use them in user-defined templates. My current solution was to start with an abstract card, which I then subclassed into either Monsters or Spells/Traps. When Pendulum and Link monsters were added I just attached their fields to the standard monster card. This resulted in typecasts all over my code.

    For my actual question, I'm wondering if there is a better way to do this? What is the proper way to design classes to represent these cards?

    EDIT: Here is a sample of where I use the actual fields in code. Please forgive a fair amount of this probably being terribly written, some parts of this are either 7 years old or based off of (or trying to fix) 7-year-old code. Also note that due to technical issues I retyped most of this into Pastebin, so anything that would prevent this from compiling is just an error in the transcription (also note that I added a couple of comments for where I know certain things could be better).

    https://pastebin.com/J6TMa023

    submitted by /u/Renard-Chase
    [link] [comments]

    Numpy how to find the sum of Y coordinates divisible by 3?

    Posted: 03 Dec 2019 09:05 AM PST

    I have a 16x16 matrix and want to find the sum of values that have a y coordinate that divide by 3

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

    Programming in C: Problem with integer limits, unable to print proper hex values over 0x7FFFFFFF

    Posted: 03 Dec 2019 02:49 AM PST

    EDIT: resolved now thanks to u/akevinclark !! Looks like strol was the bottleneck which was something I would have never caught, thanks again!

    Original: I've tried casting every int variable as an unsigned long int as well as casting all char variables as an unsigned char, but the last 4 or 5 values in my sorted array end up overflowing. Any advice is greatly appreciated, even if it's just general advice on other parts of the code.

    Program:

    #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> FILE *pnt__Text_file; char str__File_OG[9999]; char str__File_copy[9999]; char *stringFile_name[8] = {"1.txt", "a.txt", "2.txt", "b.txt", "3.txt", "c.txt", "4.txt", "d.txt"}; int sortHolder; char hexArray[10]; unsigned int num[256]; void fnc__Get_OG_file_string(char*), fnc__Make_OG_file_copy(char*), fnc__Get_copy_file_string(char*), fnc__File_functions_hub(char*, char*), fnc__Check_for_file(char*); void SortIntArrayAscending(unsigned int*, int); int main() { fnc__File_functions_hub("3.txt", "c.txt"); int numberHexStrings = (strlen(str__File_copy)/10); for(int j = 0; j < numberHexStrings; j++) { for(int i = 0; i < 8; i++) { hexArray[i] = str__File_copy[(i+2)+(j*10)]; } num[j] = (int)strtol(hexArray, NULL, 16); } SortIntArrayAscending(num, numberHexStrings); for(int j = 0; j < numberHexStrings; j++) { printf("%x\t%d\n", num[j], num[j]); } pnt__Text_file = fopen("c.txt", "w"); fprintf(pnt__Text_file, "0x%x", num[0]); fclose(pnt__Text_file); for(int k = 1; k < numberHexStrings; k++) { pnt__Text_file = fopen("c.txt", "a"); fprintf(pnt__Text_file, "0x%x", num[k]); fclose(pnt__Text_file); } printf("End of program.\n"); return(0); } void fnc__File_functions_hub(char *passed_string1, char *passed_string2) { fnc__Get_OG_file_string(passed_string1); fnc__Make_OG_file_copy(passed_string2); fnc__Get_copy_file_string(passed_string2); return; } void fnc__Get_OG_file_string(char *passed_string) { pnt__Text_file = fopen(passed_string, "r"); fnc__Check_for_file(passed_string); while(!feof(pnt__Text_file)) { fscanf(pnt__Text_file, "%s", str__File_OG); } fclose(pnt__Text_file); return; } void fnc__Make_OG_file_copy(char *passed_string) { pnt__Text_file = fopen(passed_string, "w"); fprintf(pnt__Text_file, "%s", str__File_OG); fclose(pnt__Text_file); return; } void fnc__Get_copy_file_string(char *passed_string) { pnt__Text_file = fopen(passed_string, "r"); fnc__Check_for_file(passed_string); while(!feof(pnt__Text_file)) { fscanf(pnt__Text_file, "%s", str__File_copy); } fclose(pnt__Text_file); return; } void SortIntArrayAscending(unsigned int*intArray, int numberOfValues) { printf("Sorting: Ascending"); for(int i = 0; i < numberOfValues; i++) { for(int j = (i + 1); j < numberOfValues; j++) { if(intArray[i] > intArray[j]) { sortHolder = intArray[i]; intArray[i] = intArray[j]; intArray[j] = sortHolder; } } } printf("\n\n"); return; } void fnc__Check_for_file(char *pnt__Passed_string) { if(pnt__Text_file == NULL) { printf("Unable to open \"%s\".\n", pnt__Passed_string); printf("Please check that the file exists and is accessible.\n"); exit(EXIT_FAILURE); } return; } 

    file "3.txt" contents: 0x6b8b45670x327b23c60x643c98690x663348730x74b0dc510x19495cff0x2ae8944a0x625558ec0x238e1f290x46e87ccd0x3d1b58ba0x507ed7ab0x2eb141f20x41b71efb0x79e2a9e30x7545e1460x515f007c0x5bd062c20x122008540x4db127f80x216231b90x1f16e9e80x1190cde70x66ef438d0x140e0f760x3352255a0x109cf92e0xded726390x7fdcc2330x1befd79f0x41a7c4c90x6b68079a0x4e6afb660x25e45d320x519b500d0x431bd7b70x3f2dba310x7c83e4580x257130a30x62bbd95a0x436c61250x628c895d0x333ab1050x721da3170x2443a8580x2d1d5ae90x6763845e0x75a2a8d40x8edbdab90x79838cb20x4353d0cd0xb03e0c690x189a769b0x54e49eb40x71f324540x2ca886110x836c40e90x2901d8290x3a95f8740x813864110x1e7ff5210x7c3dbd3d0x737b8ddc0x6ceaf0870x22221a700x4516dde90x3006c83e0x614fd4a10x419ac2410x5577f8e10x440badfc0x507236790x3804823e0x77465f010x7724c67e0x5c482a970x2463b9ea0x5e884adc0x51ead36b0x2d5177960x580bd78f0x153ea4380x3855585c0x70a64e2a0x6a2342ec0x2a487cb00x1d4ed43b0x725a06fb0x2cd89a320x57e4ccaf0x7a6d8d3c0x4b588f540x542289ec0x6de91b180x38437fdb0x7644a45c0x32fff9020x684a481a0x579478fe0x749abb43

    It's 100 random hex values, the goal is to scan in the values from a file and sort in ascending order. Big thanks to anyone that spends even a moment glancing over this!

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

    input == 'string'

    Posted: 03 Dec 2019 08:03 AM PST

    What I want to do is ask user, whether user wants to use calculator, play tic tac toe, or let us know which is their favorite animal. I have written code for all three of them: calculator, favorite animal and tic tac toe, but how do I ask them to choose option, and then execute code only for what they choose? I use the code at the end of the post and the statements go like:

    if answer == 'calc':

    // Code for Calculator

    elif answer == 'animal':

    // Code for Animal

    elif answer == 'ttt':

    // Code for Tic Tac Toe

    answer = input("Do you want to use simple calculator?(Type: calc)\nMaybe you want to let us know which animal is your favorite?(Type: animal)\nOr you want to play Tic Tac Toe?(Type: ttt):\n")

    Help?

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

    Does playing video games relax and unwind you? Considering it's just another screen?

    Posted: 03 Dec 2019 07:59 AM PST

    I'm looking for some easy ways to relax and unwind because I'm starting to feel somewhat burnt out, and I'm wondering if other people have good experiences with video games as a de-stresser.

    Asking about video games specifically because I'm not an outdoors person, it's cold as fuck out, and I live in a tiny city with nothing to do - so video games are the most fun I can have here.

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

    Is there a way to automate starting a program and getting it to run on pc from my phone?

    Posted: 03 Dec 2019 06:13 AM PST

    I am sorry if this is the wrong place to ask, but I was wondering if there was some way for me to learn how to push a button or send a message from my phone that would automatically start a program on my pc and click a button within it, for example launching windows camera and hitting the record button or launching utorrent and hitting the resume button and then minimizing them. Thank you for any advice you can offer.

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

    Online Swift Compiler?

    Posted: 03 Dec 2019 05:08 AM PST

    Hi, can I use Repl.it to compile Swift code and build IOS apps? If Repl.it isn't suitable compiler, does there exist one?

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

    [Tools/experience] How to monitor dependencies/services?

    Posted: 03 Dec 2019 03:48 AM PST

    The situation is common: you build an application that depends on several other services, be they SaaS providers or other departments internal to the company. Your integrations are working and all is well.

    Nothing good last and of course the services are actively developed as well, so over time they change. In a perfect world service providers would version their APIs and provide timely notifications of obsolescence and decommissioning, but this is not a perfect world - especially in enterprise - hence my question:

    How do you stay on top of service dependencies? How do you make sure that you're not surprised by changes to dependencies, even when internal processes are inadequate?

    To clarify, I'm looking for experiences with software to track and monitor external services, but any and all advice is appreciated.

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

    Why does Bruteforcing take so long?

    Posted: 03 Dec 2019 02:36 AM PST

    I was told you can save a lot of time by supplying a mask (Length of the string) when using brute force but why can't you just use multiple masks parallel to each other?

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

    No comments:

    Post a Comment