Using the "extends" functionality in drools spreadsheets? - excel

I have a question about using a certian drools functionality in drools decision spreadsheet, that would help a lot in reducing the files and making them more readable.
I can't add more than two links so please downlad this .zip file that includes:
Version1.PNG, Version1.drl, Version2.PNG, Version2.drl, Version3desired.drl
http://s000.tinyupload.com/?file_id=89653236807266194978
So here is the sample rule that we are using right now (something similar)Version1.PNG
And this when converted to a drl gives us the following 193 line long drl file. (Version1.drl)
It is ok and it works well, but after some research we found out we could use the "extends" functionality in drl.
And it works in a drl, what I would like to know is how would I use it in an Excel spreadsheet?
I designed the rule in this way: Version2.PNG
Clearly this is not how "extends" should be used in Excel, since this returns the following drl (Version2.drl)
You can see the extends is inside the "" of the rule name. Makes sense I guess, what I woudl like to know however is, how would I use it correctly? a seperate column? That didn't work, at least not the way I did it.
Does anyone know how It should be done?
The correct DRL that should be made after the Excel is converted is this: (Version3desired.drl)
Thank you for any help :)
Cheers!

There is no gain in using extends with spreadsheets in the way you describe it in your question.
I suggest that you stick to the spreadsheet layout shown in Version1.png. If data entry personnel complains about the dull repetition of 1/7/30 in oodles of rows, teach them how to join cells so they need to type each value only once.

Related

Where can I find a simple and useful list of VBA objects and methods for a beginner?

I tried pressing f2 to get the VBE thingo open and it just looks like jibberish to me.
I need something nice and simple which gives me a heirachy of what key words to use and where to put the dots so that I can do what I need to do and start learning this lanauge.
h = Worksheets("name_lists").range("g17").Offset(down, 0).Value
I don't know what worksheet is ? Is it a class with object range calling method offset ?
I need some sort of a resource to see what functionality is available but I can't make VBE do what I want.
Can someone please help me.
Thanks.
What you are asking for is at http://msdn.microsoft.com/en-us/library/office/ff194068(v=office.15).aspx. This should help you with documentation about individual objects and their properties/methods.
As for what functionality is available: (just about) everything you can do with the Office suite can be accessed through VBA. A good first step is to record a macro, and then try to follow the generated code. The caveat with that approach is that the recorder LOVES to use .Select and Selection., which is generally bad practice.
And, when you have a specific question you can't figure out, ask it here.

Any way in Expression Engine to simulate Wordpress' shortcode functionality?

I'm relatively new to Expression Engine, and as I'm learning it I am seeing some stuff missing that WordPress has had for a while. A big one for me is shortcodes, since I will use these to allow CMS users to place more complex content in place with their other content.
I'm not seeing any real equivalent to this in EE, apart from a forthcoming plugin that's in private beta.
As an initial test I'm attempting to fake shortcodes by using delimited strings (e.g. #foo#) in the content field, then using a regex to pull those out and pass them to a function that can retrieve the content out of EE's database.
This brings me to a second question, which is that in looking at EE's API docs, there doesn't appear to be a simple means of retrieving the channel entries programmatically (thinking of something akin to WP's built-in get_posts function).
So my questions are:
a) Can this be done?
b) If so, is my method of approaching it reasonable? Or is there something stupidly obvious I'm missing in my approach?
To reiterate, my main objective here is to have some means of allowing people managing content to drop a code in place in their content that will be replaced with channel content.
Thanks for any advice or help you can give me.
Here's a simple example of the functionality you're looking for.
1) Start by installing Low Replace.
2) Create two Global Variables called gv_hello and gv_goodbye with the values "Hello" and "Goodbye" respectively.
3) Put this text into the body of an entry:
[say_hello]
Nice to see you.
[say_goodbye]
4) Put this into your template, wrapping the Low Replace tag around your body field.
{exp:low_replace
find="[say_hello]|[say_goodbye]"
replace="{gv_hello}|{gv_goodbye}"
multiple="yes"
}
{body}
{/exp:low_replace}
5) It should output this into your browser:
Hello
Nice to see you.
Goodbye
Obviously, this is a really simple example. You can put full blown HTML into your global variable. For example, we've used that to render a complex, interactive graphic that isn't editable but can be easily dropped into a page by any editor.
Unfortunately, due to parse order issues, EE tags won't work inside Global Variables. If you need EE tags in your short code output, you'll need to use Low Variables addon instead of Global Variables.
Continued from the comment:
Do you have examples of the kind of shortcodes you want to support/include? Because i have doubts if controlling the page-layout from a text-field or wysiwyg-field is the way to go.
If you want editors to be able to adjust layout or show/hide extra parts on the page, giving them access to some extra fields in the channel, is (imo) much more manageable and future-proof. For instance some selectfields, a relationship (or playa) field, or a matrix, to let them choose which parts to include/exclude on a page, or which entry from another channel to pull content from.
As said in the comment: i totally understand if you want to replace some #foo# tags with images or data from another field (see other answers: nsm-transplant, low_replace). But, giving an editor access to shortcodes and picking them out, is like writing a template-engine to generate ee-template code for the ee-template-engine.
Using some custom fields to let editors pick and choose parts to embed is, i think, much more manageable.
That being said, you could make a plugin to parse the shortcodes from a textareas content, and then program a lot, to fetch data from other modules you want to support. For channel entries you could build out of the channel data library by objectiveHTML. https://github.com/objectivehtml/Channel-Data
I hear you, I too miss shortcodes from WP -- though the reason they work so easily there is the ubiquity of the_content(). With the great flexibility of EE comes fewer blanket solutions.
I'd suggest looking at NSM Transplant. It should fit the bill for you.
There is also a plugin called Shortcode, which you can find here at
Devot-ee
A quote from the page:
Shortcode aims to allow for more dynamic use of content by authors and
editors, allowing for injection of reusable bits of content or even
whole pieces of functionality into any field in EE

Retrieve data from the web using Excel [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've spent hours scouring the net for anything to do with VBA calling data from the web in excel and nothing provides a tutorial on how to do so, only complicated examples un-related to what I want to do.
I want to pull data from either a .html or .xml site, doesn't matter, via Excel and find specific points in that data. I can find specific points but don't know how to get the data or scroll through multiple lines. I've done this exact sort of thing in mIRC (sort of C code).
http://eve-central.com/home/quicklook.html?typeid=438
http://api.eve-central.com/api/quicklook?typeid=438
Those are two examples, using roughly the same data I'd like to retrieve. It'd be FAR more specific with at most 100 or so different values.
I'd like to be TAUGHT how to do it, not given the code to do it, or if you must explain each part with comments in-depth please.
Edit: I'm just saying here that I don't want you to link me some random code that does something similar and expect me to modify it without an explanation. Not wanting someone to just write up a full guide of internet capability for Excel.
Thanks
Nick
Edit: I'll try explaining it again in a different sense. I play a game called EVE Online, and there's a lot of "market" databases online that allow access in this form for programs to extract data of certain items' prices. Pretty much I want to do that in an Excel document and then obviously list them in a hidden sheet or something. I don't want to have to use a secondary program, I know it's entirely possible within just Excel.
Have a look here - How can I send an HTTP POST request to a server from Excel using VBA? and getHTTP with (excel) VBA?
That deals with the code part. A note regarding the links provided, refer to the MSDN documentation regarding the WinHttp.WinHttpRequest.5.1 and MSXML2.ServerXMLHTTP to gain better clarity regarding what the these libraries are used for. I also suggested reading up a bit about using COM objects in VBA
I'd like to be TAUGHT how to do it,
not given the code to do it, or if you
must explain each part with comments
in-depth please.
Not to be rude, but this sounds to me like you want someone to teach you how to code. I dont think one can simply teach code.
Edit:
I misunderstood your question, correct me if I wrong, but the crux of your question revolves around I can find specific points but don't know how to get the data or scroll through multiple lines.
Using http://msdn.microsoft.com/en-us/library/aa163921(office.10).aspx, you would probably need to get all your result nodes into an XML object. You could then need to loop through the result set ( which I think is what you meant by scroll).
Related question: How to parse XML using vba
This is a quick and rough answer, becuase what your doing sounds a little bit dodgy(see comment), but from my understanding of Excel, I think your best bet is to use the ODBC driver and connect directly with MS Access (then export into excel) to the same database that the website is using to to receive all the data.
Which will mean that you will need:
1. both the username and password to the database.
2. the associated sql queries that the website is using to retrieve the data. (which may include joins, functions etc.)
Otherwise, you will have to get it through the "front", and you will need to write your own html parser for the section of each page to generate an xml file so that excel can read the final contents table data cleanly. (for excel 2007 and up.)
Doing so will also allow you be able to infer a column's 'data type' such as int, char, bigint etc. in the xml schema. But yeah, this might only need to be done probably in something like console C#/C++/java whatever, not in excel itself because I'm pretty sure excel doesn't have a feature that lets you write your own 'HTML to XML' parser for a website it knows nothing about.
hope this helps..
1) Copy a link to the price data you want. ie
http://api.eve-central.com/api/marketstat?typeid=34&typeid=35&regionlimit=10000002
2) In excel select the location you want the data to be imported to. Preferably a blank sheet.
3) Data -> Import External Data -> New Web Query.
4) Paste the link into the address bar. You can edit the link later on to add or subtract typeids.
5) Press the Go button.
6) Select one of the yellow arrow boxes. I chose the box directly above the line evec_api version.
7) Press the Ok button to import the data to the sheet you selected in step 2.
Now you can right click on the data to "Refresh Data".
Use whatever look up formulas to read the prices from this data to the rest of your sheet.
You can change the address of the Web Query by right clicking on any part of the data and selecting "Edit Query..."
Hope this gets you going in the right direction. This will work with Excel version 2002(XP) and 2003. Excel 2007 is more friendly to XML queries.

How to get Google page rank and number of searches in Excel sheet?

I have a link in one column and, based on it, I want
Number of Google searches in column 2
Page rank of first result in column 3
I know this can be done, as I saw a friend pulling google search result right in Excel. If anyone knows, please share how I could do that.
If I correctly interpret your question, one of the tasks you had to do is
How do I get programmatically the Google page rank for a list of URLs?
You can find the code to do this in this CodeProject article:
Request Google´s Pagerank programmatically
Regarding the Excel part: it depends which programming framework or platforms you could use. You could use to create a .NET extension for Excel using the Microsoft Visual Studio Tools for Office.
From Excel there is Data->Get External Data->New Web Query. Is this what you want?
You have two options, both of which are unfortunately poorly documented.
If you are comfortable in C/C++, you can write a special DLL called an "XLL" that you can call during Excel runtime. There is some sparse documentation available. Note that this stuff isn't very fun to use.
If you prefer .NET, there is a binding for the entire Office suite outlined here that allows you to write COM-based methods that you can call from Office. It is intended for automation, but you can write any managed code you want and have Excel call into it.
There is also what Remou just suggested; I don't actually own a copy of Excel to test that out, but it may be the easiest option.
By link i meant keywords and not URL. I want to put a keyword in one cell and pull number of searches and page rank in adjacent cells.
I tried doing the same with web query in excel but i can only reach till the number of searches. that too not in the proper cell (trying to figure out). But i have no clue about how to get the pageranks.
I am not that tech savvy to code a binder or plugin for myself. Although i am checking the link by splattne. Please focus more light on it. Is it gonna be time consuming if i try to make this one..?
Regards
Thinkjayant
There are some nice plugins for this (in various languages) on GitHub:
http://github.com/search?langOverride=&language=&q=pagerank&repo=&start_value=1&type=Repositories&x=0&y=0
I have a PR checker functions in my Excel plugin "SeoTools".
http://nielsbosma.se/projects/seotools/

United States State shapes for Office

I want to create visuals along the lines of CNN's "red-state, blue-state" shadings of the states in the U.S. for my project. I'm planning to do something fancier than just shading the state's shape in a color. Are there open source libraries of state shapes/polygons (or - if not open source - others) that I can import into Word, Excel, etc. that I can use to show complicated graphs based on states?
I have Map Point, but haven't been able to figure out how to shade the states in a complex way.
you could try google charts, it looks like http://www.woot.com is doing something similar to what you need
Here is a good example using google maps... I've used code like that before.. perhaps from this exact example.
http://econym.org.uk/gmap/example_states2.htm
EDIT: you might want to consider converting the states.xml into JSON... it'll be smaller (136k of XML right now!) and should load faster in most browsers.
There might be a couple parts to the question you are asking, but to address the first part "Are there open source libraries of state shapes/polygons...", here's a resource to check out:
http://commons.wikimedia.org/wiki/Category:SVG_maps_of_the_United_States
It's a list of various SVG(scalable vector graphics) files which can be imported into a number of applications. Basically a giant xml representation of lines and endpoints. This can be directly converted to XAML, if you're into a more programmatic way of charting(ie, C# w/ Silverlight).
However, to address the second part regarding MS Office, Visio can import SVG files for manipulation as well. I'm unsure what type of graphs you were looking for, but I hope this can assist in some small way on your path to awesomeness ;)

Resources