• Breaking News

    Thursday, January 16, 2020

    What is the relevance of either java or .net, as far as companies that use them and what they use them for? Ask Programming

    What is the relevance of either java or .net, as far as companies that use them and what they use them for? Ask Programming


    What is the relevance of either java or .net, as far as companies that use them and what they use them for?

    Posted: 16 Jan 2020 12:03 PM PST

    I'm contemplating an education in either and I'm curious what the world looks like for these specific languages.

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

    Any recommendations for making a web-based banking system?

    Posted: 16 Jan 2020 04:35 PM PST

    Hello. I'm being asked to develop a banking system from scratch. The project requirements are rather extensive, but I won't do the whole thing; at least I want to make a prototype and perhaps a little more to earn some experience (and money). I know this is a delicate kind of project, so I want to do it right from the start. I have a few questions:

    • Is there any technology that could help me in this area?
    • Is it good to have a separate backend and frontend or is it better to have a monolithic architecture? I'm specially worried about security in the case of having a separate frontend, because of JWT tokens or credentials management in general, but I assume it would be better to have it this way because there will be a mobile app for the project, and both the frontend and the app could benefit from the same backend.
    • At Infrastructure-level, would it be wise to use something like App Engine or Kubernetes?
    • For this kind of application, would the language for backend matter in the long run? Will I run into some limitation if I use some language like Python or Node.js? Or would it be better to use something like Go or Elixir?

    TL;DR: I being asked to start developing a web-based bank (not finish it, just the start, at least for now) and I want to make it right. Any tips?

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

    Unable to create object of type <'dBContext'>

    Posted: 16 Jan 2020 05:03 PM PST

    I am using .net core backend framework to initialize a database based on a model I created. I am using VS code.

    I am using 'dotnet ef migrations add InitialCreate' and I get the error: 'Unable to create object of type EmployeeContext'.

    I am unsure what the issue is. I also don't understand why the above command also wants to build/run my code when all I am doing is adding the migration.

    Here is some of my relevant code:

    EmployeeContext.cs

    using Microsoft.EntityFrameworkCore; using restapi.Models; namespace restapi.Data { public class EmployeeContext : DbContext { public EmployeeContext (DbContextOptions<EmployeeContext> options) : base(options) { } public DbSet<Employee> Employee { get; set; } } } 

    EmployeeController.cs

    using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using restapi.Models; using restapi.Data; namespace restapi.Controllers { [ApiController] [Route("[controller]")] public class EmployeeController : ControllerBase { private readonly EmployeeContext _context; public EmployeeController(EmployeeContext context) { _context = context; } public IEnumerable<Employee> Get() { return _context.Employee; } } } 

    inside startup.cs (configuration)

    services.AddDbContext<EmployeeContext>(options => options.UseSqlite(Configuration.GetConnectionString("EmployeeContext"))); 

    project file cs

    <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.1"> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PrivateAssets>all</PrivateAssets> </PackageReference> <PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="3.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools.Dotnet" Version="2.0.3" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" /> </ItemGroup> </Project> 

    appsettings.json

    { "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*", "ConnectionStrings": { "EmployeeContext": "Data Source=Employee.db" } } 
    submitted by /u/dev123321
    [link] [comments]

    How should I study?

    Posted: 16 Jan 2020 09:27 AM PST

    Hi, I already have a pretty good understanding of python, and I wanted to get into cybersecurity, but I also got into full stack webdev recently, and I want to keep studying both, how should I do it? a couple of hours of each everyday? or mon, wed, fri for cybersecurity and tue, thu, sat for webdev? or a third option? thanks in advance.

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

    Programing n00b needs help starting a raspberry pi project.

    Posted: 16 Jan 2020 03:33 PM PST

    Hey there folks!

    I am in need of some advice as I develop this little project.

    I am looking to learn a coding language, to eventually build a small GUI program that'll run on a raspberry pi and a touch display. I know a bit of HTML and CSS but am unsure of where to go from there. From what I have read it seems python would be a good bet, is that the case? If y'all could recommend a language and any helpful resources it would be much appreciated.

    The ideal programs functions are as follows:

    • Takes up the full display size and cant be accidentally closed by user

    • Upon starting the program a random image is displayed from a set (program must allow for adding images to the set as time goes on)

    • Allow the user to zoom and pan with mouse or touch controls.

    • Allow the user to have another image randomly selected and displayed - via a kind of randomize button.

    For now that's really about it. I am trying to start small with this project to develop skills. Ideally what ever language I can approach this project with can scale to larger and more complex programs to display images and video.

    Thanks for the help everybody!

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

    [Java] User-Defined Methods Not Being Called & Other Issues

    Posted: 16 Jan 2020 09:28 PM PST

    https://imgur.com/a/zPQkLYB

    https://github.com/Umphire/vault/blob/master/Admissions

    I'm trying to invoke a my own defined method in the main method, but my compiler is saying that my methods don't exist. Also, the if-then statements in my code are not functioning either. Does anyone know how to solve this issue? I have linked a photo of my code as well as a github link to it.

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

    Raspberry pi and multitasking

    Posted: 16 Jan 2020 08:04 PM PST

    I just finished setting up a 3b+ with RetroPie and I'm trying to write a script to play an audio file on loop. I think I followed these directions:

    https://hackaday.io/project/3390-snap-crackle-pi/log/11304-setting-up-the-pi-to-loop-sound-file-at-boot

    using the steps for a file on the pi (not sure if I gave it the correct locations).

    If I did this right, would I be able to hear the audio loop if RetroPie is running? Or is RetroPie too meaty to allow that kind of script?

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

    What should I use for my database?

    Posted: 16 Jan 2020 04:11 PM PST

    I'm a foreign language professor and I want to create a vocabulary database just for my own use (initially). I know I could build it in Microsoft Access, but I wonder if that is outdated and will limit me in the future. I have some basic web experience (HTML, CSS, Drupal), but it's been a while.

    Is there a different platform that I should consider building it in? It would be nice if I could access and edit data online and allow multiple users to access and input data.

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

    Noob Question : pro and cons of 2 diff ways

    Posted: 16 Jan 2020 06:43 PM PST

    Hello guys, so I've been doing some programming mainly with Laravel for awhile. While I was working on a project with several other developers, I notice few things that does thing exactly the same with different ways. So I'm wondering what is the pro and cons of these ways.

    There are several cases:

    The 1st one is use and \ what is the difference ?

    Is there any benefits of using use instead of calling it directly with \ ?

    for example :

    use GuzzleHttp\RequestOptions; // vs \GuzzleHttp\RequestOptions 

    The second one is with eloquent

    use App\Post; $post = Post::find(1); $post->title = 'Learn to Code'; $post->author = 'Ashraf'; $post->save(); // vs $post = Post::find(1)->update([ 'title' => 'Learn to Code', 'author' => 'Ashraf' ]); 

    There are several other cases like these, so is there any performance benefit in these different ways? or they are more or less the same and I can use either?

    I hope you can enlighten me on these. Thank you.

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

    Can't Compile DrJava GUI Programs? (Repost from r/learnjava)

    Posted: 16 Jan 2020 06:32 PM PST

    Every time I try to compile a program that runs GUI(s) the program is unable to run. The successful compile message appears, but after hitting run it says that the "Current document is out of sync with the Interactions Pane and should be recompiled!"

    This is only happening with programs that create GUIs. I tried it with other programs that don't, and they seem to work fine. Need help ASAP!

    EDIT: Compiler version is JDK 8.0_222, and the DrJava file I have is beta 2019-08-13

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

    Confusion! with pay stub code

    Posted: 16 Jan 2020 11:55 AM PST

    I'm creating a pay stub for my coding class

    int main()

    {

    float hourlyPay = 0, hours = 0, employeeNumber = 0;

    int product;

    product = (float) (hourlyPay* hours);

    printf(" Enter your Employee's number :") ;

    scanf("%f", &employeeNumber);

    printf(" Enter your hourly pay :");

    scanf("%f" , &hourlyPay) ;

    printf(" Enter your number of hours worked :") ;

    scanf("%f" , &hours) ;

    printf("\n\n");

    product = (double) (hourlyPay*hours);

    //deductions = (int)( product*.06);

    printf(" Thank you!\n");

    printf(" Here is your paycheck!\n\n\n");

    printf("\t\t\----------------------------------------\n");

    printf("\t\t Employee's Number:\t %.0lf \n" , employeeNumber);

    printf("\t\t Hourly Pay: \t\t %.2f\n" , hourlyPay);

    printf("\t\t Hours worked: \t\t %.0f\n" , hours);

    printf("\t\t Total Gross Pay:\t %d Dollars\n\n ",product);

    printf("\t\t\t Deductions\n");

    printf("\t\t\t Tax (6 % ) %d\n\n" , product );

    printf("\t\t Net Pay\n");

    printf("\t\t\----------------------------------------\n\n\n");

    printf(" Bye!");

    My problem is I don't know how to take the product and multiply it by a set number such as .06. Along with when I enter for example 8.75 into hourly and enter 9 into hours it should display 78.75 but it displays just 78.

    Any help is gladly appreciated!

    Another question would be how to display the % as it is . In my code when ran just shows a blank space

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

    Where to start?

    Posted: 16 Jan 2020 03:15 PM PST

    I'm interested in learning programming/coding as a side hobby, but I have absolutely no idea where to start. I have some "learn the basics" apps but beyond that...I'm lost. Is there a subreddit that would be better for me to ask in? Can I use a chromebook to practice writing code/where do I start? I know very little about computers, but have always been interested in learning.

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

    dotnet 'any command' just builds my project....

    Posted: 16 Jan 2020 11:00 AM PST

    I am losing my mind trying to figure out why I can't run any dotnet commands from the terminal using vs code. I must be doing something stupid.

    My end goal is to migrate a database based on a model that I developed. However, no matter what command I run with 'dotnet', it always just tries to build/run my project.

    I am trying to run:

    dotnet ef migrations add InitialCreate 

    But it just builds and runs the project and does print out "Unable to create an object of type 'EmployeeContext'" when it closes down. Even if the migration aspect worked, why would it try to build and run my project? I just want it to migrate the databases, and then I can update the database right after. Here are some relevant files:

    appsettings.json

    { "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*", "ConnectionStrings": { "EmployeeContext": "Data Source=Employee.db" } } 

    restapi.csproj (restapi is my project name)

    <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.1"> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PrivateAssets>all</PrivateAssets> </PackageReference> <PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="3.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.1" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" /> </ItemGroup> </Project> 

    launch.json

    { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": ".NET Core Launch (web)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/restapi.dll", "args": [], "cwd": "${workspaceFolder}", "stopAtEntry": false, "serverReadyAction": { "action": "openExternally", "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" }, "env": { "ASPNETCORE_ENVIRONMENT": "Development" }, "sourceFileMap": { "/Views": "${workspaceFolder}/Views" } }, { "name": ".NET Core Attach", "type": "coreclr", "request": "attach", "processId": "${command:pickProcess}" } ] } 
    submitted by /u/dev123321
    [link] [comments]

    How to call a method only once in an onTickListener()?

    Posted: 16 Jan 2020 02:33 PM PST

    I'm trying to get the TextToSpeach speak() method to only be called once. I'm running my speech() method inside a chronometerOnTickListener because it needs to speak at a certain percentage. If it's on 16% for more than a second, it calls the t1.speak() method twice. I tried to use t1.speak() then t1.stop() method but that made it so the voice was never used because it runs so fast to stop(). I tried using Thread.sleep(1000), but that stopped the whole program, including the timer. I'm trying to find a way to only call the speak() method once while it's in a onTickListener. Pausing is a last resort as I don't know how long it will be on a certain percentage. Any suggestions?

    Edit:

    Here's my speech method:

    public void speech() { switch((int)progressPercent) { case 16: t1.speak("16 percent", TextToSpeech.QUEUE_FLUSH, null); break; case 18: t1.speak("18 percent", TextToSpeech.QUEUE_FLUSH, null); break; case 20: t1.speak("20 percent", TextToSpeech.QUEUE_FLUSH, null); break; case 22: t1.speak("22 percent", TextToSpeech.QUEUE_FLUSH, null); break; case 24: t1.speak("24 percent", TextToSpeech.QUEUE_FLUSH, null); break; case 26: t1.speak("26 percent", TextToSpeech.QUEUE_FLUSH, null); break; } } 
    submitted by /u/dnlaua
    [link] [comments]

    If you had 1.5 months to learn, what topics would you cover?

    Posted: 16 Jan 2020 02:00 PM PST

    I recently became aware of an incredible opportunity at a tech company that brings on super entry level folks and trains them in certain disciplines. Specifically, I'm looking at either a Cloud (AWS, Azure, etc.) or Enterprise Management Systems concentration. In my current job (Marketing Operations) I frequently work with, but don't write, HTML. I was doing the codecademy course for Java just for fun and I found it much more engaging than HTML or CSS, then discovered the opportunity. Since I finished the Java course, I jumped into the Computer Science path which covers Python as well as some other concepts. Java and Python have completely grabbed my interest, I find the problem solving more engaging and exciting than anything I've done in my current role.

    Basically, I guess my question is what concepts should I be familiar with that maybe aren't directly related to skill with languages? I don't have an education in CS, so I just want to make sure I have my bases covered.

    This opportunity has struck me like lightening, and I really want to take full advantage and not miss anything. I'm more than happy to clarify anything if you want.

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

    Weird behaviour - bad compiling? - from Visual Studio

    Posted: 16 Jan 2020 01:47 PM PST

    I'm using Visual Studio Community to compile a command line C++ project. it's only a few thousand lines of code and it's a rewrite of an old project, which I never had any problems with, plus some code from another project which I've also never had problems with.

    As a bit of hangover from the previous version, I #include a file which contains this:

    struct global_struct { int verbosity = 1; int workbpp_cmd; std::vector<Image> images; int max_levels = 0x7fffffff; int sub_levels = 0; int width = 0; int height = 0; int jpegquality = -1; int compression = -1; char* seamsave_filename = NULL; char* seamload_filename = NULL; bool savemasks = false; bool save_out_pyramids = false; char* xor_filename = NULL; bool no_output = false; char* output_filename = NULL; bool debug = false; double xres = -1; double yres = -1; Threadpool* threadpool; png_color* palette = NULL; }; global_struct _globals; 

    defining a struct and then declaring a global of that struct. As you can see, the first member is an int called verbosity which is set to 1.

    The weird is that, every now and again (maybe 1 in 20 compiles), the variable _globals seems to be initialised with all its members set to 0 (I first noticed because of the effect verbosity has on the program's output).

    I know it's pretty vague without showing you more of the program, but I've been through and commented out extensive chunks of code, and have now added a check right at the start of main() to check that verbosity really is 1, as it should be, and yet still, every now and again, I hit F5 after changing a couple of innocuous lines and get told that verbosity equals zero. If I then Rebuild Solution, or Clean Solution and Build, it usually works fine the next time. The good and bad binaries definitely differ, although I'm not sure what to make of those differences.

    I'm now starting to wonder whether a) something is corrupt in my project, or b) I'm doing something that is, strictly speaking, undefined behaviour. It's probably a bad idea to use a global struct like this anyway, and I'm phasing it out, but I'd like to get to the bottom of the problem anyway. I also wondered if my RAM was going faulty or something, but I've had no other problems with the computer.

    So does anyone have any ideas about what might be going wrong? I don't remember this happening to the previous version of the project (which no longer compiles due to other stuff having been moved around), and I open sourced it and it was compiled and used on Linux and MacOS by a few people, none of whom reported any such problems.

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

    Gaze contingent interface implementation

    Posted: 16 Jan 2020 01:37 PM PST

    Hey,

    I'm working on a project where I create a spotify interface and control some aspects of it using gaze, recorded by an eye-tracker, as input.

    The only way I can process the eye tracking data is with a module I wrote in Python.

    Now, my initial plan was to make the interface a web application (e.g. react.js app), and feed the eye tracking data through some API. Obviously, this is a pretty bad work-around as I would then have to map the data to the interface again. (e.g. screenCoord(x,y) -> interfaceComponent)

    My question(s) to you:

    What other problems do you see with my initial idea, what things am I overlooking?

    Would implementing the interface in Python be easier (which library could help)?

    Are there alternatives I may not know about (It does not necessarily need to be a web app, the only requirement is access to the spotify webAPI)?

    I would really appreciate any ideas/proposals of how you would handle this problem!

    (Also, if you have some questions/need some clarification, PLEASE don't be afraid to ask them, I'll try and respond and update this post as soon as I can)

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

    Font Awesome - how do I remove this damn line??

    Posted: 16 Jan 2020 12:54 PM PST

    What's the best type of documentation for transferring code & product ownership

    Posted: 16 Jan 2020 08:56 AM PST

    I'll be transferring a number of products to new teams, some out-sourced, and won't be able to train them before my exit but I do have some time to generate new documentation to help them.

    I'm particularly interested in what people who have inherited products, services, repos, etc. found to be the best types of documents for your on-boarding.

    So far I was going to focus on System Level Architecture, User Flows, deployment process and making sure there is sufficient instruction on how to set up the development and testing environment.

    What else might I consider?

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

    Restriction bias and preference bias?

    Posted: 16 Jan 2020 11:29 AM PST

    Im having trouble understanding Restriction bias and preference bias, can sombody give me a simple explanation of them?

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

    [JS] Best way to initialize and fill up an object with data? And how to assign values to deep layers of an object (obj1.lay1.lay2.lay3 = "orange") ?

    Posted: 16 Jan 2020 09:43 AM PST

    Hello!

    I am trying to make an object and fill it up.

    One would think that

    var obj.color = "orange" 

    would initialize an object and assign a value to its layer 1 property

    But the suggested method is

    var obj = new Object(); obj.color = "orange"; 

    NEver liked constructors and in this case it looks redundant and like it would be obvious fro mthe first example that it was an object, but whatever. In this type of assignment, I suspect that I am wasting resources on fetching an object and then adding stuff to it and maybe expanding memory space, so I suspect (but I don't know, and I would liek you to tell me) that the following method is most legit:

    var obj = { color : "orange } 

    So please tell me which one is best if I have like 100 properties to assign at once?


    The second question is because I have seen something ,I want to use it, but I obviously don't know how it works.

    I tried:

    var obj = new Object(); obj. theme.color = "orange" 

    And neither

    obj.theme.color 

    nor (what I actually want)

    var col1 = "color"; obj.theme[col1]; nor var thm1 = "theme"; obj.[thm1].color 

    appear to work.

    Please tell me how to go deep into object and how I can use the property accessors succesfully on deep layers.

    Thank you


    Ps, how do you write that reddit code where you highlight code inline?

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

    .center - why isn't it working here?

    Posted: 16 Jan 2020 08:50 AM PST

    Hello. Following this Traversy Media's tutorial - https://www.youtube.com/watch?v=HZv8YHYUHTU&feature=youtu.be&t=408

    Here's my problem:

    https://imgur.com/a/HLEPATh

    It works for the "About" section, but not in the footer. Everything works for him, and I'm not sure what I'm doing wrong.

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

    What program would one use to develop an app with a similar layout to Twitter or Reddit?

    Posted: 16 Jan 2020 08:29 AM PST

    For example, I'm sure I could use Unity, which is my preferred engine for building games, but what's the most optimal program to use to build these sorts of apps? Also, could it be done in Java/C#/JavaScript, or would I need to pick up a new language like PHP?

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

    How are modern 2019/2020 desktop-app made?

    Posted: 16 Jan 2020 04:05 AM PST

    Hello guys!

    So as i see web dev is more and more growing as of past years, im wondering, what are current technologies regarding desktop-app? What technology should one follow to improve and create desktop-apps and find a job in that field ?

    I know Electron is somewhat a popular choice and seen in something like Discord.But there is also UWP and WPF and QT that are still used and even UWP is a more modern technology albeit locked to windows 10(Which is quite popular and shouldn't be too much of a problem).

    I guess my real question is, if myself or someone else would want to create a dekstop-app or support a dekstop-app, which technology route should be followe, to stay up to modern standards ?

    (Small example: lets say if you are to create desktop apps like Photoshop or something like Skype or a dekstop-app for a streaming service like netflix/twitch etc)

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

    No comments:

    Post a Comment