Re: [racket-users] Fwd: Us congress hearing of maan alsaan Money laundry قضية الكونغجرس لغسيل الأموال للمليادير معن الصانع

2016-02-03 Thread Mark Lee

To All,

This message has been chronically sent to the mailing list. Can we 
classify it as spam and unrelated to the Racket Language?


Regards,
Mark

On Wed, Feb 3, 2016 at 3:17 PM, Kasem A  wrote:




YouTube videos of

 U.S. Congress money laundering hearing

of

Saudi Billionaire  " Maan  Al sanea"
 with bank of America

and  The  owner of Saad Hospital and  Schools
 in the Eastern Province in Saudi Arabia

and the Chairman of the Board of Directors of Awal Bank  in Bahrain


With Arabic Subtitles


موقع اليوتيوب الذي عرض جلسة استماع 
الكونجرس الأمريكي

 لمتابعة نشاطات غسل الأموال ونشاطات

السعودي معن عبدالواحد الصانع

مالك مستشفى  وشركة سعد  ومدارس سعد 
بالمنطقة الشرقية بالسعودية   ورئيس 
مجلس ادارة بنك اوال البحريني


مترجم باللغة العربية

http://www.youtube.com/watch?v=mIBNnQvhU8s












































































--
You received this message because you are subscribed to the Google 
Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, 
send an email to racket-users+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Strange behavior when writing to a file

2015-06-03 Thread Mark Lee
On Tuesday, June 02, 2015 04:47:33 PM Matthew Flatt wrote:
> I think you wanted `(and (>=` in place of `(or (<`.

That did it, thanks a lot!
Mistake on my part when I wrote it, the string-length check was added 
afterwords so I used an or statement instead of an and.

Regards,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: This is a digitally signed message part.


[racket-users] Strange behavior when writing to a file

2015-06-02 Thread Mark Lee
To all,

I've been recently working on a database and I've encountered strange behavior
when I use "call-with-atomic-output-file" and "with-output-to-file". Attached
is a sample piece of code. The correct contents of the SOAP file should be :

*First-Name : John
*Last-Name : Doe
*Gender : male
*Phone-Number : 000-000-

Instead I get :

*First-Name : John
*Last-Name : Doe
*Phone-Number : 000-000-

In addition, If one uncomments the redirects to file, they get the correct
output (but it's not saved to a file):
*First-Name : John
*Last-Name : Doe
*Phone-Number : 000-000-

Regards,
Mark

database-test.rkt
Description: application/kdeuser1


signature.asc
Description: This is a digitally signed message part.


[racket-users] Source Code Level Flattener

2015-04-26 Thread Mark Lee
To All,

I recently encountered an issue while trying to demodularize my modules to 
create a single bytecode file. Apparently raco demod has issues with the 
racket gui code.

Hence, I've created a source code level demodularizer. It basically reads the 
require statements in the source code and imports them into a *-mega.rkt file. 
This file can be subsequently compiled with raco make <*-mega.rkt>.

The code can be found at :
https://github.com/bluerider/flattener

Regards,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: This is a digitally signed message part.


[racket-users] Re: raco demod : '"cannot instantiate `racket/gui/base' a second time in the same process"

2015-04-25 Thread Mark Lee
On Saturday, April 25, 2015 01:03:13 PM you wrote:
> On Saturday, April 25, 2015 01:39:54 AM you wrote:
> > On Saturday, April 25, 2015 01:34:59 AM you wrote:
> > > To all,
> > > 
> > > I have a project that I'm trying to compile to a single bytecode file
> > > via
> > > (raco demod). I compile a module .rkt file which requires several
> > > library
> > > module .rkt files. One of these module .rkt files is a windowing library
> > > that call on #lang racket/gui. (raco demod) manages to flatten and
> > > generate
> > > the bytecode but the bytecode fails to run with (racket). This is the
> > > error
> > > I get from (raco decompile).
> > > -
> > > 
> > > (#%apply-values
> > > 
> > >  _print-values4927
> > >  (if (_scheme_register_process_global10921
> > >  
> > >   '"GRacket-support-initialized"
> > >   (_cast8910 '1 _scheme _pointer))
> > >
> > >(error
> > >
> > > '"cannot instantiate `racket/gui/base' a second time in the same
> > > 
> > > process")
> > > 
> > >'#))
> > > 
> > > -
> > > The program runs fine when I compile it with (raco make) and (raco exe).
> > > In
> > > addition, the windowing library is only required once. What could be
> > > causing this error?
> > > 
> > > Regards,
> > > Mark
> > 
> > This error also repeats if I just (raco demod) the windowing library
> > itself.
> > 
> > Regards,
> > Mark
> 
> I tried a simple sample of GUI code and I get the same error:
> 
> -
> #lang racket/gui
> 
> (let ([window (new frame% [label "Test Window"]
>   [stretchable-width #t]
>   [stretchable-height #t])])
>   (new message% [label "testing"]
> [stretchable-height #t]
> [stretchable-width #t]
> [parent window])
>   (send window show #t))
> --
> 
> Regards,
> Mark

I tried a hello world program without calling any windowing but using #lang 
racket/gui. It seems the issue lies with raco demod and #lang racket/gui.

---
#lang racket/gui

(displayln "Hello World")
---

Regards,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: This is a digitally signed message part.


[racket-users] Re: raco demod : '"cannot instantiate `racket/gui/base' a second time in the same process"

2015-04-25 Thread Mark Lee
On Saturday, April 25, 2015 01:39:54 AM you wrote:
> On Saturday, April 25, 2015 01:34:59 AM you wrote:
> > To all,
> > 
> > I have a project that I'm trying to compile to a single bytecode file via
> > (raco demod). I compile a module .rkt file which requires several library
> > module .rkt files. One of these module .rkt files is a windowing library
> > that call on #lang racket/gui. (raco demod) manages to flatten and
> > generate
> > the bytecode but the bytecode fails to run with (racket). This is the
> > error
> > I get from (raco decompile).
> > -
> > 
> > (#%apply-values
> > 
> >  _print-values4927
> >  (if (_scheme_register_process_global10921
> >  
> >   '"GRacket-support-initialized"
> >   (_cast8910 '1 _scheme _pointer))
> >
> >(error
> >
> > '"cannot instantiate `racket/gui/base' a second time in the same
> > 
> > process")
> > 
> >'#))
> > 
> > -
> > The program runs fine when I compile it with (raco make) and (raco exe).
> > In
> > addition, the windowing library is only required once. What could be
> > causing this error?
> > 
> > Regards,
> > Mark
> 
> This error also repeats if I just (raco demod) the windowing library itself.
> 
> Regards,
> Mark

I tried a simple sample of GUI code and I get the same error:

-
#lang racket/gui

(let ([window (new frame% [label "Test Window"]
  [stretchable-width #t]
  [stretchable-height #t])])
  (new message% [label "testing"]
[stretchable-height #t]
[stretchable-width #t]
[parent window])
  (send window show #t))
--

Regards,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: This is a digitally signed message part.


[racket-users] Re: raco demod : '"cannot instantiate `racket/gui/base' a second time in the same process"

2015-04-24 Thread Mark Lee
On Saturday, April 25, 2015 01:34:59 AM you wrote:
> To all,
> 
> I have a project that I'm trying to compile to a single bytecode file via
> (raco demod). I compile a module .rkt file which requires several library
> module .rkt files. One of these module .rkt files is a windowing library
> that call on #lang racket/gui. (raco demod) manages to flatten and generate
> the bytecode but the bytecode fails to run with (racket). This is the error
> I get from (raco decompile).
> -
> (#%apply-values
>  _print-values4927
>  (if (_scheme_register_process_global10921
>   '"GRacket-support-initialized"
>   (_cast8910 '1 _scheme _pointer))
>(error
> '"cannot instantiate `racket/gui/base' a second time in the same
> process")
>'#))
> -
> The program runs fine when I compile it with (raco make) and (raco exe). In
> addition, the windowing library is only required once. What could be causing
> this error?
> 
> Regards,
> Mark

This error also repeats if I just (raco demod) the windowing library itself.

Regards,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: This is a digitally signed message part.


[racket-users] raco demod : '"cannot instantiate `racket/gui/base' a second time in the same process"

2015-04-24 Thread Mark Lee
To all,

I have a project that I'm trying to compile to a single bytecode file via 
(raco demod). I compile a module .rkt file which requires several library 
module .rkt files. One of these module .rkt files is a windowing library that 
call on #lang racket/gui. (raco demod) manages to flatten and generate the 
bytecode but the bytecode fails to run with (racket). This is the error I get 
from (raco decompile).
-
(#%apply-values
 _print-values4927
 (if (_scheme_register_process_global10921
  '"GRacket-support-initialized"
  (_cast8910 '1 _scheme _pointer))
   (error
'"cannot instantiate `racket/gui/base' a second time in the same 
process")
   '#))
-
The program runs fine when I compile it with (raco make) and (raco exe). In 
addition, the windowing library is only required once. What could be causing 
this error?

Regards,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: This is a digitally signed message part.


Re: [racket] Error propagation in `flexpt` [was: [racket-bug] all/14862: extflonum returns a different solution to flonum and mixed-integer calculations]

2014-12-02 Thread Mark Lee
On 12/01/2014 06:17 PM, Neil Toronto wrote:
> #lang racket
> 
> (require racket/extflonum
>  math/bigfloat)
> 
> (define phi.t 1.6180339887498948482t0)
> 
> (real->extfl (bigfloat->real (bfexpt (bf (extfl->exact phi.t))
>  (bf 1474
> (extflexpt phi.t 1474.0t0)

To Neil,

The evaluation of your code indicates they are the same. Interestingly,
when my extfloat fibonacci code outputs a different solution from the
wolfram alpha solution. Since I see differences in the mixed-integer and
double flonum implementation, I think this is probably due to precision
in calculating the golden ratio since I'm not using the built in phi.
Thanks a lot!

Regards,
Mark

---(extfl->exact-integer (fibonacci-binet-extfloat (->extfl 1474)))
49922546054777678469368960618385043003363699372091997320161178553101214384627692576770903082349499224676352191140704886034527523514622364369317165742944965314856341231163850547175249260301355158481926463722577824611277339602822853152374805000431249526771373929335749513493133245637066106005248388530836602880


  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Error propagation in `flexpt` [was: [racket-bug] all/14862: extflonum returns a different solution to flonum and mixed-integer calculations]

2014-12-02 Thread Mark Lee
On 12/01/2014 06:57 AM, Neil Toronto wrote:
> Moved discussion to the Racket Users mailing list.
> 
> This isn't an extflonum error. Your extflonum implementation of the
> fibonacci function is actually more accurate than your flonum
> implementation.
> 
> While floating-point operations are fairly accurate, they're not (and
> can't be) perfect implementations of real functions. Worse, any errors
> in their inputs may be magnified in their outputs' error, depending on
> the inputs' actual values.
> 
> In particular, even if `flexpt` is as accurate as possible (i.e. adding
> no error beyond rounding to the nearest float), it will magnify error
> quite a bit when its first or second argument has any error at all and
> its second argument is large.
> 
> In this case, you're exponentiating an *approximation* of the golden
> ratio, which has some error, by a large number. The extra precision in
> an extflonum makes up for it for the most part, so you get a different
> answer.
> 
> If you want to quantify the error in a floating-point function
> implementation, you can write a separate bigfloat implementation and use
> as much precision as you like. The default precision of 128 bits is fine
> in this case.
> 
> 
> #lang racket
> 
> (require math/flonum; for flround and stuff we'll need later
>  math/base  ; for phi.0
>  math/bigfloat)
> 
> (define (fibonacci-binet-float x)
>   (flround (fl* (flsqrt #i1/5) (flexpt phi.0 x
> 
> (define (fibonacci-binet-bigfloat x)
>   (bfround (bf* (bfsqrt (bf 1/5)) (bfexpt phi.bf x
> 
> 
> Here's what I get on your example input:
> 
> 
>> (fibonacci-binet-float 1474.0)
> 4.992254605478015e+307
> 
>> (bigfloat->flonum (fibonacci-binet-bigfloat (bf 1474)))
> 4.992254605477768e+307
> 
> 
> Checking it against the exact implementation:
> 
> 
>> (require math/number-theory)
>> (fl (fibonacci 1474))
> 4.992254605477768e+307
> 
> 
> There are a lot of solutions to this problem. One of my favorites is
> this one, which uses two floats to represent the golden ratio:
> 
> 
> (define-values (phi.hi phi.lo) (bigfloat->fl2 phi.bf))
> 
> (define (fibonacci-binet-float* x)
>   (flround (fl* (flsqrt #i1/5) (flexpt+ phi.hi phi.lo x
> 
> 
> (See also `make-flexpt`, which is implemented in terms of `flexpt+`.) On
> your example input, I get
> 
> 
>> (fibonacci-binet-float* 1474.0)
> 4.992254605477767e+307
> 
> 
> This is still one floating-point number away from the closest
> approximation, but that's about as close as you can get without
> computing all of it in higher precision.
> 
> One last thing: floats get incredibly sparse away from zero. In
> particular, 64-bit floats can exactly represent integers only up to
> 2^53. (Every float >= 2^53 is even, every float >= 2^54 is divisible by
> 4, and so on.) Practically, this means it's pretty much impossible for a
> floating-point Fibonacci implementation to be exact for inputs larger
> than 74, since (fibonacci 75) > 2^53.
> 
> For a lot more on how errors propagate through floating-point programs
> and what to do about it, you can read my article on it, which seems to
> still be freely available here:
> 
> 
> http://www.computer.org/cms/Computer.org/ComputingNow/issues/2014/10/mcs2014040080.pdf
> 
> 
> Neil ⊥
> 
> On 12/01/2014 12:24 AM, m...@markelee.com wrote:
>> A new problem report is waiting at
>>http://bugs.racket-lang.org/query/?cmd=view&pr=14862
>>
>> Reported by Mark Lee for release: 6.1.1
>>
>> *** Description:
>> When running my fibonacci solver, I find that my extfloat code returns
>> different numbers compared to my flonum code and mixed-integer code.
>>
>> *** How to repeat:
>> #lang racket
>>
>> ;; written by Mark Lee
>>
>> ;; require some modules
>> (require racket/flonum)
>> (require racket/extflonum)
>>
>> ;; requires SSE instructions, solve with long double precision
>> (define (fibonacci-extfloat extfl)
>> (if (extfl<= extfl 2.0t0)
>> 1.0t0
>> (extfl+ (fibonacci-extfloat (extfl- extfl 1.0t0))
>> (fibonacci-extfloat (extfl- extfl 2.0t0)
>>
>> (define (fibonacci-binet-extfloat extfl)
>> (extflround (extfl* (extfl/ 1.0t0 (extflsqrt 5.0t0))
>> (extflexpt (extfl/ (extfl+ 1.0t0 (extflsqrt 5.0t0))
>> 2.0t0) extfl
>>
>> ;; solve with double precision
>> (define (fibonacci-float fl)
>> (if (fl<= fl 2.0)
>> 1.0
>> (fl+ (fibo