Programming

53K

Solutions

41K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.

I am starting out in Ruby on rails. and wanted to see how things are done in it. coming from asp.net MVC , it helps to know the model , views and controller.
I know about the gem files which are similar to nuget packages, in .net projects.

I want to create a simple ruby on rails app, which can talk to multiple REST apis,

in asp.net projects, I used to create an interface and an implementation class , call it RestClient with GET, put, post methods. put these
classes in some library project, which my other project can reference , and whatever classes wants to use would inherit this class
and call those methods.

what is convention , in ruby on rails project. does want create a service/interface class or what is the way to use it in Ruby on Rails.
0
I would like to modify the current Powershell script to produce the output data shown in the DesiredOutput.out file.

NB - Changes include - Codes to show side by side, Totals to appear for each column shown, small formatting changes.

Below are the files for your review.

Source.in
Script.ps1
Output.out
DesiredOutput.out

Thanks in advance for your help.
Script.ps1
Output.out
Source.in
DesiredOutput.out
0
Hello,
why do I get a NumberFormatException in this line?
sum+=Double.parseDouble(input.toString());
How can I fix it?

    public class InputCalculator {
       
        public static void inputThenPrintSumAndAverage(){
            Scanner input = new Scanner(System.in);
            if(!input.hasNextInt()){
                System.out.println("SUM = 0 AVG = 0");
            }
            else{
                double sum=0,avg=0;
                int ctr=0;
                while(input.hasNextInt()){
                    sum+=Double.parseDouble(input.toString());
                    ctr++;
                }
                input.close();
                avg= Math.round(sum/ctr);
                System.out.println("SUM = "+ sum  + "AVG = " + avg);
            }
     
     
        }
     
    }
0
Can someone help me with my assignment? I need help with this assignment. I'm not sure that I write the code is wright for this assignment.  I'm using Assembly language. Please, someone, help me. I struggling in this class. I  really want to pass this class. Can someone explain to me this assignment and go over for this assignment?

This is the assignment:

A prime number is an integer that is divisible only by 1 and by itself. Write a program that:

1.      Takes a number as an input.

2.      Prints back to the console all the primes that are larger than 1 but not larger than the number that has been entered.

You need to have a procedure called isPrime. You may have more procedures if you like.

1.      This procedure receives a number through one of the registers.

2.      Checks if this number is prime.

3.      Returns back through one of the registers to the main program 1, if the number is prime, 0 otherwise.

sample run:

Please enter a number: 44

Primes found until the given number:

2 3 5 7 11 13 17 19 23 29 31 37 41 43 Press any key to continue . . .

The code I write is

include Irvine32.inc
.code
    ; Division Operations -
    ;eax <- edx:eax/arg
    ;edx <- edx:eax % arg

    call    read_hex

lb2:    
    dec     eax
    jz      exit
    jmp     prime_check

prime_check:

    ; The check for whether 2 is a prime is done separately here
    mov     ecx, eax
    sub     ecx, 2
    jz      is_prime

    mov     …
0
I need help with my assembly language assignment.  I'm not sure how to write three times a step to repeats. And how can I write code for
          DisplayDiff: calculates and displays the difference. (first input - the second input)

   Please, somebody, help me I feel frustrated. I need to submit this tomorrow but I want to finish it today. Can someone help me as soon as possible??!!

This is my assignment looks like Write a program that:

1.     Clears the screen, locates the cursor near the middle of the screen.

2.      Prompts the user for two signed integers.

3.      Displays their sum and difference.

4.      Repeats the same steps three times. Clears the screen after each loop iteration.

5.     You might need to call the following procedures from irvine32 library:

·        ClrScr

·        WriteString

·        WriteInt

·        ReadInt

·        Crlf

·        ReadChar

·        Gotoxy

The Gotoxy procedure locates the cursor at a given row and column in the console window. By default, the console window’s X-coordinate range is 0 to 79 and the Y-coordinate range is 0 to 24. When you call Gotoxy, pass the Y-coordinate (row) in DH and the X-coordinate (column) in DL. Sample call:

mov   dh,10 ; row 10

mov   dl,20 ; column 20

call  Gotoxy; locate cursor

 

6.     You need to create the following procedures:

        Locate. It needs to be called before anything displays on the screen. Where it sets the cursor position.…
0
Hi I want to buy or subscribe Customer service/Chat software that support on our website.
Just like Experts-Exchange but I hope the software has features to allow me programming something like the following:

1. If the member login, and the member's city is Los Angeles, CA. I want to have Customer Service Rep A on the chat. If member's city is Houston, TX, I want to have Customer Service Rep B on the chat.

Do you know where I can get it? Or does Twillo has a way I can build up using c#/MVC?
0
Is it possible to create an overlay on an iOS device that does not interact with an application? I am a newbie at programming and wanted to know if SwiftUI can accomplish this?
0
Are there any recommended Python, R and SQL source code samples which should read for learning purpose and which can be downloaded from GitHub?
0
Hello,
I want to make a programming project with friends.
We decided to use subversion(SVN) instead of git.
But I don't see a good/current tutorial for subversion.
How can I learn subversion?
0
I have 2 programmers which are very good but spend some time playing on-line games.

They do not complain about the salary which is good and according to standards.

Please advise what to do, or read, so they can focus on their work and increase their productivity

Thanks
0
Hi Experts
I am looking for a program to replace the traditional circulation of paper between departments
This program provides the ability to scan these files, send them to other departments and approve these files or convert them for review.
0
Hi,

I can't figure out where and in what format to put the sorting parameters in this python code.

from .notes import isNew, isNotNew

nidToRand = dict()
def toTup(card, params):
    """A tuple to sort the card. See bothSched.sortCids to get more
    informations."""
    l = []
    for param in params:
        if isinstance(param, tuple):
            param, reverse = param
        else:
            reverse = False
        if param == "new first":
            val = (isNotNew(card.note()))#false occurs first in list
        elif param == "seen first":
            val = (isNew(card.note()))#false occurs first in list
        elif param in {"ord", "card position"}:
            val = (card.ord)
        elif param == "note creation":
            val = (card.nid)
        elif param == "card creation":
            val = (card.id)
        elif param == "mod":
            val = (card.note().mod)
        elif param == "note random":
            if card.nid not in nidToRand:
                nidToRand[card.nid] = random()
            val = nidToRand[card.nid]
        elif param == "card random":
            val = (random())
        if reverse:
            val = -val
        l.append(val)
    return tuple(l)

Open in new window


It is from here: https://github.com/Arthur-Milchior/anki_sort_cards
0
I notice many IT security positions are starting to ask for scripting such as python and powershell and I wanted to know which direction I should go as far as learning and making the most of it.  Which language is easier or can learn faster and makes most sense in the long run.
0
Hello there,

I've just enabled Spring Actuator and the information provided even just by the simple health endpoint is amazing.

I would like to make it secure so that a user is forced to authenticate and I can do it adding to application.properties:
management.endpoint.health.show-details=when_authorized

My application is not using spring-security but it is authenticating against LDAP.

Using LDAP credentials doesn't work when requesting the actuator endpoint, I would like to understand how I can make it so that the actuator endpoint can use LDAP authentication too.

Thanks for your help!
0
I need help on performance issue which we are facing.

Users will click on createXML then xml of size 20 MB will be saved in CLOB. This XML file has data for 10 reports.
When user click on ViewXML button, then we are showing this xml file in tabular format on browser. While showing, we show data for first report and users have provision to change report type in dropdown value. Issue is when report type is changed , application is going to not responding mode as it is searching specfic report type data from 20 MB file and showing on browser.

Existing code: On click of viewxml button, system is retrieving whole 20MB file from db (CLOB) and saving into physical shared location then code is searching for specific report type data from that 20 MB file and displaying specific report type data. It is taking huge amount of time as it is saving whole xml file (20 MB) into physical shared location and searching for specific report type data from that 20 MB file.


After code change: i have changed code to get specific report type data from CLOB. On click of viewxml button, system is retrieving only specific report type data from db(CLOB) and saving into physical shared location only data related to specific report type.  Then displaying specific report type data in a browser.It is faster now as it is retrieving only specific report type data instead of reading whole xml file.

But the issue after code change is for 2 report types data is of 5MB then it is taking around 10 …
0
Hello, I'm trying to jump into the programming side of things and I have a course I need to finish.  I have been going through the course material, challenge exercises, and coding sections and find that reading isn't helping it stick.  Maybe it's the course, but probably me.

Looking for a Python one-on-one type instructor for virtual sessions to go through the programming portion with me.  I have limited time access to the course and would need to complete the material in a couple weeks.

Thank you
0
Hi all,

I am trying to understand how to implement automatic login, based on Windows user, using ADFS technology.

I read everywhere that it supports SAML and Oauth but I should go for SAML because this is what Enterprises are using for SSO.

I do understand this but what I don't understand is why Oauth is "for Internet" and it is authorization oriented and not authentication.

I've googled and read quite a bit but still the concept is not clear for me.

Is there anyone that can help me understanding the difference?
0
Can anyone help with an advise please? I am using a csv file converted to arff in Weka and it converted my numeric values to Nominal, hence not allowing me to perform Times Series analysis. Does anyone know how to specify that my data are actually Numerical please? Thank you in advance.
0
Hello,
what have I done wrong? I am using superposition method.
I want to calculate U2
1.PNG
2.PNG
3.PNG
4.PNG
0
Basically I have 5 textboxes
output1number, output2number, output3number, output4number, output5number

I want to update the variable with the value of another variable..

Example:

function switch(i,o)
  var= "output" .. o ..  "number"
  Controls.var.String = i

Open in new window


But I get an error: attempt to index a nil value

How can I achieve this?
0
Good Afternoon all for some reason i am getting a error mysql.connector.errors.ProgrammingError: Not all parameters were used in the SQL statement, i have checked all the %s and they all show as 7 as well as all the items in the sql, i am sure is not much but if someone could take a look that would be great

    from requests_html import HTMLSession
import mysql.connector

mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="*****",
  database="flightdata"
)

mycursor = mydb.cursor()

# create an HTML Session object
session = HTMLSession()

# Use the object above to connect to needed webpage
resp = session.get("https://www.adelaideairport.com.au/flight-information/flight-search/?flt_no=&carrier=All&city=&dte=Current&leg=Departures")

# Run JavaScript code on webpage
resp.html.render()


airline_spans = resp.html.find('.SearchResultFlightListRow')
print (airline_spans)
airline_list = [span.text.split('\n') for span in airline_spans]

for flight in airline_list:
    if len(flight) == 7:
        flightno, From, to, scheduled, estimated, gate, status = flight
        print ("This is a " + estimated)
        if estimated == "":
            print (" currently no dely ")
            print ("This is a " + estimated)
            estimated = 'IDEL'
        print (f'Flight no {flightno} from  {From} to {to} is scheduled to depart at {scheduled} from gate {gate} and flight status is {status}')

    elif len(flight) == 6:
    …
0
I currently have Magic Mirror installed as well as both the MMM-Facial-Recognition and MMM-Facial-Recognition-Tools modules.  I captured training images and ran the necessary scripts.  However, I am having a problem setting up the config.js file and making my mirror selectively display contents on the screen by who is looking at it.  I am not sure how exactly to go about this because everything I have found online so far has provided no guidance.
0
Hi Experts,
I get when I try to pip install a python library called probfit.  My python is 3.7.

error: Unable to find vcvarsall.bat
0
Hi Experts,

I am programming stuff using Caspio tools, since they only provide revision history to some of their features, I had requested we invest in a custom program that will connect online and perform that in a scheduled bases (as manually its possible to accomplish that from their site).

I had mentioned to our manager that its very useful when debugging stuff to know when exactly did a certain problem started to occur.

and this was manager's response.

...I still don’t get how back-ups will help in troubleshooting. Is it more than just back-ups?

Perhaps you can point to a place where this usage and benefit its being clearly explained in a more professional way.

In addition I would like to have an idea what could cost such a task (writing a script that will logon to our Caspio account and perform the export).

Thanks
0
Have a Asp.net web application with 3 layered projects inside: data access layer, presentation layer and business logic layer. Web app works very well on a web server. I need to publish these layers to seperate servers as separate layers. How can I do that? Is it possible to have every layer in different server instead of publishing the web form app into a one server?
0

Programming

53K

Solutions

41K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.