• Breaking News

    Monday, April 1, 2019

    Simple Inbound and Outbound Call Tracking Ask Programming

    Simple Inbound and Outbound Call Tracking Ask Programming


    Simple Inbound and Outbound Call Tracking

    Posted: 01 Apr 2019 05:58 PM PDT

    Hi,

    I'm working with a small business to track some simple metrics on their phone system (inbound calls, avg. wait time, number missed, outbound calls, etc.). I've started to look at services like call rail, but they are fairly expensive.

    Is there a software or hardware solution I can use to plug into a land line and track all calls? Any thoughts would be appreciated

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

    How to connect my SQL database to my Javascript for my website.

    Posted: 01 Apr 2019 08:04 PM PDT

    I have built a table in SQL of law schools in Canada and their average GPA and LSAT scores for people admitted.

    I also have built a calculator in Java Script for people to find their averages after inputing their marks and pressing a button to find their average/GPA. I want to create an option where if they decide to see which Law schools they have a high likely-hood of getting into, lets call them safety schools, the program would could use the output of the calculator to run a query on the data base to find Law schools with an average admission GPA = or less than the person's average gpa.

    In SQL I have written the query of a table named law school:

    SELECT * From lawschool where GPA <= 3.6

    I want to make the query so that instead of 3.6 the query finds schools with an admissions average GPA <= (Output of JS Calculator AKA the person's GPA).

    I have been told I would need to use python to connect my database with the Java script I was hoping I could get detail on how to do that?

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

    Interviewing for work and second contact with a company is a full-stack programming challenge. It's a 4 hour programming project-based challenge and I've never seen anyone ask this before. Opinions?

    Posted: 01 Apr 2019 08:52 AM PDT

    As the title says, I'm supposed to fulfill a 4 hour programming project-based challenge in order to progress in the interview process. As an older programmer, these challenges set off warning bells as I have a 100% record of completing them, getting an on-site interview and then not be chosen.

    The company is a startup in LA that could be lucrative if it succeeds, but frankly I'm tired of people needlessly wasting my time. I would love to hear reddit's opinion of these large interview challenges and whether they were fruitful for you.

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

    Selection sort question

    Posted: 01 Apr 2019 08:45 PM PDT

     public static void selection(int [] arr){ int k=0; for(int i=0;i<arr.length;i++){ int min = arr[i]; for(int j=(i+1);j<arr.length;j++){ if(arr[j]<min){ min=arr[j]; k=j; } } int temp = arr[i]; arr[i] = arr[k]; arr[k] = temp; } } public static void selection2(int [] arr){ int min =0; for(int i=0;i<arr.length;i++){ min = i; for(int j=(i+1);j<arr.length;j++){ if(arr[j]<arr[min]){ min=j; } } int temp = arr[i]; arr[i] = arr[min]; arr[min] = temp; } } 

    The selection2 method sorts perfectly, but selection does not. Curious as to why, any insights appreciated! Symptoms are just completely incorrectly sorted lists, I feel I'm implementing the same idea in each.

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

    List question - Python

    Posted: 01 Apr 2019 05:03 AM PDT

    Hey all,

    Please let me know if this isn't rules appropriate, I can't for the life of me find the community rules/info button anywhere.

    I'm writing a script and stuck with an issue that I don't quite understand, which I speculate may be as a result of my not understanding properties of lists properly. When I delete an element from a list within a function that is created using a call to a different list, the element is also deleted from the parent list? Why is this?

    A simple example is shown below:

    ~~~py list1 = [a,b,c,d,e,f,g]

    def func(list): templist = list

    #should be deleting element at index 3 in templist only del templist[3] 

    func(list1) print(list1)

    for some reason, element at ind3 is also being deleted in list1?

    output: [a,b,c,e,f,g] ~~~

    Thanks for any help with this!

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

    Javacript window.scrollBy() function not working on internal links?

    Posted: 01 Apr 2019 01:46 PM PDT

    window.onload = function(){ var navlinks = document.getElementsByClassName('nav-link'); for(let i = 0; i < navlinks.length; i++){ var link = navlinks[i]; link.onclick = function(){ var header = document.getElementById('header'); var height = header.offsetHeight; window.scrollBy(0, -1 * height); } } } 

    I have a fixed header on my website and anchors with internal links. I would like to have the page scroll down by the height of the header when the links are clicked and am using the above method, but it doesnt seem to be working. Is it possible that its executing the scroll first and then linking to the section? What over methods could i use that don't involve restructuring the whole page?

    edit some time later: SOLVED. For anyone else who might see this, I figured out a way around it. The problem was that the page was scrolling first and then going to the link, making look like nothing happened. I converted the anchor elements to div elements and made use of the element.scrollIntoView() function, then just scrolled by the remaining required height. Not an elegant solution by any means, but it works. In the words of TheCodingTrain, "I'll refactor this later" :)

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

    Need help implementing pthreads in C++ with C calls

    Posted: 01 Apr 2019 05:11 PM PDT

    I'm in a programming class and I have an assignment in C++ where we use C system calls and I need some help with pthread implementation.

    I was given some sample code where two pthreads are created and call two separate functions. One fills a buffer with 10 random numbers and the other 'consumes' the numbers after waiting an undefined (by the professor) amount of time. At the end of the program "the parent thread reports the Min, Max, and Avg" of the numbers.

    The sample code lays the frame work for the project and I need to create the implementation. I'm not that great with C just yet so I'm looking more for an explanation on how things work or should work rather than someone writing me code. As far as the project write-up explains, I need to make the first pthread generate random numbers, and the second one needs to read those numbers and print the Min, Max, and Average. I know this sounded redundant but I'm just trying to explain it better so you guys can understand it and maybe help explain it to me.

    I initially didn't post code because it is not originally my code to post but if it will help you guys get a better grasp I'll post some of it.

    Thank you anyone in advance if you try and help, I appreciate it!

    Edit: I think I figured most of it out, just not entirely sure how to make a pthread wait for the buffer to fill.

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

    Concurrency with pthreads

    Posted: 01 Apr 2019 03:15 PM PDT

    So below is two sections of code that simulate 5 "philosophers" each executing one of the segements below and thus sharing and eating with 5 individual "chopsticks". Philosopher 0 has access to chopsticks 0 and 1, Phil 1 to chopsticks 1 and 2, so-on til Phil 4 who has access to chopsticks 4 and 0. They need both to start eating.

    We know that the code does not prevent deadlock, but Allegedly one of the code segments below allows 2 adjacent philosophers to eat at the same time. I would expect segement 2 to be the one with the issue because it is releasing the mutex before reseting the ownership of its chopsticks, but I worked out different scenarios of execution an i am not coming up with any scenario where for example Philosopher 1 and 2 are both eating at the same time. Any this isnt for homework, its a review for a test! I seriously think the teacher messed up on this one, there is not a case which 2 adjacent can eat

    1 void eat(int phil_id) { 2 pthread_mutex_lock(&mutex[phil_id]); 3 chopsticks[phil_id] = phil_id; 4 delay(500); // small delay to ''permit'' opportunity for deadlock 5 pthread_mutex_lock(&mutex[(phil_id+1)%5]); 6 chopsticks[(phil_id+1)%5] = phil_id; 7 delay(rand() % 10000); // delay random amount [0,9999] for actual eating 8 chopsticks[(phil_id+1)%5] = -1; 9 pthread_mutex_unlock(&mutex[(phil_id+1)%5]); 10 chopsticks[phil_id] = -1; 11 pthread_mutex_unlock(&mutex[phil_id]); 12 } 

    Code 2

    1 void eat(int phil_id) { 2 pthread_mutex_lock(&mutex[phil_id]); 3 chopsticks[phil_id] = phil_id; 4 delay(500); // small delay to ''permit'' opportunity for deadlock 5 pthread_mutex_lock(&mutex[(phil_id+1)%5]); 6 chopsticks[(phil_id+1)%5] = phil_id; 7 delay(rand() % 10000); // delay random amount [0,9999] for actual eating 8 pthread_mutex_unlock(&mutex[(phil_id+1)%5]); 9 chopsticks[(phil_id+1)%5] = -1; 10 pthread_mutex_unlock(&mutex[phil_id]); 11 chopsticks[phil_id] = -1; 12 } 
    submitted by /u/bikerchef
    [link] [comments]

    Linking javascript file to an HTML file

    Posted: 01 Apr 2019 02:13 PM PDT

    Hi everyone. I currently have a project for a web development class where I am encountering an issue.

    I have created a basic website (HTML) and have finished writing all the CSS and Javascript for it.Problem is that it won't run my javascript code (and I have verified that it works by testing it in the console).

    I used the following code to link the two files together:

    <script type="text/javascript" src="ResumeJS.js"></script>

    The two files i'm trying to link are "Resume.html" with "ResumeJS.js". They are already in the same directory.

    Anybody have any idea why it wouldn't be working?

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

    How to read a letter int,int in C?

    Posted: 01 Apr 2019 12:20 PM PDT

    Hello! Basically, I want the user to enter the following format:

    h integer,integer

    example: h 5,6

    h is standard, then integer followed by comma and another integer. The integers represent positions in an array x,y so I need a way to keep them so I can use them in a function I've created.

    Can someone help me understand what I need to do? Thanks!

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

    [Google Scripts] Trying to play a sound file when shared Google Doc is opened.

    Posted: 01 Apr 2019 11:15 AM PDT

    Sorry if this isn't the place for this, I wasn't finding any help elsewhere.

    Anyway, it's April fools, and my roommate already got me.

    We have this shared Google doc were working on, and I'd like to have that ear-rape Sanic theme blare the next time he opens it. Any advice on how to make that happen would be greatly appreciated.

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

    What high-level programming language is Cock? and Isabelle?

    Posted: 01 Apr 2019 07:27 AM PDT

    https://youtu.be/ESXOAJRdcwQ?t=2834 is where the languages are mentioned, I am trying to Google them, maybe I am hearing them wrong. My second question is, can someone help explain the part where he says when the language is at such a high level, its just writing a specification where your code cant be wrong? How is that possible? And what does "writing a specification" even mean?

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

    What is the standard approach to authentication when trying to make multiple separate apps work together?

    Posted: 01 Apr 2019 11:04 AM PDT

    Example Scenario: 1. I am working with a Wordpress site and this site has its own login system. The user will provide credentials to the Wordpress site. 2. After they log into the Wordpress site, there is an area where I will use a separate premade CRM system (SugarCRM for example). I don't want the user to have to provide credentials to the SugarCRM site. 3. There is also an area where there will be premade bulletin board system (maybe phpBB). I don't want the user to have to provide credentials to the phpBB site.

    I would like for the user to log into the Wordpress site and have that identity persist across to the phpBB and SugarCMR sites. It feels like this is a common thing to do, so I'm wondering what term I should google to see how others have approached. I have tried OAuth and OpenID, but are those what I'm looking for? Thanks

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

    Ask about the guide to write actual code for mathematical functions

    Posted: 01 Apr 2019 06:49 AM PDT

    Hi everyone, I remember seeing a list of many code snippets (in Javascript or pseudocode or smth like that) that demonstrate how to implement mathematical functions. Something like:

    dot product a . b

    code a1*b1 + a2*b2 + a3*b3

    I tried to google it but all I could find was the javascript Math library. Does anyone know where to find this list or the keyword to find it? thank you :)

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

    Need some help to understand class inheritance (C++)

    Posted: 01 Apr 2019 06:48 AM PDT

    I'm trying to extend someone else's API for my own purposes, and I'm trying to get my head around class inheritance in that context.

    I've written this minimal program:

    #include <stdio.h> class first_class { public: first_class() {}; }; class second_class : first_class { private: int y; public: int get_y() { return y; } second_class() { y=99; } }; int main() { first_class* a = new first_class(); second_class* b = new second_class(); int q = ((second_class*)a)->get_y(); printf("%d\n",q); int r = b->get_y(); printf("%d\n",r); } 

    first_class does nothing at all, and has no members. second_class inherits from first_class, but adds a private member y and a getter function, get_y();

    When I call get_y() on an instance of second_class, it works as expected. When I call get_y() on instance of first_class, which I have cast to second_class, it returns 0.

    Is that what should be expected? Are all child-class-only member variables automatically set to zero, or is that one of those usually-happens-but-not-actually-guaranteed things that compilers do sometimes, and they should actually be treated as undefined?

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

    How to Create Simple Custom Avatars for a Website

    Posted: 01 Apr 2019 10:20 AM PDT

    Hi all,

    I am currently working on a website and we want to implement a feature where users can create 2D avatars. The focus will not be on the faces (although if we could get it to look like a slightly less detailed version of Bitmoji, that would be great) but on the clothes. The clothes shouldn't be super detailed either, but should be able to give an idea of what someone might look like if they wore those clothes in real life (color schemes and other stuff).

    The website is currently being made using HTML, PHP, and MySQL. What should we use to create the graphics, and does this sound like a difficult thing to accomplish? We are hoping to be able to organize the clothing options, have an outline/template for each one (i.e. blank short sleeve t shirt, long sleeve t shirt, etc.) that users can fill with their desired color, so the only thing we would really need to draw/create would be the outlines of each item of clothing. The clothing items users create could be stored in a MySQL database (we would love to know if there are other, better options for back-end storage) We also want to make it easy for users to swap between individual outfits.

    Thanks!

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

    Deleting element from List of object pointers with iterator pointer (C++)

    Posted: 01 Apr 2019 10:17 AM PDT

    Hey guys, I have a List of object pointers, and I'm trying to delete an element with an iterator pointer and I keep getting build errors as I'm not sure what the proper way to go about this is. Here is some of the code in question. Also, here is my error in a pastebin.

    class PlaneManager{ private: list<Plane> * planes = new list<Plane>; list<Plane>::iterator * iter = new list<Plane>::iterator; public: void DeletePlane(const string& tailNumber); 

    Here is the function in question that throws errors.

    void PlaneManager::DeletePlane(const string& tailNumber){ if(PlaneExists(tailNumber)){ for (iter = planes->begin(); iter != planes->end();++iter){ if(iter.GetTailNumber() == tailNumber) planes->erase(iter); } }else cout << "Couldn\'t find that plane." << endl; } 

    Thanks for any insight you can provide, as I'm still a little lost with pointers.

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

    What was the weuredest bugfix you saw/had?

    Posted: 01 Apr 2019 09:46 AM PDT

    I MEAN WEIREDEST!!!

    example: [insert game name] fixed a bug where you would turn into an entangled mess when standing on a spinning object for too long

    each patch note that i read says "bugfix" or "minor bug fix", each dev out there fixing bugs, tell me what you fixed, i want to know what bug this was

    to people saying "you copied from thumblr", i did not directly but i found a picture related to this thread on thumblr and i can't find the orginial

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

    im following intel openvino tutorial online and need some help

    Posted: 01 Apr 2019 02:16 AM PDT

    So basically I am trying to follow an openvino tutorial on youtube. they are using ubuntu while im on windows 10, so i assume some of the codes typed in the terminal is just slightly change. it reached a point where it tells me to:

    --->mkdir build --->cd build --->cmake .. 

    so I did that in cmd

    C:\>mkdir build A subdirectory or file build already exists. C:\>cd build C:\build>cmake .. CMake Error: The source directory "C:/" does not appear to contain `CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.` 

    May I know what is going on and how to solve this? im following this tutorial

    https://www.youtube.com/watch?v=6Ww_zLDGfII&list=PLDKCjIU5YH6jMzcTV5_cxX9aPHsborbXQ&index=5

    terribly sorry for any formatting issue. im new here

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

    Storage classifiers in C

    Posted: 01 Apr 2019 07:52 AM PDT

    What is the difference between the auto, static, register, and extern storage classifiers?

    The definition in the book doesn't make sense to me.

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

    No comments:

    Post a Comment