• Breaking News

    Tuesday, February 26, 2019

    Is it just me or are full time scrum masters simply professional Facebook browsers? Ask Programming

    Is it just me or are full time scrum masters simply professional Facebook browsers? Ask Programming


    Is it just me or are full time scrum masters simply professional Facebook browsers?

    Posted: 26 Feb 2019 09:00 AM PST

    I've never met one who I felt contributed enough to justify their position.

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

    Derived classes implementing the behavior

    Posted: 26 Feb 2019 03:01 PM PST

    In my shop we have a strong desire to abstract out what i'll call the "prime object model", that is the object model without any behavior. It is just pure data, relationships, etc, but no behavior.

    Often we take these objects and give them to services to do something. For example, if Customer only had the data, we might do something like, RententionProgram.Process(thisCustomer). The service then looks at the customer and figures out what to do.

    It got me thinking, what if in each domain, you inherit this base model, then provide the functionality around it. So customer service gets a Customer data model, inherits it and provides the functionality (and interfaces) needed for its domain, and Tech support can inherit from it as well and provide its own domain level behavior.

    Customer in sales might have different functions than a Customer in the Retention domain, and yet different functions in the tech support domain. Typically we use mappers to be between these.

    What are the pitfalls of inheriting your data model and providing domain specific behavior?

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

    C++ Learning: Program that should output if doubles ( a - b == .01 ) only works with inputs 0, .01 , .02

    Posted: 26 Feb 2019 09:24 PM PST

    Hello, I've been trying to teach myself programming from the Stroustrup C++ book. So far the assignment I'm working on has made me write a program that has a while loop that asks for 2 doubles then prints them, writes out the smaller input and larger input, writes if the inputs are equal, and writes if they are within .01 of each other. I've written a program that does all of that, but the last part that prints if they are within .01 of each other only works if that condition is true with inputs between -.02 and .02. For example if I enter 0 and .01 it will be true, but if I enter .03 and .02 it will not write that they are within .01 of each other even though this condition is true. If someone could please explain where I made a mistake in my code it would be very appreciated!

    #include<iostream> #include<string> #include<vector> #include<algorithm> #include<cmath> using namespace std; inline void keep_window_open() { char ch; cin>>ch; } int main() { double a = 0; double b = 0; double min = 0; double max = 0; constexpr double close = 0.01; while (a = b == 0) { cout << "enter two doubles: \n"; cin >> a >> b; if ( a > b ) { max = a; min = b; cout << "The larger value is: " << max << " The smaller value is: "<< min << "\n"; cout << "difference is: " << ( max - min) << "\n";} else if ( a < b ) { max = b; min = a; cout << "The larger value is: " << max << " The smaller value is: "<< min << "\n"; cout << "difference is: " << ( max - min) << "\n"; } else { cout << "The values are equal\n"; } if ( ( max - min ) == close ) { cout << "The values are almost equal!\n"; } a = 0; b = 0; min = 0; max = 0; } } 

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

    Javascript data accessing?

    Posted: 26 Feb 2019 05:11 PM PST

    I'm trying to access some of this data for use in a data visualization using D3 but am having trouble with the return type. I can summarize what I'm trying to do below, or I can send you a link to a fiddle if you'd like.

    var x; x = d3.csv("myFile.csv", function(d) { return { //this is where I return all the data that I need from my file }; }).then(function(data) {return data}) console.log(x); 

    My goal is to be able to access the csv files as a variable, such that if I want the first element, I use x[0]; Can someone help me out, it'd be really appreciated!

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

    Organize C++ classes around SQL database

    Posted: 26 Feb 2019 08:53 PM PST

    Those who wrote web apps using C# or Java are familiar with the concept of Entity Class - Entity Framework is a perfect example.

    I'm writing a web app using C++ and I wonder if having such classes would be worth it.

    I found an opinion and the guy recommends using Stored Procedures approach with no entity classes:

    The common mistake many people make with database mapping is that they focus on the schema and develop a tightly-coupled representation of the tables in business logic classes. This is not the best way at all - obviously it makes the business logic layer so tightly coupled to the DB that they quickly realise its a mistake and end up adding another layer to try to decouple business logic from DB, calling it a DAO or ORM or similar.

    What you should do is look at your DB as a layer in itself, one that provides an API where data requests are made. I find its easiest to conceptualise this by writing all your SQL as stored procedures and restricting all access to the underlying tables. (this approach also has the benefit of increasing security)

    Once you do this, you start to look at the data as a resource to be consumed, the business logic will have classes written that map to the stored procedures and they work together - logic in the business logic classes with data that is operated on sourced from your "data API". It also means you can change the schema without any change to the business logic layer at all (though, obviously if you change the stored proc API that is used, you'll have to change the callers, but you can add new sprocs where needed without any impact on existing code).

    Another benefit is that your DB and your business logic are then independent and can be worked on separately. using your DB API would be not much different than using a 3rd party API provided via a web service or other data source.

    How would you go about this?

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

    What is the point behind undefined behavior?

    Posted: 26 Feb 2019 04:19 PM PST

    I am coding since 2007 and do it professional since 2010. But I could never wrap my head around the purpose of undefined behavior in C and C++. Can someone explain it or recommend a good blog article on the why?

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

    Android app architecture advice

    Posted: 26 Feb 2019 07:55 PM PST

    Hi! I'm a still a green horn programmer, but I have been working as a developer for a software company getting me sea legs for about two years now. I mainly work in a .NET WPF XAML Entity Factory code base. We use the MVVM pattern with SQL db's for the apps crud. I'm now feeling confident enough (and motivated enough) to take on my own project. I'm creating a mobile rpg type game that's strictly UI based with the exception of images for in game items (weapons, character avatar etc). I feel like Xamarin.Android is what I should be using, but I have some stipulations and need some feedback.

    1. I do not want to use a local database like SQLite for data storing.
    2. I want the app user/session data to be stored locally on disk when the app is closed and in memory when the app is open.
    3. I want to use the MVVM pattern as it is what I'm more capable with and seems fitting for my concepts.
    4. I want to use XAML or AXML, something that can bind with view models. The biggest gap conceptually for me is how to create a data store/model just in C# as I've only used model classes with Entity Factory.
      Thank you for your help!
    submitted by /u/FrankUnderhood
    [link] [comments]

    What does 'a sync' mean when talking about user flow?

    Posted: 26 Feb 2019 06:20 PM PST

    A job I applied to asked some questions. One of them is:

    What's one improvement you would make to the user flow when creating a sync?

    I have no idea what 'a sync' is in this context

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

    Can anyone explain why we don't need to reload 'head' if the cas operation fails for a lock-free stack push?

    Posted: 26 Feb 2019 11:50 AM PST

    template<typename T> class lock_free_stack { private: struct node { T data; node* next; node(T const& data_): data(data_) {} }; std::atomic<node*> head; public: void push(T const& data) { node* const new_node=new node(data); new_node->next=head.load(); while(!head.compare_exchange_weak(new_node->next,new_node)); } }; 

    I am reading page 185 of Concurrency in Action by Anthony Williams where he introduces the push function for a lock-free stack. I am trying to reason about various total orderings to make sense of what would happen.

    I construct an empty lock_free_stack called stack1. Later I call stack1.push(data_packet_a); from one thread and stack1.push(data_packet_b); from another thread at the same time. Consider the following interleaving (for the default global memory ordering):

    Thread 1 allocates heap memory pointed to by new_node and copies data_packet_a to this heap location.

    Thread 2 allocates heap memory pointed to by new_node and copies data_packet_b to this heap location.

    Thread 1 copies the pointer value at head to the stack's new_node->next.

    Thread 2 copies the pointer value at head to the stack's new_node->next. (i.e. does nothing).

    Thread 1 compares the value of the pointer in stack's new_node->next and the pointer value in head, finds they're equal (durh) and sets head's pointer value to new_node's pointer value.

    Thread 2 compares the value of the pointer in stack's new_node->next and the, now different, pointer value head, finds they are not equal, and loops forever.

    Thread 2 is now in an infinite loop, with head and new_node->next holding different values, data_packet_b is not on the stack and has leaked onto the heap without a reference. I have checked the errata without finding anything. The solution will be that there is something really basic about C++ I don't understand. Can someone point out the, most likely very basic, hole in my reasoning?

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

    How to use required on Angular.

    Posted: 26 Feb 2019 02:57 PM PST

    Hello community. What is the correct way to use an angular node module? I'm a novice using node, I've been experimenting with Electron and now I want to use it together with Angular. In electron I used a module as follows:

    const defaultGateway = require('default-gateway');

    Now I want to do this from angle, when I do it I get the message «'require' call may be converted to an import.ts(80005)», I have tried:

    import * as defaultGateway from 'default-gateway';

    And it returns the message «Could not find a declaration file for module 'node_modules/default-gateway'. './node_modules/default-gateway/index.js' implicitly has an 'any' type. Try npm install @types/default-gateway if it exists or add a new declaration (.d.ts) file containing declare module 'node_modules/default-gateway';ts(7016)».

    What's the right way to do it?

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

    What is your own unique 'hello world' program you use when learning a new language?

    Posted: 26 Feb 2019 02:50 PM PST

    When you are trying to grasp a language or framework, what is your unique way of doing so?

    For example, I always pull a get request from a Chuck Norris joke API, and output the joke only. This let's me learn how the language/framework handles get requests and Json handling, which I enjoy working with regularly.

    What about you?

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

    What coding languages / topics do I need to learn create an online math game?

    Posted: 26 Feb 2019 02:25 PM PST

    dHash Optimization

    Posted: 26 Feb 2019 02:19 PM PST

    So I have a question regarding dHash. Like the one used here

    There are a couple different flavors of dHash. The typical setup is to crunch the image down to 8x8 and take the difference across the x axis. This produces a 64bit hash.

    You can also do the same thing but also go along the y axis and concatenate the two for a 128bit hash.

    Even further, you can go back to just doing the x axis but only shrink the image to 16x16 and end up with a 128bit hash.

    So my question, in general because I know a lot of things factor into it: Would I get better results (less false positives) from doing both row and column hashing on a 8x8, or just one direction on a 16x16?

    I know one answer is "Why not both?" but this is more of a hypothetical question. What do you think?

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

    anyone know why i keep getting synthax errors on my if statiments

    Posted: 26 Feb 2019 02:17 PM PST

    if choise == "a"
    elif print (num1, "+" ,num2:"=" add (num1, num2))

    if choise == "B"
    elif print(num1,"-" ,num2:"=" subtract(num1, num2))

    if choise == "C"
    elif print(num1, "*" ,num2:"=" multiply(num1, um2))

    if choise == "D"elif
    print(num1, "/" ,num2:"=" divide(num1, num2))

    else:
    print("You did somthing wrong")
    i am a very veeery new beginner like 1 day ago and have tryed looking for the problem erivy were so please help

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

    Quad core macbook necessary?

    Posted: 26 Feb 2019 09:54 AM PST

    I am looking to get a new laptop soon, probably a mac. My current laptop is old, slow, and generally awful. I'm looking at getting a new macbook over a pc simply for preference - I am aware I could get a windows or linux machine cheaper. I am also aware that I could get a used or older mac but would prefer to go for new as I think it would be an OK investment as these laptops last forever. I would primarily use it for web design, general programming, and web browsing, possibly gaming. I own a desktop pc that can handle more expensive computing for machine learning, gpu intensive video games, etc.

    • Is it important to spend an extra $300 for the quad core and TOUCHBAR TM, or would the dual core macbook pro be fine?
    • Is a macbook pro a better choice than a normal macbook?
    • Am I being excessively stupid even going for a mac and spending the mac tax? (This would be my first mac)
    • Any further advice???

    Thanks!

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

    Finding a top tier software developer/devopment team

    Posted: 26 Feb 2019 06:06 AM PST

    I was looking for some pointers on where to find excellent quality freelance software developers, or development teams. I have a fair bit of experience programming, but only in python and almost entirely 'front-end', and what I want to create will certainly need the use of servers (of which I have almost no knowledge), and SQL.

    I've looked online at a few freelance websites and talked with a few people, but none of the candidates' portfolios were satisfactory. I feel that the success of the project will directly hinge on the quality of the user interface and the smooth running of the back-end software, so it is incredibly important that I hire someone I can trust to deliver this.

    Where can I find top level developers? How much would this level of programmer cost for what I have had estimated to me as a 3 month project (for one person)?

    Any advice would be greatly appreciated.

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

    Should I worry about "the best way" to make a program, or just write it?

    Posted: 26 Feb 2019 01:35 PM PST

    Hello there, i've been piddling with programming for over 10 years now - and i've found love with python, and naturally... i'm trying to learn Django. I find myself trying to improve my code execution way before I have anything resembling a working app - and i noticed this pattern in my programming hobby....

    I know there are best practices in programming. However, lets say i wanted to make a quick function or even a full program... would it be best to write and optimize and plan features before they are needed in the code (what i do currently), or should i worry about having a working concept before i go through and then add in flair, extra features, and optimization?

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

    Using C# .Net Gmail API, Why can i not print number of email in inbox?

    Posted: 26 Feb 2019 12:14 PM PST

    Im experimenting with the gmail api in C#.

    My code looks like this:

    UsersResource.MessagesResource.ListRequest request = service.Users.Messages.List("me"); Console.WriteLine("Count Message: "); IList<Message> messages = request.Execute().Messages; if (messages != null && messages.Count > 0) { foreach (var message in messages) { Console.WriteLine(message); } } 

    It returns Google.Apis.Gmail.v1.Data.Message, 100 times. I understand that there are apperently 100 message in messages, but why? Im so confused.

    For the record i currently have 1100 mails in my inbox.

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

    How can I create a self authenticating link (Django)?

    Posted: 26 Feb 2019 11:27 AM PST

    I want something like http://www.mysite.de/login/authkey or http://www.mysite.de/username:password to automatically login the user with a link. I found "django-autologin" but without documentation and "django-sesame" but that doesnt work.. Is there a simple solution?

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

    How long does it take you to build a web app?

    Posted: 26 Feb 2019 10:41 AM PST

    I've been told that I am a "slow" programmer. I think I'm methodical, but compared to other people, I'm slow.

    If you're more junior, try to answer as well about the type of quality you typically deliver.

    If you're more senior, can you articulate if you feel slower than others who are more junior and how you've grown/developed yourself as a result?

    Simply answer with how many years experience and how long it might take you to build a simple app with one or two entities, and CRUD on one of those entities.

    What do you do to speed up your process? How do you do quality control checks?

    How often do you take breaks? How many lines do you write in a day?

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

    Partner to learn java.

    Posted: 26 Feb 2019 10:10 AM PST

    We can start with the basic or jump straight into whatever looking to start asap

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

    How to?

    Posted: 26 Feb 2019 09:10 AM PST

    How can you copy text from Facebook Messages or Direct messages and put them in a text file

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

    Anyone have experience with Google Maps API?

    Posted: 25 Feb 2019 10:57 PM PST

    I was wondering if it would let me pull the following variables and do the following functions, either directly or indirectly, I don't need someone to do the work for me, just wondering if these are even possible to return so I can rule out the API if it won't work for me.

    Variables:

    Travel time between two points on a map

    Travel time between two points on a map taking into account current traffic

    Travel time between two points on a map taking into account historical traffic

    Speed limit of road at a given address/intersection

    Functions:

    Generate list of all addresses (or simply return a random one) in a given village/township/city/county

    Generate list of all intersections (or simply return a random one) in a given village/township/city/county

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

    bash scripts to add functionality to newsboat

    Posted: 26 Feb 2019 07:31 AM PST

    hi all,

    i started using newsboat/podboat as my podcatcher. it's great, very easy to use and very powerful--however, i'm missing two functions that are important for my "work" flow. i know that both functions can be accomplished with a bash script, but i'm still a novice linux user and this represents my first foray into writing a script that does more than simply execute a program. unfortunately i don't have the time to simply start learning bash from the ground up, so i'm looking for some suggestions on how to get started writing the two scripts i need.

    the first script i need: podboat is set up to download files into a ~/Podcasts subdirectory for each podcast. however, a lot of shows name their files in abbreviated, unhelpful ways; others give their files long, random strings of characters. i want to be able to look at the contents of a directory and see which episode each file is, without needing to ffprobe and read the metadata, or cross-reference the date. so i want a script that will automatically rename newly downloaded files according to a consistent format--maybe episode title and date. i think the easy solution is to have the script read the metadata and rename the file with certain fields; however, not every show writes their metadata?! the more complex solution that, with my limited knowledge i don't really know how to do, would be to get the episode title right from newsboat itself, to make sure this is written to the metadata, and then write this to the filename.

    the second script i'm looking for is simply one that will remove the oldest file in a directory when the number of files reaches a certain threshold. i only want to keep 3 files in each show's folder, and don't want to be manually removing files.

    thanks in advance for your help. i can't be the only person who uses newsboat for podcasts, and who is unsatisfied with how podcasters name their files. even though it's quite "niche," i feel like someone has probably already come up with a solution to this problem; or, there is a solution from some other thing that can be easily retrofitted.

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

    No comments:

    Post a Comment