Output of this is:
print(arr.shape)
print(arr.flags)
Output:
(676, 3516)
C_CONTIGUOUS : False
F_CONTIGUOUS : True
OWNDATA : False
WRITEABLE : False
ALIGNED : True
WRITEBACKIFCOPY : False
UPDATEIFCOPY : False
But when I trim the rows using:
arr = arr[preds<0]
I get this output
(670, 3516)
C_CONTIGUOUS : True
F_CONTIGUOUS : False
OWNDATA : True
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
UPDATEIFCOPY : False
Now, when I use catboost to predict on the trimmed version of array, it takes 2x the time to predict compared to the original array. Catboost needs F_CONTIGUOUS array only I guess, not sure what contiguous array means.
How can I make the trimmed version F_CONTIGUOUS?
I am working on a beamer_presentation which consists of several sections. The section titles are too long to fit into the CambridgeUS headline. I have already tried several options from related latex sources to use some short title for the section (say just "Chapter 1" instead of "Chapter 1 with a very-very-very-very-very long title" by \AtBeginSection{\title[Short title]{Long title}}) but yet can't figure out how to manage this in header-includes of R Markdown YAML. I set the section title through # in Markdown
---
title: Title for the whole presentation
subtitle: 'Presentation'
author:
- Author
institute: "Institution"
date: " `r format(Sys.Date(), '%B %d, %Y')`"
output:
beamer_presentation:
latex_engine: xelatex
toc: true
highlight: tango
theme: "CambridgeUS"
colortheme: "lily"
fonttheme: "serif"
slide_level: 3
keep_tex: true
header-includes:
- \setbeamertemplate{navigation symbols}{}
- \AtBeginDocument{\title[Presentation]{Title for whole presentation}}
- \renewcommand{\raggedright}{\leftskip=0pt \rightskip=0pt plus 0cm}
- \def\sectionname{Chapter}
- \AtBeginSubsection{}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
# Chapter 1 with a very-very-very-very-very long title
## Intro
### The first page
In beamer, this is trivial, you can use \section[short version]{long version}. But Markdown makes such an easy job excruciatingly difficult.
However you can trick markdown like this:
---
title: Title for the whole presentation
subtitle: 'Presentation'
author:
- Author
institute: "Institution"
date: " `r format(Sys.Date(), '%B %d, %Y')`"
output:
beamer_presentation:
latex_engine: xelatex
toc: false
highlight: tango
theme: "CambridgeUS"
colortheme: "lily"
fonttheme: "serif"
slide_level: 3
keep_tex: true
header-includes:
- \setbeamertemplate{navigation symbols}{}
- \AtBeginDocument{\title[Presentation]{Title for whole presentation}}
- \renewcommand{\raggedright}{\leftskip=0pt \rightskip=0pt plus 0cm}
- \def\sectionname{Chapter}
- \AtBeginSubsection{}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
```{=latex}
\tableofcontents[hideallsubsections]
\end{frame}
\section[short version for headline]{Chapter 1 with a very-very-very-very-very long title}
\subsection[short subsection for headline]{Intro}
\begin{frame}
\frametitle{The first page}
```
some text
(be careful where you place this command, otherwise you might end up with empty extra frames - that's why I had to switch off the automatic toc and insert it manually...)
config info
spring:
kafka:
consumer:
max-poll-records: 5
cloud:
stream:
instance-count: 5
instance-index: 0
kafka:
binder:
brokers: 127.0.0.1:9092
auto-create-topics: true
auto-add-partitions: true
min-partition-count: 5
bindings:
log-data-in:
destination: log-data1
group: log-data-group
contenttype: text/plain
consumer:
partitioned: true
batch-mode: true
log-data-out:
destination: log-data1
contentType: text/plain
producer:
use-native-encoding: true
partitionCount: 5
# configuration:
# key.serializer: org.apache.kafka.common.serialization.StringSerializer
# value.serializer: org.apache.kafka.common.serialization.ByteArraySerializer
send kafka code:
LogData logData = new LogData();
logData.setId(1)
logData.setVer("22")
MessageChannel messageChannel = logDataStreams.outboundLogDataStreams();
boolean sent = messageChannel.send(MessageBuilder.withPayload(logData).setHeader("partitionKey", key).build());
consumer data listener kafka topic
I think there is an error in processing the data type in kafka, there is no problem, there is no less setting, why is the conversion type error when consuming kafka information, bytes cannot know to convert an entity class
The code here is the consumption data, which is the place where the error is reported
#StreamListener(LogDataStreams.INPUT_LOG_DATA)
public void handleLogData(List<LogData> messages) {
System.out.println(messages);
messages.parallelStream().forEach(item -> {
System.out.println(item);
});
}
Define topic identifier
public interface LogDataStreams {
String INPUT_LOG_DATA = "log-data-in";
String OUTPUT_LOG_DATA = "log-data-out";
String INPUT_LOG_SC = "log-sc-in";
String OUTPUT_LOG_SC = "log-sc-out";
String INPUT_LOG_BEHAVIOR = "log-behavior-in";
String OUTPUT_LOG_BEHAVIOR = "log-behavior-out";
#Input(INPUT_LOG_DATA)
SubscribableChannel inboundLogDataStreams();
#Output(OUTPUT_LOG_DATA)
MessageChannel outboundLogDataStreams();
}
I think there is an error in processing the data type in kafka, there is no problem, there is no less setting, why is the conversion type error when consuming kafka information, bytes cannot know to convert an entity class
Error in last run:
Caused by: org.apache.kafka.common.errors.SerializationException: Can't convert value of class com.xx.core.data.model.LogData to class org.apache.kafka.common.serialization.ByteArraySerializer specified in value.serializer
Caused by: java.lang.ClassCastException: com.xx.core.data.model.LogData cannot be cast to [B
Please help me, how to solve this problem
Each time I run an application I get the error exception error message:
Message: An item with the same key has already been added.
The full InnerException error message is as follows:
=========================
Exception Information
=========================
Message: The type initializer for 'Devart.DbForge.QueryBuilder.QueryBuilderControl' threw an exception.
Source: Devart.DbForge.QueryBuilder
TargetSite: Void .ctor()
HelpLink:
Type: System.TypeInitializationException
Place: 2
Stack:
at Devart.DbForge.QueryBuilder.QueryBuilderControl..ctor()
at Devart.DbForge.QueryBuilder.QueryBuilderService.CreateQueryBuilder()
at Devart.DbForge.SqlDocument.DyMBowSEe()
at Devart.DbForge.SqlDocument.CreateViewControl(IDocumentView view)
at Devart.DbForge.SqlDocument..ctor(IIocContainer container, String fileName, String initialView, Encoding encoding, IHierarchy hierarchy, INode item)
at Devart.DbForge.SqlServer.SqlServerSqlDocument..ctor(IIocContainer container, String fileName, String initialView, Encoding encoding, IHierarchy hierarchy, INode item)
at Devart.DbForge.SqlServer.SqlDocumentFactory.InternalCreateDocument(String moniker, String& view, Boolean createNew, Encoding encoding, IHierarchy hierarchy, INode item)
at Devart.DbForge.DocumentFactory.CreateDocument(String moniker, String& view, Boolean createNew, Encoding encoding, IHierarchy hierarchy, INode item, IPropertyProvider docData, Boolean isModal)
at Devart.Shell.AbstractDocumentService.CreateDocument(String moniker, String& view, Guid factoryId, Boolean createNew, Encoding encoding, IHierarchy hierarchy, INode item, Boolean isModal)
at Devart.Shell.AbstractDocumentService.CreateDocument(String moniker, String view, Guid factoryId, Boolean createNew, Encoding encoding, IHierarchy hierarchy, INode item)
at Devart.DbForge.DbObjects.DbObjectPopupProvider.pPCTilZstB(ICommand , CommandStatus& , Object )
at Devart.Shell.Common.CommandTargetHelper.InvokeCommand(ICommand command, Object instance)
at Devart.Shell.CommandBarService.InvokeCommand(ICommand command, ICollection objects, ICommandTarget primaryCommandTarget)
at Devart.Shell.CommandBarBase.OnItemClicked(IInternalBarControl control)
at Devart.Shell.MenuBar.OnItemClicked(IInternalBarControl control)
at Devart.Shell.CommandBarButton.Button_Click(Object sender, ItemClickEventArgs e)
at Controls.Bars.BarItem.OnClick(BarItemLink link)
at Controls.Bars.BarBaseButtonItem.OnClick(BarItemLink link)
at Controls.Bars.BarButtonItem.OnClick(BarItemLink link)
at Controls.Bars.BarItemLink.OnLinkClick()
at Controls.Bars.BarButtonItemLink.OnLinkClick()
at Controls.Bars.BarItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at Controls.Bars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at Controls.Bars.BarItemLink.OnLinkActionCore(BarLinkAction action, Object actionArgs)
at Controls.Bars.ViewInfo.BarSelectionInfo.ClickLink(BarItemLink link)
at Controls.Bars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
at Controls.Bars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Controls.Bars.Controls.CustomControl.WndProc(Message& msg)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Start of InnerException
Message: An item with the same key has already been added.
Source: mscorlib
TargetSite: Void ThrowArgumentException(System.ExceptionResource)
HelpLink:
Type: System.ArgumentException
Stack:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem item)
at System.Collections.ObjectModel.KeyedCollection`2.InsertItem(Int32 index, TItem item)
at Devart.Diagram.DiagramPalette.GetPen(Color color, Dimension width, PenAlignment alignment)
at Devart.Diagram.DiagramPalette..ctor(ViewService viewService)
at Devart.Diagram.ViewService..ctor(DiagramOptions options)
at Devart.Diagram.Diagram..ctor(String diagramTypeId, IServiceProvider parentProvider)
at Devart.Diagram.Overview.OverviewAddIn..ctor()
at Devart.DbForge.Diagramming.Overview..ctor()
at Devart.DbForge.QueryBuilder.QueryBuilderControl..cctor()
End of InnerException
=========================
Window Layout
=========================
Active document window: 'Merge_SubStage.sql' (Code)
Active window: 'Database Explorer'
Active document 'Merge_SubStage.sql'
Documents:
Name: 'initial-dev.sql', Caption: 'initial-dev.sql', Visible: False, Active view: 'Code', Initial view: 'Code'
Connection name: 'DESKTOP-GV10S60\MSSQLSERVERCARLT', Is open: 'True', Server version: '15.00.2070' string: 'Data Source=DESKTOP-GV10S60\MSSQLSERVERCARLT;Encrypt=False;Integrated Security=False;User ID=lucy'
Name: 'Merge_SubStage.sql', Caption: 'Merge_SubStage.sql', Visible: True, Active view: 'Code', Initial view: 'Code'
Connection name: 'DESKTOP-GV10S60\MSSQLSERVERCARLT', Is open: 'True', Server version: '15.00.2070' string: 'Data Source=DESKTOP-GV10S60\MSSQLSERVERCARLT;Encrypt=False;Integrated Security=False;User ID=lucy'
Toolwindows (visible or have been shown in current session):
Caption: 'Database Explorer', Visible: 'True', DefaultVisibility: 'Always', IsControlCreated: 'True', State: Docked
Caption: 'Find Results', Visible: 'True', DefaultVisibility: 'Always', IsControlCreated: 'True', State: Docked
Caption: 'Error List', Visible: 'True', DefaultVisibility: 'Always', IsControlCreated: 'True', State: Docked
Caption: 'Output', Visible: 'True', DefaultVisibility: 'Always', IsControlCreated: 'True', State: Docked
Caption: 'Start Page', Visible: 'True', DefaultVisibility: 'Always', IsControlCreated: 'True', State: Tabbed
=========================
Connections
=========================
DESKTOP-GV10S60\MSSQLSERVERCARLT (open) - 'Data Source=DESKTOP-GV10S60\MSSQLSERVERCARLT;Encrypt=False;Integrated Security=False;User ID=lucy'. Server version: 15.00.2070
CP-PretBIHydr8Config.cp-retbihydr8config.database.windows.net (current) (open) - 'Data Source=cp-retbihydr8config.database.windows.net;Encrypt=False;Initial Catalog=CP-PretBIHydr8Config;Integrated Security=False;User ID=carlton#keyloop.co.uk;Authentication="Active Directory Password"'. Server version: 12.0.2000.8
CP-pretbireferencedev.cp-retbihydr8config.database.windows.net (open) - 'Data Source=cp-retbihydr8config.database.windows.net;Encrypt=False;Initial Catalog=CP-pretbireferencedev;Integrated Security=False;User ID=carlton#keyloop.co.uk;Authentication="Active Directory Password"'. Server version: 12.0.2000.8
cp-metadata-transform-db-test.cp-retbihydr8config.database.windows.net - 'Data Source=cp-retbihydr8config.database.windows.net;Encrypt=False;Initial Catalog=cp-metadata-transform-db-test;Integrated Security=False;User ID=carlton#keyloop.co.uk;Authentication="Active Directory Password"'
Execution history
Store queries: True
Store period : 60 (days)
Available period : 60 (days)
Folder: %appdata%\Devart\dbForge Studio for SQL Server\ExecutedQueries
Max script size: 1024 (KB)
Initial interval: Week
History folder content:
C:\Users\Carlton\AppData\Roaming\Devart\dbForge Studio for SQL Server\ExecutedQueries\ExecutedQueries.db (8822784)
The error is generated from my SQL application that I use to run SQL queries on
Do you have any thoughts on how to resolve this issue?
Thanks
Looks to be caused by a recent Windows update and a known issue to DevArt: https://forums.devart.com/viewtopic.php?f=32&p=200230
Problem solved with version 6.0.563:
The application fails with a critical error when trying to create diagram objects after installing the KB5006670, KB5006672 or KB5006674 Windows update
https://www.devart.com/dbforge/sql/studio/revision_history.html
Built-in MATLAB classes have values for a Description and DetailedDescription attribute:
>> ?handle
ans =
meta.class handle
Package: meta
Properties:
Name: 'handle'
Description: 'Base class for handle classes'
DetailedDescription: ''
[snip]
Similarly, some methods and properties of built-in classes have the same attributes:
>> a = ?containers.Map;
>> a.PropertyList(1)
ans =
meta.property handle
Package: meta
Properties:
Name: 'Count'
Description: 'Number of pairs in the collection'
DetailedDescription: ''
[snip]
How can I set these attributes for my classes/methods/properties?
Use arguments to the classdef:
classdef (Description='A type of story.',...
DetailedDescription='Once upon a time..') MyFairyTaleClass
Commandline:
>> ?MyFairyTaleClass
ans =
meta.class handle
Package: meta
Properties:
Name: 'MyFairyTaleClass'
Description: 'A type of story.'
DetailedDescription: 'Once upon a time..'
Hidden: 0
Sealed: 0
ConstructOnLoad: 0
HandleCompatible: 0
InferiorClasses: {0x1 cell}
This is an undocumented feature it seems.