Updated RKRelationship Mapping with RestKit - ios

I've been diving into RestKit lately but since the newest version came out so recently, all the tutorials I've found both on their github and just on the web are all for old versions. Normally that's not a problem but a lot of classes that used to exist now don't, which of course, makes all the tutorials useless.
For the sake of everyone that uses it, for the newest version of RestKit, how would you relationship map this sample JSON?
{
"entities": {
"message": [
"dentist appointment"
],
"dateRange": [
{
"start": "2012-11-15",
"end": "2012-11-16"
}
],
"time": [
"02:00:00PM"
]
},
"action": "REMINDER_SET",
"category": "REMINDER"
}
Upvote this if you have the same question.

Related

Performance of Hyperledger Composer

We are building an application, in which one of the assets will have a concept array of 10,000 records. We need to know, what could be the performance time for this asset retrieval.
Sample Asset Type.
{
"$class": "org.example.basic.Asset",
"userId": "pradeep",
"companyName": "ABC",
"records": [
{
"$class": "org.example.basic.Record",
"recordId": "1",
"recordName": "record1",
"recordType": "Manual",
"dateCommitted": "2018-09-21T12:38:04.464Z",
"skills": [
{
"$class": "org.example.basic.Skill",
"skillLevel": "BASIC",
"Langauge": "Node.js"
},
{
"$class": "org.example.basic.Skill",
"skillLevel": "EXPERT",
"Langauge": "Java"
}
]
},
{
"$class": "org.example.basic.Record",
"recordId": "2",
"recordName": "record2",
"recordType": "Auto",
"dateCommitted": "2018-09-21T12:38:04.464Z",
"skills": [
{
"$class": "org.example.basic.Skill",
"skillLevel": "BASIC",
"Langauge": "Node.js"
},
{
"$class": "org.example.basic.Skill",
"skillLevel": "EXPERT",
"Langauge": "Java"
}
]
},]
}
There will be 10,000 records and 1000 skills. Please suggest.
I don't think anybody will be able to answer you question of performance time. It will depend partly on your coding, but mostly on your Fabric design/configuration and your available hardware.
Testing on a variety of Fabric and Hardware configurations may help you.
You might also want to look at Hyperledger Caliper for performance testing.
I'm not sure from the example data - but are you including an array of 1000 concepts in a single Asset? That seems like a lot to manage and retrieve/search through.
Looking at your number of 10,000 records - are you developing a prototype.demo or POC?
Have you seen this announcement regarding Composer? I think that most people will now regard Composer as a good vehicle for demo/ptototype/POC, but not for Production where performance and long term support are required.

Mapping without KVC , RestKit version:0.27.0

I have a JSON data without a key on the top level, I need to POST it to our server, but how could I map that using RestKit (version: 0.27.0):
e.g.
[
{ "title": "RestKit Object Mapping Intro",
"body": "This article details how to use RestKit object mapping...",
"author": {
"name": "Blake Watters",
"email": "blake#restkit.org"
},
"publication_date": "7/4/2011"
}
]
PS: I've seen some workaround on this issue, but unfortunately, none of them could work for the newest version 0.27.0.
Thanks in advance

Make electron app smaller?

I just recently built an electron app and packaged it using electron-packager. The .exe file is 55,000kb and the rest of the folder is quite bulky as well. Is there any way to take down the size of this application at all?
Here's a github issue on it.
The comment I'm emphasizing is:
That's the expected size, there is no way to make it smaller.
The reason why it's so big is because electron is loading most of chromium inside that 50mb file.
So no unfortunately there is no way to make it smaller sorry.
A somewhat helpful post from that github thread suggests removing unnecessary node modules via electron-packager. It also offers a bit more explanation on why files are so large.
You can zip your app and if you're using electron-packager you can ignore some node modules that you don't need when the app is running, this makes it a bit smaller. For instance I have a 37MB zipped Electron app (Note Windows version is much larger as it contains a copy of Git). But Electron will always have a large part of Chrome in it so there is only so much that can be done. Electron itself right now is ~33MB.
There is a way to reduce Electron size drastically (up to 99%, depending how big is your app), by using native browser, available in each OS, instead of loading webkit. BUT as built in browsers don't have the system API's, you will also be drastically limited in what you can do. But, if you need basic web ui app, this might be the best solution out there, though, it must be mentioned, that it might have some unexpected issues, as you will need to test your app on different OS'es browsers..
The method i'm talking about is available in awesome post Put your Electron app on a diet with Electrino by Pauli Olavi Ojala
If you are using Electron Builder https://www.electron.build you should use the various methods listed to remove files and folders for specific platforms.
Example
{
"name": "Example",
"version": "1.1.2",
"description": "",
"main": "main.js",
"scripts": {},
"build": {
"appId": "com.example",
"afterSign": "notarize.js",
"fileAssociations": [{
"ext": [
"mp4"
],
"name": "Media File",
"role": "Viewer"
}],
"dmg": {
"sign": true
},
"mac": {
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist",
"icon": "build/icon.png",
"category": "public.app-category.video",
"extraFiles": [{
"from": "resources/bin/mac",
"to": "Resources/bin/mac",
"filter": [
"**/*"
]
},
{
"from": "node_modules/platforms/darwin-x64/bin",
"to": "Resources/bin/mac",
"filter": [
"**/*"
]
}
],
"files": [
"!gruntfile.js",
"!README.md",
"!notarize.js",
"!.env",
"!minify.js",
"!src/*",
"!.git/*",
"!resources/*"
]
},
"win": {
"target": "nsis",
"signingHashAlgorithms": [
"sha1"
],
"certificateFile": "",
"certificatePassword": "",
"files": [
"!gruntfile.js",
"!README.md",
"!notarize.js",
"!.env",
"!minify.js",
"!.git/*",
"!resources/mac/*"
]
}
},
"author": "Example",
"license": "ISC",
"devDependencies": {
},
"dependencies": {
}
}

Visual Studio error when trying to create MVC application on Azure

I want to create a new MVC application with Visual Studio Community 2015. I've followed this tutorial on how to do this and I've gone as far as creating the application, but after I click 'Create' to create the application, the error message below is displayed.
Is this message referring to the Azure API version for Visual Studio? If so, how should I resolve this? I've looked online and I can't seem to find anything about this error. I'm a newbie at this, so I'm not sure if I've overlooked anything, but I don't seem to according to the tutorial. Any help is greatly appreciated!
UPDATE
The image below shows the SQL API version I've found. It's odd thought, because it does not match the version shown in the error message.
As the error message says the API have to be in correct format yyyy-MM-dd.
API version I was using recently was 2014-04-01 or 2014-04-01-preview. Try any of these when defining SqlServer resouce.
Also have a look at resources.azure.com if you have any SqlServers created and double check the API version from there..
This does not relate to the Azure Sdk version for Visual Studio. It relates to the (in your case) API version used to create SqlServer instance using Azure Resource Manager
Sample SqlServer and database resource node:
"resources": [
{
"name": "[parameters('sqlServerName')]",
"type": "Microsoft.Sql/servers",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [ ],
"tags": {
"displayName": "SqlServer"
},
"properties": {
"administratorLogin": "[parameters('sqlDatabaseUserName')]",
"administratorLoginPassword": "[parameters('sqlDatabasePassword')]",
"version": "12.0"
},
"resources": [
{
"name": "AllowAllWindowsAzureIps",
"type": "firewallrules",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', parameters('sqlServerName'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "255.255.255.255"
}
},
{
"name": "[parameters('databaseName')]",
"type": "databases",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"kind": "v12.0",
"dependsOn": [
"[parameters('sqlServerName')]"
],
"tags": {
"displayName": "SqlDatabase"
},
"properties": {
"collation": "[parameters('sqlDatabaseUriNameCollation')]",
"edition": "[parameters('sqlDatabaseUriNameEdition')]",
"maxSizeBytes": "10737418240"
//10 gigs currently
}
}
]
}
Also as #Robert McKee pointed make sure you have latest Azure SDK (2.7.1 or 2.8 released recently)
I'm not sure how, but this evening when I went to try it again, it worked. Thank you all for your answers!

How to download attachments from JIRA v6.3.15 in java

I'm trying to get list of JIRA issues created after a given date and download the respective attachment files from my application in java. The JIRA Server version I am currently using is 6.3.15.
When I searched on web I found the below REST client, however it says it supports till JIRA Server 6.0. I want to know whether it supports 6.3.15 as well, if not are there any other alternate solutions?
REST Java Client for JIRA
by Atlassian Labs for JIRA Server 5.0 - 6.0
https://marketplace.atlassian.com/plugins/com.atlassian.jira.jira-rest-java-client
REST Java Client for JIRA is a wrapper around JIRA REST https://docs.atlassian.com/jira/REST/6.3.15/.
I see that there was no changes in attachment REST methods between 6.0 and 6.3.15. Take the current version and I am sure it will work for you.
Another way is to directly use JIRA REST API and in your case it can be even simpler. I guess you need:
call https://YOUR_JIRA/rest/api/2/issue/CURRENT-ISSUE?fields=attachment for one issue or
https://YOUR_JIRA/rest/api/2/search?jql=YOUR_JQL&fields=attachment to return set of issues matching JQL query (make sure to take care about paging if you expect more than 1000 issues)
For each issue there will be a section with attachments:
"attachment":
[
{
"self": "https://vkrupach.atlassian.net/rest/api/2/attachment/10100",
"id": "10100",
"filename": "to test",
"author":
{
"self": "https://vkrupach.atlassian.net/rest/api/2/user?username=vkrupach",
"name": "vkrupach",
"key": "vkrupach",
"emailAddress": "vkrupach#ukr.net",
"avatarUrls":
{
"48x48": "https://vkrupach.atlassian.net/secure/useravatar?avatarId=10122",
"24x24": "https://vkrupach.atlassian.net/secure/useravatar?size=small&avatarId=10122",
"16x16": "https://vkrupach.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
"32x32": "https://vkrupach.atlassian.net/secure/useravatar?size=medium&avatarId=10122"
},
"displayName": "Volodymyr Krupach [Administrator]",
"active": true,
"timeZone": "Europe/Moscow"
},
"created": "2015-04-19T10:05:59.696+0300",
"size": 469,
"mimeType": "text/html",
"content": "https://vkrupach.atlassian.net/secure/attachment/10100/to+test"
}
]
"content": is direct link to file.

Resources