• Breaking News

    Sunday, May 24, 2020

    Convert Open Source project from one language to another Ask Programming

    Convert Open Source project from one language to another Ask Programming


    Convert Open Source project from one language to another

    Posted: 24 May 2020 04:57 PM PDT

    Hello there,

    I was asked this question earlier today by a friend and I had no idea how/what to answer, and was wondering if anyone here could help me?

    So the question is; if, for example, someone were to make a C#-based (ASP.NET) version of WordPress and rename it to [fictional name]; can the developer(s) claim their version (of WordPress) is not open source and sell it as their own CMS? (they don't necessarily have to sell it, I just put it there)

    What I mean is that if you were to "convert" any open source project (if possible) from its original programming language to a new programming language, is the newly "converted" project still the "same old project" and goes under the same open source license or is it a completely new project?

    - I am aware there will be some minor changes in functionality and other things and so on since not all programming languages offer the same "stuff."

    Thanks in advance! =)

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

    What's the difference between python and python shell?

    Posted: 24 May 2020 09:19 PM PDT

    I recently learnt that shell is a programming language (here) and terminal is a graphical emulator. We use the shebang #!to tell the shell what to use to run the script. For example, if we want to run a py script

    #!/usr/bin/env python 

    If shell itself is another programming language, why do we have to "tell" the shell what interpreter to use if we are using some other language like python? Do all the languages parse everything to shell and then run the script? What's the difference between python and python shell? Does every language have a shell?

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

    Got my first big freelance gig but...now I’m freaking out

    Posted: 24 May 2020 05:25 PM PDT

    I just got my first major freelance job..but..

    Hey guys!

    So for the last few months I've been freelancing but most of my projects have been quite small, insignificant creations. I do a lot of my own projects in my spare time so I've quite a heavy portfolio.

    Today I was offered to create a fully functional site for a local animal shelter, requiring a payment functionality where users can donate money and everything. (Which I intend on using stripe for!)

    Now..I'm beginning to panic...

    Is there anything I really need to know? The projects I've been working on up to now are all hosted on Github, should I use this or any other hosting sites? What about deployment? Through college, we learned to deploy sites on heroku, should I use this and make a CNAME for their domain?

    Any tips?

    Thank!

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

    I am new to Servlet programming.Can someone explain me step by step how a servlet executes,what happens behind the scenes in a detailed manner.

    Posted: 24 May 2020 08:57 PM PDT

    Does anyone know a free or cheap API for historical stock data?

    Posted: 24 May 2020 06:34 PM PDT

    I was debating about asking over at r/stocks but wasn't sure if this subreddit would be more applicable. Anyway I'm working on some analysis software but a lot of the stock APIs I'm seeing only go back to 2010. I'm looking for a source that would at least give me 2007 or 2008 to present.

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

    Python export as .xlsx instead of .csv?

    Posted: 24 May 2020 05:47 PM PDT

    This program exports its results as a .CSV. Id like it to export as .xlsx.

    ASINS are 10 digit's long, often with leading zeros. Id like the output to retain this format.

    Example ASIN: 0082631779

    It should not be: 8.28E+09 or 82631779.

    code: https://pastebin.com/2tfAHT8q

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

    Web crawling

    Posted: 24 May 2020 02:21 PM PDT

    I require data - namely care providers in the UK and the best way I could think of obtaining this is through web crawling. Would this be possible? And if so, where do i start? I am primarily a .NET C# dev.

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

    Is it normal for programmers to forget the syntax of a language after not using it for a while ?

    Posted: 23 May 2020 11:11 PM PDT

    Which date format do you use? Also state your country.

    Posted: 24 May 2020 03:47 PM PDT

    I'm a CS student and I'm overwhelmed by all the possible career paths. How do I choose? (x-post /r/cscareerquestions)

    Posted: 24 May 2020 06:18 PM PDT

    Is it possible to combine AR phone tracking with cardboard VR view?

    Posted: 24 May 2020 06:56 PM PDT

    With most IOS Vr games I see on the App Store you are always stationary, only able to look around but never move freely. In augmented reality games you can move the phone around and it gives you freedom of movement just without the VR view. Wouldn't it be possible to have the phone camera tracking while a game displays for a Vr cardboard setup? Is there already something like this and I'm just stupid?

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

    Create dynamic pages on android

    Posted: 24 May 2020 09:39 PM PDT

    Hi everyone!

    I have problem that involves creating and saving dynamic pages on an android app.

    The problem: There is a DB that contains orders, order numbers and the rest of the data required. On the app this data feeds into a recycler view and each cell loads a page that has the info for that order. The issue I'm facing is how to make those pages dynamic. Each order contains a different number of boxes and each box can contain a different number of parts. How could I go about making that page dynamic and generate EditTexts for each part (the edit text is used to input serial numbers). That EditText data must be saved and when the user goes off the page and reloads any data entered previously still must be saved there.

    Things I've tried: So far I've made functions to create the EditTexts programatically and then pass it an integer for the of them to create on page load. I'm encountering issues obtaining their Id's and tags though. I was considering saving all the page data, the number of cards (boxes) and the EditTexts (parts) as JSON data and saving that to a DB, then using that repopulate the page when a cell is clicked and the page loads. I believe I could also save the inputted EditText values in that JSON so when it loads the page layout the data will be there with it. I'm not sure if this is the best approach though. Any feedback or suggestions on how to get started on this would be appreciated! I've tried researching this problem but there is alot of mixed responses and this might not even be the most efficient way honestly.

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

    I have a problem with the installation of some packages in R.

    Posted: 24 May 2020 09:36 PM PDT

    When I am trying for example car, I get this error message:

    Installing package into '/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0' (as 'lib' is unspecified) also installing the dependencies 'curl', 'rio' trying URL 'https://cloud.r-project.org/src/contrib/curl_4.3.tar.gz' Content type 'application/x-gzip' length 673779 bytes (657 KB) ================================================== downloaded 657 KB trying URL 'https://cloud.r-project.org/src/contrib/rio_0.5.16.tar.gz' Content type 'application/x-gzip' length 420489 bytes (410 KB) ================================================== downloaded 410 KB trying URL 'https://cloud.r-project.org/src/contrib/car_3.0-8.tar.gz' Content type 'application/x-gzip' length 499932 bytes (488 KB) ================================================== downloaded 488 KB * installing *source* package 'curl' ... ** package 'curl' successfully unpacked and MD5 sums checked ** using staged installation Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing `libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing `libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Using PKG_CFLAGS= Using PKG_LIBS=-lcurl ------------------------- ANTICONF ERROR --------------------------- Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) * rpm: libcurl-devel (Fedora, CentOS, RHEL) * csw: libcurl_dev (Solaris) If libcurl is already installed, check that 'pkg-config' is in your PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...' -------------------------------------------------------------------- ERROR: configuration failed for package 'curl' * removing '/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0/curl' Warning in install.packages : installation of package 'curl' had non-zero exit status ERROR: dependency 'curl' is not available for package 'rio' * removing '/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0/rio' Warning in install.packages : installation of package 'rio' had non-zero exit status ERROR: dependency 'rio' is not available for package 'car' * removing '/home/madscientist/R/x86_64-pc-linux-gnu-library/4.0/car' Warning in install.packages : installation of package 'car' had non-zero exit status The downloaded source packages are in '/tmp/Rtmp7e1hzP/downloaded_packages' 

    When I tried to install rio and curl libraries separately, and then I installed car again, I had the same problem.

    Any advice?

    ** My OS: Linux mint 19.3

    p.s. car package, is not the only package I have this problem.

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

    Please. Someone could help me? Waveform graphic is crashing, python

    Posted: 24 May 2020 09:02 PM PDT

    Please. Someone could help me? I made a code for waveform graphic in Python but the graphic is low and crashing. This is my code https://github.com/jellyBott/Python/blob/master/Waveform.py

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

    [C# ASP.NET WebForms] Calling a server side method from a dynamically generated button inside an update panel.

    Posted: 24 May 2020 04:50 PM PDT

    Lets preface this with the fact that I am learning ASP.NET C# and this is my first "real" project so there is a good chance I am missing something obvious, I apologize in advance.

    I am working on a web page that displays three columns. The first is "Categories", a user should be able to select a category then have a list of items to choose from appear in the second column "Items". When they click an item the third column should show details about said item. For the most part this is a classic Master/Detail scenario except we take it a step further and do Master/Detail/Detail.

    To achieve this I am generating dynamic buttons on Page_Load() in the "Categories" column. In addition I have added a debug line when the page loads, this is important later.

    protected void Page_Load(object sender, EventArgs e) { //DB query to get categories omitted for (int i = 0; i < categories.Rows.Count; i++) { Button btn = new Button(); btn.Click += new System.EventHandler(CategorySelected_Click); btn.Attributes["runat"] = "server"; btn.ID = "CatSelBtn" + i; btn.Attributes["data-categoryid"] = qry.GetCategories().Rows[i]["id"].ToString(); //And some other non-relevant attributes CategoriesPane.Controls.Add(btn); } System.Diagnostics.Debug.WriteLine("Page Loaded"); } 

    As you may have noticed these buttons have a Click event handler that calls the method CategorySelected_Click(). These buttons all generate successfully and clicking on them results in that method being successfully called. This method is set up in a similar fashion, it grabs a list of items then generates buttons for the items, of course this needs to be done asynchronously so it doesn't reset the user's category selection, so this time it is all contained with an update panel.

    C#

    protected void CategorySelected_Click(object sender, EventArgs e) { //DB query to get items omitted Button btn = (sender as Button); string categoryid = btn.Attributes["data-categoryid"].ToString(); for (int i = 0; i < items.Rows.Count; i++) { if (items.Rows[i]["Category"].ToString() == categoryid) { Button ibtn = new Button(); ibtn.Click += new System.EventHandler(this.ItemSelected_Click); ibtn.Attributes["runat"] = "server"; ibtn.ID = "ItmSelBtn" + i; ibtn.Attributes["data-itemid"] = qry.GetItems().Rows[i]["id"].ToString(); //And again some none relevant attributes here ItemsParent.Controls.Add(ibtn); } } ItemsPanel.Update(); } 

    ASP

     <div class="col-md-2 items-pane"> <asp:UpdatePanel ID="ItemsPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False"> <ContentTemplate> <div id="ItemsParent" runat="server"> </div> </ContentTemplate> </asp:UpdatePanel> </div> <div class="col-md-8 view-pane"> <asp:UpdatePanel ID="ItemDetailsPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False"> <ContentTemplate> <div id="ItemDetailsParent" runat="server"> </div> </ContentTemplate> </asp:UpdatePanel> </div> 

    Again this generates a list of buttons for each item matching the correct category. No issue there, but this time I need the clicked button to call the third and final method which will display the details for the item. This is where things stop working. I assumed that because I was able to generate buttons successfully on Page_Load() that it would work the same inside an update panel. Right now the third method just contains a debug line to check if its firing at all.

    protected void ItemSelected_Click(object sender, EventArgs e) { System.Diagnostics.Debug.WriteLine("Item has been selected"); ItemDetailsPanel.Update(); } 

    In my output console in visual studio when I click on an Item Button control it writes Page Loaded indicating a successful postback but I am not seeing Item has been selected indicating that the third method is firing. I also inserted a breakpoint there but it is not being reached.

    I initially thought I needed to add an asyncpostback trigger for each button generated to my update panel but that did not seem to resolve that issue, and because I can now see that Page_Load() is getting triggered I am pretty sure that isn't the issue. This leads me to believe that the click event is somehow not being registered. So my question to you is this: How do I make a dynamically generated button inside an update panel call a server side method? Any help is greatly appreciated.

    Link to my SO post with the same question: https://stackoverflow.com/questions/61993741/calling-a-server-side-method-from-a-dynamically-generated-button-inside-an-updat

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

    I wrote MergeSort in Javascript and it's keep treating 14 as smaller than 3!!!!!

    Posted: 24 May 2020 08:28 PM PDT

    Hello, I wrote a merge sort in Javascript as part of my project 'Data Sorting Visualization'.

    Anyway, I noticed some cases that sorting is not properly done sometime and it's behaving unpredictable depending on the input array. Good news is an input value always yield the same result after the function is ran.

    Following is my input value: 21,2,14,3,27,41. For few several steps, it successfully lead to 2-14-21 and 3-27-41. First, it extracts 2 after comparing with 3. Then, when comparing 14 and 3, it picks up 14!!!!!!!! whyyyyyyyy. I tried storing them in a temp variable and everything else and i just don't know why.

    Please help me.

    function merge(a, b) { // We will be swapping each elements from arr[l:m], arr[m+1,r]; var left = a; var right = b; var final = []; while(left !== 'undefined' && right !== 'undefined' && left.length !== 0 && right.length !== 0 ){ // ISSUE HERE!!!! 14 is read <= than 3 !!! How!!!!! if( left[0] <= right[0] ){ var temp = left.splice(0, 1); // remove the smaller item ands store it temporarily to add it to final final.push(temp); } else if ( left[0] > right[0]){ var temp = right.splice(0, 1); // remove the smaller item ands store it temporarily to add it to final final.push(temp); } } if ( left.length === 0 || left === 'undefined'){ // push all right to final var i; for (i = 0; i < right.length; i++){ final.push(right[i]); } } else if (right.length === 0 || right == 'undefined'){ var i; for (i = 0; i < left.length; i++){ final.push(left[i]); } } return final; } function mergesorting(arr, l, r) { if (arr.length === 1) { return arr; } var m = 0; if (r > l) { m = Math.floor( (l+r) / 2); // 0 + 4 / 2 = 2 0 + 3 / 2 1.5 var left = arr.slice(l, m + 1); // plus one is necessary for slice var right = arr.slice(m + 1, r + 1); left = mergesorting(left, 0, left.length - 1); right = mergesorting(right, 0, right.length - 1); return merge(left, right); } } class MergeSort extends React.Component { constructor(props){ super(props); this.state = { arr: [21,2,14,3,27,41]}; this.handleClick = this.handleClick.bind(this); } componentDidUpdate(prevProps){ if (this.props.value !== prevProps.value) { this.setState({ arr: this.props.value}) } } handleClick() { this.setState(state => ({ arr: mergesorting(this.state.arr, 0, this.state.arr.length - 1), })); } render (){ return ( <div style={{backgroundColor: "lightblue"}}> <button onClick={this.handleClick} >Start Sorting!</button> <p>MergeSort.js: {this.state.arr}</p> </div> ); } }; 
    submitted by /u/happyhappyamerica
    [link] [comments]

    How to use noise to select random areas?

    Posted: 24 May 2020 08:02 PM PDT

    I'm working on 3D terrain generation for a project of mine, and I'm stumped on how to create "zones" to allow for biome placement.

    I don't want to do a temperature/moisture map approach because I want to use a different approach to choosing how biomes should be placed adjacent to each other.

    To put it simply, I basically want to take a 3D area, and create 3D zones inside it, then use some data to choose what biome should go in each space.

    P.S. As for noise, I've been using OpenSimplex noise, as it has an implementation built into the engine I'm using, but I could use some different noise types if that would work out better.

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

    Switching From Unity Game Development To C++ Game Development

    Posted: 24 May 2020 03:55 PM PDT

    Hi all!

    I have worked with Unity for several years, but have realized that the companies I want to work for primarily use C++ for developing their games. In order to gain the experience required for these cooler game studios I have been learning Unreal Engine and C++, but there's a big issue. 90% of my work in Unreal Engine is done with blueprints and doing many things in Unreal is almost impossible using C++. So how do I get the C++ experience to work for these AAA gaming companies if both Unity and Unreal Engine don't really train me in C++? Should I use some other game engine that uses C++? Or should I just develop general desktop applications in C++?

    submitted by /u/Quiet-Hotel
    [link] [comments]

    Recommendations for an iOS app to edit plain text files

    Posted: 24 May 2020 06:28 PM PDT

    Hi r/AskProgramming,

    I am looking for a basic iOS app that will allow me to edit some txt files that I have. It doesn't need to be able to run or even compile the code, just edit and save it.

    The files I am editing are stored on iCloud Drive.

    Preferably I would like something free, as I will only be using this app to make minor changes to the code, for any real heavy lifting I have an IDE on my computer. I really don't want to be spending $10 on an app, to use it once or twice per month.

    Thanks in advance.

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

    Is there a way to save continuous in-game data?

    Posted: 24 May 2020 03:56 PM PDT

    What i mean is for example you are playing a racing game and you want to keep printing the current speed of your car (not from screen grabs). In a way like trying to grab the udp stream for a particular IP on the network, but for a game.

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

    why cant i download pycharm?

    Posted: 24 May 2020 11:06 AM PDT

    I tried downloading pycharm on my Mac yet it won't let me create a new python file. Can anyone help me plz?

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

    Some tools for organizing benchmark reports?

    Posted: 24 May 2020 10:22 AM PDT

    Hi,

    I have an open-source project. We have some benchmarks.

    For simplicity, let's assume that the output of each benchmark is a 2-D plot (i.e. a vector of [x, y] pairs).

    Then, we have releases. After each release, I want to run all benchmarks, store their results, and generate reports from them.

    Report from each release should be a set of plots, one plot for each benchmark. I want to be able to browse those plots by release and to compare plots from different releases (i.e. show the results of the same benchmark from different releases on one plot).

    Ideally, reports should be static HTML + JavaScript, so that I don't need a server to browse them and can just upload them to github pages.

    Could someone recommend open-source tools that solve this or similar problem? Maybe I'm googling this wrong, but I haven't find any ready-to-use solution. On the other hand, this sounds like a pretty common use case, doesn't it?

    Currently I'm using Google Benchmark (C++ library). I could code this by myself by parsing it's JSON output and generating reports using plotly (python library) or similar tool. However, I'd prefer to use some existing solution, if it exists.

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

    Software advice needed

    Posted: 24 May 2020 10:18 AM PDT

    Hi !

    i am a new (returning) programmer and i'd like abit of help.

    I want the simplest GUI / Javascript builder possible.
    I mainly want to program old games like blackjack ect , so i want to mess around with arrays.

    I've tried VB.net through visual studio but found it a bit overwhelming, especially cause all i want to do is add like 5 labels , 5 textfields and do a bunch of math with those....

    I've also tried Netbeans IDE 1.8.2 but found that allot of the code isn't exactly javascript , wich leaves me with alot of syntax errors, maybe i'm missing something here...

    What i'd like : a suggestion for a simple java coder with GUI , prefferably with alot of online documentation with examples. Can anyone help an old soul out?

    Kind regards

    Dimitri

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

    [C#] Can someone explain this HomeController.cs line by line, please?

    Posted: 24 May 2020 10:18 AM PDT

    When you run dotnet mvc it will scaffold an app in Visual Code and there is HomeController.cs

    namespace temp1.Controllers { public class HomeController : Controller { private readonly ILogger<HomeController> _logger; public HomeController(ILogger<HomeController> logger) { _logger = logger; } public IActionResult Index() { return View(); } public IActionResult Privacy() { return View(); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } } 

    We have a namespace temp1.Controllers. Then we have public class HomeController derived from Controller. And then I get lost. ILogger is a generic with type of HomeController? Why an underscore _logger?

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

    Code for checking credit card type

    Posted: 24 May 2020 09:58 AM PDT

    Here's the link for the code. There are 3 pictures you can find them disordered, sorry for that. Please help me finding mistake in code. Function calling is troubling I think. https://m.imgur.com/a/QJI6AGS

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

    No comments:

    Post a Comment