• Breaking News

    Sunday, October 14, 2018

    Computer science teachers (and still working older programmers/developers): What has changed in the last 20 years? Ask Programming

    Computer science teachers (and still working older programmers/developers): What has changed in the last 20 years? Ask Programming


    Computer science teachers (and still working older programmers/developers): What has changed in the last 20 years?

    Posted: 14 Oct 2018 09:45 PM PDT

    I cut my teeth on coding as a high schooler banging out class/HW exercises in turbo PASCAL. After taking your typical 3 semester lower division intro CS classes in college, I never really touched any code at all unless you count some scripting-type stuff in MATLAB. The main threads of what I remember in broad strokes from my c/c++ based programming I,II, III consisted of string operations, data structures, and object oriented principles and practices. It's all a blur. Everything I'd used to work on, including the IDE itself (such as they were in the pre-graphic days), fitted on a floppy. (<1.44 MB for those not in my target audience.) I lost a lot of sleep back in the day, but I confess I regard Borland fondly and with nostalgia.

    Fast forward to today, I am completely overwhelmed by what I see. Python seems to be the teaching language of choice for many structured courses. not too scary. However, the IDEs in use, such as MS Visual Studio, appear absolutely monstrous compared to text based and command line environment I used to work on. People now talk about "code refactoring"(?) and it isn't rare for collaborative project assignments involving the use of CVS code management tools, which I was aware of as a young student but was never required to learn. Similarly, competency with debugging tools/techniques appear to be a must.

    I feel like I'm functionally starting from scratch, as the total mentality and attitude in writing code and software development has evolved beyond what I experienced as a young student. (edit: Or maybe I just received a REALLY bad education without the real world experience to realize it.) The rise of mobile devices appear to have made languages like Objective-C & Swift popular for aspiring developers in the Apple camp. In that vein, I've been given lots of "advice" from those with specific goal-oriented motivations in acquiring programming skills/experience. I don't necessarily want to help build the next release of "Call of Duty" or engage in commercial work. I'd like to think I'm seeking to be a well-rounded generalist with a good set of core skills. But it would be nice to become proficient enough with parallel programming techniques/methods to use today's modern hardware to crunch pattern matching problems. Until I realized how rusty I'd become on the basics, I foolishly believed I could pick up OpenCL, CUDA, and OpenMPI without too much trouble. Such as things are, I need to spend some time "learning to walk" again, so to speak. But it sure feels like I'm an Earth-born Terran navigating an alien planet with toxic atmosphere and a different gravity, lol. I have no idea how much effort is really involved ahead of me at the moment. But if there is anything you can offer that can help me get a lay of the land to better get from here to there, it would be much appreciated.

    tl;dr: Trying to brush up after taking classes but never using programming skills since the 2000s. Not a complete N00b, but feel like one given the changes in the last 20-ish years. seeking advice.

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

    Why would we want to increment a pointer in C?

    Posted: 14 Oct 2018 12:51 PM PDT

    I am learning about pointer increments, and I was wondering what the use of increment to a pointer would be.

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

    Is CMake + Visual Studio + CLang possible?

    Posted: 14 Oct 2018 10:54 PM PDT

    Hello!

    I'm currently using CMake to build my project in Visual Studio. This gives me the best of both worlds [when Visual Studio doesn't crash/bug], but I'd like to really get the best of everything by adding CLang into the mix. Using CLang as my compiler would allow me to use clang-tidy to do some linting and static analysis on my project.

    Is using CLang with Visual Studio and CMake possible? How can I do that?

    Here's my CMakeLists https://github.com/Pierre-vh/Moonshot/blob/master/CMakeLists.txt

    Thank you!

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

    How to select a random line from a file in Python?

    Posted: 14 Oct 2018 10:01 PM PDT

    Hey guys, I'm trying to make a twitter bot that suggests a random destination to visit.

    Current basic script is

    from twython import Twython # fill in your 4 keys in following variables C_key = "MY C KEY" C_secret = "MY C SECRET" A_token = "MY A TOKEN" A_secret = "MY A SECRET" myTweet = Twython(C_key,C_secret,A_token,A_secret) myTweet.update_status(status="Hi reddit, this works! I need to replace this with a random line from a text file") 

    Works fine for posting a single thing to Twitter.

    I have a text file called destinations.txt which looks something like this:

    Wolf's Lair, Poland Worlds End Xochimilco Yakushima Yellowstone National Park York Minster Yosemite Zambezi Zimbabwe 

    What would be the best way to do this? I'm basically 100% new to Python.

    Thanks

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

    Homework help

    Posted: 14 Oct 2018 09:56 PM PDT

    Two students, A and B, in csc 102 compared their grades (0 <= <= 5_ in the first 3 quizzes . Grades for A: a1, a2, a3 Grades for B: b1, b2, b3

    If a1>b1 then A receives one point If a1<b1, then B receives one point If a1=b1 then neither student receives a point

    Given the grades of A and B, you are asked to write a C++ program to print the point totals of the two students.

    Input Format:

    The first line contains three space-seperated integers: a1, a2, a3 The second line contains three space-separated integers: b1, b2, b3

    Output Format: Print space separated integers denoting the respective point totals earned A and B

    Instructions: Run your program using different sets of input to validate it. Provide 1) the C++ program developed, 2) inputs used, and 3) output

    • So this is a intro to c++ class and I asked a friend who mentioned something called "adding a counter" but I have no idea what that is because we never covered it, so what is the simplest way to do this?
    submitted by /u/leem1999
    [link] [comments]

    Help with output format, how do you add up the points. This is introduction to c++ and I am completely new so a whole complicated thing isn’t going to help lol.

    Posted: 14 Oct 2018 09:45 PM PDT

    Two students, A and B, in csc 102 compared their grades (0 <= <= 5_ in the first 3 quizzes . Grades for A: a1, a2, a3 Grades for B: b1, b2, b3

    If a1>b1 then A receives one point If a1<b1, then B receives one point If a1=b1 then neither student receives a point

    Given the grades of A and B, you are asked to write a C++ program to print the point totals of the two students.

    Input Format:

    The first line contains three space-seperated integers: a1, a2, a3 The second line contains three space-separated integers: b1, b2, b3

    Output Format: Print space separated integers denoting the respective point totals earned A and B

    Instructions: Run your program using different sets of input to validate it. Provide 1) the C++ program developed, 2) inputs used, and 3) output

    • So this is a intro to c++ class and I asked a friend who mentioned something called "adding a counter" but I have no idea what that is because we never covered it, so what is the simplest way to do this?
    submitted by /u/leem1999
    [link] [comments]

    Can't figure out how to find smallest Index our of three IndexOf [Java]

    Posted: 14 Oct 2018 09:21 PM PDT

     index0 = userReply.indexOf(topic0); index1 = userReply.indexOf(topic1); index2 = userReply.indexOf(topic2); if (index0 != -1 && index0 < index1 && index0 < index2) { smallestIndex = index0; }else if ( index1 != -1 && index1 < index0 && index1 < index2){ smallestIndex = index1; }else if (index2 != -1 && index2 < index0 && index2 < index1) { smallestIndex = index2; } 

    hopefully that code is enough, I am working on an assignment but cant seem to work this bit out, basically i want smallestIndex to take the value of the true smallestIndex but as they return as -1 I believe this is causing some issues.

    Suggestions please!

    Edit: before anyone says yes i know it's poorly laid out and done this is a introductory class please go easy on me :)

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

    Why Is there a base64 size difference between a generated UIImage, and a referenced local image?

    Posted: 14 Oct 2018 08:58 PM PDT

    I have two base64 strings, that are generated from the same image. One is generated after the initial capture of an image (relevant conversion code below) and then it is saved to the user's disk, and the other is generated through an Ionic plugin called "Image-Picker". Now when I went to compare the two images, I noticed that the "picked" one was almost 2.5 times smaller than the one that I originally captured.

    The only thing I can think of is that the originally captured image is converted into a UIImage, and then converted into a base64 generated image, but I'm not sure why that would add so much extra overhead to the base64 size.

    let UIImage = UIImageJPEGRepresentation(image!, 0.85)!

    let base64Image = UIImage.base64EncodedString(options: .lineLength64Characters)

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

    Any tips or programs that can help organize a growing pdf library?

    Posted: 14 Oct 2018 07:05 PM PDT

    I'm not sure if this is the right place for this or not, but I'll ask anyways. I find that as I develop my programming skills, I've accumulated more and more pdf files of documentation and e-books that are growing more and more disorganized. Right now, I just have one big folder with a few subfolders. But, I was wondering if anyone knew of any programs that are helpful for maintaining a pdf library?

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

    How do you troubleshoot DNS/Apache configuration problems?

    Posted: 14 Oct 2018 02:35 PM PDT

    I'm having a problem with a subdomain redirecting to another domain and I can't figure out where the problem is. What do you guys do to troubleshoot these kinds of problems?

    Also, any tutorials or documentation for setting up servers with multiple domains would be greatly appreciated too. Thanks!

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

    Why are noobs being told to learn programming in very high level languages like Python or Java? Why not C?

    Posted: 14 Oct 2018 05:43 AM PDT

    I've seen many websites, blogs and even here on Reddit where people new to programming languages are told to learn Python. About 15 yrs ago when I was in university, we were taught Java as a part of curriculum.

    I believe this is bad. These languages do not have any semblance of the computer that it's actually running on. Eventually, I've heard veteran programmers telling things like, "I don't care, I'll create as many threads and let Java do what's needed" or "Why do I have to know about dependencies, Maven will handle it" and so on.

    Maybe it's just me or has others come across these kinds of "veterans" because they lack understanding of computers? Why are so many advised to learn basics using unrealistic languages that focus purely on algorithms and not the hardware it runs on?

    Edit: Lots of people have commented about things that are beyond the scope of this discussion.

    About 10 yrs ago I came across a piece of code that kept track of power states on various lines. When there were voltage fluctuations this would send out a block showing the reason for such fluctuation or even power failure. It worked for 99% times, but when it came to the last power source it failed. Developers blamed hardware team, hardware team blamed the poor manufacturing quality and so on.

    This feature wasn't important, at least no spec or standards mandated this feature. But this feature could've helped those field operators a lot. They didn't have to walk/drive in desert sun for several kilometers to pull out the sensors from pits. They could've sat in their cozy air-conditioned rooms monitoring status.

    When I dug inside, I found it was tracking power states as bit fields stuffed inside a struct. No wonder it wasn't working that fast. I converted it into an array and did some bit manipulation fuckery. Code was ugly, lot of my colleagues opposed, but it worked - Even in that last moment when sensor was running on borrowed time due to super caps. This is not that 3% critical code Knuth noted. But it helped reduce a few man hours.

    This humane responsibility is something that's missing in modern developers who only strictly focus on absolute business needs. Note, again, this has nothing to do with optimisation, but efficient and correct programming. I felt this is likely because of the way people are learning programming and I asked this question. But somehow the discussion seems to have diverged far off.

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

    How to beat junior dev salary by going self employed?

    Posted: 14 Oct 2018 02:27 PM PDT

    hello. I wonder how to, or better said, how likely it is that junior software dev can beat his salary by going self employed?

    Of course one way is to develop a product and sell it, but hey, that's way harder and less likely to achieve in comparison to..... finding clients and work for them, or in other words, contracting your ass out. So lets take a look at working for clients.

    The math. Average salary for junior dev in US is 70kUSD, after tax that's about 54kUSD. The point is that junior software engineer is one greedy mofo and wants to earn one fold more as in 9-5 employment. Therefore target net income becomes 108kUSD. As self employment taxes and health insurance eats half of income, this means that we need to earn 216kUSD. Yayks. Further, in a year one would probably have 1 month for vacation and sickness, and 3 months of gaps when searching for clients. Therefore there is 8 months of productive time. At 160 work hours per month, that's 8x160=1280 of work hours per year. If we divide 216kUSD by 1280 hours, we get hourly rate which is 168,75 bucks/hour....

    Seriously? Who is going to pay you that amount of money? I think that's a hourly rate that sw dev agencies charge, and those are some serious mofos with decade of experience.

    In fact, I've googled what's the hourly rate for junior contractors - it ranges between 40 to 60 bucks. Way less than we need. Further, if we take 50bucks per hour and assume 1280hours of work per year (same as before), that's 64kUSD per year or about 32kUSD after tax and health insurance. Is moral of the story don't contract your ass out because it's totally not worth it?

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

    Help converting to binary in VB multiple times

    Posted: 14 Oct 2018 01:51 PM PDT

    Hey everyone, this is my first post on this sub. I have an assignment where I have to use Do While Loops and For Loops to convert a number (entered with a textbox) into binary with bases from 2 to 7 and output to a list box. Any idea on how I can do that?

    Public Class Form1

    Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click

    Dim num As Integer

    ' Dim base As Integer

    Dim outString As String = ""

    Dim remainder As Integer

    'For base = 2 To 7 Step 1

    num = CInt(txtIn.Text)

    Do While (num > 0)

    For base = 2 To 7

    remainder = num Mod base

    num = num / base

    outString = CStr(remainder) & outString

    Next

    Loop

    ' Next

    lstOut.Items.Add(outString)

    End Sub

    End Class

    this is my code, please help!

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

    Do students own their homework / project code? Can I push my school work to public repos?

    Posted: 14 Oct 2018 01:49 PM PDT

    Assuming the code is not largely based on a skeleton code given by school, I see no reason to deny students ownership of their work, which means they should be able to upload and showcase their work on github public repos. Some of the school projects at my school are rather complicated and are worth showcasing, some of them are even drivers for specific sensors / boards and can be developed into an open source project later.

    However my professor said multiple times not to push code to public git repos, even after semester ends. Is there any legal basis to their statement? What kind of trouble will I get into if I use public repos anyways?

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

    Anyone willing to help with some javascript or coffeescript for an ubersicht widget ?

    Posted: 14 Oct 2018 01:03 PM PDT

    I am looking for some help writing an ubersicht widget to display NHL standings on my desktop. I am getting the standings from https://statsapi.web.nhl.com/api/v1/standings I am able to do the css styling, just not anything else. Haha. The widget needs to be written in Coffeescript or javascript. Any help would be awesome. It's driving me crazy trying to figure it out.

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

    What are the differences between GPL version three, and the Apache Licence?

    Posted: 14 Oct 2018 12:46 PM PDT

    Just all the differences between JUST GPL version three and the Apache Licence

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

    How differently are pointers and array represented in memory in C?

    Posted: 14 Oct 2018 12:21 PM PDT

    I'd like to know how differently pointer and arrays are treated in C. I know this is not part of the C standard and is implementation defined, so I'll give an example in my Linux computer. If I create and assign an array as int a[1]; a[1]=0; the relevant part of the assembly code is:

     .cfi_def_cfa_register 6 subq $16, %rsp movq %fs:40, %rax movq %rax, -8(%rbp) xorl %eax, %eax movl $0, -16(%rbp) movl $0, %eax movq -8(%rbp), %rdx xorq %fs:40, %rdx je .L3 call __stack_chk_fail .L3: leave .cfi_def_cfa 7, 8 

    While int*p; *p=0; translates to:

     .cfi_def_cfa_register 6 movq -8(%rbp), %rax movl $0, (%rax) movl $0, %eax popq %rbp .cfi_def_cfa 7, 8 

    It seems that a pointer involves less operations, which makes sense, but I'd like to know in plain language what's happening here.

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

    Question about loose coupling with data objects

    Posted: 14 Oct 2018 11:54 AM PDT

    I'm working on a project where I find myself reaching through (active record) data objects frequently to maintain a normalized data model:

    Organization -> Place -> ImageObject -> description 

    and the like. I realize this tightly couples my various data models (Organization, Place, and ImageObject in this example). Is this okay in the context of a normalized data model? Is there a good alternative? Is this just inherent in AR ORMs, and something I'd avoid using a data mapper ORM?

    Denormalizing the model is a separate issue and I understand various trade-offs with doing so. My question is more about coupling when denormalizing isn't appropriate.

    submitted by /u/calligraphic-io
    [link] [comments]

    I tried hosting a bot on Heroku, I installed the CLI and Git but I still cant do $ heroku in cmd (I'm a beginner don't judge me lol)

    Posted: 14 Oct 2018 06:30 AM PDT

    Is it safe to unpickle this in python? (spoilers for python challenge)

    Posted: 14 Oct 2018 05:54 AM PDT

    I'm just starting to learn a little bit of python, and I'm doing the puzzles on pythonchallenge.com.

    I've got to one about pickling/unpickling, and I think I'm meant to unpickle the characters I found here: pythonchallenge.com/pc/def/banner.p .

    However, when I was reading about pickling/unpickling, it said to never unpickle from a source you don't trust.

    I don't know/trust the guy who made the puzzles, but I think maybe it is okay to unpickle these characters because there are so few of them, he couldn't harm my computer by me unpickling it?

    ps. I only want to know if it is safe to try to unpickle those characters, not if I am on the right track with the puzzle :)

    Edit: also here is the page for this puzzle: http://www.pythonchallenge.com/pc/def/peak.html

    inspect element for the clues

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

    Is the term "publisher" used to refer to what we know as front end developers or is this just a local thing in China?

    Posted: 14 Oct 2018 01:28 AM PDT

    mDNS for resolving a .local hostname (Windows Embedded Compact 2013)

    Posted: 14 Oct 2018 03:49 AM PDT

    Hello All,

    I'm tyring to use mDNS on a Windows Embedded Compact 2013 device to resolve a .local hostname from a DNS server from the same subnetwork. I used the code below on a test program (4.7.1 .NetFramework Application) and it succesfully received an answer with the SRV record. But my code does not work on my Windows Embedded Compact device, as the server does not receive my query.

    So my question is as following: is this code not valid for a Windows Embedded Compact 2013 device or am i missing something?

    Other solutions for my problem are very welcome and i'm thanking you in advance.

    IPEndPoint mdnsEndpoint = new IPEndPoint(IPAddress.Parse("224.0.0.251"), 5353); IPEndPoint anyEndpoint = new IPEndPoint(IPAddress.Any, 0); sender = new UdpClient(mdnsEndpoint.AddressFamily); sender.JoinMulticastGroup(mdnsEndpoint.Address); IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, 5353); UdpClient receiver = new UdpClient(mdnsEndpoint.AddressFamily); receiver.Client.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); receiver.Client.Bind(endpoint); receiver.JoinMulticastGroup(mdnsEndpoint.Address); // Packet contains a DNS query with a question for a .local hostname sender.Send(packet, packet.Length, mdnsEndpoint); new Thread(() => { while(true) { var result = receiver.Receive(ref ipEndPoint); // Process result... } }).Start(); 
    submitted by /u/blueballsisworst
    [link] [comments]

    No comments:

    Post a Comment