• Breaking News

    Wednesday, June 9, 2021

    Using Genetic Algorithm for timetabling Ask Programming

    Using Genetic Algorithm for timetabling Ask Programming


    Using Genetic Algorithm for timetabling

    Posted: 09 Jun 2021 10:56 AM PDT

    In a some of the papers and articles where they implemented a timetabler with a Ga they measure the fitness of a solution by the amount collisions, like two classes at the same place, but why can't you just make a check to see if a class exists in that time before adding it to the schedule, wouldn't that just be better? Or is it necessary so my population can be more diverse or something?

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

    Rotating scanned documents programtically

    Posted: 09 Jun 2021 06:49 PM PDT

    Hello everyone, I've been tasked with automating some of our accounts payable processes at work. At the end of each day our inwards goods team scans a bunch of supplier invoices through which are then manually sorted through by the accounts payable team. We would like to automate pulling out specific data points from invoices which can then be used to sort and filter them. This is all well and good and shouldn't be to much of a hiccup except I'm not sure what to do about the rotation of of invoices. For example, if an invoice is scanned through sideways, or upside down, how would I go about correcting that? We have many different suppliers each with there own style of invoices which makes this a bit tricky. I think it would need to be a solution which would look at the entire document and make a decision rather than one which looks for specific markers.

    I'm posting here hoping someone has had some experience with something like this and can point me in the right direction

    I'm using C# but I'm open to all suggestions. Thanks

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

    Counting character headers in SAS

    Posted: 09 Jun 2021 07:08 PM PDT

    So I have a dataset that's being pulled from a csv. I'm trying to write a code that counts the amount of columns within the table but I haven't found a way. All my headers of course are on the first row and they're all in character format. I know that I have 26 variables, but I need to write code that gives me the output that there's 26 variables. And to be clear, I don't want it to read each one and give me a list, I'd just like it to give me the numeric number of variables from the counted amount of columns.

    Sorry if this is basic, I'm very new and trying to get the hang of it and couldn't find anything through Google or stack overflow.

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

    Need recommendations for SQL Databases

    Posted: 09 Jun 2021 09:33 PM PDT

    Hi there! I am fairly new to programming and I am challenging myself to make my first project in Java. However, I have some problems regarding what is the better SQL database to use on my project. I have worked on several SQL databases like MySQL, MariaDB and SQLite, however, I don't know which one to choose. Here are the features that my project contains:

    • made with Java.
    • is a cash register system.
    • is only limited to a single computer.
    • is portable
    • can be used by any people and thus the user will not depend on a programmer.

    Any suggestions will be appreciated.

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

    AppContainer / Desktop Bridge AppData redirection specifics

    Posted: 09 Jun 2021 03:17 PM PDT

    I've been looking at AppContainers as a means of sandboxing arbitrary processes, and can see that packaged apps redirect access to certain registry and file locations.

    I have the following c# code (requires the NtApiDotNet package) as a test, which launches itself inside an AppContainer, prints the location of appdata / localappdata / environment, then quits:

    static async Task Main(string[] args) { if (NtProcess.Current.IsSandboxToken) { await Console.Out.WriteLineAsync("in appcontainer"); await Console.Out.WriteLineAsync($"appdata :{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}"); await Console.Out.WriteLineAsync($"localappdata :{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}"); IDictionary xx = Environment.GetEnvironmentVariables(); foreach (DictionaryEntry item in xx) { await Console.Out.WriteLineAsync($"{item.Key} : {item.Value}"); } } else { using AppContainerProfile x = AppContainerProfile.CreateTemporary(new[] { KnownSids.CapabilityInternetClient, KnownSids.CapabilityDocumentsLibrary }); Win32ProcessConfig win32ProcessConfig = new Win32ProcessConfig() { AppContainerSid = x.Sid, ApplicationName = NtProcess.Current.Win32ImagePath, }; AllowAccess(x, Path.GetDirectoryName(NtProcess.Current.Win32ImagePath), FileAccessRights.GenericAll); using Win32Process win32Process = Win32Process.CreateProcess(win32ProcessConfig); await win32Process.Process.DuplicateAsWaitHandle().WaitAsync(); } } private static void AllowAccess(AppContainerProfile container, string folder, FileAccessRights accessRights) { SecurityDescriptor securityInfo = Win32Security.GetSecurityInfo(folder, SeObjectType.File, SecurityInformation.Dacl); Ace newAce = new Ace(AceType.Allowed, AceFlags.ContainerInherit | AceFlags.ObjectInherit, accessRights, container.Sid); if (!securityInfo.Dacl.Contains(newAce)) { securityInfo.Dacl.Add(newAce); Win32Security.SetSecurityInfo(folder, SeObjectType.File, SecurityInformation.Dacl, securityInfo, true); } } 

    Unfortunately only the local appdata & temp folders are redirected to a per-user-per-package directory; the normal appdata folder still points to the users %appdata% folder (which as far as Environment.GetFolderPath is concerned, doesn't exist - as the container doesn't have permissions, so it returns empty)

    So far there's not a whole lot of information I've been able to find out about how packaged apps enable the redirection features inside an AppContianer for a process - so any ideas on how this works, or where I could begin looking to figure it out would be great!

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

    choosing a framework for an auctioning web app

    Posted: 09 Jun 2021 10:39 AM PDT

    I'm working ecommerce website at my internship, oddly enough I'm the only in-house developer and can't really ask anyone for help. We don't do online transactions because of the amounts involved, so no shopping cart system, no payments just paper invoices. Some of the main goals are to build a user portal for listing products, ability to query products from a large database (~40,000 listings), admin portal for managing all listings, and public platform that allows for bidding, favoriting items, querying items, filters ect..

    Managment has told me they don't want to use a CMS like wordpress or wix, I ended up using node.js with express and SQL and hosting the app on google cloud. 3 weeks into the project, I've been primarily focusing on the backend, putting together a VERY simple front-end (as we don't have a designer yet).

    What worries me is I have no plans for a front-end framework, nor do I know if I should use one. I'm very proficient with vanilla JS/ CSS/ HTML, and I'm somewhat experienced with react.js (which I didn't enjoy using). Would I be shooting myself in the foot by simply continuing to use vanilla JS for the entire web app? This isn't going to be a very complex web app like facebook, so I'm leaning towards not using a framework.

    tl;dr building an auction website like ebay without online transactions/ shopping cart. Is it a good idea to not use a framework?

    submitted by /u/Vegetable-Band5417
    [link] [comments]

    People Who Can Dream In Programming Languages???

    Posted: 09 Jun 2021 08:06 PM PDT

    General question for all experienced programmers and I'm very intoxicated atm so sorry if this is a dumb question. I was remembering back to an old web dev internship in high school where a conversation led to the topic of dreaming in code??? I was an anxious high schooler so I never asked him about this, but what is this all about?

    How is this visualized? are you sitting on your computer on a text editor, or seeing the text editor as your entire vision vision? Do you just become a compiler interpreting code XD

    Maybe it was cap but can anyone give any insight

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

    Need to explicitly call derived class's base class constructor, copy constructor, and copy assignment operator, but need not bass class's destructor?

    Posted: 09 Jun 2021 07:28 PM PDT

    In the constructor, copy constructor, and copy assignment operator, need to add bass's in {} or initializer list, but in derived class's destructor, need not care about bass's desturctor?

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

    Flask Mail for production?

    Posted: 09 Jun 2021 06:59 PM PDT

    I'm currently using flask-mail on a linode server for my website for 3 things:

    • Confirm user registration when they first sign up
    • allow users to securely reset their password
    • I'd like to send out emails to users maybe once a month or less to give updates on the site

    Apart from that, I have no reason to send emails. As of now everything works how I'd like it to, but it's currently tied to a gmail account, but I keep seeing people say that gmail is bad for production, and worse I've seen people say they limit your correspondence to 100 new users before cutting it off.

    I don't anticipate having a massively high volume of users and honestly don't want to scrap the work I've put into the emailing system for something new. Does anyone know an alternative where I can simply register a new account and password and use in conjunction with Flask-Mail that would be suitable for production and won't be an issue?

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

    What is the best way to use APIs ?

    Posted: 09 Jun 2021 02:36 PM PDT

    I used python for about 6 months and while it's great I'm starting to see his limits when trying niche web API. So what should I learn next ? I heard js was compatible with a lot of thing but wanted another opinion.

    What I really want is something that is popular enough to be almost the main source of all API.

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

    Atlas.ti experts, PLEASE HELP ME

    Posted: 09 Jun 2021 11:54 AM PDT

    After coding 2 days worth of quotes, i get the following error while trying to split. "Attempt to acces an object not found in store". Cancelling would could me to lose my work but i can't find out what is causing this error. Anyone here that can help me, or direct me to someone (or a subreddit) who can?

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

    How to Developers access non-public API's

    Posted: 09 Jun 2021 05:13 PM PDT

    I wrote a Depop Bot a while back that used selenium and ChromeDriver. I don't like interacting with the UI through code. I've done some research and see that there are many Depop Bots out there that claim to use Depop's API. However Depop does not have a public API and I'm sure they would not let a developer use it for a bot, so how do people create bots that use non-public API's?

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

    Must add 'namespace::' before function definition? Can't just use 'using namespace A'? only can omit 'namespace::' before class object?

    Posted: 08 Jun 2021 11:49 PM PDT

    in g.cpp

    #include"g.h" using namespace A; void A::g(){ cout<<"A::g() called\n"; } 

    like

    #include"g.h" using namespace A; void classA::g(){ cout<<"A::g() called\n"; } 
    submitted by /u/hwpcspr112
    [link] [comments]

    [Terminology] Source file containing program entry point

    Posted: 09 Jun 2021 12:41 PM PDT

    Back when I first started formally learning programming, my professor told us to (and I paraphrase) "keep the program entry point in its own source file, called the 'driver'". I never questioned it at the time, and I have been doing it ever since.

    Years later, when discussing design patterns with friends and colleagues, it was pointed out to me that drivers are strictly for hardware and not software. However, nobody has been able to give me an alternate term for the 'driver' file. Rather, they just tell me to "keep the program entry point inside the source file with the bulk of the program's logic".

    I am curious if this practice was something my professor came up with, or which actually has some prevalence. I have tried searching online, but have not been able to find any relevant information. Do you know if such a practice exists, and if so, what the file containing the program entry point is typically called?

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

    Issue with IIS Web-service that I did not write.

    Posted: 09 Jun 2021 12:36 PM PDT

    I am having issues with a webservice that I had written. It constantly will crash and send back empty responses. I feel like I am getting close to the solution, but I am not very informed on IIS and I do not write in the coding language. I am at my wits end as this has halted development for a bit here and need to move on. **The strange thing is that this code works 100% of the time on an older system.**

    Another thing to mention, the web-service usually works one or two times until the next set of requests either crash the application or respond with bad response bodies. This does lead me to believe that maybe memory is being used but never freed up for use again? Sort of like a leak?

    Here is the C# code:

    https://pastecord.com/ogicuxysyg.cs

    Here is SOME of the C code, I can provide more if necessary:

    https://pastecord.com/fygagovisu.cpp

    The error I receive is System.AccessViolationException when checking DebugDiag.

    Here is the call stack I have generated using Application Verifier and DebugDiag:

    https://pastecord.com/yjedidyzom.css

    Again, I didn't write this code and am not too familiar with C#. I mainly code in Javascript but I can try and understand any code that may need to be adjusted. Any help is greatly appreciated.

    Here is the output I receive. I log both the status code and body of the response. You'll notice an empty response body when an output string is expected. One bad response ruins the calculations so any further responses are useless.

    https://pastecord.com/vonupozaqu.html

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

    Can anyone help with this? Software suggestions?

    Posted: 09 Jun 2021 12:12 PM PDT

    Hi, I'm a business owner who gets a ton of invoices and I want to begin keeping track of them. I'm wondering if there's a way to scan a PDF of the invoices and get certain values from them into a database?

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

    Is there an open source driver manager?

    Posted: 09 Jun 2021 12:04 PM PDT

    Hello, My organization has about 150 computers running either Windows 7 or Windows 10 on a local network and most of the calls my department gets are about drivers being outdated.

    I'm thinking about building a driver manager that downloads the latest drivers from an address in the closed network and compares them against the PC's hardware IDs.

    Now I know this idea is nothing new but all the driver managers I found online download the drivers from the different companies sites which are unreachable in our network. I was thinking that if there is an open source one I could change the address that contains the drivers.

    Does anyone know of an open-source driver manager or a better solution?

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

    jQuery sortable

    Posted: 09 Jun 2021 11:59 AM PDT

    I'm a bit lost after going through the sortable documentation. I have a button that onclick should return the list to its original state prior to any sorting: $("sort").sortable("refreshpositions").

    However using this, or even trying the 'destroy' method doesn't seem to make a difference in reverting the list to its original state.

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

    Any good way to have a window snap onto two monitors like it's one big one?

    Posted: 09 Jun 2021 11:27 AM PDT

    I have two large monitors that I want to have a my vscode window snapped onto. Doesn't matter if the solution is in Windows or Arch linux just as long as it works. I'm running on a GeForce RTX 3070 so mosaic is out of the question.

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

    Need some insight/advice on a 'mathey' question

    Posted: 09 Jun 2021 07:33 AM PDT

    LC: https://leetcode.com/problems/integer-break/

    The key observation that unlocks a non-DP solution is the fact that for any integer n greater than 4, it has the property such that 3 * (n - 3) > n which means breaking it into two integers 3 and n - 3 makes the product larger while keeping the sum unchanged.

    If n - 3 is still greater than 4, we can break it into 3 and n - 6, resulting in 3 * 3 * (n - 6)
    , and so on, until we cannot break it (less than or equal to 4) anymore.

    I was just wondering more from an academic perspective, why this is true/valid?

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

    What to do when an API don't have any documentation ?

    Posted: 09 Jun 2021 07:23 AM PDT

    I found a cool API but I checked everywhere and It don't have any documentation only a readme and the actual file. What can I do ?

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

    Tutorials/ resources for implementing LSP?

    Posted: 09 Jun 2021 04:38 AM PDT

    Decided to make my own text editor, I'd like to have syntax highlighting for a few languages (python csharp and clojure would be a start). Has anyone done this (the LSP way) ? any tips, resources ect?

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

    Need help with Python code, please help :(

    Posted: 09 Jun 2021 05:03 AM PDT

    import tkinter import sqlite3 from tkinter import messagebox def login(): i = en_id.get() p = en_pw.get() conn = sqlite3.connect('test.db') cur = conn.cursor() cur.execute("SELECT * FROM member") rows = cur.fetchall() 

    for row in rows:

    if row[0] == i and row[1] == p:

    # login success

    messagebox.showinfo(row[0] + '님 환영합니다 !', '로그인 성공 !')

    else:

    # login fail

    messagebox.showerror('아이디와 비번을 확인하세요', '로그인 실패 !')

    break

    conn.commit() conn.close() w = tkinter.Tk() w.title('로그인 실습 v0.5') lbl_id = tkinter.Label(w, text='아이디 : ') # id lbl_pw = tkinter.Label(w, text='패스워드 : ') # pw en_id = tkinter.Entry(w) en_pw = tkinter.Entry(w) btn_login = tkinter.Button(w, text='LOGIN') lbl_id.grid(row=0, column=0) lbl_pw.grid(row=1, column=0) en_id.grid(row=0, column=1) en_pw.grid(row=1, column=1) btn_login.grid(row=2, column=0, columnspan=2, sticky='nswe') w.mainloop() 

    The problem here is that if login is successful, I get a failure popup after the expected success popup. It seems like there's something wrong with the loop.

    I need to fix the text shown above in a different format (it says inline code, I just used it to make it stand out).

    Please help :(

    + Note the highlighted part's indents disappeared as I changed the format. Tried to fix it with no luck.

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

    No comments:

    Post a Comment