• Breaking News

    Wednesday, June 19, 2019

    If ever you switched from a dynamically typed to a statically typed language for your work, how did it feel? Ask Programming

    If ever you switched from a dynamically typed to a statically typed language for your work, how did it feel? Ask Programming


    If ever you switched from a dynamically typed to a statically typed language for your work, how did it feel?

    Posted: 19 Jun 2019 12:25 PM PDT

    If you ever did the reverse that counts too. I've read suggestions that dynamically typed is more suitable for small programs. Personally I'm used to Python and have yet to have any issues with it that I've noticed.

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

    How do you plan/organise a new project?

    Posted: 19 Jun 2019 08:09 AM PDT

    Hey fellow programmers!

    I'm embarking on my first project , and i feel like I didnt do enough pre-coding prep. I planned everything in my head and jumped right into coding.

    I'd like to know how you plan your ideas and projects, if you have any tips or tricks for a newbie and what software or tools you'd recommend.

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

    How to add text and picture in a popup marker in folium?

    Posted: 19 Jun 2019 08:11 PM PDT

    Which of your projects are you the most proud of?

    Posted: 19 Jun 2019 07:01 AM PDT

    Not sure if a post like this is allowed but it'd be great to learn about such projects. Mods, if you feel this post doesn't fit in this subreddit I'd be happy to take it down but let me know if there's an alternative subreddit which this would be a better fit for. Thanks.

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

    what is the best programming language for building a dynamic website

    Posted: 19 Jun 2019 07:08 PM PDT

    I want to build a website that can grab information from other websites and display that information on my website. For example, grabbing yield curve data from treasury.gov website and embedding that onto my website. Additionally, I then want to build a system which grabs that information that I just received on my website from treasury.gov and put that information onto an excel file.

    Any programming languages that can make this happen? Do I need any other skills?

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

    Checklist for your computer last day at work

    Posted: 19 Jun 2019 01:22 AM PDT

    Using windows 10, what would be a good checklist to do last day at work giving that im not supposed to delete or alter the OS?

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

    true vs faux advantages of functional programming?

    Posted: 19 Jun 2019 02:35 PM PDT

    This might be a sophomoric thought, but I'm curious what people think.

    I was reading this article (link below) that was kind of an intro to declarative vs. functional programming, and the author includes some code samples of both paradigms.

    Looking at this specific code sample, I wondered if maybe the declarative paradigm would have an advantage over the functional paradigm for the reason that the internal representation of the functional approach (the filter) might actually be just a declarative loop as far as the interpreter ends up processing it.

    https://itnext.io/what-exactly-is-functional-programming-ea02c86753fd

    To put it another way, is it sometimes often better to adopt a declarative paradigm because that's how the interpreter or compiler is going to convert the functional paradigm anyway? I'm reminded of a meme I sometimes see where the Scooby Doo gang pulls the mask off a costumed criminal labeled "Iterator" and underneath the mask the so-called Iterator is just a for-loop.

    So maybe part of my question is: when is functional programming really and truly advantageous over declarative programming?

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

    I'm a very visual thinker. I think that's why I have such a hard time understanding computers.

    Posted: 19 Jun 2019 11:59 AM PDT

    Does anyone know of a video that would give me a visual perspective of kilobytes, megabytes, etc.?

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

    Getting input from one jsp to another

    Posted: 19 Jun 2019 11:43 AM PDT

    Hey guys! I'm doing a project, and since stackoverflow is very picky, I can't ask questions for a day but I have to deliver this project tonight.

    I'm doing a web app.

    I want to use an input value in one jsp from another jsp.

    What am I doing wrong? Thank you.

    Error:

    https://imgur.com/a/WakjS74

    jsp index.jsp:

    <form action="loginServlet"> <table style="font-family: Corbel"> <tr> <td><label for="username"> username</label></td> <td><input type="number" name="username"></td> </tr> ..... 

    jsp editar.jsp:

    <jsp:include page="index.jsp" > <jsp:param name="username" value=""/> </jsp:include> .... <% for(int i = 0; i < dados.getEntradasUser(Integer.parseInt(request.getParameter("username"))).size(); i ++){ % ..... 
    submitted by /u/pa7amc_
    [link] [comments]

    Text-based Game

    Posted: 19 Jun 2019 12:50 PM PDT

    So I ran into a situation while coding, Im trying to make a text-based game and I am not sure if this code is good or not, and how to progress it. can someone help me by looking it over? Also if this is sloppy I apologise I began this last night and sadly when this got posted all the code was moved around I hope it is still readable

    include <iostream>

    include <iomanip>

    using namespace std;

    int main() { cout << "MAIN MENU" << endl; cout << "1.Start Game" << endl; cout << "2.Quit" << endl; cout << "Selection: " << flush;

     int value; cin << value; if (value == 1) { cout << "Game intro" << endl; cout << "Press space and enter" << endl; cout << "Selection: " << flush; if (value == I need help here too I cant get it to use spacebar to continue); { cout << "Game beginning" << endl; } int input; cin >> input; 

    } else if (value == 2) { cout << "Quitting" << endl; return 0; } return 0; }

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

    C# dynamic class selection?

    Posted: 19 Jun 2019 04:33 PM PDT

    I'm trying to make a system where it's easy to add optional event handlers that are kept in seperate C# files and dispatched based on a name stored in a database, preferable in a sub-folder under the app root folder. Each handler file will correspond to a sub-class or class-like grouping.

    Each file will potentially implement various event handling methods. It's "potentially" because if an implementation is not given, there is no need to code for it. I don't want to have to code blank place-holder stubs, partly because new kinds of events may be added in the future. Each event gets the same set of parameter(s) types.

    // Simplified pseudo-code void sampleUserInteraction() { int id = promptUser("Enter the target ID number"); var row[] = sql.firstRow("SELECT thing FROM myTable WHERE id=" + id); var targetThingName = row["thing"] // get explicit class name var targetThingRef = makeClassFileReference(targetThingName); var x = new ParameterStuff(...); result_a = targetThingRef.a(x); // event "a" result_b = targetThingRef.b(x); // event "b", etc... result_c = targetThingRef.c(x); Etc... result_z = targetThingRef.z(x); Etc... } // file event_handlers/thing1.cs class thing1 { method a(x){...}; method b(x){...}; method w(x){...}; } // file event_handlers/thing2.cs class thing2 { // No methods necessary } // file event_handlers/thing3.cs class thing3 { method r(x){...}; } // etc... 

    Perhaps it can be implemented somehow with a list of lambdas, partial classes/methods, large switch/case blocks, reflection traversal, etc. Each file doesn't have to correspond to an actual class if something else can do the job. I prefer an implementation that's easy to follow; If I get hit by a bus or am on vacation, I want my substitute to be able figure it out fairly quick so I don't have to answer questions from the hospital.

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

    Why is the two General's Problem unsolvable?

    Posted: 19 Jun 2019 12:37 PM PDT

    https://en.wikipedia.org/wiki/Two_Generals%27_Problem

    It's said to be impossible to solve, but wouldn't the solution be a terminating "change-over condition" that both generals have already agreed to? In terms of programming it referred to TCP connections, but what about a set upon agreement to talk to something else?

    For instance, both generals are briefed to have a code word that means you'd need to switch to something else. The wiki brings up TCP connections not agreeing to state, but wouldn't it work like this:

    The first General would command: "Attack at 9pm the 1st of August, 1001."

    He would repeat it until getting the agreed upon reply, which is a command:

    The Second General would command the first, "Attack at 9pm the 1st of August, 1001." He'd repeat until he got a reply, agreed upon as follows:

    The First General would state: "Good Copy." until the Second General replies as such:

    Second General states, "Good Copy," until he gets his last important message:

    Here's where I don't understand. If the first general was logical and trusted the Second General, and wanted to not get into a forever chain of "Did you get that", he'd switch to something completely arbitrary:

    First General would then say, "So what are you eating for dinner tonight?" on repeat. At this point the First General knows to attack without a shadow of a doubt.

    The second General would then say on repeat:

    "I'm having pancakes, what about you?" Knowing full well he'll be attacking at Attack at 9pm the 1st of August, 1001.

    After that it's just gravy. The first knows the attack, the second knows the attack. Due to the briefing before being deployed, there is common knowledge. Wouldn't this just be a protocol agreed to by all Generals in the Army? Doesn't Common Knowledge include things everyone knows everyone knows everyone knows ... already? By the time the Generals are explaining the way they like to baste their Turkeys, it's known with a wink and a smile a long time ago that the attack will go off.

    Isn't the fact that there is prior knowledge implicit in Common Knowledge (I know what blue eyes look like in the Blue Eyes Problem and I know how to count) that two Generals going back and forth forever forgets?

    What am I missing?

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

    STM32F2 code on F4

    Posted: 19 Jun 2019 10:14 AM PDT

    I'm not that well versed in stm chip programming but I've found code that I would like to use. It was originally written for the STM32F205VET6 processor but the f2 dev board does not have enough pins so I was wondering if it was possible to run the same code on the chinese stm32f407 dev board without altering the code as the f2 and f4 supposedly have the same pinout.

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

    Programming

    Posted: 19 Jun 2019 04:00 PM PDT

    I am going all out on Programming. I am almost poor broke, so I am going all in, it's either going to break me or help me, if you have any suggestions that may help me on the way I'd be happy to hear them.

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

    I've extensively debugged my DLL Injection program but still don't know what's wrong

    Posted: 19 Jun 2019 06:08 AM PDT

    I'm trying to inject a DLL into another process by using the popular CreateRemoteThread + LoadLibrary technique.

    Variables I've instantiated at beginning of main():

    LPCWSTR DllPath{ L"C:\\Projects\\MyProject\\x64\\Release\\MyDll.dll" }; LPCWSTR gameWndTitle{ L"Name of the Game" }; 

    This is my getPid function:

    void getPid(DWORD &pid, LPCWSTR &gameWndTitle) { HWND hGameWnd{ FindWindowW(NULL, gameWndTitle) }; if ( hGameWnd == NULL ) throw 1; GetWindowThreadProcessId(hGameWnd, &pid); if (!pid) throw 2; } 

    Debugging info:

    - No thrown exceptions.

    - hGameWnd value is 0x00000000000a0820. Does that look right? It's a lot of zeros.

    - GetWindowThreadProcessId assigns 11680 to pid

    The I open the process:

    HANDLE hGameProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pid); if (hGameProcess == INVALID_HANDLE_VALUE || NULL) { std::cerr << "Faile to OpenProcess(), error code: " << GetLastError() << '\n'; return 1; } 

    Debugging info:

    - The if block doesn't get executed. So, it's not an INVALID_HANDLE_VALUE or NULL value.

    - OpenProcess assigns value 0x00000000000000ac to hGameProcess. This also looks suspicious because of so many zeros.

    Last function is the inject function:

    void injectDll(HANDLE hGameProcess, LPCWSTR &DllPath) { FARPROC loadLibraryAddress{}; HMODULE hKernel{ GetModuleHandleW(L"kernel32.dll") }; if (hKernel != NULL) { loadLibraryAddress = GetProcAddress(hKernel, "LoadLibraryW"); if (loadLibraryAddress == NULL) throw 1; } else throw 2; // Allocate memory in game process to make space for the DLL LPVOID vAllocExRetVal{ VirtualAllocEx(hGameProcess, NULL, sizeof(DllPath), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE) }; if (vAllocExRetVal == NULL) throw 3; // Write Dll path to memory, which I previously allocated. BOOL wpMemResult{ WriteProcessMemory(hGameProcess, vAllocExRetVal, DllPath, sizeof(DllPath), NULL) }; if (wpMemResult == 0) throw 4; // Create new thread for target process, and run the DLL in it. HANDLE hGameThread{ CreateRemoteThread(hGameProcess, NULL, NULL, (LPTHREAD_START_ROUTINE)loadLibraryAddress, vAllocExRetVal, NULL, NULL) }; if hGameThread == NULL) throw 5; } 

    Debugging info:

    - No thrown exceptions.

    - Debugger says hKernel value is kernel32.dll!0x00007ffbd4760000

    - Debugger says loadLibraryAddress value is kernel32.dll!0x00007ffbd477e950

    - vAllocExRetVal value becomes 0x000001568bb80000

    - WriteProcessMemory returns 1.

    - hGameThread becomes 0x000000000000000b4

    Now I use Process Explorer to look through the list of DLLs in target process to see if my DLL was loaded, but I can't find it in the list.

    In summary, the only leads I have are those suspicious values which have far too many zeros. But I don't know what to do about it, and I don't know if they are even the problem.

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

    Tools for learning code optimization

    Posted: 19 Jun 2019 09:11 AM PDT

    I was wondering how the members of this sub learned about code optimization. There are many different ways to code the same problem but some methods obviously run faster then others. I recognize that I spend a lot of my time just trying to get my code to work and not understanding whether or not the code will run quickly. Are there any good resources out there to learn why some functions work faster then others. I would specifically be interested in python, (py)spark, and SQL.

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

    Is it possible to run a webpage as an executable file?

    Posted: 19 Jun 2019 09:04 AM PDT

    I was wondering if it was possible to run an exe which loads a webpage. This is the site I'd like to get running as an EXE: www.infernoplus.com/royale/

    That way I don't have to run it with an internet browser, and will stop lag which gets caused by the browser itself. It's all online so the whole link/game should theoretically work within a .exe as long as there's an internet connection.

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

    What are some fun trade show games/contests involving programming?

    Posted: 19 Jun 2019 06:52 AM PDT

    I am currently designing a trade show booth for a tech company looking for new employees and programmers. This will be at Javazone 2019 in Norway, with a lot of geeks and you know, people intersted in programming and Java etc.

    What are some good challenges/games/contests that could make you interested in going to a stand and play the game/hack the thing/program the function? S

    Thanks!

    submitted by /u/The-Respawner
    [link] [comments]

    How does Wrapify calculate impression? In the video and detail on the website, it stated that they also calculate the total impression on the ads but the question is that how is it possible or what the technologies that i need to calculate the impressions?

    Posted: 19 Jun 2019 04:34 AM PDT

    APIs for airline ticket prices that aren't Skyscanner?

    Posted: 19 Jun 2019 02:27 AM PDT

    Skyscanner keeps rate limiting me (despite not making nearly 400 calls/minute) and I just don't have the energy to sort it out. Are there any decent alternatives now that Google's QPX is dead?

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

    http://???/getLatitudeAndLongitude?streetAddress=123$20xyz%20st,%20city%20state%2012345 returns {"latitude":2345, "longitude":3523}

    Posted: 19 Jun 2019 01:11 PM PDT

    No comments:

    Post a Comment