• Breaking News

    Tuesday, May 7, 2019

    Why would a user/bot connect to a website 20 times a day and stay for 0.00 seconds? learn programming

    Why would a user/bot connect to a website 20 times a day and stay for 0.00 seconds? learn programming


    Why would a user/bot connect to a website 20 times a day and stay for 0.00 seconds?

    Posted: 06 May 2019 11:30 AM PDT

    I recently took over the website management for my company. I noticed weird behavior with a user connecting from the same city over and over throughout the day. There is no sensitive information on our site, just our catalog and a contact us form. Why is this user connecting over 600 times a month to our main page and then just leaving. Every time they visit it counts it as a new user and they have a 100% bounce rate and the session last 0.00 seconds. I can't tell if it is malicious but it is definitely throwing off my statistics

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

    installing multiple versions of Firefox on one machine

    Posted: 06 May 2019 08:11 PM PDT

    I'm playing around with making Firefox extensions (it's fun! Try it!) and I'm trying to run different versions to see if anything will break when they update the browser. Allegedly you can use Profiles to install different versions that update independently. ( https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Multiple_profiles and https://developer.mozilla.org/en-US/docs/Mozilla/Profile_Manager#Profiles_and_application_versions) But no matter what profile I use, changing the version applies the change to all profiles. I have automatic updates turned off in each profile. Help? I'm wondering if the documentation is out of date since some of the stuff they reference is nowhere to be found in the profile manager, but obviously I might just be doing something totally wrong.

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

    I bought couple of coding games and so far it has been fun to practise my coding skills

    Posted: 07 May 2019 12:06 AM PDT

    These guys seem to have two types of games.

    I have tried both SODR and Project ORB game. I tried for Python programming and C# programming language.

    I am still exploring these games but so far has been fun.

    If you guys want to take a look here are the link to these games

    https://knackbout.com/savior-of-data-realm-game-promo

    https://knackbout.com/project-orb-game-promo

    Should try the demo version first. I did the same and then went and bought the game.

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

    Best resource to pointers/linked list

    Posted: 06 May 2019 05:27 PM PDT

    c++. Want to absolutely master them like a god. post best book/video etc that will do that. assume i know nothing atm.

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

    What is the fastest way to compare two files by key columns and generating a diff of added, deleted , modified and unchanged lines ?

    Posted: 06 May 2019 07:36 PM PDT

    The files would have millions of lines. If there is a way to use storage to trade off to speed thats ok too.

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

    Need a Guide: Data Input Program for Stores

    Posted: 07 May 2019 12:07 AM PDT

    I'm in currently in university and I got a job offer to make a program for a store's cashier and manager to input data and such. However, I'm still in my 2nd semester and my curriculum isn't exactly the fastest there is so I'm not confident in accepting this job. I've been thought basic data structures like linked lists and BST and i can probably just google how to read and write files myself. What I'm not confident in is making the actual program itself. I tried making flappy bird with java once but that was relatively simple.

    So I need some sort of guide or a set of lessons to get me on the right track. I'll try to find some myself once i get home, but any suggestions would be appreciated. Any advice?

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

    Visualizing code on paper/whiteboard? What is it called?

    Posted: 06 May 2019 10:22 AM PDT

    I'd like to visualize/plan my code on paper.
    But I forgot what this is called... you generally do it on a whiteboard, where you draw the logic behind the code.

    I'm really bad at explaining, sorry.

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

    Help: Someone can help with me with the error

    Posted: 06 May 2019 11:51 PM PDT

    Is for my School Test, please

    /*PARTE 1 PROGRAMMAZIONE AD OGGETTI

    ---------------------------------------------------

    Dichiarare la classe serbatoio cilindrico avente le seguenti proprietà

    -Diametro

    -Altezza

    Livello

    Ed i seguenti metodi

    -costruttore

    -carico_litri

    -scarico_litri

    -calcola_livello

    Realizzare un prigramma di Test con un oggetto della classe serbatoio utilizzando tutti i medoti

    disponibili*/

    #include <iostream>

    #include <stdlib.h>

    using namespace std;

    class Serbatoio {

    private:

    int Diametro;

    int Altezza;

    int Livello;

    int Litri;

    public:

    Serbatoio (int diam, int alt, int liv); //costruttore

    int getDiametro (int diam);

    void setDiametro (int diam);

    int getAltezza (int alt);

    void setAltezza (int alt);

    int calcLivelllo (int diam, int alt, int liv, int lit);

    int CaricaLitri (int LitCar);

    int ScaricaLitri (int LitScar);

    };

    int Serbatoio::calcLivelllo (int diam, int alt, int liv, int lit){

    int base;

    int raggio;

    raggio=diam/2;

    base=raggio*raggio*3.14;

    liv=base*lit;

    Livello=liv;

    return Livello;

    }

    Serbatoio::Serbatoio (int diam, int alt, int liv){ //costruttore

    diam=6;

    alt=10;

    liv=0;

    Litri=0;

    Diametro=diam;

    Altezza=alt;

    Livello=liv;

    }

    int Serbatoio::CaricaLitri (int LitCar){

    Litri=LitCar+Litri;

    return Litri;

    }

    int Serbatoio::ScaricaLitri (int LitScar){

    Litri=Litri-LitScar;

    return Litri;

    }

    int main () {

    Serbatoio Recipiente();

    int scelta;

    cout<<"L'altezza del serbatoio e' pari a 10m mentre il suo diametro è 5m\n";

    cout<<"Inserisca '1' se uno se desidera caricare dei litri o 2 se ne desidera scaricarne\n";

    cin>>scelta;

    if (scelta==1){

    cout<<"inserisca i litri da caricare";

    cin>Recipiente.CaricaLitri(int LitCar);

    }

    if (scelta==2){

    cout<<"inserisca i litri da scaricare";

    cin>>Recipiente.ScaricaLitri(int LitScar);

    }

    cout<<"il livello e'" <<Recipiente.calcLivello()<<;

    }

    //thank you very much

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

    [C++] How can I read unicode input using the windows console?

    Posted: 06 May 2019 07:43 PM PDT

    Using SetConsoleOutputCP(CP_UTF8) and SetConsoleCP(CP_UTF8) I am able to print unicode strings (u8"Exámplè") and read from files unicode characters, but I can't read unicode character from "std::cin".

    I am in Windows 10, using Visual Studio 2019.

    Example:

    #include <windows.h> #include <iostream> #include <string> int main() { SetConsoleOutputCP(CP_UTF8); SetConsoleCP(CP_UTF8); std::string word; std::cout << "Example of being able to print: " << u8"Exámplè" << std::endl; std::cout << "Give me some word: "; std::cin >> word; std::cout << "This is your word: " << word << std::endl; system("pause"); } 

    Output:

    Example of being able to print: Exámplè Give me some word: Exámplè This is your word: Ex mpl 
    submitted by /u/Datwaftx
    [link] [comments]

    What are some cool things to do in python

    Posted: 06 May 2019 11:08 PM PDT

    I'm starting to learn python currently but I dont want to keep watching tutorial videos the entire time, I have been trying to think of some projects to do or start on but none of them really seem to grab my attention, if anyone knows a project I should do based off of python that would be great

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

    How does a many to many relationship with one table work?

    Posted: 06 May 2019 10:50 PM PDT

    https://peewee.readthedocs.io/en/latest/peewee/relationships.html#multiple-foreign-keys-to-the-same-model

    I'm having a difficult time comprehending the workings of a many to many relationship involving just one table. This being applied to a social context where ...

    • A follows B, but B doesn't follow A
    • B follows A, but A doesn't follow B
    • A and B follow each other

    class User(BaseModel): username = CharField(unique=True) password = CharField() email = CharField() join_date = DateTimeField() 

    class Relationship(BaseModel): from_user = ForeignKeyField(User, backref='relationships') to_user = ForeignKeyField(User, backref='related_to') 
    submitted by /u/BinnyBit
    [link] [comments]

    My A* algorithm gets a short path but not always the shortest. Why?

    Posted: 06 May 2019 10:43 PM PDT

    The algorithm:

    Uses a PQ that supports change priority operations.

    Assume all the ADTs work correctly.

    Example problem: Find the shortest path of operations to get from integer x to integer y using the following operations and weights; add/subtract 1 : 1, multiply/divide by 2 : 5, square : 10.

    To get from x = 11, to y = 117 the algorithm gives this result:

    Total states explored in 0.019s: 110

    Search was successful.

    Solution was of length 7, and had total weight 19.0:

    17 => 16 => 15 => 225 => 224 => 223 => 111

    The correct result should is:

    Total states explored in 0.018s: 338 <--- may vary.

    Search was successful.

    Solution was of length 6, and had total weight 18.0:

    17 => 16 => 15 => 225 => 112 => 111

    My implementation

    Memory optimized version. Doesn't add vertices to the PQ until they are seen.

    public AStarSolver(AStarGraph<Vertex> input, Vertex start, Vertex end, double timeout ){ graph = input; 

    source = start; dest = end; if(start.equals(end)){ solutionweight = 0; solution = List.of(start); result = SolverOutcome.SOLVED; numofstates = 0; timetosolve = 0; return; } fringe.add(start, 0.0); distTo.put(start, 0.0); Stopwatch sw = new Stopwatch(); while (!fringe.isEmpty()) { Vertex src = fringe.removeSmallest(); numofstates++; marked.add(src);

    List<WeightedEdge<Vertex>> neighbors = graph.neighbors(src); for(WeightedEdge<Vertex> e: neighbors){

    double heur = graph.estimatedDistanceToGoal(e.to(), dest); if ((heur == Double.POSITIVE_INFINITY || marked.contains(e.to())) && !e.to().equals(dest)) { 

    continue; } double distFr = distTo.get(e.from()) + e.weight();

     if(!distTo.containsKey(e.to())){ 

    distTo.put(e.to(), distFr); } if (!fringe.contains(e.to())) { fringe.add(e.to(), distFr + heur); edgeTo.put(e.to(), e); }

    if (distTo.get(e.to()) > distFr) { 

    fringe.changePriority(e.to(), heur + distFr); edgeTo.put(e.to(), e); distTo.put(e.to(), distFr); } if (e.to().equals(dest)) { solutionweight = distTo.get(e.to()); solution = pathTracer(e); timetosolve = sw.elapsedTime(); result = SolverOutcome.SOLVED; return; }

    if (e.to().equals(dest)) { 

    solutionweight = distTo.get(e.to()); solution = pathTracer(e); timetosolve = sw.elapsedTime(); result = SolverOutcome.SOLVED; return; }

     } 

    if (timeout < sw.elapsedTime()){ result = SolverOutcome.TIMEOUT; return; } } result = SolverOutcome.UNSOLVABLE; solution = List.of();

    }

    private List<Vertex> pathTracer(WeightedEdge<Vertex> e) { ArrayList<Vertex> path = new ArrayList<>(); 

    path.add(e.to()); path.add(e.from()); while (!e.from().equals(source)) { e = edgeTo.get(e.from()); path.add(e.from()); } Collections.reverse(path); return path; }

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

    How to make an Ai that pulls google images from lyrics to a song

    Posted: 06 May 2019 10:29 PM PDT

    Literally wanna do this.

    How can I make an an AI to do this?

    https://youtu.be/FnWK2qG7Mas

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

    Strongly-connected component detection help?

    Posted: 06 May 2019 06:19 PM PDT

    Hey everyone, I'm trying to write a method that detects the strongly connected components of a directed graph. Unfortunately, I've hit a small roadblock with my code. I believe it's in the DFS method that I made, can anyone help me diagnose it and make sure it a proper DFS, or if it's a problem with findSCC? With my unit tests, I have the correct amount of SCCs, just not the exact same elements within them. Thanks!

    Link

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

    Interactive way to learn Perl ?

    Posted: 06 May 2019 06:02 PM PDT

    I have close to none programming experience, and I am looking to learn Perl in my free time (realistically once or twice a week for half an hour).

    I found it very difficult to learn by reading a book and I prefer hand on learning one small step at a time, is this doable and where should I look into to begin my learning? I appreciate any advice or suggestion you might have!

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

    Does the critical thinking process become more "natural" or easier in a CS degree?

    Posted: 06 May 2019 09:31 PM PDT

    Hey guys,

    I just completed my first year in Computer Science and failed a course due to not meeting the required weighted exam average. Overall, I wouldn't say the year was too challenging but the fast critical thinking required in certain long answer questions on exams (like producing recursive algorithms for example) are what gave me the most anxiety in this year. The content is only going to get harder in the next 2-3 years of this degree, which sort of scares me.

    Does the process of thinking critically really fast and under pressure, or grasping fast-paced content get easier or more natural as you progress in this degree? I feel a lot slower than everyone when it comes to grasping concepts in class and on exams so I just wanted to hear your experiences in this major regarding this problem I'm having :/

    Thanks guys!

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

    How to improve my web-programming workflow?

    Posted: 06 May 2019 09:21 PM PDT

    Before I start, I want to clarify that I did not study programming in some kind of school or university, but rather through small scale, issue-specific tutorials (e.g.: "How to retrieve a value from an array in js?").

    I consider myself to be a moderate programmer, who can set up a website (including setting up and managing a backend database, retrieving data through AJAX and PHP and visualize it on the front end). But I know that my tools/workflow is not standard procedure and probably ineffective. Therefore I would like to ask for some advice of how to manage my projects and what kind of tools/workflow I should follow.

    This is how I currently set up a blog post on my website:

    1. I have a Wordpress page, hosted on a server of a large server-provider (I don't know how to set up my own server and fear that once something fails with the server I cannot fix it and my website is not reachable; also I like the option of having the opportunity to add plugins to my site, which I don't need to program myself)
    2. I have no admin rights on the server, but use phpMyAdmin to manage my database
    3. I am using FileZilla to connect to my server
    4. I load my script (php or js) from the server to my local environment and edit it there (with Notepad++), save it and re-upload to the server and see how the change affects my blog post
    5. If I find some library for my code I am downloading it and save it in my "js" directory and retrieve it in the <head> part of my page.
    submitted by /u/rick854
    [link] [comments]

    Do you guys normally download css files or create them yourself?

    Posted: 06 May 2019 05:27 PM PDT

    I'm doing the codecademy web development course right now and I'm in the first part, but css has been introduced out of the blue. Did i miss something, or do people just use downloadable css files?

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

    Using Python, how can I combine all the tables in a sqlite3 database into one, but only including the unique contents? (Not including those with same row data)

    Posted: 06 May 2019 08:32 PM PDT

    FOr example, I have 4 tables, and in table 1 there is a row with the same data as a row in table 2. In table 3 there is a row that looks the same as a row in table 4. I need them all in a single table,( it doesn't matter if it's in the same database or not) but excluding the duplicate rows.

    They all have the same no. of columns and the same column names.

    Please help me create a function, because I have tried UNION But it just does not work, I have also tried UNIQUE, and it also does not work. Thank you so much.

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

    Online tutors?

    Posted: 06 May 2019 04:41 PM PDT

    I am looking for a C++ tutor to teach me the language, but am unsure if I want a one on one tutor or an online one. Does anyone know any online tutoring services/websites that teach C++ adequately?

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

    Base64 Inquiry

    Posted: 06 May 2019 08:19 PM PDT

    I need to use the Base64InputStream from Apache Commons Codec, create an instance, and decode the contents of a file.

    I figured out a way to to it by using

    String encodedText = Base64.getEncoder.encodeToString(text.getBytes("UTF-8"));

    But my prof wants me to use Base64InputStream and im not sure how to do it that way.

    Any help would be greatly appreciated - thanks!

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

    [C++] Can someone explain how this code works

    Posted: 06 May 2019 07:45 PM PDT

    const char *&name () {

    static const char * n = " Foobar " ;

    cout << n << " .\ n " ;

    return n ;

    }

    I'm not sure I really understand the *&name(). I know

    name() = "Foobar2";

    will print out "Foobar", but then n stores "Foobar2" and I don't really understand why

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

    Are college school books better?

    Posted: 06 May 2019 07:37 PM PDT

    I know college books are over priced some, but I was looking at someone's C# class book and it was over $80. But are college books much better?

    Would it be worth buying a college programming book vs a regular retail book.

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

    No comments:

    Post a Comment