• Breaking News

    Wednesday, October 31, 2018

    ASP.NET to Python? Ask Programming

    ASP.NET to Python? Ask Programming


    ASP.NET to Python?

    Posted: 31 Oct 2018 08:59 PM PDT

    First off if like to say I found an open source project written in asp.net that I would like to use but it's so hard to make asp.net work well on Linux and BSD.

    So I want to go on freelancer and see if anyone can rewrite the project in Python (I was thinking about using flask).

    So my questions are, How much should I pay for that, Is it ok to have someone "translate" code from an open source project into another language, Am I required to disclose that it is "translated" from asp.net to Python base on X open source project.

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

    How is satellite or rover code updated?

    Posted: 31 Oct 2018 10:22 AM PDT

    I was wondering if anyone is/was working as a developer maintaining or writing the software which is controlling the satellites in orbit or the rovers on Mars. I guess this would be a cool AMA.

    How is the code tested to make sure it will work as expected once pushed out to the satellite/rover?

    Is there a recovery procedure in place in case the software crashes? How does it work?

    When working with ecommerce websites, things sometimes go wrong and we have to troubleshoot and correct the issues either on the server or in the application. Sometimes, we have use backups to recover from system failures. Is there like reset to default that can be initiated in the case of critical failure?

    What is the programming language of choice when developing the software? C/C++, assembly?

    I just find it interesting that there dev's out there who write code which is controlling multimillion dollar machines floating or roaming in space never to come back to earth. Thanks!

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

    The emperor has no clothes.

    Posted: 31 Oct 2018 03:56 PM PDT

    As children, we all read the story "The Emperor's New Clothes". So Mike is the emperor, and well, he's naked and can't admit it. Mike's been in charge of this software project since its inception five years ago. He has made most of the decisions how it was to be built and participates in the building. There are about three dozen users, although only about eight use it daily. The sponsor who championed its deployment, retired four months ago.

    My project, by no fault of my own, closed down about a year ago. Mike's server guy was soon to retire, and I had some experience, so I was given the choice to join Mike's group, or go looking for another job. I had never seen how their system was put together, but had heard a pretty impressive sales pitch for it, so I figured I would make a go of it. I could always go looking later.

    So I'm an experienced software architect with over thirty years of experience. That experience helps me understand that any project grows cruft and technical debt. Finding that in Mike's project was pretty easy. I know better than in my first few months to be the bull in the china cabinet, pointing out every issue I find. But I soon realized they are everywhere. I ask Mike about some of the more obvious things, expecting him to say something like, "Yeah, we had to make choices between multiple evils." But much to my chagrin, he expressed pride in the choices made, and obviously expected me to compliment him and keep up the pretense of his beautiful design.

    Now I could just act like I see his clothes, or I could start making suggestion for design changes. I took that latter tactic about three months ago. At first, Mike just listened politely, but ignored anything I said or asked for. So I have ratcheted up how aggressive my points are presented continuously, now having held more design review team meetings in the past two months than Mike held over the past year.

    My other coworkers can see what's happening. The most senior, three years on the team, is also retiring in two months. He's not exactly ready to go to battle and call him naked. Another has only been on the team two months longer than myself and seems to be content to just say the clothes are there. The last team member only joined this month, and so is naturally confused by everything.

    This saga will no doubt continue for some time. I don't feel like I'm at risk, either from Mike, our users, or our common boss since I do know what I'm talking about. I'm contemplating getting to the point of telling him he is outright naked by the end of the year, but I'm not sure he will even understand. Mike's been drinking his own Kool-Aide for so long that he is convinced that everything is fine.

    What is your advice? Am I going about this correctly?

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

    How do you analyze/understand a code base?

    Posted: 31 Oct 2018 07:42 AM PDT

    Hey /r/programming — how do you go about breaking down and understanding a code base?

    I'm finding it difficult to map out all the code relationships between functions, objects, etc. and end up consuming a ton of time just flipping between files to get a basic understanding of the data flows.

    I'd be curious to hear your best practices and tips.

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

    Companies main web application reliant on dying library and no one cares

    Posted: 31 Oct 2018 09:51 AM PDT

    This may not be the best place to ask this. If it belongs somewhere else please let me know and I will move it.

    As the tile says our companies main web application is heavily reliant on a library that is barely maintained. I have been warning about this dangers of this since I started working for the company. Today while working on a new feature (as our clients never stop wanting more). I noticed that a small but very use full function of this library has stopped working as it relies on depreciated functionally that from today will start effecting clients. To me this is a very bad sign. The last stable version of this library was released over a year and a half ago.

    So... How do I get my colleagues to listen when I say if we don't do something soon, we will be in trouble? Considering they never paid attention before.

    I currently work for a small engineering company. We make data recording devices. The data from these devices gets record to our main database for our primary web application to process analysis and display this data to our users. They can also do a large number of other task with this data on the site. The site is of a good size ~ 1/2 million lines of js in the front end alone. Saying that the entire site is so tightly coupled it might as well be considered a monolith, with little distinction between anything. I could talk for days on all of the sites flaws but that is a rant for another time. BTW there are also ZERO unit tests or documents as the "Senior" dev does not believe in them.

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

    Python TCP File Transfer Client/Server - Download gets empty file, Upload gets nothing

    Posted: 31 Oct 2018 04:04 PM PDT

    Currently writing a TCP file handling client/server in Python.

    When the client inputs "get [filename]", they are supposed to have that file sent to them from the server. When they input "put [filename]" the file they specified is uploaded to the server. (There is also a list function I haven't implemented yet.)

    However, my problem is, so far, the "get" requests just create an empty file with the name. The "put requests" just do nothing, no files created or anything.

    Would really appreciate some help!

    Client.py

    import socket import sys import os host_name = "127.0.0.1" port_number= 5000 def put(input_command): client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect((host_name,port_number)) client_socket.sendall(input_command.encode()) string = input_command.split(" ",1) filename = string[1] with open(filename, 'rb') as upload_file: for data in upload_file: client_socket.sendall(data) print("File uploaded.") client_socket.close() def get(input_command): client_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) client_socket.connect((host_name,port_number)) client_socket.sendall(input_command.encode()) string =input_command.split(" " ,1) filename = string[1] with open (filename, "wb") as download_file: file_size = os.path.getsize(filename) bytes_received = 0 while bytes_received<file_size : data = client_socket.recv(4096) download_file.write(data) bytes_received +=len(data) download_file.close() print("File downloaded.") client_socket.close() client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect((host_name,port_number)) while(1): print("Enter your command") #TODO- be more...helpful input_command = input().strip() string = input_command.split(" ",1) if (string[0] == "put"): put(input_command) elif (string[0] =="get"): get(input_command) 

    Server.py

    import socket import sys import os portnumber = 5000 ipaddress = socket.gethostbyname("0.0.0.0") print("IP Address: ", ipaddress, "Port number: " , portnumber) print("Directory: ", os.getcwd()) server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: server_socket.bind(("0.0.0.0", portnumber)) server_socket.listen(5) print("Socket bound") except Exception as e: print(e) exit(1) while(5): conn, addr = server_socket.accept() print("Client connected.") reqCommand = conn.recv(1024) print("Client request: """ %(reqCommand)) if (reqCommand == "list"): ##TODO- implement list print("List") else: string = reqCommand.split(' ',1) filename = string[1] if (string[0] == 'put'): with open(filename, 'wb') as upload_file: while True: file_size = os.path.getsize(filename) bytes_received = 0 while bytes_received< file_size : data = conn.recv(4096) upload_file.write(data) bytes_received +=len(data) upload_file.close elif (string[0] == 'get'): with open (filename, 'wb') as download_file: file_size = os.path.getsize(filename) bytes_received = 0 while bytes_received<file_size : data = conn.recv(4096) download_file.write(data) bytes_received +=len(data) download_file.close() server_socket.close() 
    submitted by /u/simmeh-chan
    [link] [comments]

    Trying to create a multiplication table in C# (Visual Studio)

    Posted: 31 Oct 2018 03:23 PM PDT

    Just got into programming recently, so I'm having some trouble creating a For Loop. Basically, I have to create a C# program that allows a user to enter a number, after which they press a button and it displays a multiplication table in an output label. It should say (if say the user enters the number 2 for instance) "2x1=2, 2x2=4, 2x3=6", etc on up to 12 each on its own line. Here's what I have to far, which isn't working.

    private void button1_Click(object sender, EventArgs e) { Decimal userinput = Convert.ToDecimal(txtNumber.Text); for (int i = 1; i <=12, i++) { Console.WriteLine(i, i * 2); } lblOutput.Text = Console.ReadLine (): } 

    Unsurprisingly, it doesn't work. Probably because my code is shitty and I have no idea what I'm doing. Any help would be much appreciated.

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

    In C : why is this showing me the numbers 1-20 instead of the first 20 multiples of 3.

    Posted: 31 Oct 2018 03:05 PM PDT

    #include <stdio.h>

    main (){

    int num=0,multi=0; while(multi<20){ num++; if(num%3==0);{ printf("%d ",num); multi++; } } 

    }

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

    My basic C# unit converter never finishes calculating. What's wrong?

    Posted: 31 Oct 2018 01:26 PM PDT

    It launches without any errors in visual studio, but once it gets to these following lines it just sits there, not doing anything, it doesn't close or give any indication of anything happening either. What's up?

    WriteLine("How many degrees celsius would you like to convert?");

    WriteLine(double.Parse(ReadLine()) + " celsius is the same as " + (32 + ((9 * double.Parse(ReadLine())) / 5)) + " fahrenheit and " + (double.Parse(ReadLine()) + 273.15) + " kelvin.");

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

    Structs help and vector

    Posted: 31 Oct 2018 12:50 PM PDT

    Hello! So, I'm studying computer engineering, and I'd like some help with structures. It's the first time I hear about this kind of thing so I'm not familiar at all.

    We got this example

    typedef struct { ... ... } vector;

    and I have no idea what it means. Same for vector. I'd appreciate some help over here!

    edit: programming in C

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

    Build a data entry program?

    Posted: 31 Oct 2018 09:00 AM PDT

    So when I play most competitive video games I like to be able to track my stats. For years now I've been doing this manually on a google spreadsheet, but the other day a friend suggested that I could probably program a relatively basic interface to enter and store the data, and have more options to view the output or a summary of the statistics in a less convoluted and clunky way than excel.

    In my head, it would just be a series of pop up boxes prompting entry of specific information, either manual or drop down, that then is then logged in a database that can searched and filtered to show various information.

    I don't have any programming experience, so I really have no idea if something like that would be simple (albeit hard for a newbie), or if its likely to take a ton of work. I'm mostly here to ask whether it sounds doable, and if so how I should go about getting started.

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

    What programming language to learn next

    Posted: 31 Oct 2018 08:55 AM PDT

    Over the last year on and off I've been learning HTML and CSS. What language should I learn next. I want this to be something employers would want. My goal is to end up doing freelance work on the side/get a job. i've been suggested to learn Python by a friend. For context I'm still in school.

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

    Linking problem on Linux with mingw

    Posted: 31 Oct 2018 12:27 PM PDT

    I'm trying to compile a GIMP plugin I've written. It's 100% seamless to compile for Linux:

    gimptool-2.0 --build my_plugin.c 

    and it's done. Unfortunately, I couldn't find a suitable replacement for Windows, so I'm trying to cross-compile it in Linux with MinGW. Here's what I'm trying:

    i686-w64-mingw32-gcc \ -L libgimpui \ -I /usr/include/gimp-2.0/ \ -I /usr/include/cairo/ \ -I /usr/include/gegl-0.4/ \ -I /usr/include/glib-2.0/ \ -I /usr/lib/x86_64-linux-gnu/glib-2.0/include/ \ -I /usr/include/babl-0.1/ \ -I /usr/include/gdk-pixbuf-2.0/ \ -I /usr/include/gtk-2.0/ \ -I /usr/include/pango-1.0/ \ -I /usr/lib/x86_64-linux-gnu/gtk-2.0/include/ \ -I /usr/include/atk-1.0/ \ IFS.c 

    But I get a billion linking errors such as /tmp/ccqzsEYQ.o:my_plugin.c:(.text+0x24): undefined reference to 'gimp_main'. I also have tried to use gimptool's --msvc-syntax argument, which leads me to this:

    i686-w64-mingw32-gcc -pthread -I/usr/include/gegl-0.4 -I/usr/include/json-glib-1.0 -I/usr/include/babl-0.1 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gimp-2.0 -o 'my_plugin' 'my_plugin.c' -lgimpui-2.0 -lgimpwidgets-2.0 -lgimpmodule-2.0 -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0 -lgimpcolor-2.0 -lgimpbase-2.0 -lgegl-0.4 -lgegl-npd-0.4 -lm -Wl -lgmodule-2.0 -pthread -ljson-glib-1.0 -lgio-2.0 -lbabl-0.1 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype 

    This gets me ~25 errors all of the same type: /usr/bin/i686-w64-mingw32-ld: cannot find -lgimpui-2.0.

    I would be very interested in suggestions or comments! Thank you!

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

    Except Qt, what are my options to make cross platform GUI desktop apps in 2018?

    Posted: 31 Oct 2018 03:29 AM PDT

    I would like to stay away from Qt and use something 100% libre by default. What are my options in 2018 for the cross-desktop dev (Win, Max, Lin)?

    For people asking why not Qt, well, they limit the open source (not libre) version. The commercial version allows to use you a lot more features, plus the linking makes everything more complicated. I also don't like that things can change with Qt in the future like in the past with KDE. I just don't like the language like "pretty much solved" https://www.kde.org/community/history/qtissue.php so Qt is not an option. I understand that it migh be easier to develop crossplatform things in but I will always kindly refuse Qt ;)

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

    Should I take Another semester of java or try C#

    Posted: 31 Oct 2018 11:56 AM PDT

    Right now i am in Java Programming, doing okay in it. Basically my whole list of programming classes i have taken is

    1 semester of beginner c++ (joke class learned nothing)

    1 semester of c++ (basically where i learned alot of the fundamentals)

    1 semester of Java (basically using the same fundamentals but in java (only half way through the course since i am taking the class now))

    I wanted to know peoples opinions on if i should continue java for next semester which involves building android apps or try a new language (c#) for one semester.

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

    PHP File Usage

    Posted: 31 Oct 2018 11:29 AM PDT

    Folder Organization

    ~~~ +lab03 | + princessbride | | | + info.txt
    | + tmnt | | | + info.txt
    | + mortalkombat |
    + info.txt ~~~

    My PHP code

    ~~~ <?php

    $movie = $_GET["film"];

    if(is_null($movie)){ header('Location: http://endless.horse/'); }else{

    $file = "/lab03/" . $movie; $line = file($file . "/info.txt"); 

    }

    ?> ~~~

    $movie is got by url in that way --> /lab03/movie.php?film=princessbride

    My PHP Error

    Warning: file(/lab03/princessbride/info.txt): failed to open stream: No such file or directory in /opt/lampp/htdocs/lab03/movie.php on line 11

    line 11 is ~~~ $line = file($file . "/info.txt"); ~~~

    Request

    Can someone help me? I don't understand my error.

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

    Division Algorithm I need to convert to Assembly, but I don't fully understand the Pseudo-code

    Posted: 31 Oct 2018 10:29 AM PDT

    https://i.imgur.com/7a1vNsL.png

    N for the numerator (dividend), D for the denominator (divisor), Q for the quotient and R for the remainder.

    The lines I don't fully understand have red arrows. Do you start off counting the amount of bits in N, then have a for loop that gets the (n-1) bit and then does the calculations in the for loop? Am I understanding that right? Could someone explain the other two lines too?

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

    Byte Order Mark Problems

    Posted: 31 Oct 2018 06:39 AM PDT

    Is there any reason, while reading a file, that the Byte order mark would only be partially recognized? I'm writing a java program that's reading a file and printing modified data in a new file. The file is being ready as UTF-8 encoded, so there's 3 BOM characters, \u00EF \u00BB and \u00BF, but at the beginning of every file my program prints a \u003F which is '?' and I can't figure out why. A regex replace on the BOM characters doesn't remove it, nor does a regex replace on \u003F. So It must be inserted AFTER the file is read. But I can't figure out whats going on. Has anyone run into this?

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

    How can I auto click the black squares on my MacBook or Ubuntu VM?

    Posted: 31 Oct 2018 09:27 AM PDT

    We are playing this flash game at work: http://www.donttap.com/

    Photoshop is not an option, that would be unfair.

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

    Need Help with .BAT File [N00B]

    Posted: 31 Oct 2018 08:54 AM PDT

    Help with setting up a Kik app Bot in Kik Groups.

    Posted: 31 Oct 2018 08:12 AM PDT

    Sorry if this is the wrong place to post, but I couldn't really find where else. Anyways, here's the story:

    Earlier a few days ago, I joined a public Kik group chat on the app. In that group chat, they have a bot that is listed as an actual member in the group (rage bot). For this bot, you never have to mention them in order to talk to or summon him in a group chat. Aka, you never have to type @botname to bring him into the conversation in a group chat.

    So for example, if I wanted to know the rules of the group, then anyone could just type "group rules" and the bot will reply with the rules. And at any other time, the rage bot will jump into the conversation whenever certain other keywords or phrases are said or when certain events happen.

    That's how I want my bot that I created to work for my group chat with my friends, but I don't know how to set it up like that.

    After some digging (this is how rage bot works), I figured out that I need to set the bot up to where I can PM the bot "usage" and that will allow me to add him as a friend so I can then add the bot to the group as a member. When I tried this with my bot, it wouldn't even find my bot when I searched for him to add him to the group. But this does work with Rage Bot.

    Here's a video of rage bot. I need my own bot to do this.

    I used Dialogflow to setup and configure my chat bot, but after finally getting in contact with them, they said that it's "out of their scope".

    Anyone have any idea of how to do this?

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

    Semantic Web in practice

    Posted: 31 Oct 2018 07:48 AM PDT

    So I'm trying to learn more about the Semantic Web. I think I get the general idea and concepts, but I can't seem to find much about the practical applications (like examples with actual code) of stuff like RDF, SPARQL, etc.

    Is the Semantic Web even relevant in 2018? Can anyone point me in the right direction?

    submitted by /u/diasporic-acid
    [link] [comments]

    Is there a difference between "curl"-ing a url and just typing it into a browser?

    Posted: 31 Oct 2018 07:34 AM PDT

    I understand that a browser has more infrastructure so the command might take longer to execute, but is there a difference in the information that gets sent in the request, and the info that is returned?

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

    What are some use cases for real-time log shipping of web application logs?

    Posted: 31 Oct 2018 06:01 AM PDT

    At work I have ~100 webservers and I'm considering setting up real-time log shipping, i.e. copying application logs from all servers to a central location as fast as possible. I currently have logrotate setup to copy logs when they get rotated every 24h, but that doesn't let me do real-time application debugging. In considering solutions, I'd like to know if there are any other use cases for this kind of stuff beyond debugging.

    I already have a New Relic setup, so that takes care of APM etc. Is there any other reason I'd want to read my logs in real-time?

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

    No comments:

    Post a Comment