https://medium.com/beingcoders/create-a-signed-apk-file-using-cordova-cli-49ffbe423cee
https://www.youtube.com/watch?v=aHTfXivFe74
https://stackoverflow.com/questions/35173542/unable-to-sign-the-unsigned-apk/35173700
https://medium.com/beingcoders/create-a-signed-apk-file-using-cordova-cli-49ffbe423cee
https://www.youtube.com/watch?v=aHTfXivFe74
https://stackoverflow.com/questions/35173542/unable-to-sign-the-unsigned-apk/35173700
https://youtu.be/9OnZuuJJlCk
1. cordova zomok com.zomok.app // create dir
2. cordova platform add android
3. cordova requirements
4. Install necessary plug-ins
5.Bulid android
6
在JavaScript中,有一个问题一直被没有很好地解决,就是小数点保留指定的位数,也就是我们通常说的Math.Round()函数。
首先,JavaScript有自带的Math.Round()函数,能够对一个浮点数进行四舍五入,但是返回的结果是个整数,无法精确到小数点后。
Number.toFixed()方法,能保留小数点后面的指定位数,但如果执行2.1.toFixed(2)的话,会返回2.10,而不是我们期待的2.1,所以,这个方法也不太可取。
最近我发现一个很简单的方法,假设我要对0.105进行四舍五入并保留两位小数,如果直接调用Math.Round()的话,结果是0,如果直接调用.toFixed(2)方法的话,会返回0.10,最简单有效的方法就是对0.105先乘以100,再调用Math.Round(),然后再除以100,就OK了。
var number = 0.105;
alert(Math.round(number * 100) / 100);
网页弹出0.11
举一反三,如果你想保留三位小数,就是
Math.round(number * 1000) / 1000
如果你想转换为百分比,再保留两位小数,就是
(Math.round(number * 10000) / 100) + '%'
————————————————
版权声明:本文为CSDN博主「老朱.」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/daguanjia11/article/details/48650711
$sql = "SELECT count(*) FROM `table` WHERE foo = ?";
$result = $con->prepare($sql);
$result->execute([$bar]);
$number_of_rows = $result->fetchColumn();
Yes, you can definitely hide/encode/encrypt the php source code and 'others' can install it on their machine. You could use the below tools to achieve the same.
But these 'others' can also decode/decrypt the source code using other tools and services found online. So you cannot 100% protect your code, what you can do is, make it tougher for someone to reverse engineer your code.
Most of these tools above support Encoding and Obfuscating.
You can choose to use both (Encoding and Obfuscating) or either one, depending on your needs.
This is a...passing thought, though I'm not sure how practical it would be:
<span class="protectedNumber" title="01234567890"></span>
css:
span.protectedNumber:before {
content: "Phone number: " attr(title);
}
https://www.w3schools.com/howto/howto_css_subnav.asp
https://stackoverflow.com/questions/11426275/how-can-i-show-dots-in-a-span-with-hidden-overflow
https://www.youtube.com/watch?v=9yUF9yz02Cc
https://stackoverflow.com/questions/9650572/resize-images-in-php-without-using-third-party-libraries
https://www.techinasia.com/4-alternative-android-app-stores-indonesia
http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_TEdgeBrowser_Component_and_Changes_to_the_TWebBrowser_Component
https://stackoverflow.com/questions/29123404/deploying-android-app-developed-in-delphi-firemonkey-to-google-play-store/29130191
https://stackoverflow.com/questions/29123404/deploying-android-app-developed-in-delphi-firemonkey-to-google-play-store/29130191
www.durinews.com/tools/
https://blog.gtwang.org/linux/rsync-local-remote-file-synchronization-commands/
duriNews is a news aggregator that constantly updates and organizes the news and current events that are happening locally and internationally.
Top 5 Reasons to Download the duriNews App
1. Watch news and video of your favorite anytime, anywhere.
2. 24/7 with local and international news.
3. Introduction to the user interface.
4. News stories that matter most to you, with relevant, formatted content.
5. Easy to find and follow the sources you trust, as well as browse and discover new ones.
There are different languages to choose from, including Malaysian Chinese, Malay, Thai Chinese, Indonesian and Filipino.
In addition to different languages, we also provide different categories, such as international news, local news, sports, entertainment, politics, business economics and videos.
You are also welcome to visit our official website https://www.durinews.com. Or visit https://www.durinews.com/download/ to download the latest version.
We strive to do better. Thank you.
if WebBrowser1.LocationURL = 'about:blank' then
ShowMessage('about:blank page is displayed ...');
function record(str){
var p = document.createElement("p");
p.appendChild(document.createTextNode(str));
document.body.appendChild(p);
https://img.youtube.com/vi/DjB1OvEYMhY/hqdefault.jpg
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var oFrame = document.getElementById("myFrame");
oFrame.contentWindow.document.onclick = function() {
alert("frame contents clicked");
};
};
</script>
</head>
<body>
<iframe id="myFrame" border="0" src="test.htm"></iframe>
<iframe id="theiframe" src="test.htm" style="width: 200px; height: 400px;" onload="iframeclick()"></iframe>
</body></html>
<!DOCTYPE html>
<html>
<body onclick="myFunction()">
<p>Click anywhere in the document to display the active element.</p>
<input type="text" value="An input field">
<button>A Button</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.activeElement.tagName;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
https://blog.csdn.net/weixin_30607659/article/details/95270618
介绍
本文章介绍了Delphi XE5 获取Android手机网络状态,通过该代码可以得到Wift是否连接、手机网络是否连接,首先会实现一个类库Androidapi.JNI.Network,然后通过这类库来判断网络状况。
在使用这个类库之前,需要配置手机的权限,否则无法得到信息。
下面是这个判断类库的代码:
unit Androidapi.JNI.Network;
interface
function IsConnected: Boolean;
function IsWiFiConnected: Boolean;
function IsMobileConnected: Boolean;
implementation
uses
System.SysUtils,
Androidapi.JNIBridge,
Androidapi.JNI.GraphicsContentViewText,
Androidapi.JNI.JavaTypes,
FMX.Helpers.Android;
type
JConnectivityManager = interface;
JNetworkInfo = interface;
JNetworkInfoClass = interface(JObjectClass)
['{E92E86E8-0BDE-4D5F-B44E-3148BD63A14C}']
end;
[JavaSignature('android/net/NetworkInfo')]
JNetworkInfo = interface(JObject)
['{6DF61A40-8D17-4E51-8EF2-32CDC81AC372}']
{Methods}
function isAvailable: Boolean; cdecl;
function isConnected: Boolean; cdecl;
function isConnectedOrConnecting: Boolean; cdecl;
end;
TJNetworkInfo = class(TJavaGenericImport<JNetworkInfoClass, JNetworkInfo>) end;
JConnectivityManagerClass = interface(JObjectClass)
['{E03A261F-59A4-4236-8CDF-0068FC6C5FA1}']
{Property methods}
function _GetTYPE_WIFI: Integer; cdecl;
function _GetTYPE_WIMAX: Integer; cdecl;
function _GetTYPE_MOBILE: Integer; cdecl;
{Properties}
property TYPE_WIFI: Integer read _GetTYPE_WIFI;
property TYPE_WIMAX: Integer read _GetTYPE_WIMAX;
property TYPE_MOBILE: Integer read _GetTYPE_MOBILE;
end;
[JavaSignature('android/net/ConnectivityManager')]
JConnectivityManager = interface(JObject)
['{1C4C1873-65AE-4722-8EEF-36BBF423C9C5}']
{Methods}
function getActiveNetworkInfo: JNetworkInfo; cdecl;
function getNetworkInfo(networkType: Integer): JNetworkInfo; cdecl;
end;
TJConnectivityManager = class(TJavaGenericImport<JConnectivityManagerClass, JConnectivityManager>) end;
function GetConnectivityManager: JConnectivityManager;
var
ConnectivityServiceNative: JObject;
begin
ConnectivityServiceNative := SharedActivityContext.getSystemService(TJContext.JavaClass.CONNECTIVITY_SERVICE);
if not Assigned(ConnectivityServiceNative) then
raise Exception.Create('Could not locate Connectivity Service');
Result := TJConnectivityManager.Wrap(
(ConnectivityServiceNative as ILocalObject).GetObjectID);
if not Assigned(Result) then
raise Exception.Create('Could not access Connectivity Manager');
end;
function IsConnected: Boolean;
var
ConnectivityManager: JConnectivityManager;
ActiveNetwork: JNetworkInfo;
begin
ConnectivityManager := GetConnectivityManager;
ActiveNetwork := ConnectivityManager.getActiveNetworkInfo;
Result := Assigned(ActiveNetwork) and ActiveNetwork.isConnected;
end;
function IsWiFiConnected: Boolean;
var
ConnectivityManager: JConnectivityManager;
WiFiNetwork: JNetworkInfo;
begin
ConnectivityManager := GetConnectivityManager;
WiFiNetwork := ConnectivityManager.getNetworkInfo(TJConnectivityManager.JavaClass.TYPE_WIFI);
Result := WiFiNetwork.isConnected;
end;
function IsMobileConnected: Boolean;
var
ConnectivityManager: JConnectivityManager;
MobileNetwork: JNetworkInfo;
begin
ConnectivityManager := GetConnectivityManager;
MobileNetwork := ConnectivityManager.getNetworkInfo(TJConnectivityManager.JavaClass.TYPE_MOBILE);
Result := MobileNetwork.isConnected;
end;
end.
通过这个类库,我们可以调用IsConnected、IsWiFiConnected、IsMobileConnected函数来判断网络状况
function GetNetworkState: string; // 得到当前网络连接状态
var
NS: TNetworkState;
begin
NS := TNetworkState.Create;
try
if not NS.IsConnected then // 无网络
result := '0'
else if NS.IsWifiConnected then // wifi
result := '1'
else if NS.IsMobileConnected then // 移动数据
result := '2';
finally
NS.Free;
end;
end;
查看原文
Delphi XE5 获取Android手机网络状态
http://www.dfwlt.com/forum.php?mod=viewthread&tid=826
(出处: 大富翁Delphi开发技术网站)
转载于:https://www.cnblogs.com/wcf-delphi/p/8616106.html
<?php
function
dateDifference(
$start_date
,
$end_date
)
{
// calulating the difference in timestamps
$diff
=
strtotime
(
$start_date
) -
strtotime
(
$end_date
);
// 1 day = 24 hours
// 24 * 60 * 60 = 86400 seconds
return
ceil
(
abs
(
$diff
/ 86400));
}
// start date
$start_date
=
"2016-01-02"
;
// end date
$end_date
=
"2016-01-21"
;
// call dateDifference() function to find the number of days between two dates
$dateDiff
= dateDifference(
$start_date
,
$end_date
);
echo
"Difference between two dates: "
.
$dateDiff
.
" Days "
;
?>
import re
text = '<p>Contents :</p><a href="https://w3resource.com">Python Examples</a><a href="http://github.com">Even More Examples</a>'
urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', text)
print("Original string: ",text)
print("Urls: ",urls)
https://www.thoughtco.com/drag-a-delphi-form-1058461
try
IdHTTP1.Get(URL);
c := IdHTTP1.ResponseCode;
if c = 200 then
begin
lblbottom.Visible:= false;
timer1.Interval := 0;
webbrowser1.GoBack;
end;
except
end;
Program DateDemo;
uses sysutils;
var
YY,MM,DD : Word;
begin
writeln ('Date : ',Date);
DeCodeDate (Date,YY,MM,DD);
writeln (format ('Today is (DD/MM/YY): %d/%d/%d ',[dd,mm,yy]));
end.
uses IdTCPClient;
function CheckInternet : Boolean;
var TCPClient : TIdTCPClient;
begin
TCPClient := TIdTCPClient.Create (NIL);
try
try
TCPClient.ReadTimeout := 2000;
TCPClient.ConnectTimeout := 2000;
TCPClient.Port := 80;
TCPClient.Host := 'google.com';
TCPClient.Connect;
TCPClient.Disconnect;
Result := true;
except
Result := false;
end; { try / except }
finally
TCPClient.Free;
end; { try / finally }
end;
https://community.embarcadero.com/article/technical-articles/145-ui/973-how-can-i-change-name-of-firemonkey-mobile-application-to-contain-spaces
unit Androidapi.JNI.Network;
interface
function IsConnected: Boolean;
function IsWiFiConnected: Boolean;
function IsMobileConnected: Boolean;
implementation
uses
System.SysUtils,
Androidapi.JNIBridge,
Androidapi.JNI.GraphicsContentViewText,
Androidapi.JNI.JavaTypes,
FMX.Helpers.Android;
type
JConnectivityManager = interface;
JNetworkInfo = interface;
JNetworkInfoClass = interface(JObjectClass)
['{E92E86E8-0BDE-4D5F-B44E-3148BD63A14C}']
end;
[JavaSignature('android/net/NetworkInfo')]
JNetworkInfo = interface(JObject)
['{6DF61A40-8D17-4E51-8EF2-32CDC81AC372}']
{Methods}
function isAvailable: Boolean; cdecl;
function isConnected: Boolean; cdecl;
function isConnectedOrConnecting: Boolean; cdecl;
end;
TJNetworkInfo = class(TJavaGenericImport<JNetworkInfoClass, JNetworkInfo>) end;
JConnectivityManagerClass = interface(JObjectClass)
['{E03A261F-59A4-4236-8CDF-0068FC6C5FA1}']
{Property methods}
function _GetTYPE_WIFI: Integer; cdecl;
function _GetTYPE_WIMAX: Integer; cdecl;
function _GetTYPE_MOBILE: Integer; cdecl;
{Properties}
property TYPE_WIFI: Integer read _GetTYPE_WIFI;
property TYPE_WIMAX: Integer read _GetTYPE_WIMAX;
property TYPE_MOBILE: Integer read _GetTYPE_MOBILE;
end;
[JavaSignature('android/net/ConnectivityManager')]
JConnectivityManager = interface(JObject)
['{1C4C1873-65AE-4722-8EEF-36BBF423C9C5}']
{Methods}
function getActiveNetworkInfo: JNetworkInfo; cdecl;
function getNetworkInfo(networkType: Integer): JNetworkInfo; cdecl;
end;
TJConnectivityManager = class(TJavaGenericImport<JConnectivityManagerClass, JConnectivityManager>) end;
function GetConnectivityManager: JConnectivityManager;
var
ConnectivityServiceNative: JObject;
begin
ConnectivityServiceNative := SharedActivityContext.getSystemService(TJContext.JavaClass.CONNECTIVITY_SERVICE);
if not Assigned(ConnectivityServiceNative) then
raise Exception.Create('Could not locate Connectivity Service');
Result := TJConnectivityManager.Wrap(
(ConnectivityServiceNative as ILocalObject).GetObjectID);
if not Assigned(Result) then
raise Exception.Create('Could not access Connectivity Manager');
end;
function IsConnected: Boolean;
var
ConnectivityManager: JConnectivityManager;
ActiveNetwork: JNetworkInfo;
begin
ConnectivityManager := GetConnectivityManager;
ActiveNetwork := ConnectivityManager.getActiveNetworkInfo;
Result := Assigned(ActiveNetwork) and ActiveNetwork.isConnected;
end;
function IsWiFiConnected: Boolean;
var
ConnectivityManager: JConnectivityManager;
WiFiNetwork: JNetworkInfo;
begin
ConnectivityManager := GetConnectivityManager;
WiFiNetwork := ConnectivityManager.getNetworkInfo(TJConnectivityManager.JavaClass.TYPE_WIFI);
Result := WiFiNetwork.isConnected;
end;
function IsMobileConnected: Boolean;
var
ConnectivityManager: JConnectivityManager;
MobileNetwork: JNetworkInfo;
begin
ConnectivityManager := GetConnectivityManager;
MobileNetwork := ConnectivityManager.getNetworkInfo(TJConnectivityManager.JavaClass.TYPE_MOBILE);
Result := MobileNetwork.isConnected;
end;
end.
通过这个类库,我们可以调用IsConnected、IsWiFiConnected、IsMobileConnected函数来判断网络状况
function GetNetworkState: string; // 得到当前网络连接状态
var
NS: TNetworkState;
begin
NS := TNetworkState.Create;
try
if not NS.IsConnected then // 无网络
result := '0'
else if NS.IsWifiConnected then // wifi
result := '1'
else if NS.IsMobileConnected then // 移动数据
result := '2';
finally
NS.Free;
end;
end;
查看原文
Delphi XE5 获取Android手机网络状态
http://www.dfwlt.com/forum.php?mod=viewthread&tid=826
(出处: 大富翁Delphi开发技术网站)
转载于:https://www.cnblogs.com/wcf-delphi/p/8616106.html
https://delphiworlds.com/download/network-state-demo/
https://www.amingstudio.com/delphi/598.html
https://stackoverflow.com/questions/18888345/how-to-check-if-network-is-available-on-android-and-ios-delphi-xe5
uses
GIFImg;
procedure TForm1.btn1Click(Sender: TObject);
var
MS : TMemoryStream;
GIf: TGIFImage;
begin
MS := TMemoryStream.Create;
GIf := TGIFImage.Create;
try
IdHTTP1.get('http://www.google.com/intl/en_ALL/images/logo.gif',MS);
Ms.Seek(0,soFromBeginning);
Gif.LoadFromStream(MS);
img1.Picture.Assign(GIF);
finally
FreeAndNil(GIF);
FreeAndNil(MS);
end;
end;
zomok E-commerce system plan. Choose your online ordering system. No-risk 30 day free trial. Then USD 9/month. No credit card required. h...