• Breaking News

    Wednesday, March 27, 2019

    Need help understanding network/http terminology Ask Programming

    Need help understanding network/http terminology Ask Programming


    Need help understanding network/http terminology

    Posted: 27 Mar 2019 05:26 PM PDT

    Hi. Embarrassing beginner questions. So when I read something like "tunnel port 8080 over jumpserver using ssh - socks5 proxy?", I literally don't know what any of these things. When someone says : "Start this on port 4000", I don't know what he's talking about. (I know what ssh is and use it all the time. That's the only word I know the meaning of)

    So please : could someone suggest a good textbook for dummies which helps explain these concepts?

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

    Questions for professional programmers

    Posted: 27 Mar 2019 09:51 AM PDT

    Bio: Currently a high school junior taking AP Comp Sci, with a fair knowledge of computers and programming. Taking some college courses over the summer and next year to finish out my high school career and will probably major in comp sci at UMD. Just curious about what my life might be like in 6-7 years.

    What do you do all day? Do you actually write code or do you just look over pre-written lines? How hard is it(on average)? What languages are the most prevalent? How often is it that you find yourself unable to complete a task? What is it like to program with a team? Is everyone assigned a team? Does everyone know what they're doing? Is there a lot of work outside of your office hours?

    Thanks in advance!

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

    Why are FPS games so exploitable/hackable?

    Posted: 27 Mar 2019 09:18 PM PDT

    It seems that no matter what any major developer does, someone will figure out an ESP cheat or aimbot within days of a games release. That being said there are games like League of Legends and DOTA that seem far less exploited (at least I don't hear anyone complaing about LOL or DOTA hackers.) What makes FPS games so easy to exploit?

    submitted by /u/5LU
    [link] [comments]

    How to code this simple program?

    Posted: 27 Mar 2019 10:24 PM PDT

    I need a tiny little program where I can enter up to 8 variables, and it calculates the factorial of these variables. But here comes the twist (for me): For each variable I'd like to assign "text", and the program should be able to export a .txt file with all 40 320 different combinations of these "texts" (one per line).

    I know this is not that difficult, but I'm not a programmer. I'm thankful for any help, and I'm willing to pay 20$ if someone can code this program for me. I know it's just 30 minutes of work! :-)

    submitted by /u/lars-vivendi
    [link] [comments]

    Need help pushing/resolving Axios Javascript promises

    Posted: 27 Mar 2019 08:52 PM PDT

    Hi all,

    I have been pounding my head against this problem, and need help with a solution. I have an array of IDs within a JSON, and I am iterating over that array and making a GET request of each ID. I want to then push the response of those GET requests into an array.

    Here is the function I am using to push the registrations into the array. It is iterating through an array of IDs:

    getRegistrations = async (event) => { let registrations = []; await event.registrations.forEach(registration => axios.get('/event/getRegistration', { params: { id: registration } }).then(res => { registrations.push(res.data.properties) } ).catch(err => console.log(err))); return registrations; }; 

    Here is where I am calling that code:

    render() { let event = this.getEvent(); let registrations2 = [{ age: 19, bio: 'test', firstName: 'hello', lastName: 'bye', password: 'adadas', telephone: "4920210213" }]; if (this.props.listOfEvents.events.length !== 0 && !this.props.listOfEvents.gettingList && event) { //check if the array is empty and list has not been rendered yet let columns = []; let registrations = this.getRegistrations(event); console.log(registrations); let eventProperties = event.properties[0]; Object.keys(eventProperties).forEach(key => columns.push({ title: eventProperties[key].title, dataIndex: key, key: key })); console.log(registrations); console.log(registrations2); return ( <h1>hi</h1> ) } return <Loading/> } 

    When I console-log 'registrations' vs 'registrations2' they should be very identical. However, in the javascript console on Google Chrome, 'registrations appears as '[]' where 'registrations2' appears as '[{...}]'.

    I know that it is an issue related to promises (I am returning the registrations array before actually pushing) but I have no idea how to fix it! Some friendly help would be very much appreciated!

    submitted by /u/50mac50
    [link] [comments]

    Transition from Embedded software to Web Backend...What's the path to follow?

    Posted: 27 Mar 2019 08:49 PM PDT

    Hi to all of you!

    Well, this is my first post here so I'll try to be brief...

    I'm 23 years old and studied Mechatronics Engineering. I graduated 3 years ago and I'm thinking about transitioning from embedded software development to a backend web development (or however it is called. Sorry, almost all I know about software development is just for embedded).

    Even though I saw something about C programming for microcontrollers and stuff like that during my stay at univeristy it wasn´t really that in depth. I´m basically self taught.

    In the past 3 years I´ve had the oportunity to create some important projects for electrical substations in varios places in my country.

    However, the company I was working for wasn´t really experienced/dedicated in developments of this kind (almost all they do is PLC programming for already existing projects, not embedded software projects from scratch) so the paid wasn´t really fair (taking in mind the complexity of what I did), but the most imortant thing was that I was the only one who did that stuff and had no one else to learn from.

    So I recently got hired froma a mutlinational software company to develop software in C/C++ and so far I'm quite enjoying it!. It is not embedded software but as long the languages are C or C++ I feel comfortable.

    However I've always had the interest to learn web development (I think back end suits me the most) because of a number of things. For example: more jobs, a lot of interesting concepts that sound amazing, better paid, possibility to find a remote job, huge important companies ,etc... I don´t know if keep focusing in C/C++ develpoment is a smart decision in the long term.

    So right now I´m basically asking for help to have a clearer vision of how can I learn web development...I´ve tried, but there are a lot of concepts and/or languages that confuse me a lot!

    Node Js, Jason, Angular, Scrum, Hibernate,django, etc... are some of the words I have seen and that don´t know what are they for but somehow they all are important to know so aaghhhh... there are just a lot of things going that I completly ignore and cant figure where to start from. I know knowledge requires time but.... you get the point.

    The courses I've tried (and those I can afford) start all with just basic programming stuff and I feel they are a bit slow and just teach me the syntax of a particular language.

    The other option would be studying again I think.

    Have some of you guys been in a smiliar position?

    Do you know any way to learn this stuff in a self thaught style?

    I what order should I learn things?

    Thanks for reading!

    My english is being improved constanly so future posts will be better gramatically.

    Thanks!

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

    Assistance finding autofilling software for value-assigned choices

    Posted: 27 Mar 2019 08:47 PM PDT

    So I know this is a bit of a long shot- but I couldn't find anything with google and I am not entirely sure where else to turn to. I'm coding a very simple text-based game, and I realized that I needed to track the "values" of choices that are made. I started doing it in google sheets because that's what I'm used to but, well...

    Let's just say that when every option produces a minimum of two outcomes, and each one after that produces another two values and so on and so forth, it quickly becomes too much to manually put into a spreadsheet.

    Here's an example of what I am speaking of:

    Choice one: lie or tell the truth
    Two outcomes:
    Truth (Adds a trusted value of +7)
    2. Lie (Adds a trusted value of +5)

    Next choice: be sincere or deflect
    Outcomes:

    1. Truth-Sincere (Total Value of 12 (7+5))
    2. Truth-Deflect (Total Value of 3 (7-4))
    3. Lie-Sincere (Total Value of 12 (5+7))
    4. Lie-Deflect (Total Value of 1 (5-4))

    And so on and so forth, each choice splitting the total dialogue paths into even more outcomes.

    I'm sure you can see how it becomes impractical to map out each option of the paths by hand, due to the increasing number of outcomes, but I need to know all of the possible total choice values in order to weigh the values against situational checks to see if things like lying and asking for trust pass or fail.

    I suppose my question boils down to this- does anyone know of any software that could be used to track outcomes of numerical values where the option for passing/failing can be entered and it will autopopulate all possible outcomes? Or is this something that I am not likely to find and I will just have to continue tracking it by hand?

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

    Best language to quickly write an algorithm and run it in the terminal?

    Posted: 27 Mar 2019 11:58 AM PDT

    I practice some data structures and sometimes I would want to open VSCode, declare 2-3 variables, write 2-3 "for" and "if" and in the terminal just write "run myfile.x" and get the result.

    I do it already by creating a C# console application but it's longer because I need to create a whole project in Visual Studio and I can't run it without compiling it.

    Which language should I use to do this thing in VSCode and is there extentions to run specific files in the terminal?

    submitted by /u/42-1337
    [link] [comments]

    Read FAQ, still can't decide, end goal is to learn and land a job. Are there any languages that can benefit from sys/network admin skills?

    Posted: 27 Mar 2019 08:31 PM PDT

    I'm bored outta my mind at work. I have like 90% downtime at my job on a typical day, and I feel like I'm wasting time NOT learning a programming language. Day-to-day I'm a systems administrator, so I've got experience in the tech world.

    My goal is to learn a language and land a good job with it. I'm open to pretty much anything, making games/mobile games would be cool. Writing automation scripts would be cool. I just suck at math, so anything math intensive wouldn't be cool.

    Initially I thought maybe learning swift or something would be a good way to go. Start creating apps on the app store and maybe make a little side money in a year or two after making a few apps and becoming proficient with swift. But the more I read the more I see people saying, "Don't learn swift if your goal is to make money". So I'm kinda at a loss.

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

    I need help with quad tree splitting

    Posted: 27 Mar 2019 08:21 PM PDT

    I am creating a quad tree from ground zero, because I am going to collapse it from bottom up I am refining it with a certain LoD level.

    I am using glm for mathematics and opengl for rendering. Instead of pointing to a vertex each quad points to an index from a list of vertex to avoid vertex redundancy.

    I start by computing the medians and the center, then I check in the list if any of these vertices exist. For a small amount of vertices this is trivial, however it became apparent that this strategy is ineffective.

    The code for this split is in the following repo, if anyone can help me in finding another strategy, even showing me a code snippet, I would really appreciate it.

    Thanks in advance

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

    java variable "attributes"?

    Posted: 27 Mar 2019 08:07 PM PDT

    I am somewhat new to coding and trying to create a game of minesweeper using basic GUI. I am wondering if there is some sort of "attribute" I can give a tile upon creating it to signify that it is a bomb.

    import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; public class Minesweeper extends JFrame { int tilesize = 20, framewidth = 600, frameheight = 600; int xsquares = framewidth / tilesize; int ysquares = frameheight / tilesize; int rows = 10, columns = 10; JPanel field; JButton[][] tiles = new JButton[rows][columns]; int bombs; public Minesweeper() { // Group elements in a panel field = new JPanel(); field.setLayout(new java.awt.GridLayout(rows, columns)); ButtonObserver observer = new ButtonObserver(); for (int i = 0; i < tiles.length; i++) { for (int j = 0; j < tiles[i].length; j++) { tiles[i][j] = new JButton(j + "," + i); field.add(tiles[i][j]); tiles[i][j].addActionListener(observer); } } // ContentPane's default layout manager: BorderLayout Container contentPane = getContentPane(); contentPane.add(field, "Center"); } private class ButtonObserver implements ActionListener { @Override public void actionPerformed(ActionEvent e) { Object source = e.getSource(); for (int i = 0; i < tiles.length; i++) { for (int j = 0; j < tiles[i].length; j++) { if (source == tiles[i][j]) { System.out.println("Position: [" + j + "]" + "[" + i + "]"); tiles[i][j].setEnabled(false); tiles[i][j].setText(""); } } } } } public static int bombsaround(JButton tiles[][]) { return 0; } } 
    submitted by /u/EtherealInternet
    [link] [comments]

    Weirder question: I have my first meeting for career development goals at my first job tomorrow. What are some good goals to bring to the table?

    Posted: 27 Mar 2019 08:07 PM PDT

    As the title says, I'm meeting with my manager about career development goals. I intend to stay in a development position, and would ideally go on the path toward a tech lead.

    Any advice on goals that I can bring up to help with this would be much appreciate.

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

    Hello r/ASkpRograMMinG. PLEaSe HeLp

    Posted: 27 Mar 2019 03:19 PM PDT

    PleasE hElp. I Am a HiGh SchooL StUdeNt Who CodES as A HoBby. RecENtLy, i mAde A VbsCRipT ThAT RaPiDly swItcHed mY caPSloCk On AnD OFf tO CrEaTe tHiS eFFeCt whiLe typiNG AuTONoMOuSlY. i tesTed It OnCe bEfOrE and wAS AbLe To tUrN iT oFF ThROuGh tAsK MaNaGeR, hOWEvEr tHis TIme i SenT iT ThROugh a dIscoRd mESsaGe AnD THeN dOwNLoaDED It. iT was NoT ComPrESsED OR cONverted iNTo AnyTHiNg OtHEr tHaN A .Vbs fILE, So i dOn'T UNdErsTaNd why i Am nOt AbLe to fInd THE pRoCESs iN tAsk MaNaGeR THiS Time. whIle I aM ProBAblY JUST OverLooKinG sOMeThINg ObVIoUs, I WOuLD LikE To heaR YoUr OPIniON On thIS iSsUe.

    Set WshShell = WScript.CreateObject("WScript.Shell")

    while true

    WshShell.SendKeys "{CAPSLOCK}"

    WScript.Sleep 100

    wend

    eDiT: ADdeD coDE

    Edit 2: Haha restarting fixed the problem, thanks I guess?

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

    Manually controlling optical disc speed?

    Posted: 27 Mar 2019 11:19 AM PDT

    Is there a program that exists that can alter this number? I couldn't find anything online, but I would think this would be fairly straight forward to develop.

    https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntddcdrm/ns-ntddcdrm-_cdrom_set_speed

    If this would be helpful

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

    Simple Multi-thread client server for Python

    Posted: 27 Mar 2019 06:45 PM PDT

    I'm trying to make a multi-threaded server that allows me to connect two Raspberry Pi Zero W's to it and send data from the Pi's to the server. The order of connections doesn't matter (the data from the pi's will tell me which raspberry pi is sending the data) so it can be asynchronous. Right now I'm using code from (Server/Client) and its not really getting the job done. I really don't have experience making multi-threaded servers and wanted to know if anyone knew of a library or way in which I can get data from my Raspberry Pi's. Thank you!

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

    How do I fetch online information using ruby?

    Posted: 27 Mar 2019 12:46 PM PDT

    I'm building a smart mirror for a bit of funal and practice. I'm wondering how I would gather information on weather, time, sunrise/set times, possibly even radar graphics.

    I would like to use Ruby as it is the language I understand best, but if there is another language that could handle the task better i would be open to learning it!

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

    Problem solving methodologies

    Posted: 27 Mar 2019 12:43 PM PDT

    The one I know is to brake the problem down to smaller problems.

    Do you know other methodologies? I look for more methodologies that can be put into practice.

    Thank you.

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

    is C++ worth learning?

    Posted: 27 Mar 2019 06:40 PM PDT

    people say C++ is hard as hell... very hard to get anything done..

    Python is much easier is practical... but i just finish 2 C++ classes in college

    not sure i should proceed learning C++ or drop it n learn python

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

    If you were to put a dictionary’s entire knowledge into a program, would it be able to create sentences on it’s own or would it need some basic knowledge?

    Posted: 27 Mar 2019 06:16 AM PDT

    FYI I am just an aspiring 15 year old who would like to create AIs in the future. Thanks!

    submitted by /u/Oblivious-VR
    [link] [comments]

    Is it possible to make a type safe operator[] that takes an enumerated type but not int?

    Posted: 27 Mar 2019 12:58 PM PDT

    I have an array Foo Waa[4]; I have an enum class Bar {Baz, Wiz, Fuz, Bang}; I want the compiler to reject Waa[0], Waa[1] etc. and accept Waa[Bar::Baz], Waa[Bar::Wiz] etc. I also want to be able to loop through the enum class Bar.

    I suspect this is possible but uses a lot of boilerplate. In this instance, this is a price I am happy to pay!

    My actual use case is accessing squares on a chess board. I find I keep accidentally passing elements of type File to arrays instead of Ranks, and I'm wasting a lot of time trying to be 'really careful'.

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

    which is the best resource to learn and build enterprise level architecture for backend service ?

    Posted: 27 Mar 2019 12:30 PM PDT

    Hi, I am a frontend engineer but I am always curious to learn these complex enterprise level backend stuffs. It's very hard to find the right pathway to learn it. I want to learn how the api, queuing, microservices and all these crazy stuffs works together practically by doing.can anyone please suggest me resources or give me any other suggestion or guidance.

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

    [C] Multi-threading shared linked list with a mutex around it

    Posted: 27 Mar 2019 04:08 PM PDT

    struct somestruct { struct linked_list* list; pthread_mutex_t lock; }; // Initialize struct pthread_mutex_lock(&somestruct->lock) linked_list* temp = newlist; temp->next = list; list = temp; pthread_mutex_unlock(&somestruct->lock) 

    In this situation when you have many threads running at once calling on above psuedo code, your mutex ends up bottlenecking fast operations.
    Is there a way to parallelize this better or is this the best it gets?

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

    Looping though two lists one element at a time

    Posted: 27 Mar 2019 03:44 PM PDT

    I have built a fuzzy string match using levenstein distance. I am now trying to feed the algorithm two lists with two conditions.

    the first condition: I want the first element in list_1 to be compared to every element in list_2 and once the comparison is finished I want the second element in list_1 to be compared to every element in list_2 and so on and so forth. list_1 is my target list.

    the second condition: I only want it to return scores of 80 or greater.

    I have been struggling with this for a while. Any help would be appreciated.

    # Import numpy to perform the matrix algebra necessary to calculate the fuzzy match import numpy as np # Define a function that will become the fuzzy match # I decided to use Levenshtein Distance due to the formulas ability to handle string comparisons of two unique lengths def string_match(seq1, seq2, ratio_calc = False): """ levenshtein_ratio_and_distance: Calculates levenshtein distance between two strings. If ratio_calc = True, the function computes the levenshtein distance ratio of similarity between two strings For all i and j, distance[i,j] will contain the Levenshtein distance between the first i characters of seq1 and the first j characters of seq2 """ # Initialize matrix of zeros rows = len(seq1)+1 cols = len(seq2)+1 distance = np.zeros((rows,cols),dtype = int) # Populate matrix of zeros with the indeces of each character of both strings for i in range(1, rows): for k in range(1,cols): distance[i][0] = i distance[0][k] = k # loop through the matrix to compute the cost of deletions,insertions and/or substitutions for col in range(1, cols): for row in range(1, rows): if seq1[row-1] == seq2[col-1]: cost = 0 # If the characters are the same in the two strings in a given position [i,j] then the cost is 0 else: # In order to align the results with those of the Python Levenshtein package, if we choose to calculate the ratio # the cost of a substitution is 2. If we calculate just distance, then the cost of a substitution is 1. if ratio_calc == True: cost = 2 else: cost = 1 distance[row][col] = min(distance[row-1][col] + 1, # Cost of deletions distance[row][col-1] + 1, # Cost of insertions distance[row-1][col-1] + cost) # Cost of substitutions if ratio_calc == True: # Computation of the Levenshtein Distance Ratio Ratio = round(((len(seq1)+len(seq2)) - distance[row][col]) / (len(seq1)+len(seq2)) * 100, 2) return "The addresses are {}% similar".format(Ratio) else: # print(distance) # Uncomment if you want to see the matrix showing how the algorithm computes the cost of deletions, # insertions and/or substitutions # This is the minimum number of edits needed to convert seq1 to seq2 return "The strings are {} edits away".format(distance[row][col]) 

    ^^that is my function

    rev_addrs = my_list1 target_addr = '830 Amsterdam ave' for addr in Prev_addrs: distance = string_match(target_addr, addr, ratio_calc = True) print(distance) 

    ^^I can get it to do one address but I cannot get it to work on two lists.

    any help would be much appreciated 

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

    Quick way to view formatted source HTML of webpage?

    Posted: 27 Mar 2019 11:32 AM PDT

    I often need to see what HTML is being returned from an HTTP response. In the past I have used CURL and 'view page source' and then put in the HTML in this site: https://htmlformatter.com/. Can you recommend a browser extension or CLI tool to view formatted page source HTML?

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

    What is a good AGE GATE plugin for WordPress that doesn't have issues with Cache?

    Posted: 27 Mar 2019 10:35 AM PDT

    Currently having an issue with our age gate plugin, where when we enable caching it creates an infinite loop stopping customers from getting to content. None of the premium plugins seem to address this issue other than the plugin named "Age Gate".

    Any of you have experience using an age gate plugin with caching?

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

    No comments:

    Post a Comment