• Breaking News

    Monday, October 15, 2018

    Does Agda, Idris or Coq currently include operations on files and/or a Foreign Function Interface? Ask Programming

    Does Agda, Idris or Coq currently include operations on files and/or a Foreign Function Interface? Ask Programming


    Does Agda, Idris or Coq currently include operations on files and/or a Foreign Function Interface?

    Posted: 15 Oct 2018 05:43 PM PDT

    I know these languages are primarily intended to be used as "proof assistants", but I'd like to know whether they can be used for these things as well.

    In particular I'm interested in the following three operations on files: 1) create a file, 2) delete a file and 3) check if a file exists. By a foreign function interface I mean some way to call a C function from an API like OpenGL, POSIX or WinAPI.

    I've already taken a quick look at:

    http://wiki.portal.chalmers.se/agda/pmwiki.php

    https://www.idris-lang.org/

    https://coq.inria.fr/

    and it seems that the answer is no, but perhaps someone with more experience with those languages can point me in the right direction.
    Please include a link where I can learn how to use the corresponding feature (e.g. to the entry in the standard library documentation for the function to delete a file) if you claim it exists. (I'm aware the Idris homepage mentions "foreign function interface", but I'd like to know where the documentation for this interface is located.)

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

    Does anyone make monitor stands that lower down to table-level?

    Posted: 15 Oct 2018 09:24 PM PDT

    Unity imported map(obj) doesn't include collider

    Posted: 15 Oct 2018 05:18 PM PDT

    I have imported a portal map into uninty3d but when I add a first person controller I fall through the map how do I add a collider to the map as a whole?

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

    Is Javascript good for learning OOP?

    Posted: 15 Oct 2018 08:40 PM PDT

    I want to start learning OOP concepts and I'm in web development. So I thought It's good to start with something that I know. That is Js. Is it good?

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

    are there disadvantages in using wrappers or bindings ?

    Posted: 15 Oct 2018 10:26 AM PDT

    hi,

    i'm learning opengl and sdl2 but i don't like c or c++ so of course i'm interested in bindings in other languages, but i wonder if it cause performance problems or nasty bugs or other things i don't imagine.

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

    Interact with websites without opening UI

    Posted: 15 Oct 2018 06:43 PM PDT

    Hello Redditors

    If i want to interact with websites programmatically ( which involves clicking on buttons/filling forms along with web scraping) then is there a way to do it WITHOUT opening the UI for the website.I have had some experience with selenium (python 3) but , please correct me if I am wrong, it opens the entire UI for it and I want to make my program run faster without having wait for the page to parse and download needless content.

    I realize that it may sound quite stupid as it may not be possible to interact with a website without having the UI open , but I was just wondering if it is possible

    P.S. if that is not possible then would the best way to make the page load faster be if I the UI opens without the CSS (is it possible to do this?)

    EDIT : Just found out about phantom JS (deprecated) and headless chrome .
    Thanks for helping <3

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

    Batch File to Place Like Filenames in New Folders

    Posted: 15 Oct 2018 03:51 PM PDT

    So I'm working with:

    @echo off setlocal set "basename=." for /F "tokens=1 delims=." %%a in ('dir /B /A-D ^| sort /R') do ( set "filename=%%a" setlocal EnableDelayedExpansion for /F "delims=" %%c in ("!basename!") do if "!filename:%%c=!" equ "!filename!" ( set "basename=!filename!" md "!basename!" ) move "!filename!.%%b" "!basename!" for /F "delims=" %%c in ("!basename!") do ( endlocal set "basename=%%c ) ) 

    The problem is, my file names are pretty unique. They are addresses.

    For example:

    1 Main St.pdf 2 Main St.pdf 3 Main St #3.pdf 4 N Main St.pdf 5 S Big Long Name Ave #3.pdf 

    What I'd like to do is have the code pull out the tokens that contain NO integers. I can set it to only use say, 2,3,4 token, but it burps in short address like 1 Main St.pdf but it then hits the delimiter "." so I end up with a file named "Main". When I set it to use tokens=2-4, it doesn't create any new folders.

    I'm trying to work my through this document on Loop Commands: https://ss64.com/nt/for_f.html without much luck.

    Any help is much appreciated!

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

    Is this possible?

    Posted: 15 Oct 2018 06:58 PM PDT

    I am trying to create an executable - most likely with Win32 — that sets Bing as the default browser. Is this possible to do?

    OS being Windows 10

    Thanks in advance

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

    [Python-Requests Library] Select and submit a form with requests

    Posted: 15 Oct 2018 10:38 AM PDT

    I am trying to scrape data from this website. To access the tables, I need to click the "Search" button. I was able to successfully do this using mechanize:

    br = mechanize.Browser() br.open(url + 'Wildnew_Online_Status_New.aspx') br.select_form(name='aspnetForm') page = br.submit(id='ctl00_ContentPlaceHolder1_Button1') 

    "page" gives me the resulting webpage with the table, as needed. However, I'd like to iterate through the links to subsequent pages at the bottom, and this triggers javascript. I've heard mechanize does not support this, so I need a new strategy.

    I can get to subsequent pages using a post request from the requests library. However, I am not able to click "search" on the main page to get to the initial table. In other words, I want to replicate the above code using requests. I tried

    s = requests.Session() form_data = {'name': 'aspnetForm', 'id': 'ctl00_ContentPlaceHolder1_Button1'} r = s.post('http://forestsclearance.nic.in/Wildnew_Online_Status_New.aspx', data=form_data) 

    Not sure why, but this returns the main page again (without clicking Search). Any help appreciated.

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

    liquid help

    Posted: 15 Oct 2018 02:22 PM PDT

    hey all, i have a question about liquid that i imagine someone here will be able to answer. im messing around with my shopify theme and wanted to change the estimated ship date on a per product basis instead of sitewide estimate of like 10-20 days after the current date. i found in my product templete.liquid that it assigns the "estimateStartDate" to equal "settings.delivery_start". "estimateStartDate" is hten references later where it is used in the product description to show estiamted ship date. there is also an assigned estimateenddate.

    so my question is: where can i find the code to adjust the dates within this "settings.delivery_start" that the "esitmatestartdate" is set to? ive already made an alternate templete that i will use for the products i want to have these different shipping times. hopefully all this makes sense, im an absoulte ameature in liquid and programming in gneneral. thanks a ton in advance.

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

    Weather/sunlight Twitter Bot Help?

    Posted: 15 Oct 2018 09:42 AM PDT

    Hey guys :)
    I'm pretty new to coding and programming. For my software engineering class we had to come up with an idea for an app or bot or w.e. that integrates something like weather forecast into social media.

    Pretty stupid but, I came up with the idea for a twitter bot that uses a weather & sunlight API to post certain advice related to dogs on twitter 4 times a day.

    For example if it's raining and there's almost no sunlight remaining it'll be like "it's raining and almost dark outside, better bring an umbrella and a light with you on your walk!"

    For the teacher like the planning, process and architecture of everything is more important than the code actually working 100%. I've seen some C# and javascript so far (and html/css but I dont think that's relevant rn). The teacher said it doesn't matter which coding language you use.

    Anyone got any tips for me on where to start or any tutorials that'll help me make this?
    I've been trying to watch some tutorials on twitter bots but idk...

    A whileback I thought I had found a great tutorial but I can't find it anymore now that I want to try it.. :D

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

    Python project advice.

    Posted: 15 Oct 2018 12:25 PM PDT

    I am a intermediate C programmer. I am currently learning python and know the basics. I want to make something small but useful in python, you guys have any suggestions or ideas about what should i choose. I would like to make small projects in python from any domain which seems interesting. Any suggestions will be helpful 🙂

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

    What language should I learn?

    Posted: 15 Oct 2018 02:29 PM PDT

    I want to know which of these languages are the best, and from where to learn them. I stareted with Web development, but now I want to learn more programming languages. What should I learn: Android programming or python

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

    Script that reads and posts Facebook comments? Where to begin

    Posted: 15 Oct 2018 06:36 AM PDT

    Hi, I want to write a script that reads comments under a Facebook post and if a specific comment is missing, reposts it. Where should I begin, and what approach would be (most likely) easier?

    (If you are concerned about ethical aspect of my question: there is a page posting bold/false accusations and deleting every comment that tries to explain the opposite point of view)

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

    How to I provide a restriction so that my original array cannot be modified by the function?

    Posted: 15 Oct 2018 09:29 AM PDT

    My code is working, and I thought that without a pointer the array could not be modified. How to I provide a restriction so that my original array cannot be modified by the function?

    #include <stdio.h> void addArray(int a[2][3], int b[2][3], int c[2][3], int m, int n); void printArray(int a[2][3], int m, int n); void main(){ int m=2; //No. of rows int n=3; //No. of columns int arr1[2][3] = {{3, 1, 2}, {7, 8, 9} }; int arr2[2][3] = {{6, 5, 1}, {3, 4, 5} }; int arr3[2][3] = {{0, 0, 0}, {0, 0, 0} }; puts("Initial Values:"); printArray(arr1, m, n); puts(" "); printArray(arr2, m, n); addArray(arr1, arr2, arr3, m, n); puts("\nResult:"); printArray(arr3, m, n); }// end main function void addArray(int a[2][3], int b[2][3], int c[2][3], int m, int n){ int i=0; int j=0; for ( i = 0; i < m; i++) { for ( j = 0 ; j < n; j++) { c[i][j] = a[i][j] + b[i][j]; } } } // end addArray void printArray(int a[2][3], int m, int n){ int i=0; int j=0; for(i=0;i<2;i++){ for(j=0;j<3;j++){ printf("%2d ", a[i][j]); } printf("\n"); } }// end printArray 

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

    Any ideas?

    Posted: 15 Oct 2018 08:55 AM PDT

    I'm hoping to establish a private database that can be updated easily and quickly (I need to update info daily). The intention is to have a list of resources available to certain people with access to the database, who can then easily export a clean list of applicable resources and send that exported info in an email. The biggest hurdle is that this needs to be accessible to non-programmers.

    I'm willing to spend some money on this, but it needs to check all of the boxes.

    Any thoughts or ideas on potential solutions would be hugely appreciated.

    Thank you!

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

    "Viewport" in selenium with python - why does it matter?

    Posted: 15 Oct 2018 07:18 AM PDT

    I ran into an issue while automating a webscraper. I am using selenium with python and firefox.

    I am trying to click a link that is outside the viewport of the browser and get this error message:

    MoveTargetOutOfBoundsException 

    (Why) does an element need to be visible in the browser for selenium to interact with it?

    Is the only way to work around this problem to scroll so that the element is physically visible in the browser window? That seems really old fashioned/clunky.

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

    How can i pass a multidimentional js Object from one page to other without using server side?

    Posted: 15 Oct 2018 06:59 AM PDT

    Im trying to use HTML local storage but its not working because it only allows key/value.

    submitted by /u/Don-g9
    [link] [comments]

    Honeypot Event Modeller

    Posted: 15 Oct 2018 06:14 AM PDT

    We have been assigned a honeypot event modeller project to simulate traffic on a road system. We've been given stats such as number mean of different types of vehicles in a day, number standard deviation, mean and standard deviation of the vehicle speeds, speed limit, length of road and such. I am a bit overwhelmed by this as we haven't been given any clues and I don't know where to begin. Could I get any clues on where I should start?

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

    PHP json_encode to HTML content with jQuery?

    Posted: 15 Oct 2018 04:09 AM PDT

    How can I go from this:

    {"ID":"1","name":"Test","email":"Test@gmail.com","password":"reddit","status":"1"} {"ID":"2","name":"Test2","email":"Test2@gmail.com","password":"reddit2","status":"0"} 

    to something I can display in a list or table in HTML? Security doesn't matter, it's just a project for college.

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

    Which language should I try to master after Java? C, C++, or Rust, or maybe something else?

    Posted: 14 Oct 2018 11:32 PM PDT

    I'll try to keep this simple, I know people are busy and all :-)

    My favorite programming language is C# and Java, and being my favorite language (and the language used by my favorite GUI framework JavaFX), I have tried to master Java. I have come to the point where I can use C# well, and Java very well, I want to expand my knowledge towards other languages.

    I am familiar with a lot of languages, from very niche ones (6502 assembly, Factor/FORTH) to trending ones like Rust--but my problem is exactly that--I'm a master of none (except Java, maybe).

    To maximize efficiency and make sure that the effort I spend in mastering a language does not get wasted in the near future, what language do you recommend that I master next after Java? I'm thinking more towards C++, because it's perfectly capable and is still extremely widely used, but then, from a future-proof point of view, it seems that Rust is more expressive and safe--but the opportunities are almost next to none. If I consider opportunities, it seems that Java is first and Python second, so maybe mastering Python is the way to go, but then Python is not that efficient execution-wise, or maybe that doesn't matter?

    TLDR: After Java, what language should I try to master next that will serve me the best in the future, with plenty of job opportunities? Doesn't matter what that may be, I'm very open to suggestions!

    Thanks in advance!

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

    Unit tests with a network scan

    Posted: 15 Oct 2018 03:02 AM PDT

    Hi everyone,

    So i'm doing a C# project where i need to scan the network , and do stuff with the result. My question is.. How do i write unit tests for a network scan? The outcome is different dependent on which network you're in, and even in the same network the outcome differs slightly per scan.

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

    No comments:

    Post a Comment