topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • August 19, 2019, 09:11 AM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - OptimalDesigns [ switch to compact view ]

Pages: [1]
1
My webpage html has several ID tags for various MP4 video files.  My sitemap.xml for one MP4 video is as follows:

  <url>
    <loc>http://goal-driven.net/videos/index.html#FC-Compiler</loc>
       <video:video>
       <video:thumbnail_loc>http://goal-driven.net/image/fc-compiler-icon.png</video:thumbnail_loc>
       <video:title>Shows how to use and code the FC-Compiler™ App</video:title>
       <video:description>FC-Compiler™ application is a (free) Calculus-level Compiler that simplifies Tweaking parameters in ones math model.  FC solves Algebraic through Ordinary Differential Equations Equations; Laplace transforms; etc. FC is based on Automatic Differentiation that simplifies computer code to an absolute minimum; i.e., a mathematical model, constraints, and the objective (function) definition.</video:description>
       <video:content_loc>http://goal-driven.net/videos/FC Class.MP4</video:content_loc>
   <video:duration>600</video:duration>
   </video:video>
  </url>
The <loc>http://goal-driven.net/videos/index.html#FC-Compiler</loc> line seems to be the problem.  "#FC-Compiler" refers to an ID tag on my web page ... <h3 id="FC-Compiler">.  Am I doing something wrong here or on my Sitemap.xml file?

2
I see, let me, does the slide show have transitions that move the images during transitions, or is is just a solid image appears and then eventually switches to another one without any transition (fade, slide, etc.).
If this is the case, you should be able to find some mp4 or other video codec that compresses it well.
Solid ... no transitions ... exe shows Page 1 ... waits ... then Page 2 ... etc.

Have searched for a convert from EXE to MP4 formats ... no luck so far.  Ideas?

3
It's slide show create by me using IrfanView s/w.  Either EXE or SCR run fine on my local PC.  How to upload them for web visitors to view them?  I presently have MP4 files that are HUGE but work okay.  The EXE/SCR file are 1/400th the size!  Nice and do the job.

4
I have some HTML code to present a MP4 video file as follows:
Code: HTML5 [Select]
  1. <center><video width="360" height="240" controls>
  2.   <source src="http://goal-driven.net/... Coding.mp4" type="video/mp4">
  3.   <source src="movie.ogg" type="video/ogg">
  4.   Your browser does not support the video tag.
  5. </video></center>

It works fine.  Now, because of filesize getting so large, I'm seeking a way to present a slideshow that is in a EXE or SCR file format.  Have tried the following with no luck!

Code: HTML5 [Select]
  1. <center><video width="360" height="240" controls>
  2.   <source src="http://goal-driven.net/ ... Coding.scr" type="video/mp4">  ! no go!!
  3.   <source src="http://goal-driven.net/ ... Coding.exe" type="video/mp4">  ! no go either!!
  4. </video></center>

I've tried finding a convert program from EXE to MP4 with no luck here too.  Suggestions?

Phil

5
Yes, I forgot the declare stuff...

Private Declare Sub PSDcalc_for Lib "PSDcalc_for.dll" (ByVal fileNam As String, ByRef x_array As Single, _
  ByRef spectrum As Single, nptsZ As Integer, npointsZ As Integer, _
  t_startZ As Single, t_finalZ As Single, zeroFillZ As Single, sig2Z As Single, _
  nPoles As Integer, nZeros As Integer, M_eqs As Integer, M_lags As Integer, _
  Mode As Integer, L_pts As Integer, ByVal str_len As Long)
ooo

Public Sub exitProgram()
  ooo
' no longer have this code ...      Call EndProcess("PSDcalc_for.dll")
      If EndDLL("PSDcalc_for.dll") Then MsgBox "It worked!"

A problem is in the EndDLL("PSDcalc_for.dll") stmt.  EndDLL argument should be EndDLL(DllReturnValue As Long) ... that's a problem for sure.  What should be passed to EndDLL ... DllReturnValue As Long?

6
The following VB code give an error when trying to execute it ... ideas where my problem is?
---
      If EndDLL("PSDcalc_for.dll") Then MsgBox "It worked!"
---
The VB debugger says 'EndDLL' expected variable or procedure, not module.  Hmm, "EndDLL" is a function as described next.
---
Public Function EndDLL(DllReturnValue As Long) As Boolean

'PURPOSE: End a process started with VB's Shell Statement
'INPUT: Task ID returned by Shell
'RETURNS: True if succesful, false otherwise

On Error Resume Next

Dim hInst As Long
Dim hProcess As Long
Dim lExitCode As Long
Dim lRet As Long

hInst = DllReturnValue
If hInst = 0 Then Exit Function

'Get handle to process
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0&, hInst)
If hProcess <> 0 Then
    'get exit code
    GetExitCodeProcess hProcess, lExitCode
        If lExitCode <> 0 Then
                'bye-bye
            lRet = TerminateProcess(hProcess, lExitCode)
            EndDLL = lRet > 0
        End If
End If
End Function
---

KodeZwerg, you are probably right on the problem is in my VB -exit- code ... not the DLL.   On the inet the talk is about 'Close' vs. 'Close All'.  Ideas?

7
Try running the app's demos and see what is going on.  Many runs and all is well.  Then try exiting the app.  It hangs!  Many DLLs show a wx_close() or w?_close() routine that does the job.  But out of my range.


8
Yes it is downloadable from http://fortrancalcul...o/misc/download.html page.  It is the SpectrumSolvers app ... includes all source files.  The DLL is named PSDcalc_for.dll and once downloaded and installed, the DLL is found in the \od-tools\SpectrumSolvers directory.

Thanks your your efforts.
Phil
PS:  The app closes fine -unless- the DLL is executed.  If the DLL is executed, it hangs the app when trying to close the VB app.

9
it worked!!!   oShell.run "cmd /C set win~dir=" & fileTempPath & " && " & tmp3, 3, True
"win~dir" is my environment variable that passed windows present path, fileTempPath, to the 'bat' file.

My problem was due to a shortcut to my FC-base.bat file, called FC-base-launch.lnk.  If the 'bat' file was called directly from my windows app, all was fine.  But, call a shortcut 'launch' link and the users path was lost. :(  These 'launch' links allow users to define their text & background colors, text fonts & sizes, etc. ... very helpful for developers to let the owners decide these things.  A bat file does -not- have such options.

Thanks KodeZwerg & f0dder for your help!
Phil

10
Over my head!!!  Guess I'll just leave it for someone else to work on.

Thanks for your efforts KodeZwerg and wraith808,
Phil

11
Set wshSystemEnv = wshShell.Environment( "SYSTEM" )
Do. Not. Do. This.

If you need to use vbscript instead of a proper language, go for the solution that executes cmd /c "set foo=bar & mainexecutable".

I'm a little lost here ... so we are back to cmd /c "set foo=bar & mainexecutable"?  What is the '"mainexecutable"?  This -must- be "set" before executing my main batch file.  So, will or should my oShell.run "cmd /C Set tmp = "ABC" do the trick?

12
VB, does it provide Stacktrace? If so, what does it tell?
Never heard of "Stacktrace" in VB nor Fortran ... where might I find it -or- try it?  How would you use it ... show me some code.

Thanks, Phil

13
Set wshShell = CreateObject( "WScript.Shell" )
Set wshSystemEnv = wshShell.Environment( "SYSTEM" )
' Display the current value
WScript.Echo "TestSystem=" & wshSystemEnv( "TestSystem" )
Close ... I have the following code that may explain my problem.
        Dim oShell As Variant, intResponse As Integer
        Set oShell = CreateObject("WSCript.shell")
---
Your example shows "Set wshShell = " and mine has "Set oShell = ".  So, I made that change but then "Set wshSystemEnv = " produces an error msg. saying that "wshSystemEnv" is not defined.  So, "Dim wshSystemEnv As Variant" line was added but that caused other problems. 

Next, the line 'WScript.Echo "TestSystem=" & wshSystemEnv("TestSystem")
' causes an error abort msg.  It seems that it doesn't like the "WScript.Echo" portion, but not sure what it is trying to point too.  Ideas?

Thanks for the help!  Close ... so close!
Phil

14
I got this "set -ua ..." off the www as a possible answer to my question.  I write VB code and VBscript when necessary.

Anyone out there knows how to pass an environment variable from Windows?

Phil

15
Hi,

I'm having problems with my VB6 program that merges with a Lahey Fortran DLL.  It has been around for over 20 years!  The DLL was started around 5 or 10 years ago.  My VB6 program may call the DLL 1 or more times with no problems.  Then on closing, the program hangs!!!  If one doesn't call the DLL, no hanging occurs on closing.  Ideas?

1. Phil Brubaker
2. S/N: 001873...
3. Lahey/Fujitsu Fortran 95 Express Release 7.10.02
4. Patch level?
5. OS: Windows 7
6. Example VB6 code:
Private Declare Sub PSDcalc_for Lib "PSDcalc_for.dll" (ByVal fileNam As String, ByRef x_array As Single, _
  ByRef spectrum As Single, nptsZ As Integer, npointsZ As Integer, _
  t_startZ As Single, t_finalZ As Single, zeroFillZ As Single, sig2Z As Single, _
  nPoles As Integer, nZeros As Integer, M_eqs As Integer, M_lags As Integer, _
  Mode As Integer, L_pts As Integer, ByVal str_len As Long)
 
ooo

         ReDim x_array(1 To npointsZ) As Single, spectrum(1 To npointsZ) As Single
            x_array(1) = 1: spectrum(1) = 1
            ChDrive App.path:      ChDir App.path

            Call PSDcalc_for(fileTemp, x_array(1), spectrum(1), nptsZ, npointsZ, _
                t_startZ, t_finalZ, zeroFillZ, sig2Z, _
                nPoles, nZeros, M_eqs, M_lags, Mode, L_pts, _
                Len(fileTemp))

            If nptsZ < 1 Then
              MsgBox "File Error ... read bottom of your '~rainbow.out' file for " & vbCrLf _
                 & "more details. This OUT file is in the same directory " & vbCrLf _
                 & "as your input file; ... " & vbCrLf _
                 & "   " & fileTemp, vbOKOnly, "File name in error ... " _
                 & "read Output file for more"
              Call createFileOut(fileIn)
              Exit Sub
            End If
            Call createFileOut(fileIn)
ooo
-------------------------------------------------------------------------------------

F90 code:
------------
     Subroutine PSDcalc_for( fileNam, x_array, spectrum, nptsZ, &
           npointsZ, t_startZ, t_finalZ, zeroFillZ, sig2Z, &
           npolesZ, nzerosZ, M_eqsZ, M_lagsZ, modeZ, L_ptsZ)

        dll_export :: PSDcalc_for
        character(len=*) :: fileNam

        include 'spec_in.inc'

        complex signal_amp( :)
        real y_array( :), norm_factor
        real, dimension( npointsZ) :: x_array, spectrum
        allocatable :: y_array, signal_amp
--------------------------------------------------------------------------------------

This code works, can call PSDcalc_for several times ... AOK.  Then try closing my VB6 front-end and vb6 seems to hang.  Create an EXE for my project and it too runs fine until closing.  Then it tries closing and gets the same error msg.

This app has been running since 1994 (?) with no problem, what is new that causes such error?  I found a back-up with same DLL, back in 2015, and it too aborted with same error!  The app is not used that often by me, so unclear when this shutdown error msg. started.

Any ideas on how to close down my Fortran DLL, without forcing it just a 'normal' close?

Thanks, Phil

16
Not that simple ... many parameters are passed as is.  So, how to get a variable passed that bypasses the cmd line?  And, there are many ... many apps already developed that need this technique.

Thanks, Phil

17
For example, here is what is done between two batch files:
In demo.bat,
set tmp=ABC
...
call main.bat
---

In main.bat,
if not "%tmp%"="" echo got it, %%tmp%% = %tmp% ... it worked!!
---

Now without a 'demo.bat' file, how can I pass my %tmp% variable from Windows 7 to my main.bat?

Phil
PS tried following
' Create a script (within my VB app) to pass parameters to Windows Batch file
' nogo as of 7/13/2018 pbb, need help!

' oShell.run "cmd /V /C Set -ua tmp %" & "ABC", 3, True

18
Sounds like a very interesting project.

Might you be interested in making some extra income by supporting FortranCalculus (Computer) language?  I'm retiring, closing my website, as of early Oct. 2018.  There are 5 (math) apps with source code for users to download and use for free.  One app, FC-Compiler, is a Calculus-level (math) compiler for the FortranCalculus (Computer) language.  FC was developed or funded by NASA during the 1960s.

FC has the power to increase ones income by a factor of ten!

If you or someone you know may be interested in pursuing FC, please let me know.

For an introduction to FC, download my 'CurvFit' app from FortranCalculus.info website.  Download it, Install it, and execute it.  Run some demos, look at the output files, and view the 'Fit4user.fc' file that is the source code the running in the DOS background.

Things you need to know in order to support FC:  Fortran (77) basics, I/O stmt.s; Batch programming basics; and Engineering or some science field (physics, chemistry, etc.).

There is allot that can be done with FC ... solving some Heart problems and Cancer are two that sound promising.

Just some ideas.

Phil

19
Developer's Corner / Re: Need Inno Setup Advice
« on: June 22, 2018, 04:19 PM »
source shortcut files you are referring to as "...\abc-launch" are really named "...\abc-launch.lnk" and you just aren't seeing the .lnk extension in your windows file explorer ... Does that sound plausible?

Yes, that was my problem ... many thanks. :)

Phil

20
Developer's Corner / Re: Need Inno Setup Advice
« on: June 22, 2018, 03:48 PM »
Inno Script Studio might worth a try too.

They seem to be out of town or deceased.  :(

I tried the following but nogo.  How does one copy a shortcut (.LNK ir file) with Inno Setup?

This 'icon' thing seems wrong, since its -not- an icon copy that is giving me problems.

#define MyAppName "Robot4"
AppName={#MyAppName}
DefaultGroupName={#MyAppName}

[Icons]
Name: "{group}\..\base4apps-exe-launch"; Filename: "{app}\.."

Ideas?

21
Hi,

I have been seeking High School & College math teachers that may be interested in the following Curve Fitting problem.  This type problem would be of great help for many future engineering & science students in industry. Do you know of any HS teachers that might be interested in teaching such?  If so, please forward a copy of this file to them.

Thanks, Phil
--------------


Want to help solve world (math) problems?
=====================
    Here is a typical cycle ... Problem to Solution
    -------------------------------------------------------
  • Find a Math model for a -regular- or normal cycle; i.e. a Lorentzian, sinusoidal, or whatever series.  If your model has 'n' components and workers for both -regular- and -irregular- cycles you hit the jackpot!  Your 'n' value must always be the same.  Other values in a math model are called Parameters and their values will vary with each dataset.

  • Build Pulse train: add 'i' -regular- cycles together separated by Tmin and add 1, 2, or 'j' -irregular- cycles in order to build your problem.  Next, find or build a 'black box' that can detect when a cycle is -irregular-.

  • Find or develop a 'pill' or 'black box' that will stop these -irregular- cycles from occurring.

Learn Curve Fitting for Industrial Applications
------------------------------------------

  With the Lorentz (function) where y = 1/(1+x*x), one can fit data to a wide variety of data.  There is a Windows App called CurvFit that has an option of a Lorentzian or Modified Lorentzian series; visit fortranCalculus.info/apps/curvfit.html.  Please download, install, and run some of its demo files.

  If it looks okay to you, then find some example dataset to fit on the web.  For example, I used Google to search for "one-cycle heartbeat data -apple".  When you find a one-cycle dataset, build a math model using my CurvFit app.  A heart-beat math model may help other researchers discover what's wrong with a heart, or, other disease.

  Would your students like to help find solutions to medical diseases/problems?  Ask them to find a math model for one-cycle heart-beat dataset problem using my CurvFit app.  Suggest forwarding top 5 (or so) CurvFit input files with the files named after the creators; e.g. JimS (for Jim Smith) or ElsaB (for Elsa Brubaker).  Link all of them with the same fileType of YYY (?).  Be sure students add their 'notes' below the "20. >> Keep notes below" line.  They should also Point out any unusual things that happen during a CurvFit run with their input (file) problem.  Also a good place to put references; e.g. Dataset came from the Oil Refinery field; or, Bob Jones provided this dataset from the magnetic disc drive field.  (Adding the xxx field may help websites locate these problem-solutions, in the future.)

  Add a write-up of a paragraph or two, stating the names of students that were involved in this exercise?  I would then add your statement to my CurvFit app's manual file or ReadMe.txt files for future (free) downloads.  Hope this would encourage your students.

  How about asking your students to ask their parents, grandparents, & friends if they have a dataset that may help R & D folks solve their problems?  The more folks involved the more excitement for the students.

  Math folks
  Develop a math model of a regular one-cycle heartbeat.  Try using a Lorentzian or Modified Lorentzian series.  Download My (free) CurvFit app for more insight.

  R & D folks
  Build a pulse train of regular cycle heart-beats and 1 or 2 or ??? irregular cycles.  Build/develop a 'black box' what can detect irregular cycles.

  Chemistry folks
  Find/develop a 'pill' or 'black box' that will stop future irregular cycles.

 
Irregular cycle problem solved!
  ===============

22
FortranCalculus (FC) language was developed in late 1980s to replace PROSE language that ran on Time-Sharing computers starting in 1974 on a CDC 6600 computer.  PROSE and now FortranCalculus help Engineers & Scientists solve their math problems, in minutes!

FC Compiler improves Math Modeling, Simulation & Optimization efforts by improving their productivity by 20 times!  Solutions are Faster, Improved Accuracy, & Cheaper.

The FC compiler simplifies solving math problems by minimizing code necessary to state & solve a problem.  Some new thinking is necessary for those wanting to get the most for their buck; convert from simulation to optimization thinking.

If you were a manager or CEO and had the choice of a simulation design versus an optimization design, which would you pick?

Teach Educators: Modeling & Simulation’s next step is (Mathematical) Optimizations.  Optimizations require a design Goal or Objective (function).  Today's Engineers & Scientists solve problems with a “Find X” mind-set.  With some Operational Research training they could expand their thinking to a “Find X to Optimize Y” mind-set.  Then they would be ready for Optimizations, Calculus-level programming and software.  (This would drop today’s design times that require months even man years to one or two days!  Manufacturing processes could be optimized to the days demand and thus maximize their profits.)

“Find X to Optimize Y” thinking among professors will cause most engineering & science textbooks to be rewritten with optimization examples and discussions.  This will be great stuff for industries and government; applied engineering and/or science not just theories.

A little history, in 1974 Calculus programming was introduced at a Society of Industrial & Applied Mathematicians (SIAM) conference.  Two professors heading the conference would -not- allow this paper to be printed since they realized what it would do to their (numerical methods) field of work. (Few, if any, professors are aware of what can be achieved thru Calculus Programming.)  Help, we need Engineering & Science professors to teach the “Find X to Optimize Y” mind-set.

Design Goal | Objective required for Optimization
•   Engineers & Scientists need to move from a “Find X” mind-set to a “Find X to Optimize Y” mind-set teaching in schools.
•   Industry/Company Leaders need to state their company objectives so ALL employees know it; Leadership by objectives.

23
Developer's Corner / Re: Need Inno Setup Advice
« on: June 21, 2018, 09:42 AM »
Seeking help to add a script to Inno Setup Compiler that will 'copy' my shortcut 'files' or links to each user installing my app.  The following ISS code is what I tried.

[Files]
; old way to execute my abc.exe routine.
Source: "...\abc.exe"; DestDir: "{app}\.."; Flags: sharedfile uninsneveruninstall ignoreversion

; next line is a NoGo ... Inno Setup Compiler says '...-launch' are not files!
Source: "...\abc-launch"; DestDir: "{app}\.."; Flags: sharedfile uninsneveruninstall ignoreversion
-----------

I have several apps that run in DOSbox, a Window's app that runs 16-bit DOS.  The font size and colors of text & background are my problems.  In order to fix these problems, shortcut's are created in Windows OS (within Windows Explorer) and are renamed "...-launch".  Several batch files execute these '-launch' shortcuts with the 'start' cmd; e.g.  start "%FCapp%'s DOSbox Setup" /wait abc.exe /openLF %FCname% ... parameters 4 input
This starts my abc.exe routine with the 'normal' small font size and a black background.  This is hard for me to see.

Next, these '-launch' shortcuts were created that fix the font size and background color.  This will allow each user that downloads my app to set their own size and colors.  Now, my batch files execute these abc.exe files with a '...-launch' shortcut.  These '...-launch' shortcuts are then executed in a batch file with a ...  start "%FCapp%'s DOSbox Setup" /wait abc-launch /openLF %FCname% ... parameters 4 input .

This method provides a nice solution ... font size & background color are good.  Plus, a user may change these settings if they would like too.

These '...-launch' shortcuts must -not- be deleted by user.  But, 4 apps have some duplicate shortcuts so updates must be able to over-write or replace them.  These shortcuts all have one or more parameters that must be passed to them.  'Pin' to desktop should be prohibited.

Ideas on how to create a script in Inno Setup to copy these '...-launch' shortcuts to every one of my apps and be installed to user that downloads one or more of my apps and installs it or them?

Thanks, Phil

Pages: [1]