ST3 Can't write dot ["."] while "Java syntax" is on - java

I am using Sublime Text 3 and I can't (that means when I press the key nothing happens) . while I have active java syntax. When I switch to another syntax (f.e. Javascript) problem is gone. Do anyone solved had/solved this problem?
[Installed packages]
{
"installed_packages":
[
"AngularJS",
"Better JavaScript",
"Display Functions (Java)",
"DocBlockr",
"EditorConfig",
"Emmet",
"Format SQL",
"Git",
"Goto Documentation",
"Grunt",
"HexViewer",
"HTML Boilerplate",
"HTML5",
"JavaPropertiesEditor",
"Javascript Beautify",
"jQuery",
"JsFormat",
"LESS",
"LineEndings",
"MoveTab",
"Nette",
"Nunjucks Syntax",
"Package Control",
"PHP Namespace Command",
"PHP-Twig",
"Phpcs",
"PhpDoc",
"Quick File Move",
"SideBarEnhancements",
"SJSON",
"SublimeLinter",
"SublimeLinter-csslint",
"SublimeLinter-html-tidy",
"SublimeLinter-jshint",
"SublimeLinter-json",
"SublimeLinter-php",
"Theme - Phoenix",
"VCS Gutter",
"WordCount"
]
}
[User settings]
{
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"default_line_endings": "unix",
"detect_slow_plugins": false,
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"font_face": "Consolas",
"font_size": 10,
"highlight_line": true,
"ignored_packages":
[
"JavaScript",
"Vintage",
"tern_for_sublime"
],
"show_encoding": true,
"show_line_endings": true,
"translate_tabs_to_spaces": true
}

According to sergioFC comment I did sublime.log_commands(True) and it showed up that package Display Functions (Java) is "blocking" the . key. Disabling the package solved my problem.

Related

How do I auto skip a another line instead of word wrapping in vs code for java?

I enabled word wrap settings in vs code for java. I realized it don't actually skip a line:
But I want to all of them is a different line, and it will be saved that way:
Here is my word wrap settings:
And this is my settigns.json file:
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"files.autoSave": "afterDelay",
"workbench.colorTheme": "One Dark Pro",
"python.pythonPath": "C:\\Users\\atleo\\AppData\\Local\\Programs\\Python\\Python39\\python.exe",
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
"C_Cpp.updateChannel": "Insiders",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.languageServer": "Pylance",
"[Log]": {
"editor.wordWrap": "off"
},
"java.configuration.checkProjectSettingsExclusions": false,
"python.autoComplete.addBrackets": true,
"python.analysis.completeFunctionParens": true,
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"editor.rulers": [
{ "column": 80,
"color": "#307777"}
],
"kite.showWelcomeNotificationOnStartup": false,
"java.configuration.runtimes": [
],
"[java]": {
"editor.suggest.snippetsPreventQuickSuggestions": false
},
"files.associations": {
"*.java": "java"
},
"java.refactor.renameFromFileExplorer": "autoApply",
"git.autofetch": true,
"editor.wordWrap": "wordWrapColumn",
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": true
},
}
This feature will be added in next update, which can Provide better format configuration experience.
[UPDATE]
With java extension latest release, you can achieve this feature from Command Palette then choose java: open java formatter settings with preview. Detailed information please view Java on Visual Studio Code Update – May 2021.

How to send multiple JSON in single request(Jmeter)

Though I could see this question might be repeated but couldn't find any similar solution for the below JSON strut. Pls suggest.
I have excel sheet where the data's in columns look like :
CSV file data
My expected JSON as:
{
"Child ": {
"10"
: { "Post": { "Kid-R":1 },
"Var": [1,1 ],
"Tar": [2,2],
"Fur": [3,3]},
"11":
{"Post": {"Kid-R":2 },
"Var": [1,1 ],
"Tar": [2,2 ],
"Fur": [5,4 ]}
},
"Clone": [],
"Birth": 2,
"TT": 11,
"Clock": ${__time(/1000,)}
}
I have tried incorporating beanshell preprocessor in JMeter & tried below code:
def builder = new groovy.json.JsonBuilder()
#groovy.transform.Immutable
class Child {
String post
String var
String Tar
String Fur
}
def villas = new File("Audit_27.csv")
.readLines()
.collect { line ->
new child (line.split(",")[1],(line.split(",")
[2]+","+line.split(",")[3]),(line.split(",")[4]+","+line.split(",")
[5]),(line.split(",")[6]+","+line.split(",")[7]))}
builder(
Child :villas.collect(),
"Clone": [],
"Birth": 2,
"TT": 11,
"Clock": ${__time(/1000,)}
)
log.info(builder.toPrettyString())
vars.put("payload", builder.toPrettyString())
And I could see below response only:
Note: I dont know how to declare "Key" value (line.split(",")[0]) in the above solution.
{
"Child": [
{
"post": "\"\"\"Kid-R\"\":1\"",
"var": "\"[2,2]\"",
"Tar": "\"[1,1]\"",
"Fur": "\"[3,3]\""
},
{
"post": "\"\"\"Kid-R\"\":2\"",
"var": "\"[2,2]\"",
"Tar": "\"[1,1]\"",
"Fur": "\"[3,3]\""
}
],
"Clone": [],
"Birth": 2,
"TT": 11,
"CLock": 1585219797
}
Any help would be greatly appreciated
You're copying and pasting the solution from this answer without understanding what you're doing.
If you change class name from VILLA to own you need to use new own instead of new VILLA
Also this line won't compile: Clock: <take system current time> you need to use System.currentTimeMillis() or appropriate function of the Date class in order to generate the timestamp.
If you want a comprehensive answer, you need to provide:
Well-formatted CSV file
Valid JSON payload
In the meantime I would recommend getting familiarized with the following material:
Apache Groovy: Parsing and producing JSON
Apache Groovy - Why and How You Should Use It
Reading a File in Groovy
Actually I am gonna follow DmirtiT suggestions, as mentioned in some of post to use random variable for bulk API request. Same answer it helped me here as well to generate multiple JSON structure with unique data. Thanks..

Change values of respective columns in InfluxDB

I have below given sampleMeasurement1; I want to update values of respective columns in InfluxDB. How to update those values?
SELECT * FROM sampleMeasurement1;
{ "results": [ { "series": [ { "name": "sampleMeasurement1", "columns": [ "time", "disk_type", "field1", "field2", "hostname" ], "values": [ [ 1520315870774000000, null, 12212, 22.44, "server001" ], [ 1520315870843000000, "HDD", 112, 21.44, "localhost" ] ] } ] } ] }
We can't change tag values via InfluxDB commands, we can however write a client script that can change the value of a tag by inserting "duplicate" points in the measurement with the same timestamp, fieldset and tagset, except that the desired tag will have its value changed.
Point with wrong tag ( https://docs.influxdata.com/influxdb/v1.4/write_protocols/line_protocol_reference/#syntax ):
cpu,hostname=machine.lan cpu=50 1514970123
After running
INSERT cpu,hostname=machine.mydomain.com cpu=50 1514970123
a SELECT * FROM CPU would include
cpu,hostname=machine.lan cpu=50 1514970123
cpu,hostname=machine.mydomain.com cpu=50 1514970123
After the script runs all the INSERT commands, you'll need to drop the obsolete series of points with the old tag value:
DROP SERIES FROM cpu WHERE hostname='machine.lan'
Change tag value in InfluxDB

jqgrid search with loadonce

i'm having a problem with jqgrid searching. my code works perfectly with add, edit, delete except searching. Once I load it the data shown fine, but if I click find button, it never does anything.
I have been looking for it everywhere but I can't find what's wrong. If I use loadonce : true then searching works but now having problem with paging and sorting the grid. I wanna make it work perfectly with paging, sorting, and searching.
here's my code.
$("#material_list").jqGrid({
url:"MY URL",
editurl:"MY URL",
mtype:"post",
caption:"LIST",
datatype:"json",
height:"auto",
jsonReader : {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: true
},
rowNum:10,
rowList:[5,10,15],
colNames:["PROD_CODE","PROD_NAME","COMP_CODE","UNIT","STANDARD","USEFLAG"],
colModel:[
{name:"PROD_CODE", index:"PROD_CODE", editable:true},
{name:"PROD_NAME", index:"PROD_NAME", editable:true},
{name:"COMP_CODE", index:"COMP_CODE", editable:true},
{name:"UNIT", index:"UNIT", editable:true},
{name:"STANDARD", index:"STANDARD", editable:true},
{name:"USEFLAG", index:"USEFLAG", editable:true}
],
pager:"#pager",
autowidth:true,
viewrecords:true,
//loadonce:true,
});
$("#material_list").jqGrid(
"navGrid",
"#pager",
{search:true, edit:true, add:true, del:true},
{closeAfterEdit:true, reloadAfterSubmit:true},
{closeAfterAdd:true, reloadAfterSubmit:true},
{reloadAfterSubmit:true}
);

Get node details in Alfresco via back-end webscript

I want to get node details via Backend webscript but I have some issues. I've tried two webscripts:
alfresco/service/slingshot/doclib2/node/workspace/SpacesStore/a10a0777-40f4-42da-b236-8845eb26294e
alfresco/service/slingshot/doclib/node/workspace/SpacesStore/a10a0777-40f4-42da-b236-8845eb26294e.
The first one gave me this response :
{
"status" :
{
"code" : 410,
"name" : "Gone",
"description" : "Resource is no longer available at the server and no forwarding address is known."
},
"message" : "Location is 'null'. (No permission?)",
"exception" : "",
"callstack" :
[
],
"server" : "Enterprise v4.2.0 (r57217-b28) schema 6,034",
"time" : "Jun 10, 2014 10:28:15 AM"
}
and the second :
{
"status" :
{
"code" : 500,
"name" : "Internal Error",
"description" : "An error inside the HTTP server which prevented it from fulfilling the request."
},
"message" : "05100028 Wrapped Exception (with status template): 05100077 Failed to execute script 'classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/node.get.js': 05100076 Site container UploadComponent.java does not refer to a folder.",
"exception" : "org.springframework.extensions.webscripts.WebScriptException - 05100028 Wrapped Exception (with status template): 05100077 Failed to execute script 'classpath*:alfresco\/templates\/webscripts\/org\/alfresco\/slingshot\/documentlibrary\/node.get.js': 05100076 Site container UploadComponent.java does not refer to a folder.",
"callstack" :
[
"" ,"org.alfresco.repo.site.SiteServiceException: 05100076 Site container UploadComponent.java does not refer to a folder."
,"
Updated :
You can notice that in the second webSript the error says that my file UploadComponent.java does not refer to a folder. Does this script take a cm:folder as an argument. If there is another web-script that returns the node details (properties: nodeRef, mimetype, size... ) from nodeRef please show it to me. thanks !
Pro tip - You can see all of the available web scripts at http://localhost:8080/alfresco/service/index/uri/
You're supposed to use the CMIS web scripts where possible, and this also makes for the simplest request.
http://<MyAlfresco>/alfresco/service/cmis/i/8826b8f4-9f61-41a4-9f21-14ad5b6395ab
This returns the full set of properties for the nodeRef workspace://SpacesStore/8826b8f4-9f61-41a4-9f21-14ad5b6395ab.
Some of the XML you will receive is:
<cmis:properties>
<cmis:propertyInteger propertyDefinitionId="cmis:contentStreamLength" displayName="Content Stream Length" queryName="cmis:contentStreamLength"><cmis:value>36864</cmis:value></cmis:propertyInteger>
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId" displayName="Object Type Id" queryName="cmis:objectTypeId"><cmis:value>cmis:document</cmis:value></cmis:propertyId>
<cmis:propertyString propertyDefinitionId="cmis:versionSeriesCheckedOutBy" displayName="Version Series Checked Out By" queryName="cmis:versionSeriesCheckedOutBy"/>
<cmis:propertyBoolean propertyDefinitionId="cmis:isPrivateWorkingCopy" displayName="Is private working copy" queryName="cmis:isPrivateWorkingCopy"/>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesCheckedOutId" displayName="Version Series Checked Out Id" queryName="cmis:versionSeriesCheckedOutId"/>
<cmis:propertyId propertyDefinitionId="cmis:versionSeriesId" displayName="Version series id" queryName="cmis:versionSeriesId"><cmis:value>workspace://SpacesStore/8826b8f4-9f61-41a4-9f21-14ad5b6395ab</cmis:value></cmis:propertyId>
<cmis:propertyBoolean propertyDefinitionId="cmis:isLatestVersion" displayName="Is Latest Version" queryName="cmis:isLatestVersion"><cmis:value>true</cmis:value></cmis:propertyBoolean>
</cmis:properties>
I also checked and this should give you the properties for any node regardless of where it is situated in your Alfresco instance.
There are a few webscripts you can use, such as the CMIS ones, but I think the simplest is probably the Slingshot Document Library Node webscript, with ID org/alfresco/slingshot/documentlibrary/node.get. You can read about it at http://localhost:8080/alfresco/service/script/org/alfresco/slingshot/documentlibrary/node.get
For a node with noderef workspace://SpacesStore/357b6dad-d434-4a46-a7e0-731df50e5e90 the URL is http://localhost:8080/alfresco/service/slingshot/doclib/node/workspace/SpacesStore/357b6dad-d434-4a46-a7e0-731df50e5e90, and the JSON returned looks something like:
{
"metadata":
{
"parent":
{
"nodeRef": "workspace://SpacesStore/7f4e374c-7c7c-4356-bf8f-0ec6bfc5eac4",
"permissions":
{
"userAccess":
{
"permissions": true,
"edit": true,
"delete": true,
"cancel-checkout": false,
"create": true
}
}
},
"onlineEditing": true
},
"item":
{
"nodeRef": "workspace://SpacesStore/357b6dad-d434-4a46-a7e0-731df50e5e90",
"nodeType": "cm:content",
"type": "document",
"mimetype": "application\/vnd.ms-project",
"isFolder": false,
"isLink": false,
"fileName": "testPROJECT.mpx",
"displayName": "testPROJECT.mpx",
"status": "",
"title": "testPROJECT.mpx",
"description": "",
"author": "",
"createdOn": "2014-06-10T15:17:33.791+01:00",
"createdBy": "Administrator",
"createdByUser": "admin",
"modifiedOn": "2014-06-10T15:17:42.258+01:00",
"modifiedBy": "Administrator",
"modifiedByUser": "admin",
"lockedBy": "",
"lockedByUser": "",
"size": "3555",
"version": "1.0",
"contentUrl": "api/node/content/workspace/SpacesStore/357b6dad-d434-4a46-a7e0-731df50e5e90/testPROJECT.mpx",
"webdavUrl": "\/webdav\/User%20Homes\/administrator\/testPROJECT.mpx",
"actionSet": "document",
"tags": [],
"activeWorkflows": "",
"isFavourite": false,
"likes":
{
"isLiked": false,
"totalLikes": 0
},
"location":
{
"repositoryId": "8ff64edd-57d3-4198-ac3d-8386f47bf5bb",
"site": "",
"siteTitle": "",
"container": "",
"path": "\/User Homes\/administrator",
"file": "testPROJECT.mpx",
"parent":
{
"nodeRef": "workspace:\/\/SpacesStore\/7f4e374c-7c7c-4356-bf8f-0ec6bfc5eac4"
}
},
"permissions":
{
"inherited": true,
"roles":
[
"ALLOWED;administrator;All;INHERITED",
"ALLOWED;ROLE_OWNER;All;INHERITED"
],
"userAccess":
{
"permissions": true,
"edit": true,
"delete": true,
"cancel-checkout": false,
"create": true
}
},
"custom": {},
"actionLabels":
{
}
}
}
I believe that's all the metadata and properties you're after. It's a webscript used by Share, so ought to be well tested and used. As you can see from the location section, it's a webscript which works for both site-based and non-site nodes equally
(If you do hit problems with it, probably best to ensure you're running the latest service pack if on enterprise, or newest release for community)

Categories