• Breaking News

    Monday, November 12, 2018

    (VB.NET) Can I loop through TextBoxes and set their values into an array? I'm having a difficult time with this Ask Programming

    (VB.NET) Can I loop through TextBoxes and set their values into an array? I'm having a difficult time with this Ask Programming


    (VB.NET) Can I loop through TextBoxes and set their values into an array? I'm having a difficult time with this

    Posted: 12 Nov 2018 09:50 PM PST

    Hello!

    So I have a few asp textboxes set up where the user will put some data into. Here is what it looks like:

    <asp:TextBox ID="box\_1" Columns="4" runat="server" MaxLength="4" />

    <asp:TextBox ID="box\_2" Columns="4" runat="server" MaxLength="4" />

    <asp:TextBox ID="box\_3" Columns="4" runat="server" MaxLength="4" />

    Now, I want to store the data from these textboxes into an array through a loop, something like this:

    "<script>

    Dim boxArray(3) As String

    For i As Integer = 0 to 2

    Dim box As String = "box\\\_" + cstr(i)

    boxArray(i) = box.Text

    Next

    </script>"

    Ideally this would neatly put the values of the textboxes into the array so I could easily reference it later on. However, I get the following error upon compilation:

    Compiler Error Message: BC30456: 'Text' is not a member of 'String'.

    I imagine this is because I've created the "box" String, because it works if I just hard-code it to say something like:

    boxArray(i) = box_1.Text

    Is there a good way for me to loop through the textboxes and add their contents to an array?

    Thanks in advance for any help!

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

    Adding JavaScript button to PDF file

    Posted: 12 Nov 2018 02:16 PM PST

    I have created some very basic html/js code (see below), which I want to be produced within a PDF file. I know PDF supports javascript, and I have seen some html to pdf converters online, however they don't seem to retain the functionality of the button, as in I can even press the button.

    Any thoughts?

    <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>PDF TEST</title> </head> <body> <p>This is a test!</p> <button onclick="dostuff();">BIG BUTTON</button> <p id="result"><p> <script> function dostuff() { const xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "https://jsonplaceholder.typicode.com/todos/1"); xmlhttp.onreadystatechange = function () { if (this.readyState === 4 && this.status === 200) { document.getElementById("result").innerHTML = this.response; } }; xmlhttp.send(); } </script> </body> </html> 

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

    Info from a mem address

    Posted: 12 Nov 2018 05:18 PM PST

    Given a user space virtual address, how can I tell if it's been allocated? And if so how can I fins the beginning and end of the area containing it?

    Thanks.

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

    How can someone get server access for a game.

    Posted: 12 Nov 2018 04:48 PM PST

    I'm helping find various bugs for a game but there is this one player that has been able to indirectly edit the database of the game. Its a flash mmo based on player.io backend. The change logs show that the server is what is making the call to unban his account. There is no mention in the server code to even unban players. Its my first time helping with an MMO and we can't figure out how he is doing it. Any help or insight would be appreciated.

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

    Announcing Camelot, a Python Library to Extract Tabular Data from PDFs (Open Source)

    Posted: 12 Nov 2018 10:01 PM PST

    C nobe needs help with int(?) to sting convertion

    Posted: 12 Nov 2018 12:05 PM PST

    Hi guys! I've been fighting this problem for a few days now and i cant figure it out. C to me is a new breed of hell,

    Some backstory:
    I'm trying to build a automatic chicken-coop door for my chickens to protect them from foxes and the Swedish winter cold. The problem is that i work odd hours so to open/close the door will manually during the "day light hours" will be impossible. So my idea is to do this thru a nodemcu, relay, MQTT and Homeassistant, Today controls the lights and the heating in the coop with regular 433mhz switches.

    To do this have have a windshield wiper motor mounted with a pully, and the idea is to have a NodeMCU and two relays to control the up/down of the door.

    The problem is that I cant figure out how to translate the MQTT message to a sting and therefor I cant make a if statement in the code to ether open or close the door.

    So if someone can help me with how i should write the translation I and the chickens will forever be in your grace!

    Here's the code

    https://pastebin.com/2HTXKQDH

    Bonus Fox

    https://drive.google.com/open?id=1BMH5C1I_IfIIqBVTr-3DVLrgxkqa4ZcF

    TL:DR
    Need help to fix code to so i can open/close chicken coop door thru homeassistant and MQTT. Problem translating mqtt payload to command stings up/down

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

    How can I meet a programmer to discuss my idea / hire a programmer?

    Posted: 12 Nov 2018 08:09 PM PST

    I have a one-off project; call it a business idea. I have an idea for an Outlook Add-in. It should be a simple project. I would want to sign an NDA first to protect my idea. Is the best place really freelancer or up work? -- Sorry if this doesn't belong here. Thanks guys

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

    Simple question regarding 2D arrays

    Posted: 12 Nov 2018 11:22 AM PST

    Hello I am having difficulty with a problem in Java.

    I need to: A.) Initialize a 2D array and then output the sum total of all integers in the array B.) Print the array values by row with a subtotal at the end of each row. Output needs to be like this:

    Values in array by row are: 1 2 3 = 6 6 5 = 11 8 = 8 Array total = 25

    I know how to traverse the 2D array and output it but I am confused as to how to output each row with a subtotal. My code looks like this right now:

    for ( int row= 0; row < array.length; row++) { for ( int col = 0; col < array[row].length; col++) { System.out.printf("%s ", array[row][col]); } }

    Output is : 1 2 3 6 5 8

    Any help is greatly appreciated because I am having a really hard time with this.

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

    [x-post] C# emulating the default drag-drop functionality in windows (transparent image during drag)

    Posted: 12 Nov 2018 06:24 PM PST

    Salary problem

    Posted: 12 Nov 2018 05:21 AM PST

    Hello guys. I am 22 years old and I'm working as a programmer on security department and sometimes I search vulnerabilities on embedded systems. My salary at the beginning was aprox. 650 euro and this month (after 5 months) I've got a raise of 100 Euros because I've finished my college. I feel like I'm one of the best interns from the company and I don't know if I should ask for a bigger raise now or if I should wait.

    P.S. This is my second job. I've worked 1 year and 5 months in my college at a company where I've been automated multiple networking tasks.

    Thanks in advance.

    Edit: I'm from Bucharest, Romania.

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

    How to link Java and C++ in an app?

    Posted: 12 Nov 2018 01:21 PM PST

    Is there a way to make an app that has a Java UI and do the logic in C++? How wouls the java program call the C++ portion? Thanks!

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

    Offline Java development on ChromeOS

    Posted: 12 Nov 2018 01:17 PM PST

    I have a wonderful, fully locked down Chromebook.

    As a developer, I normally use several softwares that aren't available on Chromebooks. I have alternatives for Photoshop, premiere pro, and most of my other softwares but a Java compiler is not one of them.

    TL;DR: I use code pad IDE to code offline but am looking for an app or something to run the code offline.

    So if anyone has any recommendations, I'd highly appreciate hearing them.

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

    GoF Builder Pattern versus Depenendency Injection

    Posted: 12 Nov 2018 01:04 PM PST

    Hello together, I'm quite new, like some seconds ago, in this subreddit.

    Fast forward, I'm overly confused by the confusion of internetpeople about the Builder Pattern, so I'm not sure on my conclusion, that the Builder Pattern in its original variant should be obsolete. (Gang of Four variant, with Director assembling the Complex Object, and not the one, where you just chain method calls together)

    The builder pattern, said by wikipedia, has the following advantages solving following problems:

    • Encapsulate creating and assembling the parts of a complex object in a separate Builderobject.
    • A class delegates object creation to a Builderobject instead of creating the objects directly.

    And if I inject this created, complex object into the class? Well. Sounds like I'm getting the same improvements solving the same problems, which the Builder Pattern aims for.

    For any input I'd be glad.

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

    [Python - Requests Library] Update: Select and submit aspx form

    Posted: 12 Nov 2018 12:16 PM PST

    Hello,

    I posted a few weeks ago about about scraping data from this webpage. I wanted to leave the dropdowns on default, click search, and start iterating through each page.

    With your help, the scraping code works, but it is a big job. There are ~600 pages, and the scraper breaks down after 300 pages (8 hours) because of a "connection reset by peer" error.

    Rather than starting fresh after each crash, I want the scraper to start at page 300 and hopefully it will reach the last page without error and I can append the two outputted data files. My code (below) works when I go through the pagination consecutively (starting at page 1), but it doesnt work if open page 1 and try to post to page 300. I get an error about the page_no variable "AttributeError: 'NoneType' object has no attribute 'find' " which implies it never reached page 300. Any ideas what the issue is and how to solve it?

    Open Search Page

    url = 'http://forestsclearance.nic.in/' r = requests.get(url + 'Online_Status.aspx') VIEWSTATE, GENERATOR, VALIDATION = getFormData(r.content) cookies = { 'ASP.NET_SessionId': 'kaqs1jzegnfn4zxpwio4jthl', 'countrytabs': '0', 'countrytabs1': '0', 'acopendivids': 'Omfc,Email,Campa,support,livestat,commitee,Links', 'acgroupswithpersist': 'nada', } headers = { 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8', } 

    Click Search box

    r = requests.post( url + 'Online_Status.aspx', headers=headers, cookies=cookies, data = { 'ctl00$ScriptManager1': 'ctl00$ContentPlaceHolder1$UpdatePanel1|ctl00$ContentPlaceHolder1$Button1', '__EVENTARGUMENT': '', '__EVENTTARGET': '', '__VIEWSTATE': VIEWSTATE, '__VIEWSTATEGENERATOR': GENERATOR, '__VIEWSTATEENCRYPTED': '', '__EVENTVALIDATION': VALIDATION, 'ctl00$ContentPlaceHolder1$ddlyear': '-All Years-', 'ctl00$ContentPlaceHolder1$ddl1': 'Select', 'ctl00$ContentPlaceHolder1$ddl3': 'Select', 'ctl00$ContentPlaceHolder1$ddlcategory': '-Select All-', 'ctl00$ContentPlaceHolder1$DropDownList1': '-Select All-', 'ctl00$ContentPlaceHolder1$txtsearch': '', 'ctl00$ContentPlaceHolder1$HiddenField1': '', 'ctl00$ContentPlaceHolder1$HiddenField2': '', '__ASYNCPOST': 'false', 'ctl00$ContentPlaceHolder1$Button1': 'SEARCH', } ) VIEWSTATE, GENERATOR, VALIDATION = getFormData(r.content) 

    Post to Page 300

    lastPage = 563 for page in range(300, lastPage + 1): r = requests.post( url + 'Online_Status.aspx', cookies=cookies, data = { 'ctl00$ScriptManager1': 'ctl00$ContentPlaceHolder1$UpdatePanel1|ctl00$ContentPlaceHolder1$Button1', 'ctl00$ContentPlaceHolder1$RadioButtonList1': 'New', '__EVENTARGUMENT': 'Page${}'.format(page), '__EVENTTARGET': 'ctl00$ContentPlaceHolder1$grdevents', '__VIEWSTATE': VIEWSTATE, '__VIEWSTATEGENERATOR': GENERATOR, '__VIEWSTATEENCRYPTED': '', '__EVENTVALIDATION': VALIDATION, 'ctl00$ContentPlaceHolder1$ddlyear': '-All Years-', 'ctl00$ContentPlaceHolder1$ddl1': 'Select', 'ctl00$ContentPlaceHolder1$ddl3': 'Select', 'ctl00$ContentPlaceHolder1$ddlcategory': '-Select All-', 'ctl00$ContentPlaceHolder1$DropDownList1': '-Select All-', 'ctl00$ContentPlaceHolder1$txtsearch': '', 'ctl00$ContentPlaceHolder1$HiddenField1': '', 'ctl00$ContentPlaceHolder1$HiddenField2': '', '__ASYNCPOST': 'false', } ) #scrape data soup = BeautifulSoup(r.content, 'lxml') table = soup.find('table', {'id' : 'ctl00_ContentPlaceHolder1_grdevents'}) page_no = int(table.find('tr', {'class': 'pagi'}).span.text) rows = table.findAll('tr') for row in rows[1:len(rows)-2]: My scraping code goes here... #Get form data for next page post request VIEWSTATE, GENERATOR, VALIDATION = getFormData(r.content) 
    submitted by /u/elhalconloco
    [link] [comments]

    In which institute can I learn those programming languages which are required for a computer basis job?

    Posted: 12 Nov 2018 05:45 PM PST

    Neat AI for a board game?

    Posted: 12 Nov 2018 10:29 AM PST

    I want to make a neat ai to play acquire ( https://boardgamegeek.com/boardgame/5/acquire )

    I have not touched programming in well over a decade. Can anyone help me approach this?

    I know I will need to build the game itself. But after that I don't know what I will need to do. I am not confident what language I should build the game.

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

    Generally speaking, how do you rank the quality of the following programming books publisher? O'Reilly, Manning, Packt, Apress, no starch press, Wrox.

    Posted: 11 Nov 2018 10:46 PM PST

    [LICENSE] On what license is the free to use gitHub?

    Posted: 12 Nov 2018 05:21 AM PST

    I might be wrong. Probably am. I'm researching open source licenses, and I am planning in future to create some software that would work in a way that githb does it now - personal use up to 5 or so people is ok, but more than that, pay me (in short,ha!). So does GitHub use an open source license for the free part? Or one big one? Or one of their own? Any tips on what sort of license one would have to use? It is a simplified question, but any input is appreciated, thanks <3

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

    Arduino/pi controlled TV switch

    Posted: 12 Nov 2018 08:31 AM PST

    Hi, I recently got into using arduinos and raspberry pi for some lighting projects. One project I've been working on includes using motion sensor to turn on a TV display.

    I have the TV buttons ribbon snipped and am using a breadboard to trace buttons. TV buttons > ribbon > breadboard > TV

    Questions: - how would I best capture which button does what? My thoughts were to jump off the breadboard into an Arduino and read signal - I'm having some trouble enterpreting the button presses though. - How would I programmatically emulate a button press?

    It's be great to have full control of the TV programmatically, but I really only need the power on and off on demand. I do not want to use an IR blaster as I wanted to use the emulation method if possible (learning experience and other future uses). Thanks!

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

    How to run my OpenGL program from Windows Terminal ?

    Posted: 12 Nov 2018 08:12 AM PST

    For the past 4 months I've been working with OpenGL (GLFW) in Mac and always run my program from the terminal, but after several issues with Mojave update, I need to revert back to Windows for a while. I never use OpenGL in Windows before, I've been looking online but haven't found how I can run it from the terminal the same way I run on Mac. The only solution I can find is by using Visual Studio.

    I don't use Visual Studio because it takes a lot of sources and runs quite slow. Any advice to run it from terminal ? Some site recommendation of video tutorial maybe ? Thanks

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

    Help needed! (Computer Programmer)

    Posted: 12 Nov 2018 07:54 AM PST

    Hello!

    I am currently doing a project for my course at the college I attending and I need to find a computer programmer who has 5+ years of experience working at the Dallas/Fort Worth area. So anyone on here can help me, please take a look at the interview questions give me a message. Thank you!!

    Interview Questions

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

    Executing PHP through a Siteground hosted website

    Posted: 12 Nov 2018 07:44 AM PST

    Complete newbie here, way over my head -

    I have a ZIP folder with PHP code that I was able to execute through XAMPP but I and my partner needed it to be automatically executed every 15-30 minutes so we thought online hosting would be the best idea.

    I bought a .com address and I'm hosting it on Siteground. I tried a lot through the control panel, cPanel, but I always seem to be missing something.

    I have a completely blank website with only the PHP files in the public HTML folder that I was able to access through the File Manager but it's not working.

    Does anyone know how this would be done?

    If this is hard to read due to my ignorance when it comes to coding I am very sorry...

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

    Is buying a laptop a false first step?

    Posted: 12 Nov 2018 05:35 AM PST

    Since finishing college and starting work I haven't really kept up with programming, I'm considering buying a laptop that I could use to and from work and on breaks, and since I won't be able to connect to the internet I wouldn't get distracted.

    However I'm wondering if this will actually help me or I'll just think it will and once I buy a laptop it will just be left sitting at home, how has this experience worked out for others?

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

    Which is better O'Reilly online subscription service or purchasing individual books as needed?

    Posted: 12 Nov 2018 05:34 AM PST

    I figure id only go through about a book a month anyway so cost would be roughly the same biggest negatives I could think were once I stop paying for the subscription I lose the access to what I've already read through but on the other hand books become outdated and while some cost less than the sub fee some also cost more so...? Anyone use the O'Reilly sub service? Any thoughts or assistance would be most appreciated

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

    No comments:

    Post a Comment