How do I customize a ckeditor 4.2 builtin plugin like links?

You got to observe dialogDefinition event to do this: CKEDITOR.on( ‘dialogDefinition’, function( evt ) { var dialog = evt.data; if ( dialog.name == ‘link’ ) { // Get dialog definition. var def = evt.data.definition; // Add some stuff to definition. def.addContents( { id: ‘custom’, label: ‘My custom tab’, elements: [ { id: ‘myField1’, type: ‘text’, … Read more

OpenAI GPT-3 API: How do I make sure answers are from a customized (fine-tuning) dataset?

Semantic search example The following is an example of semantic search based on embeddings using the OpenAI API. Wrong goal: OpenAI API should answer from the fine-tuning dataset if the prompt is similar to the one from the fine-tuning dataset It’s completely wrong logic. Forget about fine-tuning. As stated in the official OpenAI documentation: Fine-tuning … Read more

Scala-Spark Dynamically call groupby and agg with parameter values

Your code is almost correct – with two issues: The return type of your function is DataFrame, but the last line is aggregated.show(), which returns Unit. Remove the call to show to return aggregated itself, or just return the result of agg immediately DataFrame.groupBy expects arguments as follows: col1: String, cols: String* – so you … Read more

Print an error message without printing a traceback and close the program when a condition is not met

You can turn off the traceback by limiting its depth. Python 2.x import sys sys.tracebacklimit = 0 Python 3.x In Python 3.5.2 and 3.6.1, setting tracebacklimit to 0 does not seem to have the intended effect. This is a known bug. Note that -1 doesn’t work either. Setting it to None does however seem to … Read more

How to use Custom Serialization or Deserialization in WCF to force a new instance on every property of a datacontact ?

If your are using DataContract serialization then you can override its default behaviour using the OnDeserialized attribute. From MSDN: When applied to a method, specifies that the method is called during deserialization of an object in an object graph. The order of deserialization relative to other objects in the graph is non-deterministic. Here is my … Read more