• Breaking News

    Tuesday, May 7, 2019

    How do softwares/games package database of graphics, music, videos with their executables? Ask Programming

    How do softwares/games package database of graphics, music, videos with their executables? Ask Programming


    How do softwares/games package database of graphics, music, videos with their executables?

    Posted: 07 May 2019 08:28 PM PDT

    C#

    Posted: 07 May 2019 10:53 PM PDT

    how can i make this work?

    im trying to make a login stuff only in text file

    im getting frustrated please help me.

    all i need is to show the splitted text.

    StreamWriter sw = new StreamWriter("LoginCredentials.txt");

    sw.WriteLine("user pass");

    sw.Close();

    int i = 0;

    string[] lines = File.ReadAllLines("LoginCredentials.txt");

    var items = from line in lines

    where i++ != 0

    select new

    {

    user = line.Split(' ')[0],

    pass = line.Split(' ')[1]

    };

    foreach (var item in items)

    {

    label3.Text = item.user + item.pass;

    }

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

    How do CPU/OS interrupts work?

    Posted: 07 May 2019 10:06 AM PDT

    I think I understand the broad picture that on receiving an interrupt (signals on special pins etc?), the CPU halts its current execution and either handles the interrupt or forwards it to the OS. I'm guessing this is how external device firmware communicates events to an OS, like keyboard input, network packet receipt, etc.

    Is my understanding correct? Does all this happen on "one thread", and if not, how did it work before SMT/multi-core CPUs? I'd also appreciate being given some more detail around this, thanks in advance!

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

    OAuth2 Access tokens - Check token on every request?

    Posted: 07 May 2019 07:06 PM PDT

    I'm creating a form that queries a REST API for data, I have everything working great with one exception.

    The access token I receive after going through authentication expires after a time as is to be expected. I'm wonder what would be the best way to catch this error and refresh or re-auth the user, but not exactly sure how to implement it.

    Do I have to check the token validity for every request? and how exactly should i handle it?

    I'm using python, Django 2.2, and requests_oauthlib.

    The requests_oauthlib documentation has some examples but seems repetitive and cumbersome to preform there checks for every request in make as the web app grows

    Below is an excerpt from the view that makes my request

    @login_required() def sync_timesheets(request): token = Profile.objects.get(user=request.user).token date_from = request.session.get('start_date') date_to = request.session.get('end_date') users = request.session.get('users') jobcode = request.session.get('jobcode') query_params = {'start_date': date_from, 'end_date': date_to, 'user_ids': users, 'jobcode_ids': jobcode} log.info('Query Params: {}'.format(query_params)) # TODO: check if token is valid and refresh/re-auth if not client = OAuth2Session(client_id, token=token) # TODO: Check if there are more results then on one page and get more if true timesheet_list = client.get(parse.urljoin(url_base, 'timesheets', ), params=query_params).json() Timesheet.objects.clear_table() for key, value in timesheet_list['results']['timesheets'].items(): timesheet_values = {'id': key, 'notes': value['notes'], 'username': str(User.objects.get(id=value['user_id'])), 'date': value['date']} timesheet, created = Timesheet.objects.update_or_create(id=key, defaults=timesheet_values) timesheet.save() return HttpResponseRedirect(reverse('notes')) 
    submitted by /u/IAM_Carbon_Based
    [link] [comments]

    How much can one person accomplish by him/herself part-time with coding? Is it realistic to learn coding to develop usable programs for personal use of a quality comparable to what a person would purchase?

    Posted: 07 May 2019 09:30 PM PDT

    Sometimes I have an idea for something that isn't currently available. Is it better to learn programming, so I can put together little programs that will help me accomplish tasks, or would it take too long for one person to finish alone?

    How do you determine how long or how hard something would be to make? I had an idea for an organizational tool that implemented a calendar. Another idea was like a MIDI music program with features that aren't currently available in other applications. I have no clue if this could be knocked out in an afternoon by a single worker, or if it would take a team of 10 people six months. Zero clue.

    I'm not trying to sell these programs, but I wanted something that would work. I also already have a full-time job and a bunch of hobbies, so I'm not really looking to make programming a career or anything. I've taken a couple coding classes, but we never got past some pretty basic commands.

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

    I want a way to access data from several databases without them having access to each other

    Posted: 07 May 2019 08:51 PM PDT

    Essentially, the user authenticates to each server with biometric data, and the server sends something back if the authentication is correct. I don't want each server to have access to what's on the other servers and the client should only have access to what they can authenticate to. However, the client would have write-access to each server.

    What would be the best database/app software for me to use that would also make it easy to setup many of these servers?

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

    How would you go about building a credit card processing system?

    Posted: 07 May 2019 08:17 PM PDT

    I want a build a way to charge and process credit cards without using companies like PayPal or something. How would I actually go about charging the card and how could I build such a system? Writing this system in Javascript.

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

    For modeling a game with two opposing teams, what is a good way to keep track of both scores with minimal code duplication?

    Posted: 07 May 2019 08:07 PM PDT

    As an Angular and .NET Core developer where should I go from here?

    Posted: 07 May 2019 08:05 PM PDT

    I'm at a point where I'm not really sure how to continue. I am a home student and most of my knowledge has come by Udemy courses and the likes. A month ago I completed this course and I've since then had the chance to play around with it a bit and such. My problem is that I've no idea how to continue from here. I feel like when I'm looking up Angular / core jobs I meet most of the requirements such as SQL/EF, APIs in core, testing, oop and such (and Angular for client side). All things I am pretty confident in. I have yet to work with Azure which I've read in a lot of the job listings for the jobs I'd like to get but besides that I feel like "I have the full deal". Is that it as a software developer and I should just focus on becoming more competent or should I expand further? If the latter, any specific topics in mind?

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

    Dependency Injection for Local Variables and variables inside "Using"?

    Posted: 07 May 2019 11:01 AM PDT

    Is there a way to do dependency injection for local variables?

    public writeToFile(string text)

    {

    using(IMyWriter customWriter = new MyWriter())

    {

    customWriter.write(text);

    }

    }

    Let's say I want to inject the MyWriter class via IMyWriter (for injecting a mock), but I still want to use "using" keyword

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

    read and write object file of my Library class

    Posted: 07 May 2019 10:15 AM PDT

    Excuse me, I have my class Library which has 3 array lists, and in another class in the main method the first thing I want is that the three array lists will be read from file.. same thing for writing, when I close the program (don't worry about that)... the updated arraylists will be written to the same file. I heard that I should create an object of this class but then i don't know what to do. so what I know that I should do something like that

    when reading

    try {

     ObjectInputStream in = new ObjectInputStream(new FileInputStream("g:\\file.dat")); Object obj; while ((obj = in.readObject()) != null) { Library libr = (Library) obj; } }catch (Exception eof){ System.out.println("There is an error"); } 

    when writing

     ObjectOutputStream out; try { out = new ObjectOutputStream(newFileOutputStream("g:\\file.dat")); Library library=new Library(Library.getMembersList(),Library.getItemsList(),Library.getBorrowOperationList()); out.writeObject(library); out.close(); } catch (Exception e1) { System.out.println("An error occured while saving the file"); } 

    this is my class that I want to create an object of, to read and write

    import java.io.Serializable; import java.util.ArrayList; public class Library implements Serializable{ private static final long serialVersionUID = 1L; private static ArrayList<Member> membersList = new ArrayList<Member>(); private static ArrayList<Borrowable> itemsList = new ArrayList<Borrowable>(); private static ArrayList<Operation> borrowingOperationList = new ArrayList<Operation>(); public Library(ArrayList<Member> membersList, ArrayList<Borrowable> itemsList, ArrayList<Operation> borrowOperationList) { super(); Library.membersList = membersList; Library.itemsList = itemsList; Library.borrowingOperationList = borrowOperationList; } public Library() {}; public static ArrayList<Member> getMembersList() { return membersList; } public void setMembersList(ArrayList<Member> membersList) { Library.membersList = membersList; } public static ArrayList<Borrowable> getItemsList() { return itemsList; } public void setItemsList(ArrayList<Borrowable> itemsList) { Library.itemsList = itemsList; } public static ArrayList<Operation> getBorrowOperationList() { return borrowingOperationList; } public void setBorrowOperationList(ArrayList<Operation> borrowOperationList) { Library.borrowingOperationList = borrowOperationList; } } 
    submitted by /u/xveno0
    [link] [comments]

    What do I need to know to start an entry level job?

    Posted: 07 May 2019 08:46 AM PDT

    I went through some online tutorials and built a reddit alternative that can be seen here. It utilizes Python and Django on the back end, as well javascript, CSS and HTML on the front end. I did it all myself from scratch but I'm still not feeling very confident in my abilities, I feel like I'm too slow to solve problems. I'd like to find a short course that would cover everything I need to know for an entry level job.

    Can anyone recommend such a course or recommend any other avenues to get my skills and confidence up? I'd really appreciate it.

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

    OAuth: Can someone help me understand callback URLs?

    Posted: 07 May 2019 04:57 AM PDT

    I have a good understanding of OAuth, but I am wondering about best practices after the user has authenticated with the resource and gets redirected back to my website's callback URL. Here is what I'm having trouble understanding:

    - End user clicks some button on my page to kick off the OAuth process

    - My server sends a POST request to the resource's OAuth endpoint, containing my public key that the resource generated for me, and a callback URL which is some page I have written to handle the callback in the later steps

    - The resource server responds with a token, and then my website will pop up a new window showing the login page for the resource (Twitter, Facebook, whatever) with the token passed as a URL parameter

    - Once the user has logged in, the resource page will redirect the user to the callback URL I specified, providing yet another token as a URL parameter

    - I do some stuff with that token, get another token etc, but my question is: Everything at this point is happening in a separate window, in a different context from the page containing the original button from step 1. How do I pass the final OAuth token back to that original context? I'm guessing I store it in a cookie, so the original page can use it after the popup window has closed?

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

    Drawing experiment with Psychopy (Python)

    Posted: 07 May 2019 02:49 PM PDT

    Hi everyone,

    I'm (attempting) to create a stimulus with Psychopy for my psychology experiment. It consist in showing a few images and then have the participants draw over these images. Everything is going well - most stuff was done with the builder, to be honest - but now I've hit a wall. I can't figure out how to code having a line appear on the screen as the participants draw it with the mouse.

    I manage to build a simple drawing app with Kivy (as shown by this tutorial https://www.youtube.com/watch?v=U9TnXzQgIJU) and it runs on Pyschopy… but I just don't know how to add it to my experiment's code.

    Any thoughts?

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

    Ways to send links to another mobile device

    Posted: 07 May 2019 11:00 AM PDT

    I have an app written in Ionic/Angular and I would like to send image links from this app to another tablet. I want this to be mostly automatic, i.e. the other tablet only needs to have a display app open and, if using Wi-Fi, be on the same network. The display app would only wait for a connection/link and show images.

    What are some ways I can accomplish this?

    My current idea is to use bluetooth, i.e.

    1. The display tablet advertises.
    2. Pair with it from main app.
    3. Send link over bluetooth from the main app.
    4. The display app follows link and shows image.

    Looks like, there's the ionic-native BLE plugin I should be able to use. Would be nice to make it work on both Android and iOS.

    Are there better/simpler solutions? I wouldn't mind using an existing program on the display tablet side if it's possible but it would be better to have my own code that I can make changes to. If the better solution involves sending full image binaries rather than links, that's ok too.

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

    Are there any libraries where you input the properties of common types of container and it picks out an implementation for you?

    Posted: 07 May 2019 02:26 PM PDT

    I'm essentially wondering if this half-baked idea exists somewhere on the web or if it's somehow flawed.

    There's no substitute for learning how containers are implemented and their various space and time complexities. But I was wondering if there are any libraries that encapsulate these away for you.

    Different containers have different properties. Sometimes you care about how fast you can insert an object, other times you care about how quickly you can access random elements. Sometimes your elements are huge and expensive to copy and pointers are your friend. Sometimes you have loads of mini objects and pointers are your enemy. Sometimes you know the size of your container etc.

    It would be interesting if you could somehow code:

    using myContainer = Container_with_properties<constant_time_random_access, variable_size, small_objects>::type

    and you then have a container implemented as contiguous memory on the heap.

    Of course in this particular case this is a grotesque solution but say you wanted a container that had a fixed size and removed rarely used objects, you might not know that an LRU cache existed and could be implemented with a hashmap to a doubly linked list in which case this could prove useful.

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

    Creating a developer karma system to promote collaboration at my company.

    Posted: 07 May 2019 02:01 PM PDT

    We are a large >7000 person company. About 800 are directly involved in software development, not for a product, but as support for the rest of the company making custom solutions.

    We are proposing to create a developer karma system, based upon contribution to our Atlassian Suite of tools, that promotes reuse, fungibility, and hardened solutions.

    Please advise.

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

    Text based video games that I can play at work and appear to be programming.

    Posted: 07 May 2019 05:43 PM PDT

    Hey guys, I'm an Atlanta based web developer. I've been working for about 3 years and to be quite truthful, I'm a bit of a slacker. Generally I get about a good 4-5 hours of honest development time in throughout the 8 hour day, but sporadically throughout the day, I browse news articles and play games.

    At my last job (where I was a bit less supervised) I got very good at chess on chess.com. But at my new job, my boss frequently checks up on me, and I need to appear productive.

    So I've been browsing hacker news and playing terminal based games in my IDE's terminal. If I'm caught reading hacker news, it looks like I'm reading something technical, and the terminal games are indistinguishable from my work unless you look closely.

    I played Nethack until I was sick of it, and have recently been trying to beat the original Zork. I'm looking for other covert terminal games I can play, or any other productive looking distractions I can use to pad out my day.

    Thanks for your suggestions!

    submitted by /u/slack-master
    [link] [comments]

    GoogleFinance Wrong Stock Name

    Posted: 07 May 2019 09:34 AM PDT

    I have been using a Google Sheet to keep track of my stocks for almost 2 years now. One of the stocks I own is DISNEY (DIS), just today I noticed that:

    =GOOGLEFINANCE("DIS", "name")

    Now gives me a stock called DISTIL PLC. This also affects the price and all other information pulled for the stock.

    Does anyone know how to change this?

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

    How would I go about writing a script or program that allows the user to data-scrap information from a website?

    Posted: 07 May 2019 03:28 AM PDT

    For example, I have 100ish codepens that have css/html/js on them on codepen.io.

    Rather than going through 1 by 1, and copying each part into a text file: "codepen1" "codepen2" et cetera, it would be really nice to have a program automate this task.

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

    GTKmm TreeView signal

    Posted: 07 May 2019 12:17 PM PDT

    I have to boxes. Box on the left holds a TreeView list, box on the right shows some properties.

    I am trying to make the properties box get updated when something from the left list is selected.

    hostTreeView is the TreeView that holds the list, updatePropertiesBox on has an std::cout at the moment.

    This is the signal I'm trying to use (adapted from the buttons tutorial):

    hostTreeView.signal\_state\_flags\_changed().connect(sigc::mem\_fun(\*this, &MainWindow::updatePropertiesBox)); 

    However, the compiler is giving me massive cryptic errors that I cannot decipher. How should I approach this? It very well might be I'm looking at the problem from the wrong perspective.

    This is the error:

    /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89:30: error: return-statement with a value, in function returning 'sigc::adaptor_functor<sigc::bound_mem_functor0<void, MainWindow> >::deduce_result_type<const Gtk::StateFlags&, void, void, void, void, void, void>::type' {aka 'void'} [-fpermissive]

    { return functor_(_A_arg1); }

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

    Anyone with a programming background moved into a requirements gathering or 'other' role?

    Posted: 07 May 2019 08:28 AM PDT

    Kind of a random question but I've always really liked the development background, I had hoped to get more into it because I enjoy learning to program. I did a bit at uni and on my own (java, android, react native, react.js), but I'm by no means a senior developer (all devs at work are).

    The thing is I'm in a requirements gathering (business analyst) sort of role now, and want to move into more of a development role. The issue is all the developers I know are trying to get out! One friend is a senior Dev and he's trying to get into accounting. The other 3 I know are trying to get into similar business analyst (requirements gathering) roles. Citing issues that they don't want to be a 'coding monkey' and they want better growth.

    Interested to know about what others think in the industry, is it enjoyable to work in? Are you happy with development going forward, would you prefer to get out. I'm sort of worried I'm going to put some massive issues in my work place to get them to move my job, turn my back on my manager, only for me to find out it was just a 'grass is always greener' problem and want to get back.

    Thanks so much for any insight.

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

    Where can I learn strategies for reading/understanding large volumes of code?

    Posted: 07 May 2019 12:12 PM PDT

    "Large volumes" as in "you'll never read the whole thing in time to finish the project, so you have to find what's relevant and what isn't". I find that this was something I struggled with in a previous job, and it always troubled me that while I could trace a bug to its immediate cause (usually by grepping functions and functions that call these functions, etc.), I could never quite grasp the design of the system as a whole (this doesn't contradict the first sentence: you can skim a text and still get an idea of the basics). Other times, with old code, it was almost like archaeology, trying to get an idea of the intention and thought process of the creator by looking at pieces of their works.

    Is there a guide that teaches this? In your experience, what is the best way to understand large codebases? e.g. read it top-down or bottom-up? In order of execution or order of abstraction? Where to balance understanding the thing vs. getting things done quickly?

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

    What is the dimensions of a standard flat?

    Posted: 07 May 2019 03:20 PM PDT

    I am filling out the two questions for a company, the first question is...

    What is the dimensions of a standard flat?

    what's the answer?

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

    Does someone know extension for Firefox with tools for website analysis?

    Posted: 07 May 2019 05:02 AM PDT

    No comments:

    Post a Comment