How to output serialized JSON view data as an array of objects, instead of wrapped in an outer object?

Set a string for the _serialize option instead of an array. An array indicates that there might be multiple view vars that need to be serialized, and that requires them to be packed into separate object properties. $this->set(array( ‘platformusers’ => $platformusers, ‘_serialize’ => ‘platformusers’ )); That should give you the desired result.

Set data type like number, text and date in excel column using Microsoft.Office.Interop.Excel in c#

To set a range to text: xlYourRange.NumberFormat = “@”; You can also prefix a value you put in a cell with an apostrophe for it to format it as text: xlYourRange.Value = “‘0123456”; To set a range to number xlYourRange.NumberFormat = “0”; Obviously if you want to set the format for the entire column then … Read more

Best way to convert Java SQL Date from yyyy-MM-dd to dd MMMM yyyy format

Object such as java.sql.Date and java.util.Date (of which java.sql.Date is a subclass) don’t have a format of themselves. You use a java.text.DateFormat object to display these objects in a specific format, and it’s the DateFormat (not the Date itself) that determines the format. For example: Date date = …; // wherever you get this DateFormat … Read more

Selectively coloring text in RichTextBox

Try this: static void HighlightPhrase(RichTextBox box, string phrase, Color color) { int pos = box.SelectionStart; string s = box.Text; for (int ix = 0; ; ) { int jx = s.IndexOf(phrase, ix, StringComparison.CurrentCultureIgnoreCase); if (jx < 0) break; box.SelectionStart = jx; box.SelectionLength = phrase.Length; box.SelectionColor = color; ix = jx + 1; } box.SelectionStart = … Read more