Символы в правом верхнем углу.
Что значат звёздочка с цифрой под ней и глаз с цифрой под ним?
Что значат звёздочка с цифрой под ней и глаз с цифрой под ним?
Интересует численное интегрирование, задача в нахождении полярного момента какой-либо фигуры.
Кто-нибудь сталкивался?
Задолбался писать уравнения в LibreOffice,и чертить эпюры в QCAD, нужна софта по решению статических задач по сопромату, и видимо её надо колхозить самому, тогда нужен руководитель проекта, кто сможет?
Пример находится
https://docs.racket-lang.org/quick/
11. Objects
#lang racket
(require racket/class
racket/gui/base)
(define f (new frame% [label "My Art"]
[width 300]
[height 300]
[alignment '(center center)]))
(define (add-drawing p)
(let ([drawer (make-pict-drawer p)])
;;make-pict-drawer: unbound identifier in module in: make-pict-drawer
(new canvas% [parent f]
[style '(border)]
[paint-callback (lambda (self dc)
(drawer dc 0 0))])))
Что я промухал?
Скачал с
https://github.com/A2K/jTessBoxEditor
там файл build.xml с таким содержанием
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="jTessBoxEditor" default="default" basedir=".">
<description>Builds, tests, and runs the project jTessBoxEditor.</description>
<import file="nbproject/build-impl.xml"/>
<property name="version" value="1.3"/>
<target name="-post-compile">
<copy todir="${build.classes.dir}">
<fileset dir="." includes="readme*.html"/>
</copy>
</target>
<target name="-post-jar">
<move todir="./">
<fileset dir="${dist.dir}" includes="${ant.project.name}.jar" />
</move>
<delete dir="${dist.dir}/lib"/>
</target>
<target name="-post-clean">
<delete file="${ant.project.name}.jar"/>
</target>
<target name="dist" depends="clean,jar"
description="create binary and source distribution archives">
<mkdir dir="${dist.dir}"/>
<zip zipfile="${dist.dir}/${ant.project.name}-${version}-src.zip">
<zipfileset dir="." prefix="${ant.project.name}">
<exclude name="**/.*"/>
<exclude name="${dist.dir}/**"/>
<exclude name="${build.dir}/**"/>
<exclude name="doc/**"/>
<exclude name="${ant.project.name}.jar"/>
</zipfileset>
</zip>
<zip zipfile="${dist.dir}/${ant.project.name}-${version}.zip">
<zipfileset dir="." includes="*,lib/**,data/**,tools/**,samples/**,tesseract-ocr/**" prefix="${ant.project.name}"
excludes="build.xml,src,build,dist,doc,nbproject">
<exclude name="*.mf"/>
</zipfileset>
</zip>
<delete dir="${dist.dir}/lib"/>
</target>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="jTessBoxEditor-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
Как им пользоваться не понятно.
Скачал сайт
wget -r -k http://bauhh.dyndns.org:8000/clim-spec
локально запускаю страничку: file:///home/Documents/backup/cl/mcclim/bauhh.dyndns.org:8000/clim-spec/1.html
ввожу в окошке aprpos, например pane и вылетаю в интернет
http://bauhh.dyndns.org:8000/clim-spec/edit/apropos?q=pane
что нужно сделать чтобы apropos заработал локально, без вылета в интернет?
(in-package :common-lisp-user)
(defpackage "APP"
(:use :clim :clim-lisp)
(:export "APP-MAIN"))
(in-package :app)
(define-application-frame superapp ()
((numbers :initform (loop repeat 20 collect (list (random 100000000)))
:accessor numbers)
(cursor :initform 0 :accessor cursor))
(:pointer-documentation t)
(:panes
(app :application
:height 400 :width 600
:incremental-redisplay t
:display-function 'display-app)
(int :interactor :height 200 :width 600))
(:layouts
(default (vertically () app int))))
(defun display-app (frame pane)
(loop for element in (numbers frame)
for line from 0
do (princ (if (= (cursor frame) line) "*" " ") pane)
;; pane is the protocol class that corresponds to a pane,
;; взят как аргумент функции
do (updating-output (pane :unique-id element ;; не нашёл откуда
:id-test #'eq ;; взялись эти
:cache-value (car element) ;; опции
:cache-test #'eql) ;;
(format pane "~a~%" (car element)))))
;; По опциям, нашёл
;; updating-output (stream
;; &rest args
;; &key unique-id <- здесь element как var
;; unique-id provides a means to uniquely identify the output done by body. If unique-id is not supplied, CLIM will generate one that is guaranteed to be unique. unique-id may be any object as long as it is unique with respect to the id-test predicate among all such unique ids in the current incremental redisplay. id-test is a function of two arguments that is used for comparing unique ids it has indefinite extent.
;; (id-test #'eql)
;; cache-value <- здесь element как list
;; cache-value is a value that remains constant if and only if the output produced by body does not need to be recomputed. If the cache value is not supplied, CLIM will not use a cache for this piece of output. cache-test is a function of two arguments that is used for comparing cache values; it has indefinite extent.
;; (cache-test #'eql) почему element то
;; var то list?
;; fixed-position element нигде не определён
;; all-new
;; parent-cache
;; record-type) &body body
(defun app-main ()
(run-frame-top-level (make-application-frame 'superapp)))
(define-superapp-command (com-quit :name t) ()
(frame-exit *application-frame*))
(define-superapp-command (com-add :name t) ((number 'integer))
(incf (car (elt (numbers *application-frame*)
(cursor *application-frame*)))
number))
(define-superapp-command (com-next :name t) ()
(incf (cursor *application-frame*))
(when (= (cursor *application-frame*)
(length (numbers *application-frame*)))
(setf (cursor *application-frame*) 0)))
(define-superapp-command (com-prev :name t) ()
(decf (cursor *application-frame*))
(when (minusp (cursor *application-frame*))
(setf (cursor *application-frame*)
(1- (length (numbers *application-frame*))))))
Вылетает ошибка, указал в теле кода. И как indent этот код в emacs?
;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Package: CLIM-USER; Base: 10 -*-
(in-package :clim-user)
(define-application-frame fifteen-puzzle-1 ()
((pieces :initform (make-array `(4 4) :initial-contents `((1 2 3 4)
(5 6 7 8)
(9 10 11 12)
(13 14 15 0)))))
(:menu-bar nil)
(:panes
(display :application
:text-style `(:fix :bold :very-large)
:display-function `draw-the-display
:scroll-bars nil)
(menu :command-menu))
(:layouts
(main
(vertically () display menu))))
;;; this draws the entire display
(defmethod draw-the-display ((application fifteen-puzzle-1) stream
&key &allow-other-keys)
(with-slots (pieces) application
(dotimes (y 4)
(dotimes (x 4)
(let ((piece (aref pieces y x)))
(if (zerop piece)
(format stream "
")
(format stream "~2D " piece))))
(terpri stream))))
;;; useful macrology - the body will be run with x and y bound to
;;; the coordinates of the empty cell
(defmacro find-empty-piece-and-do ((y x) &body body)
‘(block find-empty-piece
(dotimes `(,y 4)
(dotimes `(,x 4)
(when (zerop `(aref pieces ,y ,x))
,@body ;; как бороться сэтим
;; READ error during COMPILE-FILE:
;; Comma not inside a backquote.
;; Line: 41, Column: 3, File-Position: 1092
(return-from find-empty-piece))))))
(define-fifteen-puzzle-1-command (down :menu t) ()
(with-slots (pieces) *application-frame*
(find-empty-piece-and-do (y x)
(if (not (zerop y))
(rotatef (aref pieces y x) (aref pieces (- y 1) x))))))
(define-fifteen-puzzle-1-command (up :menu t) ()
(with-slots (pieces) *application-frame*
(find-empty-piece-and-do (y x)
(if (not (= y 3))
(rotatef (aref pieces y x) (aref pieces (+ y 1) x))))))
(define-fifteen-puzzle-1-command (left :menu t) ()
(with-slots (pieces) *application-frame*
(find-empty-piece-and-do (y x)
(if (not (= x 3))
(rotatef (aref pieces y x) (aref pieces y (+ x 1)))))))
(define-fifteen-puzzle-1-command (right :menu t) ()
(with-slots (pieces) *application-frame*
(find-empty-piece-and-do (y x)
(if (not (zerop x))
(rotatef (aref pieces y x) (aref pieces y (- x 1)))))))
#||
()
(setq fp1 (make-application-frame ’fifteen-puzzle-1
:left 200 :right 400 :top 150 :bottom 350))
(run-frame-top-level fp1)
||#
У кого нибуть случалось такое:
(ql:quickload '(mcclim clim-listener))
The function :USE is undefined.
[Condition of type UNDEFINED-FUNCTION]
CL-USER> (ql:quickload :clim-listener)
To load "clim-listener":
Load 1 ASDF system:
clim-listener
; Loading "clim-listener"
;
; compilation unit aborted
; caught 2 fatal ERROR conditions
(:CLIM-LISTENER)
это что-то страшное?
В окне реакции-опор уравнения и расчётная схема, и что-то там не верно.
https://my-files.ru/Save/phc4tn/пв-обечайка-сварная-крестовина.ods
кто-нибудь сможет сообразить?
Перемещено leave из development
Как установить libssl 1.0.0, libcrypto 1.0.0 на Дебиан 9 и ничего не повредить. Получил ответ:
have you updated you OS recently? Try reinstall VariCAD if it does not help, create symlinks to libssl 1.0.0 and libcrypto 1.0.0.
VariCAD still uses older versions of the said libraries for compatibility reasons. We are considering release of 2 versions of VariCAD for 1.0.0 and 1.0.1.
библиотеки находятся в libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb, Debian Jessie, для Debian Streatch нету, распокавать я его смогу. Далее копирую файлы в отдельную директорию. А вот как подгружать их из неё через LD_PRELOAD_PATH во время запуска прграммы, как это сделать? Есть другие варианты?
Где эта, glibc 2.4 or later, библиотека в дебиан? Это glib-source, которую надо компилировать?
Команда
apt-cache policy
Списки пакетов:
Систему пришлось переустановить, и теперь не пойму, будет работоть slime sbcl Такое вот выдало
SBCL is free software, provided as is, with absolutely no warranty. It is mostly in the public domain; some portions are provided under BSD-style licenses. See the CREDITS and COPYING files in the distribution for more information. * ; loading #P"/home/igor/.emacs.d/elpa/slime-2.23/swank-loader.lisp" WARNING: redefining EMACS-INSPECT (#<SB-PCL:SYSTEM-CLASS COMMON-LISP:T>) in DEFMETHOD
; file: /home/igor/.emacs.d/elpa/slime-2.23/swank/sbcl.lisp
; in: DEFUN SWANK/SBCL::MAKE-SOCKET-IO-STREAM
; (EQ :FD-HANDLER SWANK:*COMMUNICATION-STYLE*)
;
; caught WARNING:
; undefined variable: SWANK:*COMMUNICATION-STYLE*
; in: DEFUN SWANK/SBCL::LISP-SOURCE-LOCATION
; (LET ((SWANK/SBCL::SOURCE
; (PRIN1-TO-STRING
; (SB-DEBUG::CODE-LOCATION-SOURCE-FORM SWANK/SBCL::CODE-LOCATION 100)))
; (CONDITION SWANK:*SWANK-DEBUGGER-CONDITION*))
; (IF (AND (TYPEP CONDITION 'STEP-FORM-CONDITION)
; (SEARCH "SB-IMPL::WITH-STEPPING-ENABLED" SWANK/SBCL::SOURCE :TEST
; #'CHAR-EQUAL)
; (SEARCH "SB-IMPL::STEP-FINISHED" SWANK/SBCL::SOURCE :TEST
; #'CHAR-EQUAL))
; (SWANK/BACKEND:MAKE-ERROR-LOCATION "Stepping...")
; (SWANK/BACKEND:MAKE-LOCATION `(:SOURCE-FORM ,SWANK/SBCL::SOURCE)
; '(:POSITION 1))))
;
; caught WARNING:
; undefined variable: SWANK:*SWANK-DEBUGGER-CONDITION*
;
; compilation unit finished
; Undefined variables:
; SWANK:*COMMUNICATION-STYLE* SWANK:*SWANK-DEBUGGER-CONDITION*
; caught 2 WARNING conditions
; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-util.lisp» (written 07 FEB 2019 01:25:15 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-util.fasl written ; compilation finished in 0:00:00.023 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-repl.lisp» (written 07 FEB 2019 01:25:16 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-repl.fasl written ; compilation finished in 0:00:00.067 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-c-p-c.lisp» (written 07 FEB 2019 01:25:16 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-c-p-c.fasl written ; compilation finished in 0:00:00.082 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-arglists.lisp» (written 07 FEB 2019 01:25:16 PM):
; file: /home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-arglists.lisp
; in: DEFSTRUCT KEYWORD-ARG
; (DEFSTRUCT
; (SWANK::KEYWORD-ARG (:CONC-NAME SWANK::KEYWORD-ARG.)
; (:CONSTRUCTOR SWANK::%MAKE-KEYWORD-ARG))
; KEYWORD
; SWANK::ARG-NAME
; SWANK::DEFAULT-ARG)
; --> PROGN EVAL-WHEN
; ==>
; (SB-KERNEL::%COMPILER-DEFSTRUCT
; '#<SB-KERNEL:DEFSTRUCT-DESCRIPTION SWANK::KEYWORD-ARG {10054BEB73}>
; '#(#<SB-KERNEL:LAYOUT for T {20300003}>
; #<SB-KERNEL:LAYOUT for STRUCTURE-OBJECT {20300103}>))
;
; caught STYLE-WARNING:
; Previously compiled calls to SWANK::KEYWORD-ARG.KEYWORD,
; SWANK::KEYWORD-ARG.ARG-NAME and SWANK::KEYWORD-ARG.DEFAULT-ARG could not be
; inlined because the structure definition for SWANK::KEYWORD-ARG was not yet
; seen. To avoid this warning, DEFSTRUCT should precede references to the
; affected functions, or they must be declared locally notinline at each call
; site.
; in: DEFSTRUCT OPTIONAL-ARG
; (DEFSTRUCT
; (SWANK::OPTIONAL-ARG (:CONC-NAME SWANK::OPTIONAL-ARG.)
; (:CONSTRUCTOR SWANK::%MAKE-OPTIONAL-ARG))
; SWANK::ARG-NAME
; SWANK::DEFAULT-ARG)
; --> PROGN EVAL-WHEN
; ==>
; (SB-KERNEL::%COMPILER-DEFSTRUCT
; '#<SB-KERNEL:DEFSTRUCT-DESCRIPTION SWANK::OPTIONAL-ARG {100594EF33}>
; '#(#<SB-KERNEL:LAYOUT for T {20300003}>
; #<SB-KERNEL:LAYOUT for STRUCTURE-OBJECT {20300103}>))
;
; caught STYLE-WARNING:
; Previously compiled calls to SWANK::OPTIONAL-ARG.ARG-NAME and
; SWANK::OPTIONAL-ARG.DEFAULT-ARG could not be inlined because the structure
; definition for SWANK::OPTIONAL-ARG was not yet seen. To avoid this warning,
; DEFSTRUCT should precede references to the affected functions, or they must be
; declared locally notinline at each call site.
; in: DEFGENERIC EXTRACT-LOCAL-OP-ARGLISTS => DEF.BODY (CDDR CURRENT-DEF)
; (CDDR SWANK::CURRENT-DEF)
; --> CDR CDR
; ==>
; SWANK::CURRENT-DEF
;
; note: deleting unreachable code
; in: DEFGENERIC EXTRACT-LOCAL-OP-ARGLISTS
; (SWANK::%COLLECT-OP/ARGL-ALIST SWANK::DEFS)
; ==>
; SWANK::DEFS
;
; note: deleting unreachable code
;
; compilation unit finished
; caught 2 STYLE-WARNING conditions
; printed 2 notes
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-arglists.fasl written ; compilation finished in 0:00:00.476 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-fuzzy.lisp» (written 07 FEB 2019 01:25:17 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-fuzzy.fasl written ; compilation finished in 0:00:00.104 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-fancy-inspector.lisp» (written 07 FEB 2019 01:25:15 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-fancy-inspector.fasl written ; compilation finished in 0:00:00.263 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-presentations.lisp» (written 07 FEB 2019 01:25:15 PM):
; file: /home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-presentations.lisp
; in: EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
; (SWANK:SWANK-REQUIRE :SWANK-REPL)
;
; caught WARNING:
; SWANK-REPL also exports the following symbols:
; (SWANK-REPL:LISTENER-SAVE-VALUE SWANK-REPL:REDIRECT-TRACE-OUTPUT
; SWANK-REPL:CLEAR-REPL-VARIABLES SWANK-REPL:CREATE-REPL
; SWANK-REPL:LISTENER-GET-VALUE SWANK-REPL:LISTENER-EVAL)
; See also:
; The ANSI Standard, Macro DEFPACKAGE
; The SBCL Manual, Variable SB-EXT:*ON-PACKAGE-VARIANCE*
;
; caught STYLE-WARNING:
; redefining THREAD-FOR-EVALUATION (#<STRUCTURE-CLASS SWANK::MULTITHREADED-CONNECTION>
; #<SB-MOP:EQL-SPECIALIZER :FIND-EXISTING>) in DEFMETHOD
;
; compilation unit finished
; caught 1 WARNING condition
; caught 1 STYLE-WARNING condition
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-presentation-streams.fasl written ; compilation finished in 0:00:00.048 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-asdf.lisp» (written 07 FEB 2019 01:25:16 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-asdf.fasl written ; compilation finished in 0:00:00.244 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-package-fu.lisp» (written 07 FEB 2019 01:25:15 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-package-fu.fasl written ; compilation finished in 0:00:00.012 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-hyperdoc.lisp» (written 07 FEB 2019 01:25:17 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-hyperdoc.fasl written ; compilation finished in 0:00:00.003 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-sbcl-exts.lisp» (written 07 FEB 2019 01:25:17 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-sbcl-exts.fasl written ; compilation finished in 0:00:00.035 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-mrepl.lisp» (written 07 FEB 2019 01:25:16 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-mrepl.fasl written ; compilation finished in 0:00:00.038 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-trace-dialog.lisp» (written 07 FEB 2019 01:25:16 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-trace-dialog.fasl written ; compilation finished in 0:00:00.043 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-macrostep.lisp» (written 07 FEB 2019 01:25:17 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-macrostep.fasl written ; compilation finished in 0:00:00.045 ; compiling file «/home/igor/.emacs.d/elpa/slime-2.23/contrib/swank-quicklisp.lisp» (written 07 FEB 2019 01:25:17 PM):
; /home/igor/.slime/fasl/2.23/sbcl-1.3.14.debian-linux-x86-64/contrib/swank-quicklisp.fasl written ; compilation finished in 0:00:00.003 ;; Swank started at port: 37711.
Как отключить updates? Ничего не нашёл.
Как evaluate sexp из *scratch* не в минибуфер а в прямо в sbcl, нигде не нашёл но видео видел.
(defun string-to-number (n)
(car (list (read-from-string n))))
(defun degrees-minutes-seconds-to-radians (d m s)
(+ (* (string-to-number d) (/ pi 180))
(* (string-to-number m) (/ pi (* 180 60)))
(* (string-to-number s) (/ pi (* 180 60 60)))
))
;;;(let* ((n 4)
;;; (m (expt 10 n)))
;;;(/ (fround 0.2398476566 (/ 1 m)) m))
;;; Round a flout number to required number of digits
(defun my-round (x digits)
(let* ((n (string-to-number digits))
(m (expt 10 n)))
(/ (fround x (/ 1 m)) m)))
(defun dms ()
(with-ltk ()
(let* ((window (make-instance 'frame))
#-:tk84
;;;; Explanation
(fcriteria (make-instance 'frame :master window))
(criteria (make-instance 'label
:master fcriteria
:width 60
:text "rad = aº * (π / 180) + a' * (π / (180 * 60) + a'' * (π / (180 * 60 * 60))"))
(fdigits (make-instance 'frame :master window))
(before-digits (make-instance 'label
:master fdigits
:text "Округлить до "))
(e-digits (make-instance 'entry
:master fdigits
:width 1))
(after-digits (make-instance 'label
:master fdigits
:text " знаков после запятой"))
;;;; ENTER DATA
(fdms (make-instance 'frame :master window))
(e-degrees (make-instance 'entry
:master fdms
:width 3))
(e-minutes (make-instance 'entry
:master fdms
:width 2))
(e-seconds (make-instance 'entry
:master fdms
:width 2))
(l-d (make-instance 'label
:master fdms
:text "º "))
(l-m (make-instance 'label
:master fdms
:text "' "))
(l-s (make-instance 'label
:master fdms
:text "''"))
(l1 (make-instance 'label
:master fdms
:text " = "))
(l2 (make-instance 'label
:master fdms
:text " rad"))
a
r
rslt
(b1 (make-instance 'button
:master window
:text "Run"
:command (lambda ()
(setf
a (degrees-minutes-seconds-to-radians
(text e-degrees)
(text e-minutes)
(text e-seconds)))
(setf r (my-round a (text e-digits)))
(setf (text rslt) r)))))
(setf rslt (make-instance 'label :master fdms :text 0))
(pack window)
(pack fcriteria)
(pack criteria)
(pack fdigits)
(pack before-digits :side :left)
(pack e-digits :side :left)
(pack after-digits :side :left)
(pack fdms)
(pack e-degrees :side :left)
(pack l-d :side :left)
(pack e-minutes :side :left)
(pack l-m :side :left)
(pack e-seconds :side :left)
(pack l-s :side :left)
(pack l1 :side :left)
(pack rslt :side :left)
(pack l2 :side :left)
(pack b1))))
результат будет иметь d0 в конце результата, как это убрать?
Не могу округлить число 0.2398476566 до 4 знаков после запятой Truncate round не помощники, у меня это точно.
| ← назад | следующие → |