Search

Clear filter
Question
Tiago Ribeiro · Feb 25, 2016

Better Unit Testing Strategies for InterSystems Caché Development

Good morning people.The use of TDD is currently being reference for software delivery more confiabilitade and quality.At the company I work developing web applications , we create tests for method class in a deteminado package and running the steps that the documentation recommends:1 export the tests classes to a predefined folder.2- And running the test ( D ## class (% UnitTest.Manager ) .RunTest (,"/nodelete" )It is a lot of work to do the export and run these tests would have a resource that we could only run the tests without the need for export ? You may call RunTest with /noload parameter, but you still have to set a valid directory as a value in ^UnitTestRoot Set ^UnitTestRoot = "C:\UnitTests" Do ##class(%UnitTest.Manager).RunTest("mytests:MyPackage.Tests", "/noload/nodelete") Or so, here you can specify: suit, class and method if you want Do ##class(%UnitTest.Manager).DebugRunTestCase("mytests","MyPackage.Tests","","") This call does not load any classes from any directories nor does it delete any classes from Caché. And executes the tests contained in MyPackage.Tests. The optional third argument is for specifying an individual test method within the test class to execute. Dmitry, Thanks. Different people are going to have different workflows for unit testing, but I would encourage you to settle on a way to get those tests out of the database. I'd be nervous about running tests in a namespace that contains my only copy, since %UnitTest is designed to load and delete by default. If you're using Studio with the source control hooks, it works pretty well to write the tests in a development namespace, then run them in a test namespace. Hi, Jon.Yes, I here use different developer namespace, one for testings.I will go about hooks of control sources, Thanks. Indeed. Presumably the "load and delete" defaults were a design decision based on the model of running unit tests elsewhere. That seems relevant for a build server, but not so friendly for the developer who you're trying to persuade to code the tests in the first place. Yes, Studio the source control hook facility can be your friend here provided you're prepared to spend enough time getting intimate with it.
Announcement
Evgeny Shvarov · Feb 23, 2016

InterSystems Global Summit 2016 MVP Contest Update!

Hi, Community! There are only six days left to win InterSystems Developer Community MVP prize. As it was announced in addition to Free Registration on InterSystems Global Summit winner gets 4 nights stay in the Arizona Baltimore, Waldorf Astoria Resort. We measure contribution to Developer Community on valuable posts and comments and prepared special leaderboard built on InterSystems DeepSee. By default, it shows all the members. We added the filter to the dashboard to show leaderboard without members who are InterSystems employees. So here is current leaderboard without InterSystems members: Win MVP and come to InterSystems Global Summit 2016! Go Dmitry! I would add "Go Scott!" If you change filters to February scope there is following picture for top 20:Where are your new cruel questions? ) I've been very sick the last week :( The original post talked about accounting for "number of votes a post received". How is this reflected in these numbers? We have a formula which summarize votes for posts, votes for comments.It also gives some score for comments in your post.It counts points also for your comments in other posts - e.g. for your answer on the question. Oh. Hope you are doing well now.
Announcement
Janine Perkins · Mar 22, 2016

Featured InterSystems Online Course: Caché Objects Introduction

Learn the basics about Caché objects.Caché Objects IntroductionThis course provides an overview of Caché classes, methods, and interaction with the Caché database by creating, saving, loading and deleting objects. Learn More.
Announcement
Janine Perkins · May 10, 2016

Featured InterSystems Online Course: Navigating the Management Portal

Learn the different ways to navigate the management portal.Navigating the Management PortalThis course describes how to start the Management Portal, explains the different sections of the home page and shows several ways to navigate to other pages. Learn how to start the Management Portal on your client system, identify the sections of the Management Portal home page, recall how to add a page to the Favorites and navigate the Management Portal using links and keywords.Learn More.
Article
Evgeny Shvarov · May 11, 2016

The simplest snippet to read from file in InterSystems IRIS

Hi! I believe the simplest is (to work with csv delimited by ";"): set file = ##class(%File).%New( "data.csv" ) set sc = file.Open( "R" ) if $$$ISERR(sc) quit ; or do smth while 'file.AtEnd { set str=file.ReadLine() for i=1:1:$length( str, ";" ) { set id=$piece( str, ";" ,i ) write !, id // or do smth } } do file.Close() Possible options: different variants of error handling with sc code. Embrace while loop into try/catch block. And what's yours? Ok, here is the "simplest"N IO,D,P,I,A,X,L S IO=$I R D U 0 W !,D,! S P="^" F U IO R A Q:A="" I $P(A,P,3) S L=$P(A,P,5) S:L X=$ZU(55,L) ZL ZS @$P(A,P) S:L X=$ZU(55,0) U 0 W !,$P(A,P,1,2),?20," loaded" ;(Self-loading) (Well, I'm joking - this is the standard preamble for self-loading INT file) This is MUMPS-Enigma code) I would generally advise against using %File class for reading files as this is a very low level wrapper around the COS file commands. For example if you want to apply a translate table you need to know about the 'K' flag on the open command. I much prefer using the %Stream.FileBinary or %Stream.FileCharacter classes as these provide a much more consistent interface to the file. Evgeny,Thank you for sharing this snippet.However, I don't understand why you de-piece a line with a delimiter of ";"?I would just like to see the line like it is.What am I missing here? You have missed the extension of file "data.csv" used in the example. CSV stands for "Comma Separated Values", which is simplest way to exportt Excel like data to the textual file. And in this case it was apparently exported in the Russian-loale where "comma" is ";" actually. Yes) Timur already answered. This snippet is not very general "read from file" snippet - but snippet to parse "russian-like" csvs) But every time when I work with text files line by line I use it. Thank you for that clarification, but, should that be part of the opening documentation? Didn't get it. You mean I should change the description for the snippet?Or to change the snippet to make it less "csv" specific? Just get rid of your inner for loop and you have a generic snippet that is helpful for everybody. The description doesn't speak of CSV files at all, though that may be an interesting use case as well. For CSV files, you can use the Record Mapper by the way:http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=EGDV_recmap Sorry, I am not criticizing what you have done.I had to ask why you de-pieced the line based on ";"and I was given an answer.Suppose I did not ask, took your snippet and assumed to worked for all files?All I am saying is the assumption you used (Russian style files) should be part of your documentation so someone not familiar with these style of files would know. Any (unfamiliar) assumptions should be documented. Agreed. Will fix it. Anyway, you are very welcome to add your version of the simplest ever file management snippet ;) Stefan,Thanks for the tip on the Record Mapper, great stuff! Oh, thanks for this! I think it worth to make a separate snippet posting how to use the record mapper. Haven't found it in the documentation. And since Yesterday here is new fashion way to make links to documentation ;) maybe enigmic,but i think it's very convient and good-short! it's like my native tatarian tongue))))))
Announcement
Paul Gomez · May 11, 2016

Announcing New InterSystems Product Documentation UI (beta)

We have put a new modern and responsive UI design on top of our existing product documentation. It is available in a public beta here: http://docs.intersystems.com/beta/csp/docbook/DocBook.UI.FramePage.clsPlease review the new design and give us your feedback.Note: the Class Reference UI has not been updated and all product documentation content is the same as what's in production now. This looks much better. What about class reference? Looks nice! A few things to consider:- On MacOs Safari header text is white on white background- On small (mobile) screens there is a huge 230px right padding in .book class, page looks much better without it- On small screens, it's better to hide left menu by default and let user expand it with menu button, like https://material.angularjs.org does. Also it should overlap or shift main text, otherwise both are unreadable. On the initial page displayed if you click on any of the links such as the Improved SQL Processing Performance item it takes you to a link which eventually times out, looks like these are missing the 'beta' as the first part of their url: http://docs.intersystems.com/csp/docbook/DocBook.UI.FramePage.cls?KEY=GCRN_rn1601#GCRN_rn1601_sql_performance Thank you. Last minute decision to deploy to docs.intersystems.com/beta vs. a completely different alias throws off those references which need to be relative to the root. We'll fix this on that landing page. Class reference styling will come soon, pending some debate on the usefulness and functionality of the class reference itself. Thanks for the feedback. I didn't see the large right padding on the iPhone or an Android tablet but maybe something changed. We'll check that out and the other comments. I didn't actually test it on a phone/tablet, just resized browser window. Maybe it's OK on mobile devices. Paul,First of all, thank you, it seems you have taken on a huge project here, I commend you for it.Now, two questions,1) Does it handle multiple searches like Google does. When I separate several words by a comma? And the comma indicating an "And" condition. ie: if I want to search for Cache AND Loops with search "Cache, Loops"2) When getting search results, would it be possible to put the results in a new Tab in explorer?Again, thank you. Thanks for posting this. I shall try and remember to use the link routinely for my exploration of the docs, as a way of testing the beta. Please don't remove class reference. We recognize there's a need for a class reference, so don't worry, it's not going away. The question is about functionality and completeness of the current class reference utility so there may be some refactoring in addition to changing the UI skin. There's some internal discussion about how it works and the way the information there is obtained. They'll be more on this in the next few weeks. can you introduce cookies (or something similar) to allow you to totally disregard any results in certain areas.for instance, I'm a small developer and so I do not use Ensemble, DeepSee, Iknow and so on.also if you are on window, prehaps you could filter out VMS, Unix etcnarrowing down searches fasst is often the clue to finding what you are really searching for.perhaps a filter with a series of tickboxes (defaults to everything)kevin Many times I need to get some link from documentation, to show particular part to someone. And some time it is quite difficult to get such link, and the worst place in Class References, where I can't get good link for a particular part of class.So, what I need is, an active icon with link, which then I can use, and for Class reference too.As an example github. Thanks for the feedback. Yes, we will add filtering capabilities to narrow your results. One aspect that has been lost in the transition is to have the Search Dialog always on the page. If you go to this page as an example http://docs.intersystems.com/beta/csp/docbook/DocBook.UI.FramePage.cls?KEY=D2IMP_ch_dashboards#D2IMP_dashboard_embed in order to initiate a new search it appears I have toSelect this back button on the top left hand corner Scroll the left hand side menu, list of books to the very topPlace my cursor in the search field and enter a new search term.Whereas in the old system I could Press the [Home] key to be taken to the topEnter a new search term. I would vote to make the search box visible at all times. Just checking as I still see Technical Articles I assume if you add content to DOCBOOK this additional content will still be part of this new UI? Completely agree, and one of the first shortcomings I noticed. Search bar should ALWAYS be an option an any page, at any time. Yep, that's the first thing I noticed as well. I often go from one search to another and do not want to step back to the start each time. Search is probably the most important facility for me. (Thanks to interSystems for opening it up for comment, by the way.) Great idea. (I find SharePoint frustrating. All I want is a simple link to a folder in a library, but it's really hard to get.) Browsing (top-level) tree-view of topics is not possible when you've drilled into a section.Browse in left pane to a book and section to view. Clicking into that section brings you to the doc page, however it also restricts the tree-view in the left pane only to the current book. To further browse all docs, you need to go 'back' (which removes the doc you've been viewing!).I'd want the possibility to browse in the left pane to a new section without losing my view of the actual page in docs in the right pane. Often it is helpful to keep the view of the actual doc page while browsing to your next (related) topic. Thanks for the feedback. I'll see if we can do some kind of "copy link" icon at the book/section level to make it easier to reference a particular section of the content. Yes, this is using the same DOCBOOK content. We just put a different UI on top of it. Interesting observation, thanks. So if the user is looking at the contents of a book, but in the left pane chooses Back, leave that book content visible until they choose something else? It seems in page anchor links are broken. For example on the CSP Web Gateway Management Page: http://docs.intersystems.com/beta/csp/docbook/DocBook.UI.FramePage.cls?KEY=GCGI_oper_configIn the secion "Event Log Level" there is a link to "Event Logging Parameters" (which would go to: http://docs.intersystems.com/beta/csp/docbook/DocBook.UI.FramePage.cls?KEY=GCGI_oper_config#GCGI_config_parms_system_event However, that only takes you to the beginning of the page and not to the actual section (in the same page). Yes, exactly. Thanks.Preferably there is some smooth way of backtracing these bread crumb trails that are maintained in that left pane. Can the back button smoothly transition back to the higher level tree-view? Essentially as I drill down the high level view of the documentation books, can each section and subsection be displayed while leaving the highest level of books still within browsable view? I don't see why this concept of a 'book' needs to be restrictive against transparently browsing multiple topics among multiple books. Regarding the 'Search' functionality:1) Special symbols such as $ now are searchable (without specifically adding quotes) -- excellent, great improvement!!2) Searching WITH quotes fails to perform same search:Due to above, searching both $d and $data (without quotes) works correctly. Now notice the failure of the same search with quotes: "$d" (no $data results at all) and "$data" (appropriate result 17 items down).3) When the search query contains quotes, the summary at the top of the page fails to decode the special characters ("). For example searching "$data" will display at head of result page:Matches in text: 1 - 20 of 76 for "$data". (.00029s) 4) Following a link from the Search Results page doesn't allow for respecting the in-page 'Back' button. It's unclear if this is the intended use of 'Back'. By landing on a doc from search, using the 'Back' button does not return the user to the previously used page (the search results), but instead goes to a higher level in tree-view. The version of the documentation should be clearly displayed as there are differences between the respective versions (and not just in appearance). The ordering of the sidebar is confusing to the point that I find it distracting. I think its absolutely essential to be able to use similar syntax to google etc.example the use of minusSearchWord or phrase.it's just become so natural to start excluding words when you see topics within the results that are irrelevent.so I want to be search for able torest -deepsee -csp Given that you guys have opened the hood, while not specifically a DOCBOOK request, I would like to see https://www.chromium.org/tab-to-search be supported for DOCBBOOK content. As an example I'd like to when using Google Chrome be able to type docs.intersystems.com [tab] {SearchTerm} and have the page respond with a list of results based on {SearchTerm}I understand there may be issues with what version of DOCBOOK to show but it might be useful to just show results from the latest version. Just to clarify for people. We are not working to enhance DOCBOOK searching. You can use Google search today.. right now.. on our current documentation set via the community. This is an attempt to modernize the layout and look of what DOCBOOK presents once you have clicked a search result and displayed what you get. It's is not good idea, not all time and not everywhere I have an access to google, but I have an access to my installation, and I have to search on my local machine. And such search should be support browser's search engines. And then I could do something like this.with settingsBut Ensemble documentation, should provide their own search engine to install in my browser without any manual operations. As it possible to do with AddSearchProvider Nice UI, but improve the searches is a very good idea In browsers Chrome and Vivaldi you can add the new documentation as search engine:Open settings - search - add new search engineThe URL you need is: http://docs.intersystems.com/beta/csp/docbook/DocBook.UI.SearchPageZen.cls?KeyWord=%sOnce you have done this you will be able to run docbook search from the searchbox in the upper right of your browser.
Announcement
Janine Perkins · May 27, 2016

Featured InterSystems Online Course: Learn Caché for Developers

Find out about the various ways you can learn Caché. Check out the Learn Caché for Developers Resource Guide to access online courses, classroom courses, videos and tutorials. Learn More.
Question
Jan Krestyn · Jun 15, 2016

Using the latest nodeJS version with InterSystems Caché

Hello WRC.Is possible to obtain a node-cache modul for the nodeJS ver.4.4.4. and actual Caché 2015... ?And what is the expected outlook of this.A note about this new portal: If I put into "search box" some text with dot like .js or .css ( for example: test.js ) , I obtaint error page. Try it.Of course, this "Developer Community" is nice, the right way.Nice day for all, Jan Krestyn Hi Jan,in case you haven't done this yet, please contact WRC directly for your node module request. http://www.intersystems.com/services-support/worldwide-response-center/ Thanks for the posting and for the input on the search. We'll get it fixed. We are working to get the latest node into the distributions. Its problematic because it requires newer versions of compilers then we are currently using. Once the compilers are upgraded the new node will ship in the distributions. In the mean time we are making them available separately thru the WRC
Announcement
Janine Perkins · Sep 6, 2016

Featured InterSystems Online Course: Advanced Data Transformations

Take this course to learn how to use additional features of data transformations beyond creating a simple data transformation. Learn to: Add a foreach loopCreate and use utility functionsCreate and use lookup tablesUse countingCreate and implement a subtransformationAdd a code actionLearn More.
Announcement
Derek Robinson · Sep 26, 2016

Featured InterSystems Video: OAuth 2.0 Overview

Click here to view our OAuth 2.0 OverviewInterSystems created this video as a high-level overview of OAuth 2.0 technology, geared toward developers looking to learn the basics of OAuth 2.0. It will teach you how OAuth 2.0 works, what roles are involved, what benefits it can provide, and how InterSystems Caché can be used with this technology. This is a very nice and well produced video. But it jumps into explaining about how OAuth works without every stating what OAuth is. It assumes that whoever watches the video knows what OAuth is.It would be nice to have a paragraph or two just explaining what this application is.It is not my intention to throw stones, but this seems to be a pattern in InterSystems documentation, explaining how something works without first explaining what it is. I guess they assume if they explain how it works, we will understand what it is. Not necessarily so.I know I am going to get hammered for this, but it is true. Hi Mike, thanks for your feedback! The audience we were targeting with this video mostly included developers looking to understand how OAuth 2.0 works, with an assumed understanding of what it generally is. But you raise a good point, and we've added a short description on the course page above the video.While it isn't a very thorough dive into the what, it provides a little background. Ultimately, our goal was to answer the how and why when it comes to OAuth 2.0. Thanks for your input! The new introduction is exactly what I had in mind, thank you.
Question
Ponnumani Gurusamy · Oct 6, 2016

What is the Difference of Function Routine and Procedure in InterSystems Caché

Difference between function , routine and procedure in object script. I think this is what you are looking for: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GORIENT_ch_cos A function is something that takes a bunch of inputs and returns one or more values. If the returned values are entirely determined by the inputs, and the function doesn't have any side effects (logging, perhaps, or causing state changes outside itself), then it's called a pure function.A procedure is a function that doesn't return a value. In particular, this means that a procedure can only cause side effects. (That might include mutating an input parameter!)A routine is either a procedure or a function or is the bridge between a function and a procedure, should also include instructions for accessing the function arguments and returning the result.
Announcement
Janine Perkins · Mar 31, 2016

Featured InterSystems Online Course: DeepSee Overview

Learn about tools available in DeepSee; including dashboards, the Analyzer and the Artchitect.Learn why you may use DeepSee including sample use cases to emphasize key features. We will define the basic architecture so you have a base understanding of the product and we will explore the major tools of DeepSee - dashboards, the Analyzer, and the Architect - to define at a high-level what the tools do and why you would use them. Learn More.
Article
Evgeny Shvarov · Apr 15, 2016

Sources for InterSystems Global Summit 2016 Sessions and Experiences

Hi! Please find all the source code Global Summit 2016 Sessions and Experiences in following GitHub repositories: Document Data Model experience. InterSystems iKnow experience. Internet of things experience. Global Summit Sessions - folders inside this repository consist sources (if any) for related session. Codes are in UDL form which is native to Atelier IDE. Here is small guide how you can check out this project into your Atelier: Let's see how to load code directly from GitHub URI. Open Atelier. Go to File -> Import -> Git -> Clone URI 2. Specify URL for repository and press Next 3. Choose 'master' branch and press Next 4. Check in 'Import all existing Eclipse projects after clone finishes' and press Finish 5. Open your project, right-click on connection -> 'Change connection', select the project, specify your existing Server connection and Namespace 6. Right-click on project -> 'Compile Project' Loading from repository by zip: 1. Download and unpack '.zip' from repository 2. File -> Import -> General -> Existing Projects into Workspace 3. Specify path to directory with unpacked files from repository 4. Check in 'Copy projects into Workspace' option, press Finish 5. Open your project, right-click on connection -> 'Change connection', select the project, specify your existing Server connection and Namespace 6. Right-click on project -> 'Compile Project' I want to bump this post up because it is really useful (thanks Evgeny) and people definitely need to be aware of this great resource for getting the example source!
Announcement
Janine Perkins · May 17, 2016

Featured InterSystems Online Course: Caché SQL Overview

Learn about the various options of using SQL within Caché!Learn how to test SQL queries using both Terminal and the Management Portal, as well as how to use class queries, dynamic queries and embedded SQL queries within a Caché class. Learn More.
Announcement
Janine Perkins · Oct 18, 2016

Featured InterSystems Online Course: Health Insight Overview

Learn the basics of Health Insight, including its features, architecture, and tools.Take this course to learn to: Describe Health Insight as a platform.Explain typical usage scenarios of Health Insight.Name the main features of Health Insight.Identify how Health Insight works with Information Exchange.Name the components of DeepSee used by Health Insight.Explain a typical population health data analysis usage of Health Insight.Learn More.