• Breaking News

    Wednesday, April 10, 2019

    Some help for a beginner programmer trying to make his job easier Ask Programming

    Some help for a beginner programmer trying to make his job easier Ask Programming


    Some help for a beginner programmer trying to make his job easier

    Posted: 10 Apr 2019 01:12 PM PDT

    I don't work in programming, but have an idea for a program that could help make my job easier; I just don't know where to start.

    I use Google Earth a lot for work, and have locations pinpointed with a latitude and longitude as my main piece of data I want to use for this project. I am looking to create something that will take all of the locations (roughly 2,000 in total) and provide a report listing every location that falls within a 500ft radius of a certain chosen location.

    My research is leading me to google earth api distance matrix. I know some Java Script, but I don't really have a deadline, this is just to make my life easier so I feel I could teach myself to write something quick and simple with proper direction.

    Any help would be appreciated and I can explain further if I need to. Thanks!

    submitted by /u/I-hate_cilantro
    [link] [comments]

    RUBY: How do I sum up elements in this data structure? A hash multiple hashes where the value is an array of hashes...

    Posted: 10 Apr 2019 02:56 PM PDT

    I have this data structure of stats that are grouped by id and date. I need to sum up all of the values.

    { [12345, Mon, 11 Mar 2019]=>[ { :id=>12345, :date=>Mon, 11 Mar 2019, :values=>{:total=>895, :numA=>4, :numB=>0} }, { :id=>12345, :date=>Mon, 11 Mar 2019, :values=>{:total=>227, :numA=>0, :numB=>0} }, { :id=>12345, :date=>Mon, 11 Mar 2019, :values=>{:total=>7507, :numA=>66, :numB=>0} } ], [12345, Tue, 12 Mar 2019]=>[ { :id=>12345, :date=>Tue, 12 Mar 2019, :values=>{:total=>632, :numA=>7, :numB=>0} }, {:id=>12345, :date=>Tue, 12 Mar 2019, :values=>{:total=>446, :numA=>2, :numB=>0} } ] } 

    There are hundreds of elements. Those are just two.

    I need to sum up all of the VALUES. So I should still return a hash of hashes, or preferably an array of hashes, with the same amount of elements, but not all of those mini hashes in between them with individual values. They should all be summed up. So I should have ONE stat for March 11, which is a summation of all of the March 11 stats with that same id, one for march 12 with the same id, etc...

    so like [12345, Tue, March 2019] should map to a single hash. With :id=>12345, :date=>Tue march 12, :values=>{:total=>ONE TOTAL, :numA =>ONE NUM_A, :numB=>ONE NUM_B }

    I've tried things with inject and map, I figure the solution is somewhere using those. I'm still struggling a ton with this. Thanks.

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

    How would I stitch together a grid of individual .png images by filename?

    Posted: 10 Apr 2019 09:37 PM PDT

    Basically I have a bunch of 512x515 tiles with the naming scheme "x_y.png" and I'd like to merge them into one image, like this.

    I had literally the exact same task years ago, and somebody was nice enough to write me a quick python script that would do exactly this, but I lost it a while back. Does someone want to help me out again, or even just point me towards a front-end that does this?

    submitted by /u/-Badger2-
    [link] [comments]

    JDBC Help

    Posted: 10 Apr 2019 08:14 PM PDT

    Just a question regarding SQLite, as I have a minor issue.

    I am currently doing a group assignment for a class called Software Engineering Fundamentals, and we need to make a program for said class. We are using SQLite for the assignment, as we need a database of some sort.

    This issue I am current having is needing to constantly change the url to the database file, as we are moving it around from member to member on github (examples below)

    Example 1
    String url = "jdbc:sqlite:C:/Users/Ricky/...

    Example 2
    String url = "jdbc:sqlite:C:/Users/louis/...

    Is there are way to go about this without needing to change it constantly? Because it will need to be a certain url when we submit the final copy in a month or two.

    Thanks in advanced!

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

    NoSQL vs DB Indexes for multi-column search

    Posted: 10 Apr 2019 03:52 PM PDT

    Let's say we have objects with attributes we care about searching on A, B, C, D, E and some other ones. We put them into some NoSQL store (ElasticSearch for example) as follows:

    { A: "some value", B: "some value", C: "some value", D: "some value", E: "some value" ... other parts of object } 

    And we store them in a DB table that is indexed on (A, B, C, D, E), we can use MySQL w/ InnoDB as the backend.

    Which will be more cost-effective or efficient if we want to search for objects that are an exact match for A, B, C, D, E? The DB index or NoSQL?

    What about if we there are 10,000 matches and we want to paginate by pages of 50?

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

    How can I create a reference of a reference? C++

    Posted: 10 Apr 2019 06:44 PM PDT

    I'm trying to pass an object type Civilization with a vector type Villagers to a function in another file as a reference so that I can modify the vector inside the object in Qt.

    I tried making a private Civilization *temp_civilization; so that when I call this window I pass the Civilization &obj by reference and then do *temp_civilization = &obj, but it gives me a segmentation fault error when I debug it. The idea is to modify temp_civilization, which holds the reference of obj, and modify the object &obj is referencing. Code looks something like this.

    Window:

    private:

    Ui::villagerMenu *ui;

    Civilization*temp_civilization;

    };

    CPP file

    void villagerMenu::sendCivilization(Civilization &c)

    {

    Civilization temp = &c;

    show();

    }

    void villagerMenu::on_add_villager_front_submit_clicked()

    {

    QString name = ui->villager_name_input->text();

    int age = ui->villager_age_input->value();

    QString gender = ui->villager_gender_input->text();

    int health = ui->villager_health_input->value();

    Villager v;

    v.setName(name.toStdString());

    v.setAge(size_t(age));

    v.setGender(gender.toStdString());

    v.setHealth(size_t(health));

    temp_civilization.push_villager_front(v);

    qDebug() << "[✔] Villager " << name << "added to front";

    }

    Other window (sending Civilization to the first window)

    void MainWindow::on_search_civilization_submit_clicked()

    {

    QString search = ui->search_civilization_Input->text();

    if (videogame.total() == 0) {

    QMessageBox::information(this, "Error", "There are no civilizations to search for");

    } else if (!videogame.searchCivilization(search.toStdString())) {

    QMessageBox::information(this, "Error", "Civilization does not exist");

    } else {

    qDebug() << "[✔] Civilization found";

    Civilization c = videogame.getCivilization(search.toStdString());

    villagermenu.sendCivilization(c);

    qDebug() << "[✔] Showing villager menu";

    }

    }

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

    I'm DIY-ing, but i'm little stuck on the Y

    Posted: 10 Apr 2019 07:25 AM PDT

    Hello, i'm new here and i tried to ask this question on stack overflow but they downvoted me to oblivion so im trying my luck here. So, i need a program for Windows that would run in the background and take data from a rfid card reader and send it to a database on a remote server that would subsequently store the data, the number of times the card has been scanned and at what time. I'm building a rfid lock for a garage and multuple people would use the lock. My question is, is there a program that already exists for that purpose and if not how hard would it be to write one. I hope you can help.

    I'm sorry if it's a stupid question but im a beginner

    Thanks

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

    (C++) Split a string of specific format to integers?

    Posted: 10 Apr 2019 03:51 PM PDT

    Floats not integers

    I have strings of format "E4.3324 = U90.34432" and I need to extract just the integers from this. How can I do this, using stringstream and getline? Thanks

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

    Looking for some advice on writing a video streaming server in c++

    Posted: 10 Apr 2019 11:14 AM PDT

    I'm working on a project to where I have to stream video's between Server-Client and I'm confused about what protocols I should use and what process I should follow. I know there is the RTSP with RTP, UDP with RTP, RTMP and even HLS. I also found out that I could use openCV, libVLC, ffmpeg, the live555 project, etc. and I'm very confused what library I should use and which protocol it uses.

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

    Hi how to continuously capture a candlestick on an online chart (e.g. on investing.com)

    Posted: 10 Apr 2019 01:05 PM PDT

    Couple of alternative ideas would be great!

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

    Are there any little and big endian converter online?

    Posted: 10 Apr 2019 08:54 AM PDT

    I have a hexadecimal value which is quite big and I want to use some kind of converter online which can convert it into little or big endian for me. I tried searching a lot but there's barely any online but one: https://www.scadacore.com/tools/programming-calculators/online-hex-converter/

    But it's kind of hard to copy and paste values from this site

    Can someone help me if there is anything like this online out there?

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

    Create puTTY registry key from user input

    Posted: 10 Apr 2019 12:08 PM PDT

    So I'm pretty new to the programming/automation scene. I've been tasked with creating some kind of script to gather a user's ID and enter it automatically into puTTY along with a few other static configurations. I know it would be pretty easy to do this with a registry file but I'm trying to come up with something as user friendly as possible.

    Ideally, I would have a window pop up and ask the person to type in their ID. Then it would take that username and throw it in the registry key that corresponds to that setting in puTTY. I'm just not sure which tools/language I should use for this. I've been told VBScript might be an option but I'm not very familiar with it. Is there another language that might be better?

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

    How to implement edge rank weighted newsfeed? (practical application)

    Posted: 10 Apr 2019 08:13 AM PDT

    I am taking an activity feed and providing a facebook-esque edge ranking of the activities so the user can see the most important items first. These are not push notifications, but only grabbed on request so there is no in memory database or pub/sub system in place. Right now it simply grabs the n most recent activities and when the user scrolls down continues to grab the next batch of most recent activities.

    I understand the basic principle of edge rank and giving each post a weight. What I need to figure out is how to do this *over time*.

    I.E. If I store an edge rank score in the field of an activity record in a table, and I grab the last n records, I can then sort them by edge ranking, simple enough. *But* I can only do this sorting in the batch that I grab, I don't want to have to pull many records just to sort them by edge rank because an older activity might be very important and a new activity might be very unimportant.

    I cannot store the time degradation factor in the edge rank field of an activity, unless I had a job that constantly updated the edge ranking of the records every hour or to account for time degradation.

    How can I rank these activities with time as a degradation factor without having to pull more records than I need to sort them on request. Which I guess I could do just to get something up and running.

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

    Question: Trying to create/run a report that will check data from web links.

    Posted: 10 Apr 2019 11:18 AM PDT

    Hi all, I'm not a programmer of any sort but I need help identifying what is possible.

    I have an excel spreadsheet with a list of facilitiy information and links of ID numbers to our facilities, where each link sends you to the specific site's ID status which can tell you "active" or "inactive". Since we have over 200 locations, I can not verify that every location is active.

    My idea is to create this spreadsheet that has the direct link to status information and have an automatic report generated from that link that will give me a list of the status of each store. So my question is, is this something that my IT dept can easily do? Is it something easy to figure out?

    I hope this makes sense, if not please let me know. Thanks for listening/reading.

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

    how does this program verify the password while this curl command doesn't work ?

    Posted: 10 Apr 2019 08:40 AM PDT

    https://i.ibb.co/7JQSDQ6/Cxxxapture.png

    and when i click copy device url it gives me this curl http://admin:admin@**.**.**.***/

    i masked the ip in ***

    when i open this url in the browser it still needs me to login with pass and the username !

    how does the program checks the password if the curl command doesn't work

    the router login pagehttps://i.ibb.co/nPVNXhH/image.png

    https://i.ibb.co/znhkpdD/image.png

    the program is router scan http://stascorp.com/load/1-1-0-56

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

    API Calls and Security Config Question

    Posted: 10 Apr 2019 07:51 AM PDT

    Probably a basic easy question...

    The server is configured with the clients whitelisted IP and imported certificate. Therefore it can accept API calls. However, do they API responses that go back to the client go back on the same pipe, or does the client need to open up an IP address and port to accept these responses?

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

    Help with a project idea

    Posted: 10 Apr 2019 06:40 AM PDT

    Hi guys - Sorry it's another "I don't know where to start!" questions.

    I have some experience in programming, but not anything near some of you guys. The company I work for is a retailer for wooden houses, we offer a bespoke service however that can lead to long waiting and communication times. I want to create an application (preferably web friendly) that would allow users to drag and drop items to design their own product. Think of the home design apps - Where I can create models/drawings for elements like windows and give them a barrier of how much space is needed to place that item. Along with the automated side of "If a building is X meters long than you need to put in these supports" etc.

    The issue I'm facing is that there's not many resources that I can find to help me start off - Is there anything you guys would recommend? Any advice is welcome.

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

    [C] Alternatives to two-way sorted access of an array

    Posted: 10 Apr 2019 04:51 AM PDT

    Hey everyone. Sorry if the question is a bit awkwardly phrased, hopefully the explanation will help.

    Basically, I'm working with a list of {uint:Key,float:Value} tuples (also referring to them as 'keys'). In the first stage, the list needs to be sorted by Value, and in the second stage, it needs to be sorted by Key.

    At the moment, I've just got a 'functional' version where I perform a binary search (+shuffling) for insertion, shuffling for deletion, followed by a radix sort for the second stage. This obviously isn't very ideal (I'm working with ~2048 keys thousands of times, so all the shuffling is killing performance), so I'm hoping to get ideas for implementation.

    The usage of the keys goes as:

    1. Linear access according to Value (with low-ish probability of deletion; no insertion)
    2. Linear access according to Key (no deletion, no insertion)

    My first thought was just to keep the list 'physically' (in memory) sorted by Value and maintain the Key sorting via linked list. However, this still results in a lot of memory moving around during insertion/removal (removal could be improved by using a 'dummy/skip' Value, but insertion can't be improved).

    My next thought was keeping it sorted via linked-lists for both Value and Key, but this would reduce insertion time from O(log n) to O(n), and would be a bit of a cache killer with as many keys as I'm using.

    At the moment, I'm thinking my first thought would probably be the way to go, but if you guys have any better ideas, I'm all for hearing them.

    Cheers!

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

    No comments:

    Post a Comment