• Breaking News

    Saturday, January 18, 2020

    How many of you drink coffee? How many do not, and why? Ask Programming

    How many of you drink coffee? How many do not, and why? Ask Programming


    How many of you drink coffee? How many do not, and why?

    Posted: 18 Jan 2020 06:41 AM PST

    ELI5 please - outline structure for a neural network to find letters and numbers from an image.

    Posted: 18 Jan 2020 12:33 PM PST

    ELI5 (Explain Like I'm 5).

    I am slowly teaching myself machine learning from the ground up and I am trying to pin down an assumption. Assuming I have a gray scale bitmap (single byte pixel) of some arbitrary width and height, I would need a neural network with width * height inputs and then individual outputs for all letters A-Z and 0-9?

    Is that right?

    I am already assuming I would need one or more hidden layers between the inputs and outputs but I am not quite there yet.

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

    What's going on with my code? [Python]

    Posted: 18 Jan 2020 08:49 PM PST

    I have an assignment that is something like this:

    - write a function that takes an int as an argument and counts each occurrence where there's 2 of the same number in a row e.g. 111222333444 returns 8.
    - We're also supposed to ignore 0's, so 111222000333444000 would still return 8.
    - We're supposed to write 2 versions of this code. In one of them, we're allowed to convert to string. Then we're supposed to write the same function without converting to string (this is the only part I'm having an issue with)
    - He wants us to use 40000! as the number (returns 14184)

    The code seems to work fine for numbers that are reasonably small. I can run it on anything up to 12! (takes 90 seconds to process). By the time it gets to 13 factorial it just craps out. I've tried letting it run for 30 minutes to an hour and it's still not going through.

    Here's the code: https://i.imgur.com/w6JgL4E.png
    Here's a copy/paste version of the code: https://paste.ofcode.org/3aQXbY45kLu2DbU8f7fWjSJ

    The code does work if I convert the number to string and use the string length as the range (takes about 90 seconds)

    this is seen here: https://i.imgur.com/9Kn3tT0.png
    copy/paste version: https://paste.ofcode.org/zvL4cDyJZQd59f9GN3YvUz

    I thought it might have something to do with the limitations of the timer, but I have the same issue if I remove the timer from the code

    There was a different (but similar issue) problem in the assignment where we're supposed to take our 4 digit birth year and raise it to the power of our 6-digit student id number. Needless to say, it's a massive freaking number (> 2 million digits), and we're supposed to count the number of times 2, 5, and 0 occur within that number

    Here's my code for that portion: https://i.imgur.com/sNRqiP5.png

    Once again, the code functions without any issue with numbers that are reasonably sized. However, nothing appears to happen when I run the code, it just seems to be processing the code for an hour or longer. It's worth noting that it takes my computer a literal 5 minutes just to calculate output the number

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

    Trying to generate a self-signed cert on one computer and push it and the key pair to a remote computer using Windows APIs

    Posted: 18 Jan 2020 07:02 PM PST

    The following text is copied from my StackOverflow question here. There is one person who has tried to answer and they insist that it's possible but it's clear there's a language barrier making things difficult. I'd appreciate any help anyone can provide.

    I have a scenario wherein an application needs to create a self-signed certificate and add it to the certificate store on a remote machine. I've tried both CryptAPI and CNG (though CNG still appears to use CryptAPI for creating the self-signed certificate and adding it to the remote certificate store), but the behavior I see occurs in both.

    Environment:

    Two machines on the same domain. One is Windows Server 2016 Standard and the other is Windows Server 2019 Datacenter. Same domain user with admin privileges used to log into both machines. Run the application on the 2016 machine indicating the hostname of the other.

    The code uses MFC/ATL for CString, includes wincrypt.h, and links against crypt32.lib. Tested against both VS2019's toolset and VS2005's toolset.

    What I see:

    The self-signed certificate is created and added to the remote store. If I view the certificate through the MMC it indicates that it has a private key attached. However, when I try to click "Manage Private Keys..." an error dialog says:

    "No keys found for certificate!"

    Similarly the Certificate Export Wizard says:

    "Note: The associated private key cannot be found. Only the certificate can be exported."

    And the "Yes, export the private key" option is greyed out.

    My theory is that the private key isn't being properly attached to the certificate context (or otherwise not being transmitted to the remote machine when I add the key to the certificate store).

    Here's what my code looks like:

    #include <afx.h> #include <wincrypt.h> #pragma comment(lib, "crypt32.lib") CString GetCertificateThumbprintString(PCCERT_CONTEXT pCertContext) { DWORD cbSize; if (!CryptHashCertificate(0, 0, 0, pCertContext->pbCertEncoded, pCertContext->cbCertEncoded, NULL, &cbSize)) { return ""; } LPSTR pszString; if (!(pszString = (LPSTR)malloc(cbSize * sizeof(TCHAR)))) { return ""; } if (!CryptHashCertificate(0, 0, 0, pCertContext->pbCertEncoded, pCertContext->cbCertEncoded, (BYTE*)pszString, &cbSize)) { free(pszString); return ""; } else { pszString[cbSize] = NULL; LPTSTR lpszTP = NULL; if (!(lpszTP = (LPTSTR)malloc((cbSize + 1) * sizeof(TCHAR) * 2))) { free(pszString); return ""; } for (int i = 0; i < (int)cbSize; ++i) { _stprintf_s(&lpszTP[i * 2], sizeof(TCHAR) + 1, _T("%.2X"), pszString[i] & 0xff); } CString result = lpszTP; free(lpszTP); free(pszString); return result; } } CString CreateCertificate(CString hostName) { wchar_t subjectName [MAX_PATH] = L""; wchar_t store [MAX_PATH] = L""; wsprintfW(store, L"\\\\%s\\MY", hostName); wsprintfW(subjectName, L"CN=%s", hostName); HCERTSTORE certStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, NULL, CERT_SYSTEM_STORE_LOCAL_MACHINE, store); if (NULL == certStore) { _tprintf(_T("Failed to open Personal certificate store of %s."), hostName); return ""; } DWORD encodedSubjectSize = 0; if (!CertStrToName(X509_ASN_ENCODING, subjectName, CERT_X500_NAME_STR, NULL, NULL, &encodedSubjectSize, NULL)) { _tprintf(_T("Invalid certificate subject name. Error %d\n"), GetLastError()); return ""; } BYTE* encodedSubject = (BYTE*)malloc(encodedSubjectSize); if (NULL == encodedSubject) { _tprintf(_T("malloc() failed: %d "), GetLastError()); return ""; } if (!CertStrToName(X509_ASN_ENCODING, subjectName, CERT_X500_NAME_STR, NULL, encodedSubject, &encodedSubjectSize, NULL)) { _tprintf(_T("Invalid certificate subject name. Error %d\n"), GetLastError()); free(encodedSubject); return ""; } // Acquire key container HCRYPTPROV cryptProvider; const wchar_t* pszKeyContainerName = L"TESTKEYCONTAINERTEST"; if (!CryptAcquireContext(&cryptProvider, pszKeyContainerName, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET | CRYPT_MACHINE_KEYSET)) { if (GetLastError() == NTE_EXISTS) { if (!CryptAcquireContext(&cryptProvider, pszKeyContainerName, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET)) { _tprintf(_T("Can't get a crypto provider. Error %d\n"), GetLastError()); free(encodedSubject); return ""; } } } // Generate new key pair HCRYPTKEY key; if (!CryptGenKey(cryptProvider, AT_SIGNATURE, 0x08000000 /* RSA-2048-BIT_KEY */ | CRYPT_EXPORTABLE, &key)) { _tprintf(_T("Can't generate a key pair. Error %d\n"), GetLastError()); CryptReleaseContext(cryptProvider, 0); CertCloseStore(certStore, 0); free(encodedSubject); return ""; } // Prepare key provider structure for self-signed certificate CRYPT_KEY_PROV_INFO keyProviderInfo; ZeroMemory(&keyProviderInfo, sizeof(keyProviderInfo)); keyProviderInfo.pwszContainerName = (LPWSTR)pszKeyContainerName; keyProviderInfo.dwProvType = PROV_RSA_FULL; keyProviderInfo.dwFlags = CRYPT_MACHINE_KEYSET; keyProviderInfo.dwKeySpec = AT_SIGNATURE; // Prepare algorithm structure for self-signed certificate CRYPT_ALGORITHM_IDENTIFIER algorithm; memset(&algorithm, 0, sizeof(algorithm)); algorithm.pszObjId = (LPSTR)szOID_RSA_SHA256RSA; // Prepare certificate Subject for self-signed certificate CERT_NAME_BLOB subjectBlob; ZeroMemory(&subjectBlob, sizeof(subjectBlob)); subjectBlob.cbData = encodedSubjectSize; subjectBlob.pbData = encodedSubject; PCCERT_CONTEXT certContext = CertCreateSelfSignCertificate(NULL, &subjectBlob, 0, &keyProviderInfo, &algorithm, NULL, NULL, NULL); if (!certContext) { _tprintf(_T("Can't create a self-signed certificate. Error %d\n"), GetLastError()); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); CertCloseStore(certStore, 0); free(encodedSubject); return ""; } if (!CertSetCertificateContextProperty(certContext, CERT_KEY_PROV_INFO_PROP_ID, 0, &keyProviderInfo)) { _tprintf(_T("Unable to set key provider info property on certificate context. Error %d\n"), GetLastError()); CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); CertCloseStore(certStore, 0); free(encodedSubject); return ""; } // add certificate to store if (!CertAddCertificateContextToStore(certStore, certContext, CERT_STORE_ADD_ALWAYS, nullptr)) { CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); CertCloseStore(certStore, 0); free(encodedSubject); return ""; } CString result = GetCertificateThumbprintString(certContext); CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); CertCloseStore(certStore, 0); free(encodedSubject); return result; } int main(int argc, char* argv[]) { if (argc < 2) { printf("Need arg."); return -1; } auto index = 1; if (strcmp(argv[1], "dbg") == 0) { while (!IsDebuggerPresent()) Sleep(100); index = 2; } CString strThumbprint = CreateCertificate(argv[index]); _tprintf(strThumbprint); return 0; } 

    I found a similar issue here which is what gave me the idea to call CertSetCertificateContextProperty in the first place. But it doesn't resolve the issue.

    What am I missing here?

    Edit: This same code works when the certificate store opened is on the local machine. This issue only arises when the certificate store is on a remote machine.

    Edit 2: At RbMm's suggestion, I investigated exporting the certificate into a PFX. It was unclear to me how exporting the certificates into PFX's would change anything except that perhaps the generated PFX would do some magic to allow the key pair to be passed along when I insert it into the remote store.

    In that investigation I found this which helped me change my code to utilize PFXExportCertStoreEx/PFXImportCertStore. What you see below is what I added (replacing the CertSetCertificateContextProperty call). However, it should be noted that this did not work either. So I'm again at a loss.

    // Create temporary store to shove the self-signed certificate into. HCERTSTORE initialTempStore = CertOpenStore(CERT_STORE_PROV_MEMORY, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, NULL, CERT_SYSTEM_STORE_LOCAL_MACHINE, L"MY"); if (NULL == initialTempStore) { _tprintf(_T("Failed to open local Personal certificate store.")); CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); free(encodedSubject); return ""; } // Add the certificate to the self-signed store. if (!CertAddCertificateContextToStore(initialTempStore, certContext, CERT_STORE_ADD_REPLACE_EXISTING, nullptr)) { _tprintf(_T("Failed to add cert to local store.")); CertCloseStore(initialTempStore, 0); CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); free(encodedSubject); return ""; } // Export the certificate store into a PFX that packages the certificates with the private keys. CRYPT_DATA_BLOB pfx; ZeroMemory(&pfx, sizeof(CRYPT_DATA_BLOB)); LPCTSTR password = L"hello5"; if (!PFXExportCertStoreEx(initialTempStore, &pfx, password, NULL, EXPORT_PRIVATE_KEYS)) { _tprintf(_T("Unable to export PFX.\n")); CertCloseStore(initialTempStore, 0); CertDeleteCertificateFromStore(certContext); CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); free(encodedSubject); return ""; } pfx.pbData = (BYTE*)malloc(pfx.cbData); if (!PFXExportCertStoreEx(initialTempStore, &pfx, password, NULL, EXPORT_PRIVATE_KEYS)) { _tprintf(_T("Unable to export PFX.\n")); CertDeleteCertificateFromStore(certContext); CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); free(encodedSubject); free(pfx.pbData); return ""; } // Now we don't need anything we had before because the PFX contains it all. CertFreeCertificateContext(certContext); CertCloseStore(initialTempStore, 0); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); free(encodedSubject); // Import the cert into a temporary store marking the keys as exportable. HCERTSTORE tempStoreWithKeys = PFXImportCertStore(&pfx, password, CRYPT_EXPORTABLE | CRYPT_MACHINE_KEYSET); if (tempStoreWithKeys == NULL) { _tprintf(_T("Unable to import PFX.\n")); PrintError((LPTSTR)_T("PFXImportCertStore")); free(encodedSubject); free(pfx.pbData); return ""; } // Search through the temporary store to find the cert we want. PCCERT_CONTEXT certWithPrivateKey = CertEnumCertificatesInStore(tempStoreWithKeys, nullptr); if (certWithPrivateKey == NULL) { _tprintf(_T("Unable to enumerate temporary store. Error %d\n"), GetLastError()); free(encodedSubject); free(pfx.pbData); return ""; } while (certWithPrivateKey) { DWORD requiredSize = CertNameToStr(X509_ASN_ENCODING, &certWithPrivateKey->pCertInfo->Issuer, CERT_X500_NAME_STR, NULL, NULL); LPTSTR decodedSubject = (LPTSTR)malloc(requiredSize * sizeof(TCHAR)); if (NULL == decodedSubject) { _tprintf(_T("malloc() failed: %d "), GetLastError()); free(pfx.pbData); return ""; } if (!CertNameToStr(X509_ASN_ENCODING, &certWithPrivateKey->pCertInfo->Issuer, CERT_X500_NAME_STR, decodedSubject, requiredSize)) { _tprintf(_T("Invalid certificate subject name. Error %d\n"), GetLastError()); CertFreeCertificateContext(certWithPrivateKey); CertCloseStore(tempStoreWithKeys, 0); free(decodedSubject); free(pfx.pbData); return ""; } if (_tcsncmp(subjectName, decodedSubject, requiredSize) != 0) { free(decodedSubject); certWithPrivateKey = CertEnumCertificatesInStore(tempStoreWithKeys, certWithPrivateKey); continue; } free(decodedSubject); break; } if (!certWithPrivateKey) { _tprintf(_T("No matching cert found in store\n.")); CertFreeCertificateContext(certWithPrivateKey); CertCloseStore(tempStoreWithKeys, 0); free(pfx.pbData); return ""; } 

    Edit 3: After further discussions I've tried the following as well. After creating the temporary in-memory store and adding the certificate to it, I set the CERT_KEY_CONTEXT property on the resultant add operation as follows:

    PCCERT_CONTEXT newCertContext; // Add the certificate to the self-signed store. if (!CertAddCertificateContextToStore(initialTempStore, certContext, CERT_STORE_ADD_REPLACE_EXISTING, &newCertContext)) { _tprintf(_T("Failed to add cert to local store.")); CertCloseStore(initialTempStore, 0); CertFreeCertificateContext(certContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); free(encodedSubject); return ""; } CERT_KEY_CONTEXT keyContext; keyContext.cbSize = sizeof(CERT_KEY_CONTEXT); keyContext.dwKeySpec = AT_SIGNATURE; keyContext.hCryptProv = cryptProvider; if (!CertSetCertificateContextProperty(newCertContext, CERT_KEY_CONTEXT_PROP_ID, 0, &keyContext)) { _tprintf(_T("Unable to set key context property on certificate context. Error %d\n"), GetLastError()); CertFreeCertificateContext(certContext); CertFreeCertificateContext(newCertContext); CryptDestroyKey(key); CryptReleaseContext(cryptProvider, 0); CertCloseStore(initialTempStore, 0); free(encodedSubject); return ""; } 

    This does not resolve the issue either.

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

    screed.. Why hasn't their been a reasonable terminal editor replacement for vi ?

    Posted: 18 Jan 2020 06:30 PM PST

    So I know this may be a bit of controversial post,I know editors are very personal too people, but here goes, I work with a lot of old school unix hacks and they all swear by vi, but I can't stand vi, I get that its a terminal editor invented back in the day, I know its not VS code.. but even with that my hatred for it runs deep , just starting it up .. why does this editor that requires me to press 'i' to start working with it is insane, its a f*kn editor its main role is to edit why do I need to give it a command to do so??? Also the keyboard shortcut commands are idiots esc+wq WTF, not to mention that often the character set is mis-aligned.. I'm sure there's probably a way in bash startup to configure it, which is fine but i'm bouncing system to system.. its just easier to learn the byzantine commands .. I shouldn't be using a computer editor that's older than me or my car, vi originated in 1976 .

    Ok now that I got my screed out of the way, my question is , why hasn't there been a reasonable more modern terminal replacement for this thing that is the defacto standard unix editor? am I the only one who is so irritated.. curious to hear thoughts..

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

    Recommendations YouTube channels

    Posted: 18 Jan 2020 04:38 PM PST

    Hey,

    i was wondering if and what YouTube chanells you watch wich are IT related and good to expand knowledge or even start with new stuff in general. I'm generally open to evrything :)

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

    Best Online Courses For Fullstack Web Development

    Posted: 18 Jan 2020 06:46 AM PST

    As the title suggests, I'm looking for opinions about online courses for fullstack web devs. So far I've been planning on getting one of these:

    https://www.udemy.com/course/the-complete-web-development-bootcamp/?ranMID=39197&ranEAID=uD4dhxffZm0&ranSiteID=uD4dhxffZm0-XvZpxvwubUHxVPoDmV7I_Q&LSNPUBID=uD4dhxffZm0 ( The Complete 2020 Web Development Bootcamp by Angela Yu)

    https://www.udemy.com/course/the-web-developer-bootcamp/ ( The Web Developer Bootcamp by Colt Steele)

    https://www.udemy.com/course/result-oriented-web-developer-course/ ( The Web Developer Bootcamp by Vertex Academy)

    Has anyone completed one of these, if so, are these courses worth getting. Additionally, if you have any suggestions for other online courses feel free to suggest them.

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

    Help with editing photoviewer.dll and/or photowiz.dll in Win 10. to change theme colors.

    Posted: 18 Jan 2020 12:12 PM PST

    Hello, so I have gotten this far and I find myself running into a brick wall any help is appreciated.

    I am looking to edit the Windows Photo Viewer program in Windows 10. I was able to find and complete everything needed to get WPV running in WIN 10. I was also able to change the background color of the app. However, I would like to change the bar at the top and bottom of the program to a darker theme or something other than white. The areas I am wanting to modify can be seen in this image circled in red.

    I know this is possible because there have been others who have done it as seen both here and here

    but I am uncertain about how to go about modifying the two .dll files. photoviewer.dll and photowiz.dll.

    Any help would be greatly appreciated.

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

    How to train your brain for complexity?

    Posted: 18 Jan 2020 09:39 AM PST

    For a few years now I'm interested in how to get better at programming. There are obvious ways:

    • read a lot of code
    • code a lot (write a compiler, emulator, chat, game, code katas, etc)

    However no matter how well I know a language , architecture or a design pattern, I still find it difficult to understand code (/project) I've never seen before.

    I try to follow best practices, but they seem to take you not too far:

    • read top down (packages, classes, folders, files ... functions, structures, data ...)
    • (if language supports) generate entity relationship diagrams or similar
    • read the doc (which never helps, tbh) or tests (maybe but no)

    What I miss is the ability to build up mental models quickly - as rough as it is - and transform them, shape them during the exploration of the code base. Keep multiple stacks of layers and adopt if the representation in my head was wrong (because assumptions). Also the lack of being able to recognize (higher level) patterns, channels of data flow - or even the separation of important bits vs. filler code.

    Recently I've learn some good practices that helped with this:

    • make code reading like a research: take notes, add comments (in code), write down learning and draw diagrams
    • be a VCS inspector: read commit messages, pull request descriptions, look for often-changed (hot) places

    So here is my question:

    • are there other smart tools/practices that helps understanding new code?
    • are there good training ways to improve your brain on keeping complexity/layers/stacks in your head and easily transform them on the go
    submitted by /u/DontForgetToCacheIt
    [link] [comments]

    CSS - How do I make an "Input" border outline a different color?

    Posted: 18 Jan 2020 03:04 PM PST

    Gif - https://imgur.com/a/37YAPsi

    Code (Pastebin) - https://pastebin.com/QMTt5jNz

    Issue :

    See that "blue" outline-ish thingy around the input field? How do I change it's color?

    I tried with an "outline" Property for the "text.input" class, as well as trying a .text-input:active class, but apparently, none of those are that blue...thingy around the input field, although I'm not sure what else could it be at this point.

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

    How to reliably trigger event on timer with minimal CPU usage

    Posted: 18 Jan 2020 02:59 AM PST

    I currently have a Java busy loop design like this. The method potentiallyDoSomethingIfNeeded will do something if some data from an external websocket was received, and will occasionally (every few seconds) do some miscellaneous processing.

    public class Main { public static void main(String[] args) { while(true) { potentiallyDoSomethingIfNeeded(); } } } 

    However I don't like how much unnecessary CPU resources this takes. Most of the time, the method potentiallyDoSomethingIfNeeded does nothing. Instead I am thinking of transition to a design like this:

    public class Main { public static void main(String[] args) { } public static void onTimer() { // I want this to be triggered every 1 second. doSomething(); } public static void onExternalEvent() { // I want this to be triggered when a websocket data is sent to me. doSomething(); } } 

    To me this seems to be much more efficient in terms of CPU usage since I don't have a CPU spinning doing nothing. I have two questions (you can answer one of the two and I'll be happy):

    1. Does my design make sense for my objective of reducing overall CPU usage?
    2. How can I implement a reliable, 1 second timer like this, which calls onTimer every one second but doesn't take up unnecessary CPU spinning resources.

    EDIT: This is not premature optimisation, I want to do this to reduce CPU usage on a burstable AWS instance to save money.

    submitted by /u/Future-Professional
    [link] [comments]

    Would it be possible to write a discord bot that could accept commands to navigate a like hulu, such as search for a show and select a show to play.

    Posted: 18 Jan 2020 02:29 PM PST

    I have experience writing a simple discord bot in both python and c# that could accept commands and give responses. I recently built a separate PC that's going to stream hulu for my discord server and I want my few friends and I to be able to enter a command such as !search Bob's Burgers and the bot would search hulu for Bob's Burgers, display result and then a second command could be entered to select which result to stream. Obviously there's easier ways to do this but I just want a project to work on. If it's possible can you please give me an outline or some videos to watch to research this project?

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

    Can I push a .gitignore file from my computer onto github with another .gitignore?

    Posted: 18 Jan 2020 01:18 PM PST

    I have a repo on GitHub that I initialize with a .gitignore, but I also realize I have a .gitignore (the better one) on my local computer that I want to push on to GitHub.

    What should I do? Would deleting the .gitignore from GitHub and then pushing the .gitignore from my computer work? Or vice versa, deleting the .gitignore from my computer, then pulling and editing the .gitignore that was initialized with the GitHub?

    Thanks

    edit: I don't really want to delete the GitHub repo because I already added all my team members and created branches for us, and when I do create-react-native, which is our project, it created a ./gitignore automatically.

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

    I haven't built my first desktop program. My question due to lack of knowledge is: Do you use the same techniques that you use for front-end web development to make a desktop program's front-end? If not, can you clarify this and suggest some techniques? Does it happen automatically somehow? Thanks!

    Posted: 18 Jan 2020 01:05 PM PST

    Should I advance with Python or start learning Java?

    Posted: 18 Jan 2020 12:36 PM PST

    Hi, I'm struggeling to figure out where to put most of my effort in learning new elements. I'm looking to go continue deeper into data analytics world, including working with data pipeline software & data analysis software. I already know a lot of Python, and have already deployed kubernetes web applications & worked with numerical software such as numpy, visualization such as matplotlib/jupyter and libraries such as scikit. I wish to start building these tools myself. So naturally I'm afraid that Python (as a tool) will become a bottleneck, therefor I am wondering about switching to Java.

    I love Python for prototyping & building smaller production software. However currently I'm working for a multinational company, and I wish to start making a larger impact on the community.

    Is there somone here, with lots of experience from both, that can suggest what area I should focus on?

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

    What are your opinions on coding bootcamps? Asking for someone looking for a career change

    Posted: 18 Jan 2020 12:30 PM PST

    My wife works in the restaurant industry and is tired of it. She wants to do something that is at least somewhat intellectually stimulating. We've got a little one, and I just started community college, so we are trying to figure out the best way to navigate both of us being in school. I'm totally willing to put my school on hold so that she can go.

    For people not wanting to spend 4 years in school, how can they get into an entry-level programming position? Thanks!

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

    eTextbook: a nudge in the right direction

    Posted: 18 Jan 2020 12:06 PM PST

    Hello, I am currently working on my final senior project. I was assigned an eTextbook that contains illustrations, videos, and some data analytics. I am very confused on how to start this as Ive never programmed any thing like this before. I was wondering if any of you guys knew of some sources which could help me out.

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

    C++ Templated memeber function returning a templated class

    Posted: 18 Jan 2020 08:13 AM PST

    I'm trying to write litle openGL library and i've been stuck on this problem for hours.

    Basically i have a Uniform<T> templated class and a Shader class that has a GetUniform<T>(const char* name) that should return an instance of the class Uniform with type T, also i don't want to do this with specialization because the code is same regardless of the type.

    Uniform class code:

    template<typename T> class Uniform { private: unsigned int _Location; public: inline Uniform(unsigned int location) : _Location(location) {} } 

    First getUniform<T> implementation:

    template<typename T> inline Uniform<T> getUniform(const char* name) const { unsigned int location = glGetUniformLocation(_ID, name); return Uniform<T>(location); } 

    Fails with error:
    error C2988: unrecognizable template declaration/definition

    Second getUniform<T> implementation:

    template<typename T> inline auto getUniform(const char* name) const { unsigned int location = glGetUniformLocation(_ID, name); return Uniform<T>(location); } 

    Fails with error:
    error C3861: 'Uniform': identifier not found

    Thanks in advance for your help.

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

    Confused about eventual consistency

    Posted: 18 Jan 2020 11:32 AM PST

    Say I have an API with read/write, and writes are eventually consistent.

    Say the current value of a key is A

    I then do a write with value B

    I then sit there reading until I eventually see value B

    At this point if I do another read, is it possible to receive value A?

    Like does eventual consistency mean once you've seen the updated value you won't see the old one?

    Or does it mean there's a period of time where you may see either value but at some point it will converge to one value?

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

    Macro to Reconnect Device on Network Loss

    Posted: 18 Jan 2020 10:39 AM PST

    Ok, here's the tea. Currently my PC is using some USB TPLink device to allow my PC to connect to the WiFi. The device is getting old and every few minutes it drops the connection to the wifi entirely. Unplug it and plug it back in and for the next few minutes it continues to work great. I'm getting annoyed with that cycle but I'm too cheap to shell out for a new device. Is it possible to set up a macro or other program that automatically resets the connection to the device upon losing access to the internet? I have limited programming experience and I'm not certain where to start with something like that.

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

    Using mongo for the first time, queries don't seem to be running in order?

    Posted: 18 Jan 2020 09:58 AM PST

    I'm just running through a mongo tutorial, and cannot seem to figure out why my code is running in the order it does. It displays my DB before adding to it. Any help would be much appreciated.

    var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/cat_app'); var catSchema = new mongoose.Schema({ name : String, age: Number, temperament: String }); var Cat = mongoose.model("Cat", catSchema); console.log("BEFORE CREATE"); Cat.create({ name: "Snow White", age: 16, temperament: "Gay" }, function(err, cat){ if(err){ console.log(err); } else { console.log("New CAT" + cat); } }); //retireve cats from db console.log("AFTER CREATE") Cat.find({}, function(err, cats){ if(err){ console.log("O no error"); console.log(err); } else { console.log("All the cats"); console.log(cats); } }) console.log("END") 

    So the output goes in this order. First my 3 console.logs BEFORE CREATE, AFTER CREATE, END, followed by "all of the cats" and showing the DB and lastly NEW CAT + cat

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

    Whats the contentType of the 64 bits of an IEEE754 double, like theres text/plain and image/jpeg?

    Posted: 18 Jan 2020 09:24 AM PST

    https://en.wikipedia.org/wiki/Media_type

    https://en.wikipedia.org/wiki/Double-precision_floating-point_format

    https://en.wikipedia.org/wiki/IEEE_754

    I plan to use this ContentType in a pure-functional programming language where everything is made of calls of a universal lambda function (including the bitstring of utf8 of the name of contentTypes), to label certain bitstrings by their contentType, with various optimizations so it doesnt matter how long the content-type is, in https://github.com/benrayfield/occamsfuncer

    That content-type has likely never been standardized cuz its so small (64 bits) and you wouldnt normally send just 1 of them at a time. If so then the process is to create one with the x- prefix possibly on both sides of the slash (which would you recommend?) then get it officially added to the content-type lists, or one could just pretend one thing or another already official and see if others follow, as double is already a well standardized data format but I'm just unaware of its name or if it has one. And the same for all the other common primitive types and maybe arrays of them.

    Maybe something like "application/x-ieee754-double" for the 64 bits and "text/x-IEEE754-double-base10" for the text form, but hopefully theres an existing name of it.

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

    How to create a simple 3D model in python?

    Posted: 18 Jan 2020 07:32 AM PST

    Implementing a LinkedList Iterator, calls to next and previous

    Posted: 18 Jan 2020 07:27 AM PST

    So I have an assignment where we're making a circular doubly linked list and the code is doing what I expect it to do and how I want it to work, but that's not necessarily what the test case is testing for so I don't quite understand the logic. Specifically, from the docs " Note that alternating calls to next and previous will return the same element repeatedly " (https://docs.oracle.com/javase/7/docs/api/java/util/ListIterator.html#next()))

    But like this isn't how I would expect it to happen, so this isn't how I've programmed it to happen. I'd assume if you had a list of 1,2,3, and you were currently on 2, if you call next you would get 3, and if you call previous you would get 2, not 3. So how am I supposed to make it so that as the docs say, alternating calls to next and previous will return the same element?

    submitted by /u/404WillToLive
    [link] [comments]

    No comments:

    Post a Comment