Robert Cemper · Feb 19, 2018 go to post

what is this ?  a String or a JSON object ,  or a fixed sequence of (CN=  ,OU=,  DC=, DC= )
there is no obvious groupIng by a separator visible.
You may start by

set list=$lfs($p($p(input,"{",2),"}"))
zw list
list=$lb("CN=Access.Ensemble.Developer.User","OU=Access Groups","DC=OSUMC","DC=EDU"," CN=[CPD Admin]","OU=Distribution Lists","DC=OSUMC","DC=EDU"," CN=[MUSE_Access]","OU=Distribution Lists","DC=OSUMC","DC=EDU"," CN=[IT eMaterials]","OU=Distribution Lists","DC=OSUMC","DC=EDU...")

 

But instead of an unstructured string you have an unstructured list  

Robert Cemper · Feb 19, 2018 go to post

George, Gordon
Interesting info on Upgrade2016.1  This seems to by some fake news.
Since the class is there om 2017.2 and even in IRIS2018.1
http://docs.intersystems.com/iris20181/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25CSP.Stream

The Type set fails because %CSP.Stream is just an abstract class. 
Like %CSP.Page you have to create the real object yourself as %CSP.CharacterStream or %CSP.BinaryStream
 

a little bit simplified for retyping in terminal:

set req = ##class(%CSP.Request).%New()
set cont=req.Content zw cont   ; MO AUTOMATIC OBJECT BEAUSE ABSTRACT !!
cont=""
set cont=##class(%CSP.CharacterStream).%New()  zw cont  ; NOW WE HAVE AN OBJECT
cont=<OBJECT REFERENCE>[5@%CSP.CharacterStream]
+----------------- general information ---------------
|      oref value: 5
|      class name: %CSP.CharacterStream
| reference count: 2
+----------------- attribute values ------------------
|     (%Concurrency) = 1
|    (%LastModified) = ""
|          %Location = ""  <Get,Set>
|         (%LockRef) = ""
|          (%Locked) = 0
|              AtEnd = 0
|           (Buffer) = ""
|           (IOSize) = 0
|                 Id = ""
|     LineTerminator = $c(13,10)  <Set>
|        (MaxNodeNo) = 0
|             (Mode) = 0
|           (NodeNo) = 0
|         (Position) = 1
|        (StoreNode) = ""
|        (StoreRoot) = "^CacheStream"
|         (TempNode) = ""
+--------------- calculated references ---------------
|            CharSet   <Get,Set>
|        ContentType   <Get,Set>
|            Expires   <Get,Set>
|           FileName   <Get,Set>
|            Headers   <Get,Set>
|       LastModified   <Get>
|        MimeSection   <Get,Set>
|               Size   <Get>
|        (StoreGlvn)   <Get>
|         (TempGlvn)   <Get>
+-----------------------------------------------------
set cont.ContentType=
"application/json"

; and so on ....

HTH

Robert Cemper · Feb 19, 2018 go to post

Digging around working sets I found them unable to cover package  structures:
packages seem to be implemented as kind of sub-directory. 

You see the same effect in editor pane. The package is only visible in mouseOver event.
  

You only see the packages if you click the down arrow in right upper corner and "Edit Working Set".

For "TZ = TimeZone" I googled around Eclipse and opened a can of worms. With no answer.

Robert Cemper · Feb 17, 2018 go to post

try this

 set list=$lb("","2",6,6,6,"3")
   ​for i=1:1:$LL(list) { write !,$li(list,i),?5
      if $lb($li(list,i)) = $lb(+$li(list,i))  write "Integer"
      else  write "String"
   }

 Result:

     String
2    String
6    Integer
6    Integer
6    Integer
3    String 

Robert Cemper · Feb 17, 2018 go to post

This functionality seems to be broken. Since quite some time.
It also fails in SAMPLES /  Class ZENTest.ComboTest.cls and the method
is never called.
Analysis of   Class %ZEN.Component.
dataListBox  shows that the related call to method %DrawItem got lost.

I verified it with a personal hack. 

You may contact WRC for a fix.

Robert Cemper · Feb 16, 2018 go to post

if you just want to eliminate the hyphen this may work for you:

USER>write $TR($zcvt($tr("mY-sImPlE eXaMpLe","-"," "),"W")," ")
MySimpleExample


translate hyphen to blank  first and off you go  

Robert Cemper · Feb 16, 2018 go to post

provided you have sufficient access rights you may get defined roles in Caché / Ensbele like this:

 set role=""
 for   {
     set role=$ORDER(^|"%SYS"|SYS("Security","RolesD",role)) quit:role=""  
     write role,!    ;; or do whatever you need
     }
Robert Cemper · Feb 16, 2018 go to post

I probably don't understand your expectation.

You upload typically an image or something similar that the browser
can display as part of the article, questions, answer, comment you write.
And that works excellent.
If this is something else e.g. some binary stuff, or Word.doc or Excel it may fail.
What type of file would you expect to upload ?  

Robert Cemper · Feb 16, 2018 go to post

Ooops!

The sequence of recruiters seems to be reversed related to values
 

Gold Recruiter - 10 referrals

Awarded after 10 / 50 / 100 of your referrals have joined Developer Community.

Silver Recruiter - 50 referrals

Bronze Recruiter - 100 referrals

Robert Cemper · Feb 14, 2018 go to post

Oliver,

this turned out to be somewhat more tricky than expected.
The way you used stream.FindAt(...)  returns the size of the gap between the last found occurrence and the next.
So you have to add the size of your search string for each loop to get closer to your file size

so it might be easier to do it this way:

set last=1
for  set i=stream.FindAt(last,"Invalid password") quit:i<0  set last=i

this might be closer but definitely smaller than the total size  

Robert Cemper · Feb 14, 2018 go to post

it says:

If it does not find the target string then return -1

So what you get in i is the last start of your search string

              Which is 2491024949 - 2442920326 = 48104623 from end.
It's almost the same as your first occurrence at 49134354. Looks feasible.

To get the file size as you expect the LAST search string must have been  starting
AT 
the end of your file. Which is a contradiction.

Robert Cemper · Feb 14, 2018 go to post

your code: from Docs:

set i=stream.FindAt(-1,"Invalid password",x)+i

from Docs:
 

Find the first occurrence of target in the stream starting the search at position.
It returns the position at this match starting at the beginning of the stream.
If it does not find the target string then return -1.
If position=-1 then start searching from the current location and just return the offset from the last search,
useful for searching through the entire file.
If you are doing this you should pass in tmpstr by reference in every call which is used as
a temporary location to store information being read so the next call will start where the last one left off.
If you pass caseinsensitive=1 then the search will be case insensitive rather than the default case sensitive search.

 
So your line should work like this
while(stream.AtEnd=0){set i=stream.FindAt(-1,"Invalid password",.x)+i}
-----------------------------------------------------------------^
PASS BY REFERENCE should do the trick
Robert Cemper · Feb 13, 2018 go to post

Since the time when there was a Projection to C# I have adopted unique names.
It was an incredible pain if names were not unique.
 

Robert Cemper · Feb 12, 2018 go to post

Congratulations! yes
The call to server is only necessary if you provide some tricky calculations at server side

Robert Cemper · Feb 11, 2018 go to post

I have no issue with Angular or React.
But:
Leave Vue.js since vue in French is "seen"  and that means nothing in this environment . "dejà vue"

wink

Robert Cemper · Feb 9, 2018 go to post

small extension.

USER>write $TR($zcvt("mY sImPlE eXaMpLe", "W")," ")
MySimpleExample
Robert Cemper · Feb 9, 2018 go to post

Arun,
#1) the error <INVALID OREFF>  #2) goes away if you use Method BtnClickMe( ...)   instead of  ClassMethod BtnClickMe(....)

#2) setting title property turns out to be tricky since component DataCombo is a complex structure with multiple HTML elements
with multiple title properties.  The ZENmethod  setProperty() reaches only the first one.
Which is the Label (!) and if you didn't declare it in the ZEN class it is hidden and you will never see it.

As a consequence I found this code working:

<dataCombo 
    ......
    title=""  
    onmouseover="zenPage.BtnClick(event.currentTarget);
    />

event.currentTarget gives you the real browser component (<input...>) in hands

ClientMethod BtnClick(DTCOMBO) As %String [ Language = javascript ]
{
    var MyPriority=DTCOMBO.value;
    var result=zenPage.BtnClickMe(MyPriority);
        DTCOMBO.title=result ;
    return;
}

All settings of the page happen in client code. 

/// calculate content of title
/// actually a fake for testing
Method BtnClickMe(MyPriority) As %String [ ZenMethod ]
{
    set ^%Arun($i(^%Arun))=MyPriority
    quit MyPriority_"****"_^%Arun
}

Now as you do not depend on %page object now this could be a ClassMethod as well.

Robert Cemper · Feb 9, 2018 go to post

from last comment: 
https://www.sqlservercentral.com/Forums/Topic647815-145-1.aspx

Difference between varchar(max) and varchar(8000)
Varchar(8000) stores a maximum of 8000 characters. Varchar(max) stores a maximum of 2 147 483 647 characters. 
See Books Online, the page titled "char and varchar" for more info. 
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
 

so it can be marked as done.

Robert Cemper · Feb 9, 2018 go to post

did you consider that max could mean maximum allowed size   ?   while string max has no value.

Robert Cemper · Feb 9, 2018 go to post

#1) your subscript is just $i not $i(^%ARUNDTMP)  so we loose the full trace for multiple calls.
       but we have anyhow some trace.

#2) $isObject(%page)  = 0
      so there is NO object of your ZENpage available and access to %page.... must fail.

Hard to say why and where you loose %page
 

Robert Cemper · Feb 9, 2018 go to post

did you try ?

SET SQLQuery3 "{ call xxxx('aaaa') }"
SET tSC = ..Adapter.ExecuteProcedure(,,SQLQuery3)