• Breaking News

    Monday, July 1, 2019

    Are there any common error messages in C or python that are the bane of your existence. Ask Programming

    Are there any common error messages in C or python that are the bane of your existence. Ask Programming


    Are there any common error messages in C or python that are the bane of your existence.

    Posted: 01 Jul 2019 12:33 PM PDT

    I'm clearly programmilliterate, but my husband is a software engineer primarily in C and python and I'm trying to think of a funny quote to put on something custom for his birthday in August. I hate the cringey stuff you see at the mall on tshirts and mugs, so I was thinking something annoying or frustrating. Are there any error messages that would make sense?

    Thanks for any feedback.

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

    Feedback for idea (in Python): Creating generic interface for pluggable message/task brokers/queues and changing core architecture of and for current implementation

    Posted: 01 Jul 2019 10:00 PM PDT

    I am developing on a software project that at this moment is based on a REST API changing documents on a DB, that DB pushing those changes to 'Producers' who parses them, pushes those as workitems to a Redis Task/Message Queue (the horror), 'Workers' picking those up and sending them to 'Handlers' who execute them, and afterwards the Workers pushing the results back on the queue.

    My idea would be to change this principle in two ways:

    (1) First, I'd like to simplify and have the REST API directly put things on the queue, Workers picking them up and both be responsible for updating the DB and sending it on to the Handlers. Rollback if necessary. This avoids producers and seems simpler (2) A pluggable/generic interface that hides the specific Message/Task Queue/Broker used to allow to serve different types of use cases with different performance requirements. For instance, I'd like to be able to use Kafka, Faust, Pulsar, MQTT (Mosquitto) and others

    What do you think? Especially for (2) a good idea or something similar?

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

    How to align items in CSS by their edges

    Posted: 01 Jul 2019 03:42 PM PDT

    https://imgur.com/a/EwNLf9I

    Hi all. I am working on a screen in react native using CSS styling and flexbox. The linked image is what I am going for.

    The black frame represents a view, and the red and blue boxes are each individual components inside that view. I want them to be centered in the view (both vertically and horizontally), with the blue box's center at the exact middle of the view, with the red box's bottom edge aligned with the bottom edge of the blue box.

    Setting alignItems or alignSelf to flex-end drops items all the way to the bottom of the view. Is there a way to align the red box with respect to the blue one, while keeping the blue one vertically centered in the current view (without setting specific heights or using absolute placement, I want this to scale for different screen sizes)?

    Thanks for the help!

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

    Laptop doesn’t seem to use the same DNS as other computers.

    Posted: 01 Jul 2019 03:32 PM PDT

    This is pretty funny. I have a rpi nginx reverse proxy going where ports 80 and 443 are pointed. When I call my external ip from outside the network, everything works as intended. When I call the same url from the local network I get the wrong website! On my Linux laptop, I call web.site.com I'll get "Not Found". On my windows desktop, calling web.site.com I'll get the right site! I believe that I forced the desktop to use google's dns (8.8.8.8), but when I call from Arch it says I'm using the router's DNS on the resolv.conf. Is this strange?

    I am running a dhcp on the router and I've tried to place both my ISP's DNS and Google's DNS IPs to no effect. Can anybody point me in the right direction?

    submitted by /u/Frederic-Henry
    [link] [comments]

    Need ideas for a project

    Posted: 01 Jul 2019 10:18 PM PDT

    Hi y'all,

    I am making my personal website (graduating soon) and wanted it to stand out with a nice feature. Does anyone have a recommendation, as wild as it may be, I'll consider it.

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

    Whats a live peer2peer network specialized in publish/subscribe where each peer publishes, and each peer may subscribe to a small set of other peers, a very small data (such as 10 bytes of their game controller inputs) 10-50 times per second?

    Posted: 01 Jul 2019 07:56 PM PDT

    There are limits of what home and mobile internet connections will allow of number of simultaneous connections with other computers, regardless of how little bandwidth in total it uses (such as if the whole thing of many users to and from your computer is less than watching a video).

    In bittorrent there is a bottleneck of number of unique things to search for, which led to a small set of centralized "trackers" which peers publish the claimed existence of bitstrings they have parts of and offer to others to download from them and request to download the other parts from others. IPFS is similarly bottlenecked. Even if we limit such a peer2peer network to 4 computers per IPv4 (allowing 4 specific ports that each LAN may use) thats up to 16 billion computers which is a bottleneck to even publish the existence of your address to, so that other peers may find your content if they search for it. By content, I mean for example if a million people at a million computers wanted to publish in realtime their mouse moivements (such as 4 int16s of x y position and velocity so 8 bytes per time cycle, and a time cycle may be 1/16 or 1/32 of a second)... thats 8 bytes per user per time cycle, and 16*8=128 bytes per second per user, and 128 megabytes total to become searchable (by ipv4:port of which there are a million at any one time, not by content)... of which each user maybe subscribes to 1000 of those users so receives 128 kB/sec which is well within reasonable internet usage other than the bandwidth and compute power and development effort to somehow organize a way for anyone to publish and anyone to subscribe to eachothers individually very low bandwidth mouse movements or other small data.

    I would use this for a variety of experimental massively multiplayer games if I could figure out how to optimize it so it scales while avoiding DoSAttacks etc.

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

    Help with GQRX

    Posted: 01 Jul 2019 03:42 PM PDT

    I am having trouble getting my RTL-SDR running. I went through all the steps for running GQRX but when I get to ./test GQRX it gives me an error saying libboost not found no such directory. I am not sure if I am doing something wrong or the way the program is ran in conflicting with the os.

    I am running the latest version of Raspian (Buster) on a Raspberry pi 3 b+

    If anyone has some instructions on how to set it up properly or ideas how to fix my issue they would be much appreciated.

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

    help my girlfriend out please!!!!!

    Posted: 01 Jul 2019 07:24 PM PDT

    here's some context, first off, i know absolutely nothing about coding or programming, but my girlfriend is a programmer. so she texted me today in a panic talking about how she couldn't get into her web server. she said that inspect element doesn't work and that the server won't connect. she's tried debug from her laptop, and she checked and the server's ssh is closed (i have no idea what that means but uuhh). please can somebody respond with some ideas?? she's really frenzied and idk how to help. anything at all (ideas/would be wonderfully appreciated ~!!! p.s. i've attached the error message she got; i don't know if it can help or anything but better safe than sorry yk! error message

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

    Existing tools for redirecting of console output to IDE output

    Posted: 01 Jul 2019 03:08 PM PDT

    I am trying to find some existing solution for redirecting of stdout, stderr, and console output into "Output" tool in Visual Studio, XCode, Eclipse or any other IDE. Interesting ready to use implementations which not requires any actions from developers. Any code in own project shouldn't be changed for achievement of this goal.

    I know that this functionality is not supported by IDE, but it can be implemented by extensions. Does somebody know existing extensions which allow to resolve this problem? Which existing solution is the best now?

    Thanks in advance.

    submitted by /u/vl-spirit
    [link] [comments]

    Completely new with Programming. having trouble with my Flow chart and psudocode.

    Posted: 01 Jul 2019 06:53 PM PDT

    I am taking an online class, and I am working on my program for an assignment. I am not looking for someone to do the work for me I want to learn it. But I looked in the book, searched online and saw videos pertaining to my error in my flow chart that I can't seem to get past this part. going from Pseudocode to Raptor I get all the way to the Output and can't seem to get the output display code right. Is there a reference sheet or something to help me learn?

    // Declare variables Declare Real bikesMonday Declare Real bikesTuesday Declare Real bikesWednesday Declare Real bikesThursday Declare Real bikesFriday //inputs Display "Enter the number of bikes sold on Monday: " input bikesMonday Display "Enter the number of bikes sold on Tuesday: " input bikesTuesday Display "Enter the number of bikes sold on Wednesday: " input bikesWednesday Display "Enter the number of bikes sold on Thursday: " input bikesThursday Display "Enter the number of bikes sold on Friday: " input bikesFriday //calculations(s) Set totalBikes = bikesMonday + bikesTuesday + bikesWednesday + bikesThursday + bikesFriday Set averageBikes = totalBikes / 5 //output Display "The total number of bicycles sold for the week is: ", totalBikes Display "The average number of bikes sold per day is: ", averagebikes 

    And I got all the way down to the Flowchart and when I came to the output portion i get an Error

    ID is unexpected

    Display "The total number of bicycles sold for the week is: ", totalBikes

    Maybe my output line is wrong but where I am stuck is that I don't know what is allowed and what would be the mistake.

    Any pointers? Thank you!

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

    Making an app

    Posted: 01 Jul 2019 06:40 PM PDT

    Hey I am a newbie when it comes to programming and know the basics of java and python.

    I want to create a simple game that can run on an Android device. What next steps should I take to do this. Like a software or a video tutorial might help. I am totally lost in this.

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

    C# Simplifying null check?

    Posted: 01 Jul 2019 02:29 PM PDT

    I have a DataGridView that I want to write each row to a database (using custom struct passed into my db writing function), but I only want this to be done when certain cells contain a value. I have the following code with the logic that I want done:

    if(dgvDistributors.Rows[e.RowIndex].Cells[2].Value != null) row.Distributor_Id = dgvDistributors.Rows[e.RowIndex].Cells[2].Value.ToString(); 

    I just can't help but feel that there is a less verbose way of doing this. Can this be shortened so it looks a bit cleaner, or is this the only way to go about this?

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

    Auto Donate at the End of Survey

    Posted: 01 Jul 2019 01:52 PM PDT

    Hi Everyone- We are looking for a program that we could link to the back end of a survey so that when a participant finishes the survey we (the company) could donate money as a thank you. The key is we want the participants to get an email confirming that money was donated (they'd have to enter their email). Do any of you know if something like this exists?

    Thanks!!

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

    Small native Win32 program uses 2 MB, how to find out what it is?

    Posted: 01 Jul 2019 04:36 AM PDT

    Let me start by saying there's no practical point to this except curiosity.

    I have a small Notepad-like Win32 program written in C. Visual Studio tells me it takes 2 MB of memory, including 350 KB of heap space. I took a snapshots but none of the objects on the heap could be identified (most from within ntdll).

    I'm curious how this memory usage is distributed, specifically I'd like to find out what's allocated to:

    • stack(s)
    • static storage
    • heap (and to what)
    • code & shared libraries
    • etc

    ...and how to tweak to reduce this where possible (for no good reason)! I'm a bit unfamiliar with native code tooling and couldn't find any of this in Visual Studio or WinDbg Preview.

    I already tried reducing stack and heap reserve to 4 KB using the compiler but that didn't seem to have any effect on the final memory use.

    Edit: found VMMap, that's a very good start!

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

    I have an address represented as a const char*. How do I get something to point to this address?

    Posted: 01 Jul 2019 05:28 PM PDT

    For example:

    const char* address = "2x92093030"; //this is given

    Node* node = (Node*)address; //this was what I thought to do?

    What is the correct line to get this node to point to this address?

    Thank you.

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

    Can't add already initialized objects into my ArrayList. Why?? [Java]

    Posted: 01 Jul 2019 09:30 AM PDT

    Here's some relevant snippets of my code

    public class BasicOperations {

    static weapon fist = new weapon("fist",1,100,25,0,0);

    static weapon knife = new weapon("knife",1,100,90,0,0);

    ArrayList<weapon> weaponsList = new ArrayList<>(5);

    //this is the line that won't work despite Stack Overflow forums instructing me to write it just like this

    weaponsList.add(fist);

    }

    Here's the weapon class since that might be relevant

    class weapon{

    String name;

    int quantity;

    int condition;

    int closeRangeKillCh;

    int midRangeKillCh;

    int farRangeKillCh;

    public weapon(String name, int quantity, int condition, int closeRangeKillCh, int midRangeKillCh, int farRangeKillCh){

    this.name=name;

    this.quantity=quantity;

    this.condition=condition;

    this.closeRangeKillCh=closeRangeKillCh;

    this.midRangeKillCh=midRangeKillCh;

    this.farRangeKillCh=farRangeKillCh;

    }

    public String getName(){return name;}

    public int getQuantity(){return quantity;}

    public int getCondition(){return condition;}

    public int getCloseRangeKillCh(){return closeRangeKillCh;}

    public int getMidRangeKillCh(){return midRangeKillCh;}

    public int getFarRangeKillCh(){return farRangeKillCh;}

    Can anyone help me with why I'm having trouble adding objects into my ArrayList?

    The problems Eclipse is pointing out currently is:

    1) misplaced constructs

    2) VariableDeclaratorID expected after this token

    So it seems this would be a simple Syntax issue, but I haven't seen anywhere online where I notice syntax different from mine. What am I doing wrong?

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

    You can't pass a primitive type by reference in JAVA. Why? Why couldn't they implement it?

    Posted: 01 Jul 2019 11:58 AM PDT

    Best way to implement search functionality within sentences

    Posted: 01 Jul 2019 08:24 AM PDT

    Hey guys I am working on a .net application, and currently I am having trouble figuring out the best way to implement the search functionality to narrow the results of a database query. My query basically populates a string on a line by line basis, but I want to have a search option that as the user is typing, it only shows the strings that match those words that are typed. I thought maybe a ternary search Trie might be a good way to do this, but I have only used it in terms of words and prefixes never lines and keywords so I don't know if this implementation is possible. What other ways do you guys think I should go about doing this?

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

    It it possible to pass a static variable into a constructor using a "this" pointer?

    Posted: 01 Jul 2019 04:03 AM PDT

    Hi, I'm a bit new to oop and was wondering if I'm thinking of this right. So from what I know I'd assume that I could only pass a static variable into a constructor by reference not value? Could somebody tell me if this is correct?

    Edit: Sorry should have clarified that I'm asking specifically about C++!

    Many thanks

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

    AngularJS Tutorials

    Posted: 01 Jul 2019 05:30 AM PDT

    I got employed at a new company and they use AngularJS as their front-end language. Any tips where to start learning or references I should be reading?

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

    Matlab vs Phython GUI applications

    Posted: 01 Jul 2019 05:14 AM PDT

    Hey guys, for my research internship I need to develop a GUI application that does some fairly basic calculations (charge-state distributions for an ion beam passing through a stripper). I have a lot of experience with Matlab but, I hear that app development in Matlab can be pretty janky. Phython is completely new to me however from what I understand it's easier for Matlab users to pick up, at least compared to other languages. Would it be easier/are there any benefits to using Phython for app development? I don't have much time to learn a completely different language so, I'm really stuck with these two options.

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

    How to fix Selenium error?

    Posted: 01 Jul 2019 03:54 AM PDT

    I installed Selenium and if I type:

    ~python3

    ~import selenium

    ~selenium.__version__

    I get:

    '3.141.0'

    But in sublime text i got error:

    Traceback (most recent call last):

    File "/Users/belixamin/Desktop/test.py", line 1, in <module>

    import selenium

    ModuleNotFoundError: No module named 'selenium'

    [Finished in 0.3s with exit code 1]

    [shell_cmd: /usr/bin/env python3 /Users/belixamin/Desktop/test.py]

    [dir: /Users/belixamin/Desktop]

    [path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]

    How to fix it?

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

    No comments:

    Post a Comment