php compare operator doesn't work as expected
i have a really strange problem. My Code:
$sql = "SELECT emailIsConfirmed FROM userdatabase.user where username =
'".mysqli_real_escape_string( $db, $username ) ."'";
$result = mysqli_query($db, $sql);
var_dump(mysqli_fetch_array($result)[0]);
var_dump("1");
if((mysqli_fetch_array($result)[0]) == "1")
{
return true;
}
return false;
doesn't work. Even when the output looks like this:
string(1) "1"
string(1) "1"
the result is false... Why?
I guess it is a really silly mistake.
Thanks for your help,
Vronsch
Boltinghouse
Thursday, 3 October 2013
Wednesday, 2 October 2013
AHK utilman script gives file not found error
AHK utilman script gives file not found error
I'm trying to create a simple backdoor for myself through utilman on my
computer using autohotkey. Basically I want to have the ease of access
button function normally in all cases on login screen Except when I hold
down the M key, where in this case it opens cmd instead. No batch or cmd
window should pop up, and one doesn't. The issue I'm having is that I get
a file not found error from the script, I compiled the script into
Utilman.exe and tested with a copy of the real utilman (renamed to lol.exe
which is specified in the script to run normally) and this works fine in
its own directory. However when I do this in the system32 folder it gives
an error that lol.exe is not found, also executing lol.exe on it's own
gives the exact same error, as if it reroutes to the script named Utilman
yet again. Here is the script, should be short and simple:
SetWorkingDir %A_ScriptDir%
Sleep 400
GetKeyState, state, m
if state = D
Run cmd.exe
else
Run lol.exe
Sleep 200
ExitApp
Thanks for any pointers, alternative suggestions or ideas. This would be
great to get working.
EDIT: Changing Run lol.exe to Run, "C:\Windows\System32\lol.exe" now gives
instead an exe corrupted error. This also happens if I run lol.exe on it's
own, I'm really not sure what's happening.
I'm trying to create a simple backdoor for myself through utilman on my
computer using autohotkey. Basically I want to have the ease of access
button function normally in all cases on login screen Except when I hold
down the M key, where in this case it opens cmd instead. No batch or cmd
window should pop up, and one doesn't. The issue I'm having is that I get
a file not found error from the script, I compiled the script into
Utilman.exe and tested with a copy of the real utilman (renamed to lol.exe
which is specified in the script to run normally) and this works fine in
its own directory. However when I do this in the system32 folder it gives
an error that lol.exe is not found, also executing lol.exe on it's own
gives the exact same error, as if it reroutes to the script named Utilman
yet again. Here is the script, should be short and simple:
SetWorkingDir %A_ScriptDir%
Sleep 400
GetKeyState, state, m
if state = D
Run cmd.exe
else
Run lol.exe
Sleep 200
ExitApp
Thanks for any pointers, alternative suggestions or ideas. This would be
great to get working.
EDIT: Changing Run lol.exe to Run, "C:\Windows\System32\lol.exe" now gives
instead an exe corrupted error. This also happens if I run lol.exe on it's
own, I'm really not sure what's happening.
How to remove atoms from MP4?
How to remove atoms from MP4?
I'm merging two mp4 files for video streaming. the problem is, the merged
file contains two atoms, 1 atom from each file and that is a problem when
it comes to streaming. the client needs to wait until the first atom loads
from file1, than when it's time to play second part from file2 client will
wait again for the atom to be loaded. when your atom is small you may not
notice this, but when you stream a large video, atom file could be 7-10mb.
How can I remove those two atoms from merged file and create a new one?
what i've tried:
ffmpeg -i file1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts
intermediate1.ts
ffmpeg -i file2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts
intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a
aac_adtstoasc m.file.mp4
MP4Box -add m.file.mp4 -isma mf.file.mp4
mv mf.file.mp4 m.file.mp4
I'm merging two mp4 files for video streaming. the problem is, the merged
file contains two atoms, 1 atom from each file and that is a problem when
it comes to streaming. the client needs to wait until the first atom loads
from file1, than when it's time to play second part from file2 client will
wait again for the atom to be loaded. when your atom is small you may not
notice this, but when you stream a large video, atom file could be 7-10mb.
How can I remove those two atoms from merged file and create a new one?
what i've tried:
ffmpeg -i file1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts
intermediate1.ts
ffmpeg -i file2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts
intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a
aac_adtstoasc m.file.mp4
MP4Box -add m.file.mp4 -isma mf.file.mp4
mv mf.file.mp4 m.file.mp4
Sample codes for facial gesture recognition with OpenCV (C++)
Sample codes for facial gesture recognition with OpenCV (C++)
I would need actual C++ code examples on how to create a code deciphering
facial gestures (with OpenCV). Google used to be my friend, but it
betrayed me by showing just tutorials on the question, while I would need
to see some working code for inspiration.
Can somebody help me?
I would need actual C++ code examples on how to create a code deciphering
facial gestures (with OpenCV). Google used to be my friend, but it
betrayed me by showing just tutorials on the question, while I would need
to see some working code for inspiration.
Can somebody help me?
JQuery not appending html form
JQuery not appending html form
So, again, I'm new to JQuery but for whatever reason JQuery isn't
appending the form when I click the "Add Scenario" button. It's not even
getting to the function involving #add. I have a breakpoint set on the
.on() line and it doesn't seem to recognize it when I click.
$(document).ready(function ()
{
$('#add').on('submit',function(e)
{
var form = "<div class='form'>\
<h3> Scenario </h3>\
<form id='scenario'>\
<div>Name: <input type='text' name='ScenarioName'> </div>\
<div>Rate of Investment Return (While Working): <input
type='number' name='Working'></div>\
<div>Rate of Investment Return (Retired): <input type='number'
name='Retired'></div>\
<div>Desired Retirement Yearly Income: <input type='number'
name='desiredInc'></div>\
<div><input type='submit' value='Submit'></div>\
</form>\
<div><button id='add' type='submit'>Add Scenario </button></div>\
</div>"
$('body').append($(form));
e.preventDefault();
});
});
<body>
<div class='form'>
<h3> Basic Information </h3>
<form id='basic'>
<div>Year of Birth: <input type='number' name='YOB'> </div>
<div>Current Savings: <input type='number' name='CurrSav'>
</div>
<div>Expected Retirement Age: <input type='number'
name='RetAge'></div>
<div>Life expectancy: <input type='number' name='LifeExp'>
</div>
<div><input type='submit' value='Submit'></div>
</form>
</div>
<div class='form'>
<h3> Scenario </h3>
<form id='scenario'>
<div>Name: <input type='text' name='ScenarioName'> </div>
<div>Rate of Investment Return (While Working): <input
type='number' name='Working'></div>
<div>Rate of Investment Return (Retired): <input type='number'
name='Retired'></div>
<div>Desired Retirement Yearly Income: <input type='number'
name='desiredInc'></div>
<div><input type='submit' value='Submit'></div>
</form>
<div><button id='add' type='submit'>Add Scenario </button></div>
</div>
</body>
So, again, I'm new to JQuery but for whatever reason JQuery isn't
appending the form when I click the "Add Scenario" button. It's not even
getting to the function involving #add. I have a breakpoint set on the
.on() line and it doesn't seem to recognize it when I click.
$(document).ready(function ()
{
$('#add').on('submit',function(e)
{
var form = "<div class='form'>\
<h3> Scenario </h3>\
<form id='scenario'>\
<div>Name: <input type='text' name='ScenarioName'> </div>\
<div>Rate of Investment Return (While Working): <input
type='number' name='Working'></div>\
<div>Rate of Investment Return (Retired): <input type='number'
name='Retired'></div>\
<div>Desired Retirement Yearly Income: <input type='number'
name='desiredInc'></div>\
<div><input type='submit' value='Submit'></div>\
</form>\
<div><button id='add' type='submit'>Add Scenario </button></div>\
</div>"
$('body').append($(form));
e.preventDefault();
});
});
<body>
<div class='form'>
<h3> Basic Information </h3>
<form id='basic'>
<div>Year of Birth: <input type='number' name='YOB'> </div>
<div>Current Savings: <input type='number' name='CurrSav'>
</div>
<div>Expected Retirement Age: <input type='number'
name='RetAge'></div>
<div>Life expectancy: <input type='number' name='LifeExp'>
</div>
<div><input type='submit' value='Submit'></div>
</form>
</div>
<div class='form'>
<h3> Scenario </h3>
<form id='scenario'>
<div>Name: <input type='text' name='ScenarioName'> </div>
<div>Rate of Investment Return (While Working): <input
type='number' name='Working'></div>
<div>Rate of Investment Return (Retired): <input type='number'
name='Retired'></div>
<div>Desired Retirement Yearly Income: <input type='number'
name='desiredInc'></div>
<div><input type='submit' value='Submit'></div>
</form>
<div><button id='add' type='submit'>Add Scenario </button></div>
</div>
</body>
Tuesday, 1 October 2013
Why does using a Canvas object to print via Citrix sometimes result in extremely large print files?
Why does using a Canvas object to print via Citrix sometimes result in
extremely large print files?
I have a Windows application running via Citrix on Windows Server 2008r2.
When printing via the Citrix Universal print driver to certain printers,
very small text documents balloon up to greater than 67MB in size per page
in the print queue on the client machine. The code currently is using a
TCanvas object to draw to the printer. Switching to just sending the data
to the printer in a raw fashion to the printer handle does make the issue
go away, but it also introduces other issues. Is there any way to continue
to use TCanvas for printing and not have the large print files?
extremely large print files?
I have a Windows application running via Citrix on Windows Server 2008r2.
When printing via the Citrix Universal print driver to certain printers,
very small text documents balloon up to greater than 67MB in size per page
in the print queue on the client machine. The code currently is using a
TCanvas object to draw to the printer. Switching to just sending the data
to the printer in a raw fashion to the printer handle does make the issue
go away, but it also introduces other issues. Is there any way to continue
to use TCanvas for printing and not have the large print files?
ReferenceError: Error #1065: Variable flash.filesystem::File is not defined
ReferenceError: Error #1065: Variable flash.filesystem::File is not defined
I'm attempting to write to a file in a flex Web(Flash Player) application
in Flash Builder 4.6 by using flash.filesystem.File. I added the air
.swc's (sdks\3.6.0\frameworks\libs\air) in order to be able to import
File. This resulted in an error (1046: Type was not found or was not a
compile-time constant: Vector.) which I resolved by also adding
playerglobal.swc (sdks\3.6.0\frameworks\libs\player\10).
The application is empty except for an init() function called on
creationComplete. The first line is var file:File = new File();
Although it compiles when I run the application I get this output in the
console in red font and the application terminates:
VerifyError: Error #1014: Class flash.filesystem::File could not be found.
at
Alaric/___Alaric_Application1_creationComplete()[C:\Users\joe\workspace_practice\Alaric\src\Alaric.mxml:2]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9590]
at mx.core::UIComponent/set
initialized()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1175]
at
mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at
mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8892]
at
mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8832]
I'm attempting to write to a file in a flex Web(Flash Player) application
in Flash Builder 4.6 by using flash.filesystem.File. I added the air
.swc's (sdks\3.6.0\frameworks\libs\air) in order to be able to import
File. This resulted in an error (1046: Type was not found or was not a
compile-time constant: Vector.) which I resolved by also adding
playerglobal.swc (sdks\3.6.0\frameworks\libs\player\10).
The application is empty except for an init() function called on
creationComplete. The first line is var file:File = new File();
Although it compiles when I run the application I get this output in the
console in red font and the application terminates:
VerifyError: Error #1014: Class flash.filesystem::File could not be found.
at
Alaric/___Alaric_Application1_creationComplete()[C:\Users\joe\workspace_practice\Alaric\src\Alaric.mxml:2]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9590]
at mx.core::UIComponent/set
initialized()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1175]
at
mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at
mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8892]
at
mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8832]
Subscribe to:
Posts (Atom)