• Breaking News

    Wednesday, August 21, 2019

    Is it a good idea to program in C++ using mostly dynamic memory allocation (pointers and references) like in Java? Ask Programming

    Is it a good idea to program in C++ using mostly dynamic memory allocation (pointers and references) like in Java? Ask Programming


    Is it a good idea to program in C++ using mostly dynamic memory allocation (pointers and references) like in Java?

    Posted: 21 Aug 2019 11:09 AM PDT

    In Java, everything is a reference but primitive types. So what if you program in C++ using almost always dynamic memory allocation with pointers and references? Sure it would make memory management more painful since there's no garbage collection, but what about performance? Is it slower or faster?

    I guess this is a stupid question and I'll get downvoted, but I don't care, I just wanted to ask.

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

    I'm a desktop developer - what's the easiest platform to create web interfaces for customers who want them?

    Posted: 21 Aug 2019 05:48 PM PDT

    I've been a longtime desktop developer working with WinForms and have dabbled with QT. It seems like everyone wants a web interface nowadays for their applications and I just can't seem to keep up with the technology.

    I'm want to get some opinions from people who provide web interfaces to customers. Are there any platforms that abstract away the typical web programming concepts such that I can focus on the business logic of my applications?

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

    No clue to where even start with this

    Posted: 21 Aug 2019 04:28 PM PDT

    Wut?

    So I know these are words, it's just the order they're put in is confusing. Can someone just give me an idea where to start?

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

    Linux Bash Code

    Posted: 21 Aug 2019 03:40 PM PDT

    Any idea what this code is trying to do?Linux code

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

    What programming language would you use for a custom prompt?

    Posted: 21 Aug 2019 03:22 AM PDT

    I am currently working on a custom Zsh prompt which would display some git infos such as branch, revision...

    I did it in Bash because it's the way it's usually done, it has worked fine for me in the past and I wanted to learn bash a little bit.

    Then I discovered some people did it with Python and Rust, so the question is: have you tried it for yourself and how did it work out?

    I don't want anything fancy, I am just worried about performance. Bash works fine but it's very difficult to read and maintain in general IMO, this is why I am considering switching to something else.

    Yes I am aware that there are a LOT of custom Zsh prompts out there but I want to make one of my own.

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

    Help with unity

    Posted: 21 Aug 2019 03:17 PM PDT

    Hi all. My player is refusing to move. It is giving me the idle animation play mode. im trying to create a 2d game. here is the script : using System.Collections; using System.Collections.Generic; using UnityEngine; public class MovementController : MonoBehaviour { public float movementSpeed = 3.0f; Vector2 movement = new Vector2(); Animator animator; string animationState = "AnimationState"; Rigidbody2D rb2D; enum CharStates { walkEast = 1, walkSouth = 2, walkWest = 3, walkNorth = 4, idleSouth = 5 } private void Start() { animator = GetComponent<Animator>(); rb2D = GetComponent<Rigidbody2D>(); } // Update is called once per frame private void Update() { UpdateState(); } void fixedUpdate() { MoveCharacter(); } private void MoveCharacter() { movement.x = Input.GetAxisRaw("Horizontal"); movement.y = Input.GetAxisRaw("Vertical"); movement.Normalize(); rb2D.velocity = movement * movementSpeed; } private void UpdateState() { if (movement.x > 0) { animator.SetInteger(animationState, (int)CharStates.walkEast); } else if (movement.x < 0) { animator.SetInteger(animationState, (int)CharStates.walkWest); } else if (movement.y > 0) { animator.SetInteger(animationState, (int)CharStates.walkNorth); } else if (movement.y < 0) { animator.SetInteger(animationState, (int)CharStates.walkSouth); } else { animator.SetInteger(animationState, (int)CharStates.idleSouth); } } } 

    also here is the player inspector:

    https://imgur.com/a/GUEfi9N

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

    Questions about compilers

    Posted: 21 Aug 2019 02:13 PM PDT

    I am a freshman at a university and am having some problems figuring some things out. So I am in a class that introduces us to C++ and my professor wants us to use GCC as our complier, and Code::Blocks as the IDE. He has a tutorial on how to everything get set up on windows but for mac users he says to use Xcode. so here are my questions.

    1. through Xcode is there a way a to change the compiler to GCC? (I have downloaded Command Line Tools but when I try and change the compiler through Xcode I don't have the option of GCC)
    2. He told us that our programs have to be compilable through GCC and I gave up trying to change the complier through Xcode, so I downloaded Eclipse and when creating a C++ project it asks which toolchain I would like to use and it gives me a choice between MacOC GCC and Cross GCC. So is MacOS GCC the same thing as other versions of GCC.
    3. One final question and this one might be a bit dumb, but is there a difference between GCC and GNU?

    I know some of these might sound a little basic, but I am new to some of this because my High school taught through a website so I don't know much about compilers and IDE's. Thanks for your help.

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

    Help with adding external library to cmake project

    Posted: 21 Aug 2019 01:53 PM PDT

    I am trying to import an external .lib file into cmake. The following is my code. When it compiles it gives no error but it seems that the library is not imported at all. What am I doing wrong? The .lib file is called test.lib and it exists in the same directory as my CMakeLists.txt.

    cmake_minimum_required(VERSION 3.14) project(Project) set(CMAKE_CXX_STANDARD 14) ADD_LIBRARY(test SHARED IMPORTED) SET_TARGET_PROPERTIES(test PROPERTIES IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/test.lib") add_executable(Project main.cpp) target_link_libraries(Project test) 
    submitted by /u/SubstantialVast6
    [link] [comments]

    What the hell am I doing wrong???

    Posted: 21 Aug 2019 01:30 PM PDT

    if([neuroqol_fat_raw]=8,29.5,

    if([neuroqol_fat_raw]=9,34.1,

    if([neuroqol_fat_raw]=10,36.5,

    if([neuroqol_fat_raw]=11,38.2,

    if([neuroqol_fat_raw]=12,39.5,

    if([neuroqol_fat_raw]=13,40.7,

    if([neuroqol_fat_raw]=14,41.8,

    if([neuroqol_fat_raw]=15,42.8,

    if([neuroqol_fat_raw]=16,43.8,"")))))))))

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

    SQL query, how would I write this?

    Posted: 21 Aug 2019 11:58 AM PDT

    I am trying to:

    Create a SQL query that returns the five most popular items for users with a 'gmail' email in the past 30 days, based on number of sales.

    Very much thanks for any help with this

    Table Schemas:

    customers |_email |_customer_id products |_product_name |_product_id transactions |_product_id |_customer_id |_transact_at (timestamp) 
    submitted by /u/NOPEsql
    [link] [comments]

    SMS alerts ⚠️

    Posted: 21 Aug 2019 07:48 AM PDT

    How can I add SMS alert on my order confirming page of my website, let's say I want to deliver sms to the user who ordered the product.

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

    How exactly do I store the program as a file that opens up similar to when you launch applications?

    Posted: 21 Aug 2019 09:19 AM PDT

    This question may be out of my scope of knowledge, but I recently taught myself python over the summer, and had a very simple idea. I wanted to create a math problem generator ( More so a program that reads a file with a bunch of math problems and solutions and then when you press generate it will choose a random problem). However I want this program to actually be accessible outside of the text-editor/terminal, so I was curious on how exactly you do that/what books/topics I need to learn in order to make that. I am assuming I have to code a background/etc then tell python where exactly this program will run on this background? Sorry for the poor explanation, in summary I want my program to be an icon on a desktop, you run the program and it pops up on the screen, and then you can actually use it outside of the text editor( Such as when you run Microsoft word, the program pops up on your screen).

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

    PHP MVC OOP advices and/or examples that include forms

    Posted: 21 Aug 2019 05:20 AM PDT

    Hi,

    I'm trying to get familiar with MVC frameworks. I'm ok with PHP and kinda OK with OOP (I'm not an expert but I can read the doc and usually manage to find the info I'm looking for). My intention is to learn how to use Symfony but I would like to build a simple framework first, so I can get the logic of it.

    Anyway, I found a fair amount of tutorials and I think I can see how in works but none of them included form management. A lot of them focused on creating a single access point in the index, then creating a routing class that will lead to the right controller. But all of these controllers, at best, would only generate a view that contained some retrieved data (the usual was a blog example with article number in the url -> go find the article content -> generate the view).

    What I would like to find out is the proper way for the routing system to lead to a controller that would add data in the db, which requires sending the right parameters from the form to the right method.

    Should I create a class Form that would get the parameters and point to the right class and method? How should I identify which form should lead to which method (should I use the action="" of the html)? Can I use $_POST method or does the data have to go to the url for it to work as the routing system reads urls? How, in the routing system, do I differentiate between requests that need to send data (from the form) from those who just requires data to be sent? Those questions are pretty blurry but that's how clueless I am.

    Ideally, what I need would be a good example with the following characteristics :

    - One single point of access

    - One class = one action

    - An effective yet not too complex routing system

    - At least two forms that should trigger different methods

    But, of course, any simple advice would be much appreciated!

    Thanks!

    EDIT: grammar + question added

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

    Spring Boot Soap Integration Test Failing

    Posted: 20 Aug 2019 11:44 PM PDT

    No comments:

    Post a Comment