Re: [Factor-talk] Factor As Scripting Language

2016-10-26 Thread Björn Lindqvist
A Factor version of the C function Beached is posting would be a nice
addition to the windows.privileges vocab.

2016-10-25 23:05 GMT+02:00 Doug Coleman :
> Take a look at basis/windows/privileges/privileges.factor and
> http://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights
>
> On Tue, Oct 25, 2016 at 1:49 PM Onorio Catenacci  wrote:
>>
>> This issue is that certain tasks require administrator privilege on
>> Windows and it's much more friendly to check the current user's
>> privileges and inform the user that he or she needs to elevate to
>> admin than simply fall over. :)
>>
>> Sadly before Windows 7 most users are on their machine as admins by
>> default (which is, truly, a large part of the reason that Windows was
>> such a fruitful hunting ground for people who liked to spread
>> trojans).  A lot of users still have admin privileges by default but a
>> few are smart enough to practice least-privilege.
>>
>> --
>> Onorio
>>
>> On Tue, Oct 25, 2016 at 4:35 PM, Alexander Ilin  wrote:
>> >
>> > 25.10.2016, 23:13, "Doug Coleman" :
>> >
>> > You should be able to call the Windows APIs directly (if you can figure
>> > out
>> > which ones!) and avoid using a script to call a binary.
>> >
>> >
>> > That's true. I'm simply having fun with that little task. Parsing the
>> > output
>> > and such.
>> > If I needed to solve that problem in a proper way, I would not mess with
>> > the
>> > whoami.exe, I'd look for WinAPI functions.
>> > I'm not familiar with those, so can't really help here.
>> >
>> > I have an issue with the formulation of the task, though. Why do we need
>> > to
>> > know if a user is an admin? Do we strictly want to check the
>> > Administrators
>> > group membership, or do we want to test for some specific access
>> > privileges?
>> > For instance, Power Users used to have some pretty big rights in their
>> > day,
>> > without being full admins.
>> > There is also the issue with elevation, which gives a user some rights
>> > without making him/her an admin.
>> >
>> >
>> > http://stackoverflow.com/questions/581204/how-do-i-check-if-a-user-has-local-admin-privileges-in-win32
>> >
>> > http://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights/8196291#8196291
>> > https://support.microsoft.com/en-us/kb/118626
>> >
>> > ---=---
>> > Александр
>> >
>> >
>> >
>> > --
>> > The Command Line: Reinvented for Modern Developers
>> > Did the resurgence of CLI tooling catch you by surprise?
>> > Reconnect with the command line and become more productive.
>> > Learn the new .NET and ASP.NET CLI. Get your free copy!
>> > http://sdm.link/telerik
>> > ___
>> > Factor-talk mailing list
>> > Factor-talk@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/factor-talk
>> >
>>
>>
>>
>> --
>> Onorio Catenacci
>>
>> http://onor.io
>> http://www.google.com/+OnorioCatenacci
>>
>>
>> --
>> The Command Line: Reinvented for Modern Developers
>> Did the resurgence of CLI tooling catch you by surprise?
>> Reconnect with the command line and become more productive.
>> Learn the new .NET and ASP.NET CLI. Get your free copy!
>> http://sdm.link/telerik
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
> --
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>



-- 
mvh/best regards Björn Lindqvist

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-25 Thread Alexander Ilin
25.10.2016, 23:49, "Onorio Catenacci" :This issue is that certain tasks require administrator privilege onWindows and it's much more friendly to check the current user'sprivileges and inform the user that he or she needs to elevate toadmin than simply fall over. :)Well, that would mean that the proper solution would be to check not for the Admin group membership, but for access to the specific resources (registry keys, files, etc.) that are required for the operation you are about to perform, am I right? ---=---Александр 

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-25 Thread Doug Coleman
Take a look at basis/windows/privileges/privileges.factor and
http://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights

On Tue, Oct 25, 2016 at 1:49 PM Onorio Catenacci  wrote:

> This issue is that certain tasks require administrator privilege on
> Windows and it's much more friendly to check the current user's
> privileges and inform the user that he or she needs to elevate to
> admin than simply fall over. :)
>
> Sadly before Windows 7 most users are on their machine as admins by
> default (which is, truly, a large part of the reason that Windows was
> such a fruitful hunting ground for people who liked to spread
> trojans).  A lot of users still have admin privileges by default but a
> few are smart enough to practice least-privilege.
>
> --
> Onorio
>
> On Tue, Oct 25, 2016 at 4:35 PM, Alexander Ilin  wrote:
> >
> > 25.10.2016, 23:13, "Doug Coleman" :
> >
> > You should be able to call the Windows APIs directly (if you can figure
> out
> > which ones!) and avoid using a script to call a binary.
> >
> >
> > That's true. I'm simply having fun with that little task. Parsing the
> output
> > and such.
> > If I needed to solve that problem in a proper way, I would not mess with
> the
> > whoami.exe, I'd look for WinAPI functions.
> > I'm not familiar with those, so can't really help here.
> >
> > I have an issue with the formulation of the task, though. Why do we need
> to
> > know if a user is an admin? Do we strictly want to check the
> Administrators
> > group membership, or do we want to test for some specific access
> privileges?
> > For instance, Power Users used to have some pretty big rights in their
> day,
> > without being full admins.
> > There is also the issue with elevation, which gives a user some rights
> > without making him/her an admin.
> >
> >
> http://stackoverflow.com/questions/581204/how-do-i-check-if-a-user-has-local-admin-privileges-in-win32
> >
> http://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights/8196291#8196291
> > https://support.microsoft.com/en-us/kb/118626
> >
> > ---=---
> > Александр
> >
> >
> >
> --
> > The Command Line: Reinvented for Modern Developers
> > Did the resurgence of CLI tooling catch you by surprise?
> > Reconnect with the command line and become more productive.
> > Learn the new .NET and ASP.NET CLI. Get your free copy!
> > http://sdm.link/telerik
> > ___
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
>
>
>
> --
> Onorio Catenacci
>
> http://onor.io
> http://www.google.com/+OnorioCatenacci
>
>
> --
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-25 Thread Onorio Catenacci
This issue is that certain tasks require administrator privilege on
Windows and it's much more friendly to check the current user's
privileges and inform the user that he or she needs to elevate to
admin than simply fall over. :)

Sadly before Windows 7 most users are on their machine as admins by
default (which is, truly, a large part of the reason that Windows was
such a fruitful hunting ground for people who liked to spread
trojans).  A lot of users still have admin privileges by default but a
few are smart enough to practice least-privilege.

--
Onorio

On Tue, Oct 25, 2016 at 4:35 PM, Alexander Ilin  wrote:
>
> 25.10.2016, 23:13, "Doug Coleman" :
>
> You should be able to call the Windows APIs directly (if you can figure out
> which ones!) and avoid using a script to call a binary.
>
>
> That's true. I'm simply having fun with that little task. Parsing the output
> and such.
> If I needed to solve that problem in a proper way, I would not mess with the
> whoami.exe, I'd look for WinAPI functions.
> I'm not familiar with those, so can't really help here.
>
> I have an issue with the formulation of the task, though. Why do we need to
> know if a user is an admin? Do we strictly want to check the Administrators
> group membership, or do we want to test for some specific access privileges?
> For instance, Power Users used to have some pretty big rights in their day,
> without being full admins.
> There is also the issue with elevation, which gives a user some rights
> without making him/her an admin.
>
> http://stackoverflow.com/questions/581204/how-do-i-check-if-a-user-has-local-admin-privileges-in-win32
> http://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights/8196291#8196291
> https://support.microsoft.com/en-us/kb/118626
>
> ---=---
> Александр
>
>
> --
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>



-- 
Onorio Catenacci

http://onor.io
http://www.google.com/+OnorioCatenacci

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-25 Thread Onorio Catenacci
Thanks Doug--that's sort of what I was hoping for.  Like you my issue
would be figuring out which API's to call.


On Tue, Oct 25, 2016 at 4:13 PM, Doug Coleman  wrote:
> You should be able to call the Windows APIs directly (if you can figure out
> which ones!) and avoid using a script to call a binary.
>
> On Tue, Oct 25, 2016 at 1:02 PM Alexander Ilin  wrote:
>>
>> The same, but a bit more elaborate (and hopefully more readable):
>>
>> USING: documents.private io io.encodings.utf8 io.launcher kernel
>> math sequences sets splitting ;
>> IN: other
>>
>> ! Find the header line in the sequence and return it with its number.
>> : find-header ( lines -- num/f line/f )
>> [ members "= " = ] find ;
>>
>> ! Convert header line to column widths: "=== == =" -> { 3 2 1 }.
>> : column-widths ( line -- seq )
>> [ CHAR: space = ] split-when harvest [ length ] map ;
>>
>> : table-contents ( lines header-line-num -- lines' )
>> 1 + tail harvest ;
>>
>> : first-column ( lines column-widths -- lines' )
>> first [ head [ CHAR: space = ] trim ] curry map ;
>>
>> : user-groups ( -- seq/f )
>> "whoami /groups" utf8 [ contents ] with-process-reader split-lines
>> dup find-header
>> [
>> [ table-contents ] dip column-widths first-column
>> ] [ 2drop f ] if* ;
>>
>> 25.10.2016, 00:51, "Alexander Ilin" :
>>
>> Here's a small utility for you:
>>
>> USING: io.launcher io.encodings.utf8 sequences sets documents.private ;
>> : user-groups ( -- seq/f )
>> "whoami /groups" utf8 [ contents ] with-process-reader split-lines
>> dup [ members "= " = ] find
>> [
>> [ 1 + tail ] dip
>> [ CHAR: space = ] find drop
>> [ harvest ] dip
>> [ head [ CHAR: space = ] trim ] curry map
>> ] [ 2drop f ] if* ;
>>
>>
>> Usage:
>>
>> "Administrators" user-groups in?
>> -> `t`
>>
>> ---=---
>> Александр
>>
>>
>> ,
>>
>>
>> --
>> The Command Line: Reinvented for Modern Developers
>> Did the resurgence of CLI tooling catch you by surprise?
>> Reconnect with the command line and become more productive.
>> Learn the new .NET and ASP.NET CLI. Get your free copy!
>> http://sdm.link/telerik
>>
>> ,
>>
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>>
>>
>> ---=---
>> Александр
>>
>>
>> --
>> The Command Line: Reinvented for Modern Developers
>> Did the resurgence of CLI tooling catch you by surprise?
>> Reconnect with the command line and become more productive.
>> Learn the new .NET and ASP.NET CLI. Get your free copy!
>> http://sdm.link/telerik___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
> --
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>



-- 
Onorio Catenacci

http://onor.io
http://www.google.com/+OnorioCatenacci

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-25 Thread Alexander Ilin
 25.10.2016, 23:13, "Doug Coleman" :You should be able to call the Windows APIs directly (if you can figure out which ones!) and avoid using a script to call a binary. That's true. I'm simply having fun with that little task. Parsing the output and such.If I needed to solve that problem in a proper way, I would not mess with the whoami.exe, I'd look for WinAPI functions.I'm not familiar with those, so can't really help here. I have an issue with the formulation of the task, though. Why do we need to know if a user is an admin? Do we strictly want to check the Administrators group membership, or do we want to test for some specific access privileges? For instance, Power Users used to have some pretty big rights in their day, without being full admins.There is also the issue with elevation, which gives a user some rights without making him/her an admin. http://stackoverflow.com/questions/581204/how-do-i-check-if-a-user-has-local-admin-privileges-in-win32http://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights/8196291#8196291https://support.microsoft.com/en-us/kb/118626 ---=---Александр --
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-25 Thread Doug Coleman
You should be able to call the Windows APIs directly (if you can figure out
which ones!) and avoid using a script to call a binary.

On Tue, Oct 25, 2016 at 1:02 PM Alexander Ilin  wrote:

> The same, but a bit more elaborate (and hopefully more readable):
>
> USING: documents.private io io.encodings.utf8 io.launcher kernel
> math sequences sets splitting ;
> IN: other
>
> ! Find the header line in the sequence and return it with its number.
> : find-header ( lines -- num/f line/f )
> [ members "= " = ] find ;
>
> ! Convert header line to column widths: "=== == =" -> { 3 2 1 }.
> : column-widths ( line -- seq )
> [ CHAR: space = ] split-when harvest [ length ] map ;
>
> : table-contents ( lines header-line-num -- lines' )
> 1 + tail harvest ;
>
> : first-column ( lines column-widths -- lines' )
> first [ head [ CHAR: space = ] trim ] curry map ;
>
> : user-groups ( -- seq/f )
> "whoami /groups" utf8 [ contents ] with-process-reader split-lines
> dup find-header
> [
> [ table-contents ] dip column-widths first-column
> ] [ 2drop f ] if* ;
>
> 25.10.2016, 00:51, "Alexander Ilin" :
>
> Here's a small utility for you:
>
> USING: io.launcher io.encodings.utf8 sequences sets documents.private ;
> : user-groups ( -- seq/f )
> "whoami /groups" utf8 [ contents ] with-process-reader split-lines
> dup [ members "= " = ] find
> [
> [ 1 + tail ] dip
> [ CHAR: space = ] find drop
> [ harvest ] dip
> [ head [ CHAR: space = ] trim ] curry map
> ] [ 2drop f ] if* ;
>
>
> Usage:
>
> "Administrators" user-groups in?
> -> `t`
>
> ---=---
> Александр
>
>
> ,
>
>
> --
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik
>
> ,
>
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
>
> ---=---
> Александр
>
>
> --
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-25 Thread Alexander Ilin
The same, but a bit more elaborate (and hopefully more readable): USING: documents.private io io.encodings.utf8 io.launcher kernelmath sequences sets splitting ;IN: other ! Find the header line in the sequence and return it with its number.: find-header ( lines -- num/f line/f )    [ members "= " = ] find ; ! Convert header line to column widths: "=== == =" -> { 3 2 1 }.: column-widths ( line -- seq )    [ CHAR: space = ] split-when harvest [ length ] map ; : table-contents ( lines header-line-num -- lines' )    1 + tail harvest ; : first-column ( lines column-widths -- lines' )    first [ head [ CHAR: space = ] trim ] curry map ; : user-groups ( -- seq/f )    "whoami /groups" utf8 [ contents ] with-process-reader split-lines    dup find-header    [    [ table-contents ] dip column-widths first-column    ] [ 2drop f ] if* ; 25.10.2016, 00:51, "Alexander Ilin" :Here's a small utility for you: USING: io.launcher io.encodings.utf8 sequences sets documents.private ;: user-groups ( -- seq/f )    "whoami /groups" utf8 [ contents ] with-process-reader split-lines    dup [ members "= " = ] find    [    [ 1 + tail ] dip    [ CHAR: space = ] find drop    [ harvest ] dip    [ head [ CHAR: space = ] trim ] curry map    ] [ 2drop f ] if* ; Usage: "Administrators" user-groups in?-> `t` ---=---Александр ,--The Command Line: Reinvented for Modern DevelopersDid the resurgence of CLI tooling catch you by surprise?Reconnect with the command line and become more productive.Learn the new .NET and ASP.NET CLI. Get your free copy!http://sdm.link/telerik,___Factor-talk mailing listFactor-talk@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/factor-talk  ---=---Александр --
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread Alexander Ilin
Here's a small utility for you: USING: io.launcher io.encodings.utf8 sequences sets documents.private ;: user-groups ( -- seq/f )    "whoami /groups" utf8 [ contents ] with-process-reader split-lines    dup [ members "= " = ] find    [    [ 1 + tail ] dip    [ CHAR: space = ] find drop    [ harvest ] dip    [ head [ CHAR: space = ] trim ] curry map    ] [ 2drop f ] if* ; Usage: "Administrators" user-groups in?-> `t` ---=---Александр 

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread Onorio Catenacci
Ok, thanks for the clarification folks.  I guess I should have assumed
anything other than f would be true. :)

I'm a member of IEEE--mainly for the articles. :)




> Yeah, Factor is pretty cool, I agree. : )
>
> I see you are with IEEE. That's cool, too : )
>



-- 
Onorio Catenacci

http://onor.io
http://www.google.com/+OnorioCatenacci

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread Alexander Ilin
24.10.2016, 19:08, "Onorio Catenacci" :Oh--ok. So I could tack on a "0 >" (minus the quotes of course) atthe end and that'd work out. In fact that's exactly what I want. :)Nope, `f 0 >` would throw an exception.You could use `>boolean` if you want strictly a `t` or `f` return value.`f >boolean` -> `f``641 >boolean` -> `t` Alternatively, if you turn my code into a function word, you'd subsequently check its result with an `if` or `when` or whatever. In that case the integer return value would work exactly as the `t` value, no conversion necessary.Yes, you can automate data entry into a website with Selenium.They've got bindings for C#, Java, Python and a few other languages.I was hoping that maybe someone had started an FFI for Factor becauseI'm really digging what I see in Factor so far. :)Yeah, Factor is pretty cool, I agree. : ) I see you are with IEEE. That's cool, too : ) ---=---Александр --
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread John Benediktsson
You shouldn't need to "0 >" because 641 is considered a "non false" value.


On Mon, Oct 24, 2016 at 9:07 AM, Onorio Catenacci 
wrote:

> Oh--ok.  So I could tack on a "0 >" (minus the quotes of course) at
> the end and that'd work out.  In fact that's exactly what I want. :)
>
> Yes, you can automate data entry into a website with Selenium.
> They've got bindings for C#, Java, Python and a few other languages.
> I was hoping that maybe someone had started an FFI for Factor because
> I'm really digging what I see in Factor so far. :)
>
> --
> Onorio
>
> On Mon, Oct 24, 2016 at 11:46 AM, Alexander Ilin  wrote:
> > Hi!
> >
> > 24.10.2016, 18:27, "Onorio Catenacci" :
> >
> > Thanks for the suggestion Александр! Oddly enough when I enter that
> > string into the Repl on Windows 7 I get 641. I tried breaking up the
> > command sequence over two lines (breaking at the ";") and the result
> > is the same.
> >
> > The entire output of "whoami /groups" (taken as one string) is searched
> for
> > the substring "Administrators".
> > 641 is the index of the start of that substring for you.
> > For me it returns `f`, because I'm not an admin on my system.
> > Basically, anything other than `f` is the "true" return value, as per
> Factor
> > convention.
> > The script returns the answer to the question: "Am I an admin?"
> >
> > It's not 100% bulletproof, I just came up with it in 5 minutes. YMMV.
> But it
> > should work for typical English-language Windows.
> >
> > In case anyone else is unfamiliar with Selenium:
> > http://docs.seleniumhq.org/ Selenium is basically a tool for driving
> > a browser in an automated fashion. I use Selenium to enable automated
> > regression testing of our web apps.
> >
> >
> > I have a web app with horrid UI, which I'm forced to use at work for time
> > reporting (Personec, for those who know).
> > I'm looking for a way to customize it to allow more friendly, possibly
> even
> > automated data entry.
> > Could Selenium help me?
> >
> > ---=---
> > Александр
> >
> >
> > 
> --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > ___
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
>
>
>
> --
> Onorio Catenacci
>
> http://onor.io
> http://www.google.com/+OnorioCatenacci
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread Onorio Catenacci
Oh--ok.  So I could tack on a "0 >" (minus the quotes of course) at
the end and that'd work out.  In fact that's exactly what I want. :)

Yes, you can automate data entry into a website with Selenium.
They've got bindings for C#, Java, Python and a few other languages.
I was hoping that maybe someone had started an FFI for Factor because
I'm really digging what I see in Factor so far. :)

--
Onorio

On Mon, Oct 24, 2016 at 11:46 AM, Alexander Ilin  wrote:
> Hi!
>
> 24.10.2016, 18:27, "Onorio Catenacci" :
>
> Thanks for the suggestion Александр! Oddly enough when I enter that
> string into the Repl on Windows 7 I get 641. I tried breaking up the
> command sequence over two lines (breaking at the ";") and the result
> is the same.
>
> The entire output of "whoami /groups" (taken as one string) is searched for
> the substring "Administrators".
> 641 is the index of the start of that substring for you.
> For me it returns `f`, because I'm not an admin on my system.
> Basically, anything other than `f` is the "true" return value, as per Factor
> convention.
> The script returns the answer to the question: "Am I an admin?"
>
> It's not 100% bulletproof, I just came up with it in 5 minutes. YMMV. But it
> should work for typical English-language Windows.
>
> In case anyone else is unfamiliar with Selenium:
> http://docs.seleniumhq.org/ Selenium is basically a tool for driving
> a browser in an automated fashion. I use Selenium to enable automated
> regression testing of our web apps.
>
>
> I have a web app with horrid UI, which I'm forced to use at work for time
> reporting (Personec, for those who know).
> I'm looking for a way to customize it to allow more friendly, possibly even
> automated data entry.
> Could Selenium help me?
>
> ---=---
> Александр
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>



-- 
Onorio Catenacci

http://onor.io
http://www.google.com/+OnorioCatenacci

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread Alexander Ilin
Hi! 24.10.2016, 18:27, "Onorio Catenacci" :Thanks for the suggestion Александр! Oddly enough when I enter thatstring into the Repl on Windows 7 I get 641. I tried breaking up thecommand sequence over two lines (breaking at the ";") and the resultis the same.The entire output of "whoami /groups" (taken as one string) is searched for the substring "Administrators".641 is the index of the start of that substring for you.For me it returns `f`, because I'm not an admin on my system.Basically, anything other than `f` is the "true" return value, as per Factor convention.The script returns the answer to the question: "Am I an admin?" It's not 100% bulletproof, I just came up with it in 5 minutes. YMMV. But it should work for typical English-language Windows.In case anyone else is unfamiliar with Selenium:http://docs.seleniumhq.org/ Selenium is basically a tool for drivinga browser in an automated fashion. I use Selenium to enable automatedregression testing of our web apps.I have a web app with horrid UI, which I'm forced to use at work for time reporting (Personec, for those who know).I'm looking for a way to customize it to allow more friendly, possibly even automated data entry.Could Selenium help me? ---=---Александр --
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread Onorio Catenacci
Thanks for the suggestion Александр!  Oddly enough when I enter that
string into the Repl on Windows 7 I get 641.  I tried breaking up the
command sequence over two lines (breaking at the ";") and the result
is the same. The version of the Repl is:

Factor 0.98 x86.64 (1788, heads/master-e187d63d3c, Tue Oct 18 02:14:22 2016)
[Microsoft Visual C++ 190023506] on windows

In case anyone else is unfamiliar with Selenium:
http://docs.seleniumhq.org/  Selenium is basically a tool for driving
a browser in an automated fashion.  I use Selenium to enable automated
regression testing of our web apps.

On Mon, Oct 24, 2016 at 11:09 AM, Alexander Ilin  wrote:
> Hi!
>
> 24.10.2016, 16:38, "Onorio Catenacci" :
>
> I want to be able to verify that the currently logged-in user has
> admin permissions. Any pointers to blog postings or vocabularies I
> may want to look at?
>
>
> This will tell you if the current user is a member of the Administrators
> group:
>
> USING: io.launcher io.encodings.utf8 sequences ; "Administrators" "whoami
> /groups" utf8 [ contents ] with-process-reader start
>
> If result is `f`, then the word "Administrators" was not found in the
> output. If result is a number, then it was.
>
>
> I am also interested in driving automated tests against websites. I
> didn't see anything but has anyone done any work on an FFI with the
> Selenium WebDrivers?
>
> Never heard of it.
>
> ---=---
> Александр
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>



-- 
Onorio Catenacci

http://onor.io
http://www.google.com/+OnorioCatenacci

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Factor As Scripting Language

2016-10-24 Thread Alexander Ilin
Hi! 24.10.2016, 16:38, "Onorio Catenacci" :I want to be able to verify that the currently logged-in user hasadmin permissions. Any pointers to blog postings or vocabularies Imay want to look at? This will tell you if the current user is a member of the Administrators group: USING: io.launcher io.encodings.utf8 sequences ; "Administrators" "whoami /groups" utf8 [ contents ] with-process-reader start If result is `f`, then the word "Administrators" was not found in the output. If result is a number, then it was. I am also interested in driving automated tests against websites. Ididn't see anything but has anyone done any work on an FFI with theSelenium WebDrivers?Never heard of it. ---=---Александр --
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Factor As Scripting Language

2016-10-24 Thread Onorio Catenacci
Hi all,

Apologies for the broad questions but so far my Google-Fu has been
less than effective. I want to use Factor as a scripting language for
Windows.

I want to be able to verify that the currently logged-in user has
admin permissions.  Any pointers to blog postings or vocabularies I
may want to look at?

I am also interested in driving automated tests against websites.  I
didn't see anything but has anyone done any work on an FFI with the
Selenium WebDrivers?

-- 
Onorio Catenacci

http://onor.io
http://www.google.com/+OnorioCatenacci

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk