[Tutor] Matrix Multiplication user entries

2018-03-23 Thread Noor Alghanem
Hello,

I am trying to write a program that is basically multiplying two matrices
one of size 1x8 and the other one of size 8x4. The different thing that I
am trying to figure out is that I want the program to ask the user to enter
the values for the 1x8 matrix only which will be used in the multiplication
process. How do I do that, please provide an example as I wasn't able to
find one online that works. Also, if you can please include an example of
matrix multiplication that is similar in idea to what I am trying to write.

Thank you
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 169, Issue 17

2018-03-23 Thread David Holland via Tutor
Thank you all for the replies.  I did not make myself clear.I don't want to 
access the database directly as that would be unsupported by Oracle.I mean 
Oracle forms which using in Oracle financials, and something that acts like a 
dumb clerk that takes information from a spreadsheet and puts it in the 
form.Similar to something that you use to put information into a website (I 
don't know how to do that either sadly).
 

On Friday, 23 March 2018, 16:00:13 GMT,  wrote:  
 
 Send Tutor mailing list submissions to
    tutor@python.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
    tutor-requ...@python.org

You can reach the person managing the list at
    tutor-ow...@python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."


Today's Topics:

  1. Matrix help (Connie Callaghan)
  2. Re: Oracle forms (Peter Otten)
  3. Re: Oracle forms (Mats Wichmann)
  4. Re: Oracle forms (Alan Gauld)
  5. Re: Matrix help (Peter Otten)
  6. Re: Matrix help (Alan Gauld)
  7. Matrix Multiplication user entries (Noor Alghanem)


--

Message: 1
Date: Thu, 22 Mar 2018 11:35:05 +
From: Connie Callaghan 
To: "tutor@python.org" 
Subject: [Tutor] Matrix help
Message-ID: <5ab394ed.177c1c0a.ac374.f...@mx.google.com>
Content-Type: text/plain; charset="utf-8"

Hi, 
I was just looking help for a matrix that I am building, it needs to look like 
this 
1, 0, 0, ...,0
A,b,c,0,...,0
0,a,b,c,...,0
0,0,a,b,c,..0
0,0,0,a,b,c,...,0
0,0,0,0...0, 1 

It has n rows and columns and the first and last line has to have 1s at the 
corners as shown, and a,b,c going diagonal and 0?s everywhere else, I am really 
struggling and it would be a great help to even be shown how to begin, 

Thanks 
Connie 




---
This email has been checked for viruses by AVG.
http://www.avg.com


--

Message: 2
Date: Thu, 22 Mar 2018 18:35:17 +0100
From: Peter Otten <__pete...@web.de>
To: tutor@python.org
Subject: Re: [Tutor] Oracle forms
Message-ID: 
Content-Type: text/plain; charset="ISO-8859-1"

David Holland via Tutor wrote:

> Is there anyway I can use Python to fill in an Oracle form rather than
> typing it in myself.I.e take values from a .csv file and put them into an
> Oracle form.Any ideas (I have googled it) what libraries to use?

If I understand you correctly you want to enter data into a database, in 
bulk. For that you typically bypass any GUI, and connect to the database 
directly. With Python and Oracle that would look like

http://www.oracle.com/technetwork/articles/dsl/python-091105.html

As it is possible to do a lot of damage (provided you have the necessary 
credentials) I suggest that you discuss this with your IT department before 
you proceed.



--

Message: 3
Date: Thu, 22 Mar 2018 11:41:37 -0600
From: Mats Wichmann 
To: tutor@python.org
Subject: Re: [Tutor] Oracle forms
Message-ID: <9c47487f-5664-2d7a-b99e-9ad0d581c...@wichmann.us>
Content-Type: text/plain; charset=utf-8

On 03/22/2018 11:35 AM, Peter Otten wrote:
> David Holland via Tutor wrote:
> 
>> Is there anyway I can use Python to fill in an Oracle form rather than
>> typing it in myself.I.e take values from a .csv file and put them into an
>> Oracle form.Any ideas (I have googled it) what libraries to use?
> 
> If I understand you correctly you want to enter data into a database, in 
> bulk. For that you typically bypass any GUI, and connect to the database 
> directly. With Python and Oracle that would look like
> 
> http://www.oracle.com/technetwork/articles/dsl/python-091105.html
> 
> As it is possible to do a lot of damage (provided you have the necessary 
> credentials) I suggest that you discuss this with your IT department before 
> you proceed.

>From the Python viewpoint, no clue.

Oracle Forms has its own API. Naturally, that requires a unique
scripting language to use ("but it's easy to learn!"). Maybe if they
were building it today they would use a known scripting language
instead, who knows. And the API package has, I believe, add-on costs.
It's Oracle, after all.



--

Message: 4
Date: Thu, 22 Mar 2018 18:08:53 +
From: Alan Gauld 
To: tutor@python.org
Subject: Re: [Tutor] Oracle forms
Message-ID: 
Content-Type: text/plain; charset=utf-8

On 22/03/18 15:22, David Holland via Tutor wrote:
> Is there anyway I can use Python to fill in an Oracle form

What kind of Oracle form? There are at least 2 that I'm
aware of.

1) The Oracle Forms thick client app framework which runs
  on a PC and connects to the database server. (I believe
this is now obsolescent and no longer supported by Oracle?)

2) Web Forms built using the Oracle web server framework

In either case it is usually better to access the database
directly from Python rather t

Re: [Tutor] Matrix Multiplication user entries

2018-03-23 Thread Mats Wichmann
On 03/23/2018 12:02 AM, Noor Alghanem wrote:
> Hello,
> 
> I am trying to write a program that is basically multiplying two matrices
> one of size 1x8 and the other one of size 8x4. The different thing that I
> am trying to figure out is that I want the program to ask the user to enter
> the values for the 1x8 matrix only which will be used in the multiplication
> process. How do I do that, please provide an example as I wasn't able to
> find one online that works. Also, if you can please include an example of
> matrix multiplication that is similar in idea to what I am trying to write.

For asking questions here, we really like if you show something you've
tried, so we can point out where it can be improved.

Some hints: for the second part, assuming I get what you want, you have
to change the shape of one matrix so you can multiply. So if your one
matrix will be a and the other b, something like:

import numpy

a = numpy.array(... initialization of 8x4 matrix ...)
b = numpy.array(... initialization of 1x8 matrix ...)
b.resize(a.shape)   #
print a * b

# or, depending on what you want (check the documentation - one form
# zero-extends, the other duplicates):
b = numpy.resize(b, a.shape)
print a * b


print things out along the way if you're not sure what they're doing


does this help?  (it's trickier if you want to avoid numpy! - I can't
tell if this is homework that has some specific requirements on what you
can and cannot use)

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 169, Issue 17

2018-03-23 Thread Alan Gauld via Tutor
First, please don't repost the entire digest - we've all seen
the messages before and some people pay by the byte. Secondly
it makes finding the relevant message pertaining to your
question much harder to find.

Delete all the irrelevant stuff.

The other problem with the digest is that it tends to
break the threading of messages for those reading tools that
support it.

Anyway...

On 23/03/18 16:31, David Holland via Tutor wrote:

> I mean Oracle forms which using in Oracle financials, 

It's been nearly 10 years since I worked with OF and things
are likely to have changed but back then there were two variants
 - a pure HTML client that used simple HTML forms and a
thick client that was a Java applet. Is that still the case?

Assuming you have access to a pure HTML client then you need
to use standard web scraping technologies and techniques.
You might find a package like selenium useful. However, like
any kind of robotic UI scraping be prepared for a lot of trial
and error(do you have a test bed that you can try things on?
You don't want to be doing this on your production
database!)

If you only have a Java client then things get much more messy.
But the modern move seems to e away from Java clients to rich
HTML5 so I'm guessing Oracle are heading that way too.

The final thing to check is that you don't have an import
option for CSV files. We used to use OF for our travel expenses
and for those of us who travelled a lot(*) we could fill in
an Excel spreadsheet while on the road then upload it to
OF when we got back. It saved a lo9t of time. It was just
a menu option somewhere in OF - I can't recall where.
But that might be worth asking your IT dept about...

(*)I mean a lot as in, my travel expenses often came
to twice my monthly salary... ouch! The joy of being a
consultant.

-- 

Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor