In SAPUI5, they provide samples for codes. How to actually use those? - sapui5

I just started using SAPUI5 and I am actually curious on how the samples work.
For example:
https://sapui5.hana.ondemand.com/#/entity/sap.f.FlexibleColumnLayout/sample/sap.f.sample.FlexibleColumnLayoutColumnResize
I downloaded it and opened using Atom IDE. However, I don`t see any mock data or .json.
Is that on purpose? I was actually expecting to see the code for the sample, with the sample data.
Thank you very much.

The data gets loaded from https://sapui5.hana.ondemand.com/test-resources/sap/f/demokit/sample/FlexibleColumnLayoutColumnResize/webapp/data/sections.json
see line 21 in Component.js: var oProductsModel = new JSONModel("./data/sections.json");
You can find details on how to set up a JSON model in Step 7 of SAPUI5 Walkthrough - a tutorial with all major UI5 development paradigms.

Related

SAPUI5 Tile Container only shows 2 tiles

I have copied the same example from OpenUI5 Tile Container Sample
but I can't make it working I only see 2 tiles
I have seen in different similar posts that recommends to add enableScrolling="false" to page tag but is not working for me.
This problem is intermittent and relevant to Google Chrome. It's related on how the browser handles the asynchronous request made by jQuery.sap.getModulePath().
I have tested in Firefox Developer Edition and it's working properly. Anyway, here's how to fix it:
If you comment out that line in your controller and define the JSON data to the variable sPath it works (I have made the JSON data shorter to keep the answer clean but the live demo is full, see link below).
Page.controller.js, line 12.
//var sPath = jQuery.sap.getModulePath("sap.m.sample.TileContainer", "/data.json");
var sPath = {"TileCollection":[{"icon":"sap-icon://hint","type":"Monitor","title":"Tiles: a modern UI design pattern for overview & navigation."},{"icon":"sap-icon://inbox","number":"89","title":"Approve Leave Requests","info":"Overdue","infoState":"Error"},{"type":"Create","title":"Create Leave Requests","info":"28 Days Left","infoState":"Success"},{"icon":"sap-icon://travel-expense-report","number":"281","numberUnit":"euro","title":"Travel Reimbursement","info":"1 day ago"},{"icon":"sap-icon://loan","number":"2380","numberUnit":"euro","title":"My Salary","info":"8 days ago"}]};
Working example:
Tile Container

iTextSharp and ZUGFeRD Basic profile

I am creating ZUGFeRD PDF files with iTextSharp 5.5.9 which works fine so far. The only thing which is currently not working is the setting with the Conformance-Level.
writer = PdfAWriter.GetInstance(document, New FileStream(strFilenameOut, FileMode.Create), PdfAConformanceLevel.ZUGFeRDBasic)
or
writer.SetPDFXConformance(PdfAConformanceLevel.ZUGFeRDBasic)
won't work for me. The Metadata contains %s instead of BASIC as shown in the screenshot below.
I guess that I missed something to set. Maybe someone had the same issue and can help me to solve this issue.
Regards
Jochen
ZUGFeRD is based on the PDF/A-3 standard. You are using a method to set PDF/X conformance. PDF/A and PDF/X are two very different standards. You shouldn't set the PDF/X conformance.
Please take a look at the official documentation. I have written a book about ZUGFeRD. You can download this book as an eBook if you fill out this form: http://pages.itextpdf.com/ZUGFeRD.html
For the Basic profile, you need to take a look at Chapter 5. There are many examples available online.
This is how it's done in Java:
PdfAWriter writer = PdfAWriter.getInstance(document,
new FileOutputStream(dest), PdfAConformanceLevel.ZUGFeRDBasic);
In C#, you'll have:
PdfAWriter writer = PdfAWriter.GetInstance(document,
New FileStream(strFilenameOut, FileMode.Create), PdfAConformanceLevel.ZUGFeRDBasic)
All the examples work in Java, but recently there was a problem detected with the C# port. Maybe you are experiencing the same problem. As far as I know, this problem has been fixed in the current development version.
If you are a customer, you should ask your account manager to get a hotfix that solves this problem.

OpenCV and iOS - Getting started

I am new to iOS development and apologies for a basic question. I am trying to convert an image to grayscaled and threshold it using openCV in iOS. So far, I have imported and setup the framework on xcode. What I am trying to do now is to implement the following features:
http://www.youtube.com/watch?feature=player_embedded&v=Ko3K_xdhJ1I
at 0:24 and 0:53
I tried to follow the tutorial which points to the above youtube video :
http://docs.opencv.org/doc/tutorials/ios/image_manipulation/image_manipulation.html
and wasn't sure where to paste the above code and in which file?
Many thanks.
Kind Regards.
These are helper methods and best written in a separate file. Quite simply,
http://answers.oreilly.com/topic/631-how-to-get-c-and-objective-c-to-play-nicely-in-xcode/
Put all that image manipulation code in say ImageManipulationHelper.mm and create a header file for the same
Create a nice little category for UIImage.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html
which can call these methods in turn to create any image manipulation you might want.
Easy does it. And yeah, read up a bit more on using C++ in objectiveC, if you get into trouble and also about categories. They are some of the niftier features of objectivec
I achieved the same,using the help of this awesome link
Let me know if you need any further help.
Cheers!!
Edit :
Check this out ImageFiltering

node-mongodb-native example code vs docs code? which to use?

I just wrote my first nodejs program using the node-mongodb-native driver. I used the documentation code from the github page, i.e.:
var mongodb = require("mongodb"),
mongoserver = new mongodb.Server('localhost', 6574),
dbConnector = new mongodb.Db('test', mongoserver);
dbConnector.open(function(err, db){
if(err)
console.log('oh shit! connector.open error!');
else{
...
However, upon looking at some example code on the github page, I discovered that the set up code looks very different from what I used. Does anybody know if there's any real difference between the different methods? I'm completely new to all this stuff and can't really tell if there's any reason to use one over the other. The code I wrote seems to run fine, but if the creator of the driver is using different code, I figured it would be worth checking if there are any reasons for that.
Thanks in advance for any replies!
Sami
Hi I'm the creator and no there is no particular reason you can't use your style. As when it comes to docs I usually tell people to start with the integration tests as there are many examples on how to do stuff. Unfortunately due to having a fulltime job the docs are not kept up to date at the pace I would like to.
I'm hoping to do something with that come late september but right now I'm trying to just get the driver up to the expected features of mongodb including making it work with 1.9.X and higher.
I'll accept any docs pull requests happily as the more the community help me the more it helps itself :)

Core Plot label not showing

I downloaded library coreplot and I tried the example in this tutorial: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application.
I have two problem:
1) When I compiled example i don't have error and warning but label of example not showing.
2) inside the tutorial the command axisSet.xAxis.axisLabelOffset = 3.0f; give me a error " error: 'axisSet' undeclared (first use in this function)".
What is the problem?
is very important for me a speed reply thank you all :)
best regard
That tutorial is very useful for adding Core Plot to an iPhone app, but the example plots are out of date. If you look into the comments, there is some updated the code, but that may even be out of date.
I would recommend looking at the example apps included with the Core Plot framework. Also, I have been able to find some answers by digging through the documentation (after building it).
EDIT:
Refer to this: