• Breaking News

    Sunday, June 16, 2019

    Android Studio - variable change listener? Ask Programming

    Android Studio - variable change listener? Ask Programming


    Android Studio - variable change listener?

    Posted: 16 Jun 2019 07:00 PM PDT

    I am working with Spotify's api to make an application.

    Currently: I grab the current playing song's cover art (onStart()). It is an imageView that gets updated by pulling from their api and just parsing a json file.

    As of now, if I click away from the app and return, in my onResume() method, I have a call to update the imageView if the song changed (another api request).

    Goal: What I want to do is update the imageView when the app is running (a song changes). Where in my code can I do this? Would it be some long living process or thread that constantly checks if a song has changed then calls my update ui method? If so, where do I implement this in the activity life cycle?

    Thank you ahead of time.

    Edit: I am using Java

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

    I want to share a list of programming interview questions and their solutions for all my fellow coders.

    Posted: 16 Jun 2019 05:00 AM PDT

    Solution repository for general programming questions for fellow coders.

    I have created a solution repository to the InterviewBit questions for all the fellow coders out there.

    These are the most common interview coding questions being asked in the interviews and I guarantee you, once you go through these, you'll be a better version of your programming self.

    Star it, fork it, use it whichever way you like and improve your coding game lads.

    https://github.com/mailtokartik1/InterviewBit-Solutions

    Plus, you can also help me give more solutions in different languages lads.

    Have a nice day!!!

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

    On the performance of HTML and CSS

    Posted: 16 Jun 2019 08:52 PM PDT

    Hello, everyone. I'm a programming newbie, barely starting out

    So, I understand that languages perform differently due to the way they're designed. For example, you can say C is faster than Python, because C is a static and compiled language while Python is dynamic and interpreted.

    HTML and CSS are not programming languages, they're declarative languages only suited for their specific purpose: to describe content and style.

    Now, what I want to know, is can HTML and CSS performance (that is, rendering time and responsiveness) be compared to that of programming languages?

    Lets say I build a UI entirely in HTML and CSS, and then I do the same thing in Java. Both run on the same hardware. Could a comparison like that be done?

    The way I understand it, HTML and CSS have to be 'interpreted' by their layout engine, generally written in C++, so is HTML performance bound by how fast the layout engine can interpret it? Does having more lines of code affect HTML performance?

    This question might seem very stupid, probably is, but I'm just curious

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

    Building a platform for others

    Posted: 16 Jun 2019 02:14 PM PDT

    What is it that I need to study/research to understand how to build a platform for others to build on top of (like salesforce).

    I was thinking of a domain specific language but I figured there must be some shortcut somewhere

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

    Photo text to variable?

    Posted: 16 Jun 2019 05:20 PM PDT

    hi guys!

    I'm a network IT nerd and I don't know a lot about anything that's above entry level programming. I'm looking for some guidance in terms of a solution I'm looking into. Not too sure where I should be looking or looking up, but what I want to do is get a piece of software that,

    Identifies a piece of text taken from a photo and stores it has a variable to be manipulated moving forward. So just a quick example: Have a camera to take a photo of an alarm clock, have the software read that it says 1:49, and then give me a variable like x = 149

    Are there tools like this that exist for free? Or any online resources?

    Thank you!

    Your computer brother on the other side of the screen,

    IT Guy

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

    [SWIFT] - How do I fetch the firebase database entries of users in this specific database arrangement?

    Posted: 16 Jun 2019 02:47 PM PDT

    So, each user has a education and photo database entry. All users's 2 entires need to show up underneath each other after the fetching is complete. The database is structures where a specific key is assigned to the user's email, education, and photo.

    Below is where I am right now. I isn't working for education, so I need to address that before moving on to photo.

    https://imgur.com/a/N60Vvfx

    In file A:

    import UIKit import Firebase

    class User: NSObject { var Education: String? var WhatIamConsideringBuying: String? var PhotoPosts: UIImage?

    In File B:

    func fetchUser() {

    let databaseRef = Database.database().reference() databaseRef.child("Education").observeSingleEvent(of: .value, with: { (snapshot) in if let dictionary = snapshot.value as? [String: AnyObject] { let user = User() user.Education = dictionary["Education"] as? String print(user.Education as Any) } }, withCancel: nil) } 

    I get no errors except nil in the output message box.

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

    Need help with checking username and password against an array containing suitable passwords, C++

    Posted: 16 Jun 2019 01:56 PM PDT

    Hello, I am struggling with a problem on two fronts. First, I am not entirely sure that I am importing my data correctly. Second, in my current attempt at a do-while loop, I continue to get an error message that my array is undeclared.

    Here is my code

    include <iostream>

    include <string>

    include <fstream>

    include <cmath>

    include <iomanip>

    include <vector>

    include <math.h>

    using namespace std;

    int main(){ string user,pass;

    ifstream file("UN.txt"); if(file.is_open()) { char username[10];

     for(int i = 0; i < 9; ++i) { file >> username[i]; } } 

    do {cout<< "Enter Username \n"; cin >> user; } while(user!=username); }

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

    Is this legit?

    Posted: 16 Jun 2019 01:50 PM PDT

    I know this is a weird one, possibly out of place but:

    https://www.reddit.com/r/slavelabour/comments/c1awb8/offer_i_can_make_apps_games_or_website_to/

    This can't be legit, right? I'm not crazy, am I? I am not a programmer, but it seems to me that two of his games would take too much work, even multiple people. The prices can't be right, right?

    I'd appreciate any responses.

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

    CMake configuration at build time

    Posted: 16 Jun 2019 01:49 PM PDT

    Hi. I've recently started working professionally with C++ and I've been tasked with starting a new project, for which I've chosen to use CMake.

    Currently, I have a shell script which drives CMake. I've defined an argument (--build-deps) which forces a rebuild of a git submodule. From what I've read so far, it appears that this kind of thing should be pulled into the CMake build itself.

    I know that arguments can be passed at configure time:

    cmake -DBUILD_DEPS=ON .. 

    But I feel this is inappropriate for my use case, as it happens during configure time rather than build time. I would prefer to be able to configure this particular option at build time:

    cmake --build . -DBUILD_DEPS=ON 

    Does this seem like the right thing to do? If so, can someone please point me in the right direction on how I can manage this through CMake?

    Thanks!

    EDIT: I have maybe been worrying about this too much and should just go for the configure time option, and ask the other developers to always run CMake configuration before doing a build.

    submitted by /u/Jam-e-dev
    [link] [comments]

    Vb.net Vs Python

    Posted: 16 Jun 2019 09:14 AM PDT

    Hey I will try to keep this as short as possible I hope you can help me out here , Thanks in Advance .

    I during my 12 year at school learned to code in Vb.net now I want to say we went over the basic stuff and then some like Basic OOP , Data structures like Binary tree and Linked list and code to Insert and retrieve data out of these , also we did a couple of sorting algos . But we didn't exactly Go into insane amount of detail and wrote very huge programs we just did standalone stuff .
    So the question : Do you think it would be better for me to finish learning this language fully and start coding in it and maybe make a small program / Do a project I know i am very far away from that point with the current knowledge I have OR Because I know at the end of the day VB.net isn't in demand that much and Python is more widely used ( I also have interest for ML ) and accepted in the programming community should i Just discard my Initial work of VB.net and just start with Python and learn from this basic level I am at to the level I want to reach in python

    (I hope this isn't too confusing I am basically worried If me switching to python halfway in the process of learning VB.net will mess up my programming Concepts / get me confused as I know different languages have differences as VB.net is my first language and I haven't learned it fully yet . I was just wondering if this was a good decision to switch to python .

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

    How can I know if I went over all the components of a binary tree?

    Posted: 16 Jun 2019 05:17 AM PDT

    Basically, I made a program that uses a binary tree, and you can choose a child until you get to a child who has no children. After that I want to have it so if you have not chosen every component of the tree, it will take you back and choose the last child you didn't choose, and you can continue choosing, until you choose all the components. The way I do it right now is that I have an array that saves every choice I make(Using and int of 1 and 0), and then when I get to the last choice, I initiate the tree again, and make all the choices until I get to the final value of the array, and choose the opposite of that value, I then remove the final value and replace it with the current value, so I can go down this path. The only problem of this is that it then forgets that I made the original choice. Any ideas on how I can fix this?

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

    Question about resources for setting up a system with 700TB - 2 PB of storage capacity

    Posted: 16 Jun 2019 12:14 PM PDT

    Hi people! I am interested in setting up a system with 700TB - 2 PB of storage capacity for data capture. I was originally thinking of just using a hosted service, but everything I have been looking at seems cost-prohibitive compared to just rolling my own solution. I have roughly 9 months of prep time before design and implementation kick off, so I am comfortable using that window to learn everything I can about a set up like this. My background is in networking and distributed systems, so I'm comfortable in the space. I just usually stay away from storage and filesystems, so I could use some direction. With that in mind, are there any good books, articles, or online resources for diving into this? Or should I just start playing around?

    submitted by /u/2against7
    [link] [comments]

    Need help creating a ping-pong algorithm using Contiki OS for cc2538 board.

    Posted: 16 Jun 2019 07:42 AM PDT

    Ping-pong explanation: Board A sends message to board B, after B recieves it, it sends message to board A, repeat.... so message is like a TOKEN being transfered between 2 motes.

    I've spent few days trying to create this but failed miserably... any help would be great, thanks!

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

    Should I approach this another way? C#

    Posted: 16 Jun 2019 08:22 AM PDT

    Im making an equation solver. Now to store the equations I've made an interface called IElement that requires a Value method with a double variable value to be passed. I definited a few classes like Common_Element which implements the interface so I can get the polymorphic behavior for a Value function in Function class. The Common element class is used for something like 3x2. Now the problem I have is that I have to implement a numbers class which is literally just a number to pass back, but because it has to implement the interface for polymorphic behavior I need to pass something to the value function in it even though I don't use it.

    Edit: would it also be bad practice to have have a function in an interface use the interface it's in? Eg in the IElement interface Value was Value(IElement element) instead of Value(double variable_value)

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

    Am I the only one, who most time spends on solving problems with configuration?

    Posted: 16 Jun 2019 06:05 AM PDT

    I started learning programming when I was 14. Now after the year I'm quite desperated, because the amount of time I am spending with configuration is about 70% of learning...

    I did some projects, but now I'm going to reset my PC to factory new.

    So anybody feels the same?

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

    What is the difference between Google Cloud Storage + REST API and building own NoSQL Database and own REST API

    Posted: 16 Jun 2019 03:35 AM PDT

    What is the difference with Google Storage + their own REST API to access Data or if I would create my own (Host it in Azure for example) Database and create a REST API (Lambda, Azure Functions, Google Functions) and access it there?

    I'm planning to create a simple app which needs an database and way to access it. It should be scalable and secure. I would like to them all to be "serverless". All ideas are welcome!

    Thanks in advance.

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

    No comments:

    Post a Comment