Don't Explode (itch) (JambonSupreme) Mac OS
- Don't Explode (itch) (jambonsupreme) Mac Os Free
- Don't Explode (itch) (jambonsupreme) Mac Os 2
- Don't Explode (itch) (jambonsupreme) Mac Os 1
Something that piqued my curiosity lately was the developments with SAP HANA and R (good overview here). This is definitely a new and exciting direction for SAP, with creating a well structured, and organised ‘Big Table’ option for in memory computing, and then going the extra mile to embed a specialised Open Source Statistical Computing package (R) in it – making the fore front of the world of statistical analysis open to those that dare.
Thanks for being so patient with all these comments. It is a process to install this. I am doing it on a mac and following the instructions as you have provided them, it does not work. It might be helpful to list the instruction as steps: Step 1 - Download the identity mod menu and the fabric installer, and the Fabric API. A copy of Mac OS X 10.5 Leopard (or earlier): We can’t tell you how to obtain this, but a simple Google search will. You will need an.ISO file that should be saved directly to your iPhone or iPad.
This is utterly brilliant, but the problem is that I can’t access it as I don’t have access to a SAP HANA instance (nor would most people). It is also heavily geared to ‘Big Data’, when there is still an awful lot to be gained from small, and mid-range data analysis arenas (resisting the temptation about size and clichés).
This has definitely touched on my hackers itch, and in response to this I’ve created one more Scripting Language Connector for R – RSAP.
The idea of this is to enable RFC calls (using the SAP NW RFC SDK) where any table contents are returned as data.frames (in R parlance).
Once you have this data in R, then the world is your oyster – it is up to your imagination as to what you do with it. To give an overview of how it works, and what you can do, I’m going to step through the process of installing and using RSAP.
Obtaining and Installing
Firstly you need to install R. I recommend using RStudio as it is a comfortable graphical user interface – you can get it from here.
Under debian (read Ubuntu) flavoured Linux you can install R first before downloading/installing RStudio using:
sudo apt-get install r-base-core r-base-dev r-base-html r-recommended
SAP NW RFCSDK
The SDK is available from the SAP Service Market Place SWDC – this is a forum discussion on getting it http://scn.sap.com/thread/950318
If you have (like me) installed the NPL SAP Test Drive instance, then the SAP NW RFC libs exist in the /usr/sap/NPL/SYS/exe/run directory, the only problem being that it does not contain the C header files (really – SAP should make this available on SDN).
RSAP
Download or clone the RSAP project source from https://github.com/piersharding/RSAP
Building
Ensure that the R library prerequisites are installed. To do this there is a helper script in the RSAP source code directory. cd to the source directory (downloaded above) – in my case /home/piers/git/public/RSAP – and run the following:
R –no-save < install_dependencies.R
This will prompt to install the packages yaml, reshape, plotrix, and RUnit.
To build and install the RSAP package, cd to the source directory (downloaded above) – in my case /home/piers/git/public/RSAP – run the following: Planet moolah slot machine.
R CMD INSTALL –build –preclean –clean –configure-args=’–with-nwrfcsdk-include=/home/piers/code/sap/nwrfcsdk/include –with-nwrfcsdk-lib=/home/piers/code/sap/nwrfcsdk/lib’ .
You must change the values for –with-nwrfcsdk-include and –with-nwrfcsdk-lib to point to the directory locations that you have downloaded the SAP NW RFC SDK to.
Under Linux, it is also likely that you need to add the lib directory to the LD cache or set the LD_LIBRARY_PATH variable.
Setting the LD Cache:
as root, edit /etc/ld.so.conf and add the lib path from above to it on it’s own line. Now regenrate the cache by executiong ‘sudo ldconfig’.
Setting LD_LIBRARY_PATH
You must ensure that the following environment variable is set in all your shells:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/nwrfcsdk/lib
The easiest way to do this is to add the above line to your $HOME/.bashrc file so that it happens automatically for all future shells.
Does it work?
Once the build and install of the RSAP package is complete, now you should test to make sure it’s all working.
Change to the package source code directory (you are probably still there from the above activities), and launch either R or RStudio.
From the R command line try the following:
> library(RSAP)
Loading required package: yaml
>
You should get the above confirmation message that the dependent yaml package has been loaded. Now we are ready to try some R wizardry.
How to work with RSAP
Lets work through the general process steps for interacting with SAP.
Connecting to SAP
Using RSAP we need to establish a connection to SAP. For this you need an account that has the appropriate access for RFC calls, and functionality access. Connections can be built in two ways – directly passing connection parameters:
> conn <- RSAPConnect(ashost=”nplhost”, sysnr=”42″,
client=”001″, user=”developer”,
passwd=”developer”, lang=”EN”)
>
Or using a YAML encoded file that contains the connection details:
> conn <- RSAPConnect(“sap.yml”)
>
The sap.yml file is structured like:
ashost: nplhost
sysnr: “42”
client: “001”
user: developer
passwd: developer
lang: EN
trace: 1
The above activates the trace functionality in NW RFC SDK. This will create trace files in the current working directory, and are invaluable for debugging connectivity problems.
Calling SAP
Now we have the connection object, we can get connection info with it:
info <- RSAPGetInfo(conn)
Query the system with:
res <- RSAPInvoke(conn, “<RFC Function Name”, parms)
Or close the connection:
RSAPClose(conn)
RSAPInvoke() is what we are most interested in, and we need to pass the parameters as a series of nested named lists. The classic example is RFC_READ_TABLE:
parms <- list(‘DELIMITER’ = ‘ ’,
‘FIELDS’ = list(FIELDNAME = list(‘CARRID’, ‘CONNID’, ‘PRICE’,
‘SEATSMAX’, ‘SEATSOCC’)),
‘OPTIONS’ = list(TEXT = list(“CARRID = ‘AA’ “, ” AND CONNID = 0017 “)),
‘QUERY_TABLE’ = ‘SFLIGHTS2’)
res <- RSAPInvoke(conn, “RFC_READ_TABLE”, parms)
The names must correspond directly to the parameter and structure (for tables) names, and use numeric and character types as appropriate.
The other thing that is really important to get your head around is that R data structures are column oriented, which means we have to think differently about tables that we get from SAP. Tables in SAP translate to lists of vectors where the outer list is a list of column names (a slightly loose analogy but it will do) and the vectors hang off these column names corresponding to all the values in that column down the rows.
Working through the examples in get_flights.R
In the source code package there is an example script – get_flights.R. It uses the standard demonstration data for the Flight Data system contained in table SFLIGHT2. Let’s look at what this does.
Load libraries:
> library(RSAP)
Loading required package: yaml
> library(reshape)
Loading required package: plyr
Attaching package: ‘reshape’
The following object(s) are masked from ‘package:plyr’:
rename, round_any
> library(plotrix)
>
We now have all the necessary libraries for the rest of the examples.
conn <- RSAPConnect(“sap.yml”)
parms <- list(‘DELIMITER’ = ‘;’,
‘QUERY_TABLE’ = ‘SFLIGHTS2’)
res <- RSAPInvoke(conn, “RFC_READ_TABLE”, parms)
RSAPClose(conn)
sflight = res$DATA
flds <- sub(“s+$”, “”, res$FIELDS$FIELDNAME)
sflight <- data.frame(sflight, colsplit(sflight$WA, split = “;”, names = flds))
This connects to SAP, calls RFC_READ_TABLE to get the contents of SFLIGHT2, and sets the column delimiter for that table as ‘;’. We close the connection and copy the table data from the return parameter res$DATA (see RFC_READ_TABLE in transaction SE37) into sflight. We also grab the field names returned in table FIELDS, and remove the whitespace at the end. Next – this is where the importance of the ‘;’ delimiter is – using the colsplit() function from the reshape package, we split return DATA into columns named by the FIELDS that RFC_READ_TABLE provided us.
Now we have a data.frame that looks a lot like the table SFLIGHT2 when viewed in transaction SE16.
sflight <- cbind(sflight, FLIGHTNO = paste(sub(“s+$”, “”,
sflight$CARRID),sflight$CONNID, sep=””))
sflight$SEGMENT <- paste(sflight$AIRPFROM, sflight$AIRPTO, sep=” – “)
sflight$CARRNAME <- sub(“s+$”, “”, sflight$CARRNAME)
sflight$DISTANCE <- as.numeric(lapply(sflight$DISTANCE,
FUN=function (x) {sub(“*”,””, x)}))
sflight$DISTANCE <- as.numeric(lapply(sflight$DISTANCE,
FUN=function (x) {if (x 0) NA else x}))
sflight[sflight$CARRNAME ‘Qantas Airways’,’DISTANCE’] <- 10258
This next chunk created new vectors (columns) FLIGHTNO combined from CARRID and CONNID, SEGMENT from AIRPFROM and AIRPTO, and cleaned vectors CARRNAME, and DISTANCE.
Now create some aggregated views, to generate visualisations from:
airline_avgocc <- aggregate(data.frame(SEATSMAX=sflight$SEATSMAX,
SEATSOCC=sflight$SEATSOCC,
OCCUPANCY=sflight$SEATSOCC/sflight$SEATSMAX),
by=list(carrname=sflight$CARRNAME), FUN=mean, na.rm=TRUE)
airline_sumocc <- aggregate(data.frame(SEATSOCC=sflight$SEATSOCC),
by=list(carrname=sflight$CARRNAME), FUN=sum, na.rm=TRUE)
Show a pie chart – sum of airline occupancy as a share of market:
x11()
lbls <- paste(airline_sumocc$carrname, “n”, sprintf(“%.2f%%”,
(airline_sumocc$SEATSOCC/sum(airline_sumocc$SEATSOCC))*100), sep=””)
pie3D(airline_sumocc$SEATSOCC, labels=lbls,
col=rainbow(length(airline_sumocc$carrname)),
main=”Occupancy sum share for Airlines”, explode=0.1)
Create a Stacked Bar Plot with Colors and Legend showing a summary of occupancy by segment and carrier – to do this we need to generate a summary (aggregate), and fill in the missing combinations of the grid, and then switch the orientation of rows for columns to present to the plotting funcitons:
d <- aggregate(SEATSOCC ~ CARRNAME:SEGMENT, data=sflight, FUN=sum, na.rm=FALSE) How to create a screenshot on mac.
d2 <- with(d, expand.grid(CARRNAME = unique(d$CARRNAME), SEGMENT = unique(d$SEGMENT)))
airline_sumsegocc <- merge(d, d2, all.y = TRUE)
airline_sumsegocc$SEATSOCC[is.na(airline_sumsegocc$SEATSOCC)] <- 0
# switch orientation to segment * carrier
counts <- data.frame(unique(airline_sumsegocc$CARRNAME))
for (a in unique(airline_sumsegocc$SEGMENT))
{counts <- cbind(counts,
airline_sumsegocc$SEATSOCC[which(airline_sumsegocc$SEGMENT a)]);}
counts[,1] <- NULL
colnames(counts) <- unique(airline_sumsegocc$SEGMENT);
rownames(counts) <- unique(airline_sumsegocc$CARRNAME);
x11()
barplot(as.matrix(counts), main=”Total Occupancy by Segment and Carrier”,
ylab=”Number of Seats”,
col=rainbow(dim(counts)[1]),
ylim=c(0, 15000), legend = rownames(counts))
Lastly – we create a simple performance indicator using a time series comparison of different airlines: Apple battery charger.
# performance by airline over time – dollars per customer KM
sflight$FLDATEYYMM <- substr(sflight$FLDATE, start=1, stop=6)
d <- aggregate(data.frame(PAYMENTSUM=sflight$PAYMENTSUM,
SEATSOCC=sflight$SEATSOCC,
DISTANCE=sflight$DISTANCE,
PERFORMANCE=(sflight$PAYMENTSUM/(sflight$SEATSOCC *
sflight$DISTANCE))),
by=list(carrname=sflight$CARRNAME,
fldateyymm=sflight$FLDATEYYMM),
FUN=sum, na.rm=TRUE)
d2 <- with(d, expand.grid(carrname = unique(d$carrname),
fldateyymm = unique(d$fldateyymm)))
agg_perf <- merge(d, d2, all.y = TRUE)
agg_perf <- agg_perf[order(agg_perf$carrname, agg_perf$fldateyymm),]
agg_perf$PERFORMANCE[is.na(agg_perf$PERFORMANCE)] <- 0
# create time series and plot comparison
perf_series <- data.frame(1:length(unique(agg_perf$fldateyymm)))
for (a in unique(agg_perf$carrname))
{perf_series <- cbind(perf_series,
agg_perf$PERFORMANCE[which(agg_perf$carrname a)]);}
perf_series[,1] <- NULL
colnames(perf_series) <- unique(agg_perf$carrname);
# convert all to time series
for (a in length(unique(agg_perf$carrname)))
{perf_series[[a]] <- ts(perf_series[,a], start=c(2011,5), frequency=12)}
# plot the first and line the rest
x11()
ts.plot(ts(perf_series, start=c(2011,5), frequency=12),
gpars=list(main=”Performance: dollar per customer KM”,
xlab=”Months”,
ylab=”Dollars”,
col=rainbow(dim(perf_series)[2]), xy.labels=TRUE))
legend(2012.05, 3.2, legend=colnames(perf_series),
col=rainbow(dim(perf_series)[2]), lty=1, seg.len=1)
Hopefully, I’ve shown that there is a lot that can be done with R – especially in the area of adHoc advanced business intelligence and data analysis. I have not really even scratched the surface in terms of what R can offer for advanced statistical analysis and modelling – that is where the true wizards live.
I would love to hear back from anyone who tries RSAP out – issues and user experiences alike.
Edit:
I should note that Alvaro has been here before me with OData/JSON/and R – http://scn.sap.com/community/netweaver-gateway/blog/2012/04/06/when-r-met-sap-gateway
References:
- Post on SAP HANA and R from Alvaro
Basic R Tutorials
Hi, this extension works pretty well, it's nice and simple, and does the job as expected.I have however made a small change to the code to help it degrade gracefully, for example:
Where I work currently has a mixed environment of Mac OS X and Windows. Firefox on OS X does not display inline PDFs, basically adobe haven't made a plugin, so it will show a 'this page has missing plugins' and searching will fail because there is no official one.
Sam Gross has made a Intel-only firefox addon quicklook plugin that allows firefox to view them actually in browser, so that scratches my itch.
but as it is currently, if any inline-pdf viewer is not found, it simply displays white space, which tells the user nothing if they were not expecting a pdf to be displayed inline on page and even if they were it does not help them in the slightest and provides no solution.
The same would go for a windows computer with adobe not installed.
I've modified the HTML output, just on line 26, i sourced this solution here.
That at least gives the user a bit more info. What does the developer think? I think that this(or something similar) should be integrated. feel free to use that. :)
To provide a more complete solution for users here I wrote a quick and dirty php file hosted elsewhere that serves my needs locally, that does some quick checks to see if they're using firefox, if they're on an intel or ppc mac (we only have 1), or if they're running something else.
if they're on an intel mac it'll redirect them to the plugin, ppc it'll tell them they're out of luck and anything else it'll tell them to install adobe reader.
But, for most MediaWiki projects, I wouldn't think it's appropriate to be directing to third party plugins for support or anything els, so telling them what the problem is and an alternative is enough :).
here's the quick and dirty php hack redirect if anybody finds it useful. it's literally the first code I've posted to the Internet, it works for me, sanity check it for your needs.
If anyone else than me finds this useful, dropping me a note on my userpage would be nice :).
update: i just had a look at some of the other issues on this page, you'll see that others are having the issue, and had no idea of the fix.
Don't Explode (itch) (jambonsupreme) Mac Os Free
mine is similar to the solution down the bottom, except mine has some explanatory text, and a link to the file.
The icon for a pdf is interesting, but not supported by default in mediawiki, there's no pdf icon, but my text and link works.
Hy there!I don't really have experience with this kind of extensions and I was wondering if you could help me. I am using your code and unfortunatelly it does not work when I want to embed docs which are on the local host. Do u have any idea why :(
Answer[edit]
Sorry--I just can't get you exactly..
What is the wiki code you're using? Is it something like '<pdf>http://localhost/my/path/to.pdf</pdf>'? Does any error occur? Is your Web server okay with PDFs (what does it show if you open 'http://localhost/my/path/to.pdf' in a Web browser)?
--Dmitry Shurupov 16:20, 21 February 2009 (UTC)
As written, the regex insists upon a period character (‘.’) in the domain name (like ‘mydomain.com’). Fix this by inserting a question mark after the period character: in EmbedPDF.php, change
to
Scorwin 15:31, 10 November 2009 (UTC)
Thanx for this extension, it works great here. However I got one issue that maybe easily can be solved. I like to use this extension together with the semantic form extension. In a form the user can upload a pdf-file which will be printed on the outputpage. I like to embed the pdf and not only the filename. I got it working with images but can't get it to work with EmbedPDF. The variable is called {{{inputfilename}}} so <pdf>{{{inputfilename}}}</pdf>should have to do the trick. But I got the 'Error: bad URI in <pdf>!' message after saving the page. I guess it means it doesn't recognize the '{'. Is there a way I can make an exception in the extension that it does read the whole text between <pdf> and </pdf> as a filename?
-Jos, 19-2-2009
Answer[edit]
Allowing '{{{inputfilename}}}' in <pdf> is rather simple--you just have to add few lines into the 'embedPDFHandler' function. It will look like this:
However, it will make a trick if the '{{{file}}}' string will be transformed to the URI by semantic forms extension. I don't know how it works--so, I'm not sure if it is okay.
If the problem still exists, please, let me know--I'll give the semantic form extension a try..
--Dmitry Shurupov 16:19, 21 February 2009 (UTC)
Still same error[edit]
Thanx for the answer. I added the lines though I still got the same error. I'm not quite an expert in php so forgive me if there might an 'easy' solution to my problem.
I guess I got images working because images in wiki got a special syntax: [[Image:]] instead of the <img>-tag.Perhaps there is a way to hack the code so that something like [[Pdf:{{{file }}}]] can be made instead of <pdf>..</pdf>?
--Jos, 26 February 2009
I've installed EmbedPDF.php in the extensions directory.I added the requireonce line.
I created a new page, with one line:
http://www.mydomain.org/wiki/images/e/e0/Hr1.pdf (I've removed the domain name)
and the page is there, but the pdf isn't embeded in Firefox 3.06. It's Embeded in I.E. 7.x just fine.
Answer[edit]
Please, read the 'Usage' section.
You have to add the lines like this for URLs:
<pdf>http://www.mydomain.org/wiki/images/e/e0/Hr1.pdf</pdf>
And lines like this for PDFs uploaded to your MediaWiki:
<pdf>Hr1.pdf</pdf>
Thanks for this extension. It's only in Internet Explorer (tested on v. 8) I'm having difficulties viewing the embedded pdfs. But I still wanted to use this extension, since there aren't any other ones dealing with this problem. I've added a link to the object, so browsers that won't show the embedded pdf, come up with a link instead. Now Opera, Firefox and Chrome show the embedded pdfs properly, while Internet Explorer shows a link. This is an acceptable solution for me, and maybe this idea would work for others as well?
Add the following around line 25-27 in EmbedPDF.php:
It seems that the new feature compability view in Internet Explorer might have something to do with this problem. Any ideas, Dmitry?
-- Marius, July 2009
Worked in mw 1.14.0, broke in mw 1.15.1 ?[edit]
I have been using this extension happily on a WAMP installation for an intranet with mediawiki 1.14.0. I have just tried to install it on a linux server running mediawiki 1.15.1, and mw complains about the header already being created. I suspect there is a simple fix, but I don't know it. Any help out there? TIA. Mickeyf 2009/11/18
- It's working fine for me with 1.15.3, PHP 5.2.13, Firefox 3.6.3, and Adobe Reader 9.3.2 on CentOS. --164.54.212.14 15:47, 22 June 2010 (UTC)
- I'm using 1.15.1 and I think, I had the same problem, but I can't really remember how I fixed it. Try leaving out the ending ?> - that's the only difference I found in my version. Sidcom 11:18, 23 June 2010 (UTC)
- It was working for me earlier per my comment above, and now it stopped working all of a sudden. --164.54.212.14 16:47, 28 June 2010 (UTC)
- Do you get the same error? Sidcom 16:56, 28 June 2010 (UTC)
EmbedPDF does not handle https URIs[edit]
EmbedPDF does not handle https URIs. If a wikipage contains code such:
Then it says: Error: bad URI in <pdf>!
Broken image[edit]
After inserting the code:
The rendered wiki page displays a broken image.
Versions:
- MediaWiki 1.17alpha
- InternetExplorer 8.0
Local network file share[edit]
Is it possible to adjust the code to except 'file://' addresses or '[network share name]' addresses instead of only 'http://'?
My PHP knowledge is quite limited and I was unsuccessful in all my attempts.
New features[edit]
Hi, i added some extra features to EmbedPDF extension. If you find them useful, please check the attached php file.
Features:
- Image height/width
New Sintax:
Examples:
- Interactive Button
When pressed a popup message will show up and asks where to load the pdf file (current page or new one)
Examples
Waow, I do love this new 'version' but it doesn't work for me using FireFox or Internet Explorer with MediaWiki 1.16.
I do have the button but nothing append when I click it.
Any way to fix it ?From MoBO 11:54, 17 February 2011 (UTC)
Hi, i use the new version with Mediawiki 1.16 and FireFox.
You must e litle change in function makeHTMLforPDF. (Sorry for my bad englisch)
--Speedy McCat. Keiner ist unnütz, er kann immer noch als schlechtes Beispiel dienen. 13:40, 25 March 2011 (UTC)
Zoom to document width?[edit]
Is there a way to show the pdf zoomed to the document width, by default?
Broken in the version 1.18[edit]
This is the source of the error:
The class Image is excluded in the version 1.18.Solution:
This works fine for me at http://wikiskola.se/index.php?title=L%C3%B6sningar701706, Hakeld 22:45, 28 January 2012 (UTC)
Nesting a magic word within EmbedPDF?[edit]
I noticed that the 'URI error' thread addresses something similar, but the suggested code hasn't worked for me.
In particular, I'd like to be able to have embedpdf automatically work on any File:File.pdf page so that upon visiting File:File.pdf, the pdf file is automatically displayed as embedded.
I thought to try the following function on every page that exists for an uploaded file:
<pdf>{{PAGENAME}}</pdf>
However, even when I adjust the regular expression in a similar way as you suggested by writing,
if (preg_match('/^{{[^}]+}}$/i', $input))
return makeHTMLforPDF( $input, $argv );
The magic word {{PAGENAME}} is not resolving so it returns {{PAGENAME}}, rather than File.pdf
Thanks in advance for any help,
The fast hack is to add these two lines:
In the beginning of the embedPDFHandler function.
--Dmitry Shurupov 17:22, 15 February 2012 (UTC)
Responsive Design[edit]
I made the following changes to the extension to allow the embedded PDF be responsive to the available width. This is based on Embedded Objects in Responsive Design.
I also provide a download option (based on suggestion above). If the user's browser does not support the object, the user will still see the logo and download link.
Here is the CSS used to style the embedded object.
--Lotusjeff (talk) 13:29, 16 May 2013 (UTC)
is it possible that the Adobe pageview and toolbar is shown in the document automatically?
It works like that for me[edit]
Don't Explode (itch) (jambonsupreme) Mac Os 2
Your browser's default pdf reader is what will be used
1.19 Compatibility[edit]
It doesn't seem to work well with 1.19.1After adding it, it locks up the browser when entering edit mode..
- It functions for me on 1.19.2. --Inops (talk) 09:25, 22 October 2012 (UTC)
Doesn't work?[edit]
I did these 3 things:
Don't Explode (itch) (jambonsupreme) Mac Os 1
- Created a text file called EmbedPDF.php which contains the required php code.
- Copied the file into the MediaWiki extensions folder on the server.
- Added to the end of LocalSettings.php: require_once('$IP/extensions/EmbedPDF.php');
Still, the extension and PDF file are not recognized. The wiki page just shows the pdf tags between brackets, and the filepath between them.
Any clues? Thanks