origOptions error with string containing EXDATE of jakubroztocil/rrule - icalendar

Currently I am using the library jakubroztocil/rrule
When I convert a string containing EXDATE to rrule the origOptions attribute I get is always an empty object. But if I leave it out, it returns true.
Ex:
DTSTART;TZID=Asia/Saigon:20220808T080000\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO;UNTIL=20220907T170000Z
With this string I get the correct result
DTSTART;TZID=Asia/Saigon:20220808T080000\nRRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO;UNTIL=20220907T170000Z\nEXDATE;TZID=Asia/Saigon:20220808T080000
With this string I get the wrong result
Looks like my problem will be something similar to #333
But I get nothing from it.
Thank u very much

Related

Uri.Parse() is adding random characters inside the uri

When I try to create a Uri object using Uri.parse, I get %0D%0A added after `_countryCode` value
This is what gets logged
http://api.geonames.org/countryInfo?country=US%0D%0A&username=medcollapp
value of _countryCode is a string like US or IN.
_countryCode is not empty I made sure of it.
I have no idea how to fix this any help would be appreciated.

Swift string with key-value, is this format standard ? How can I get it as a dictionary?

I work with an array of string, each string var is a coded object.
I want to decode the object, when I print a string var I get something structured like that :
"firstName=\"Elliot\" lastName=\"Alderson\" gender=\"male\" age=\"33\",some description I also need to get"
Is that a standard format to store key value properties ? I can't find anything on internet. The keys are always the same so that's not a big deal to get theses values as a dictionary but I would like to know if there is like a best practice method to get theses data instead of just searching for each key and then reach value from the first quote to the second one (for each value)
Because my file is 30000 lines so I better choose the more optimized way.
Thanks !

Parse setting explicit type using REST

I know you can set a Date field explicitly like so:
"date_brewed":{
"__type":"Date",
"iso":"2009-10-15T00:00:00.000Z"
}
But is there anyway to explicitly set the column type of 'Number' using REST? For instance, I'd like to set the column 'batch_size' to a Number instead of a string but when POST'ing via rest it keeps getting created as a string type column.
Meh, this was more of a Perl issue than a Parse issue.
What I had to do to tell Perl to treat the number like an actual number was to add a zero to the value. :/

Get the string inside objectId

I have mongoId like this :
ObjectId("53056c1e211b6f2e5d8b4567")
I only want
"53056c1e211b6f2e5d8b4567"
I tried toString but it returns the whole thing as string. I know I can extract using string operations, but is there a native way to do so ?
You can do it:
ObjectId("53056c1e211b6f2e5d8b4567").valueOf()
it have to return the following string:
53056c1e211b6f2e5d8b4567
For more details, see docs

array_reverse() expects parameter 1 to be array, string given in

I am grabbing a .txt file and trying to reverse it, but I get this error when I try to, I don't understand it. Help please?
array_reverse() expects parameter 1 to
be array, string given in ......
Here is the code:
$dirCont = file_get_contents($dir, NULL, NULL, $sPoint, 10240000);
$invertedLines = array_reverse($dirCont);
echo $invertedLines;
A string is not an array? Even if it were (as in C strings) it would not work as you expected. You'll need to split the file on line breaks (if you're trying to reverse to get the end of the file first).
$invertedLines = array_reverse(preg_split("/\n/", $dirCont));
I think you need to pass the value on an array.
array_reverse(array($dircont));
This is working fine for me.