i have a problems with my code
the code:``
$test = json_decode($assesment_keperawatan_iri[0]->formjson_bayi);
Related
I'm trying to get today's events from Calendar.app in Hammerspoon.
I have the following Javascript, that works well in the Script Editor:
But, if I paste this in a call to hs.osascript.javascript(), like this:
local source = [[
var Calendar = Application("Calendar")
var startDate = new Date
startDate = startDate
startDate.setHours(0)
startDate.setMinutes(0)
startDate.setSeconds(0)
var endDate = new Date
endDate.setHours(23)
endDate.setMinutes(59)
endDate.setSeconds(59)
var projectCalendars = Calendar.calendars.whose({name: "MyCal"})
var projectCalendar = projectCalendars[0]
var events = projectCalendar.events.whose({startDate: {_greaterThan: startDate}, endDate: {_lessThanEquals: endDate}})
var event = events[0]
event().summary()
]]
print("yyy", hs.osascript._osascript(source, "JavaScript"))
This produces the following error:
yyy false nil {
NSLocalizedDescription = "Error: Error: An error occurred.";
NSLocalizedFailureReason = "Error: Error: An error occurred.";
OSAScriptErrorBriefMessageKey = "Error: Error: An error occurred.";
OSAScriptErrorMessageKey = "Error: Error: An error occurred.";
OSAScriptErrorNumberKey = "-1743";
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
Using hs.osascript.javascript produces the same behavior.
I'm not sure what I'm doing wrong here. Can someone advise please? I'm running Big Sur.
I get an error 73 "Array access..." with code:
#include "args.bas"
Dim aargs(1) As Args.Arg
Dim args_num As Integer = 0
args_num = Args.ParseArgs(aargs) 'error 73: Array access, index expected, before ')' in 'args_num = Args.ParseArgs(aargs)'
Print args_num
ParseArgs is:
#pragma once
Namespace Args
...
Type CommandGetter As Function(ByVal arg_idx As Long) As String
Function ParseArgs(aargs(Any) As Arg, getcmd As CommandGetter=NULL) As Integer
...
End Function
End Namespace
What's wrong here?
Stupid question :)
Passing of arrays needs (), the correct syntax is:
args_num = Args.ParseArgs(aargs())
I tried to use TemplateProcessor (phpword in laravel 7) to create a docx from a defined template but i got this error :
FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in ****/vendor/phpoffice/phpword/src/PhpWord/Shared/ZipArchive.php on line 131 PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0"
When i set ini_set('memory_limit', '-1'); or rise the memory limit in my php.ini, i got :
Maximum execution time of 30 seconds exceeded
I can rise the maximum execution time but still got the same error.
The function that responsable for this error is :
public function open($filename, $flags = null)
{
$result = true;
$this->filename = $filename;
$this->tempDir = Settings::getTempDir(); // the 131 line who responsable for the error
if (!$this->usePclzip) {
$zip = new ZipArchive();
$result = $zip->open($this->filename, $flags);
// Scrutizer will report the property numFiles does not exist
// See https://github.com/scrutinizer-ci/php-analyzer/issues/190
$this->numFiles = $zip->numFiles;
} else {
$zip = new \PclZip($this->filename);
$zipContent = $zip->listContent();
$this->numFiles = is_array($zipContent) ? count($zipContent) : 0;
}
$this->zip = $zip;
return $result;
}
php -v
PHP 7.4.7 (cli) (built: Jun 12 2020 07:48:26) ( NTS )
I searched everywhere but i didn't found anything to solve this problem.
Thanks in advance
I found a solution for this problem by remplacing zipArchive with pclzip in the setting of phpword :
Path to setting : .../vendor/phpoffice/phpword/src/PhpWord/Settings.php
Change this :
private static $zipClass = self::ZIPARCHIVE;
By this :
private static $zipClass = self::PCLZIP;
I tested this for the 0.16.0 and 0.17.0 versions and it works like magic :)
PS : Maybe you have to install the pclzip to turn this on. Pclzip installation
I am using the following for redis client in go
https://github.com/go-redis/redis
I have a problem in the below shown code snippet.
vals, err = this.Cli.ZRevRangeByScore(sortedSet, redis.ZRangeBy{
Min: strconv.Itoa(int(query.Since.Unix())),
Max: "+inf",
Offset: 0,
Count: int64(query.maxEvents),
}).Result()
Whenever my query.maxEvents is 0, instead of empty set(expected), I am getting whole set as a response(unexpected). Why is this happening ?
Here is a snippet of code I have to handle smooth scrolling. here is the output of the NSLog:
2010-06-21 16:04:10.524 PDFViewWXOSX[80161:a0f] first error: -9870
2010-06-21 16:04:10.525 PDFViewWXOSX[80161:a0f] second error: 0
2010-06-21 16:04:10.552 PDFViewWXOSX[80161:a0f] first error: 0
2010-06-21 16:04:10.553 PDFViewWXOSX[80161:a0f] second error: 0
2010-06-21 16:04:10.582 PDFViewWXOSX[80161:a0f] first error: 0
2010-06-21 16:04:10.582 PDFViewWXOSX[80161:a0f] second error: 0
2010-06-21 16:04:10.588 PDFViewWXOSX[80161:a0f] first error: -9870
2010-06-21 16:04:10.589 PDFViewWXOSX[80161:a0f] second error: 0
2010-06-21 16:04:10.652 PDFViewWXOSX[80161:a0f] first error: 0
2010-06-21 16:04:10.652 PDFViewWXOSX[80161:a0f] second error: 0
2010-06-21 16:04:10.723 PDFViewWXOSX[80161:a0f] first error: 0
2010-06-21 16:04:10.723 PDFViewWXOSX[80161:a0f] second error: 0
SInt32 scroll_delta_x = 0, scroll_delta_y = 0;
OSErr err = noErr;
err = GetEventParameter( cEvent, kEventParamMouseWheelSmoothHorizontalDelta,
typeSInt32, NULL, sizeof(scroll_delta_x), NULL,
&scroll_delta_x);
NSLog(#"first error: %d", err);
if (err == noErr) {
deltaX = scroll_delta_x;
}
err = noErr;
err = GetEventParameter( cEvent, kEventParamMouseWheelSmoothVerticalDelta,
typeSInt32, NULL, sizeof(scroll_delta_y), NULL,
&scroll_delta_y);
NSLog(#"second error: %d", err);
if (err == noErr) {
deltaY = scroll_delta_y;
}
I couldn't find any information on error -9870. What is going on?
Error -9870 is eventParameterNotFoundErr, declared in CarbonEventsCore.h. The header comments on those event parameters say that you should be prepared for the possibility that they are not present.