In my recent project I'm downloading a bunch of data, so I decided to store it in a SQLite database. NOTE: I'm using sqlite3_x64.dll
Everything is working just fine but I'm struggling with getting the Median value. SQLite has an Average function but not a Median one.
I googled but all of the provided solutions are way above my pay-grade. After some more searching I found 'extension-functions.c' on the SQLite site where Median is included. After almost an hour of struggling I was able to successfully compile it into a DLL.
So I downloaded @jchd's SQLiteExtLoad.au3 as seen here:
But I'm getting these errors:
"Path\SQLiteExtLoad.au3"(21,40) : warning: $g_hDll_SQLite: possibly used before declaration. Local $RetVal = DllCall($g_hDll_SQLite, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "Path\SQLiteExtLoad.au3"(21,40) : error: $g_hDll_SQLite: undeclared global variable. Local $RetVal = DllCall($g_hDll_SQLite, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ So I tried, copying the function to my file and changing the DLL variable ($g_hDll_SQLite) directly to the DLL location (C:\...\.. .dll), but now this error fires
If __SQLite_hChk($hConn, 1) Then Return SetError(@error, 0, $SQLITE_MISUSE) To be honest, I don't know what to use as the $hConn - handle of connection.
I would appreciate any help, be it getting the median using SQLite queries or getting the DLL extension loaded using AutoIt.
EDIT: well, I suspect the $hConn variable refers to the return value of the _SQLite_Open function. Well, at least now _SQLite_EnableExtensions doesn't give errors. Now I run into problems with _SQLite_LoadExtension, which gives error -1, and extended 1. Apparently the 1 constant is a generic error where other error do not apply.
BTW, anybody knows whether I need to compile the extension DLL "into" x64 when I use a x64 SQLite? That might be the problem...
EDIT2: I recompiled the dll and tried it using the SQLite3.exe and it works, so I'm confident the extension DLL has been created correctly
I have a text file which has over 1000 lines, and I wish to replace one particular - I was able to do the replacement - but I have a issue - I want the numbers to be of specific format
Eg; my command was as follows,
my command >>>>> _filewritetoline($inp_file,$inp_replacement,"WAVE1.00STOK"&$hdet&" "&$tasso&" "&"270.0 D 5.0 72MS 1",true)
my output >>>>>> WAVE1.00STOK10.06 9.800 270.0 D 5.0 72MS 1
how do I make sure that the $hdet=10.06 is printed as 10.060(3 digits after decimel) and same with $tasso and so on.. also, how to maintain the required gap between the variables - is it by manually putting spaces ?
Hi everyone. I want to format the output of _INetGetSource to look nice and pretty.
Example google.com source output:
I have established how to get tomorrows date however I can't seem to figure out how to format the date into my required format of MM/DD/YYYY.
I have this:
$today=_DateToDayValue(@YEAR,@MON,@MDAY) Dim $Y, $M, $D $tomorrow=_DayValueToDate($today+1, $Y, $M, $D) The _DateToDayValue seems to have a fixed format. I've also tried a :
$vardate = _DateAdd( 'd',1, _NowCalcDate()) with a "StringSplit" and/or StringFormat but the _NowCalcDate seems to also be fixed to a YYYY/MM/DD format.
I'm sure I'm missing something simple but am at a loss.
Any help would be MUCH appreciated
To get the current time stamp, I got the below code.
#include <Date.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #RequireAdmin ; Under Vista the Windows API "SetSystemTime" may be rejected due to system security $td = _Date_Time_GetSystemTime() $td = _Date_Time_SystemTimeToDateTimeStr($td) $td = StringReplace($td, " ", "_") $td = StringReplace($td, ":", "_") MsgBox(0,"",$td) But it is not giving the date or time of the timezone where the system is there.