Posts

crontab - why flock run two process? -

[root@vm_47_86_centos bin]# ps -ef | grep moni root 2078 2075 0 apr04 ? 00:00:00 flock -xn /tmp/svr_lock /data1/svr/bin/monitor.sh root 2082 2078 0 apr04 ? 00:07:35 /bin/bash /data1/svr/bin/monitor.sh root 3438 3303 0 10:30 pts/0 00:00:00 grep --color=auto moni root 14249 14243 0 apr04 ? 00:00:00 flock -xn /tmp/svr_lock /data1/svr/bin/monitor.sh root 14253 14249 0 apr04 ? 00:07:32 /bin/bash /data1/svr/bin/monitor.sh crontab : * * * * * flock -xn /tmp/svr_lock /data1/svr/bin/monitor.sh monitor.sh damon. why use flock or there 2 processes

swift - Difference between before and after in viewDidLoad -

i have tried set searchbar tableheaderview inside of viewdidload : override func viewdidload() { super.viewdidload() // searchcontroller initializiation self.searchcontroller = uisearchcontroller.init(searchresultscontroller: nil) self.searchcontroller.delegate = self self.searchcontroller.searchbar.delegate = self self.searchcontroller.searchbar.sizetofit() self.searchcontroller.searchresultsupdater = self self.searchcontroller.searchbar.bartintcolor = uicolor.white self.searchcontroller.searchbar.keyboardappearance = .default self.searchcontroller.searchbar.backgroundcolor = uicolor.white self.searchcontroller.hidesnavigationbarduringpresentation = true self.searchcontroller.obscuresbackgroundduringpresentation = false self.tableview.tableheaderview = self.searchcontroller.searchbar self.definespresentationcontext = true self.fetch() self.tableview.reloaddata() } and fetch() function: func fetch() { ...

android - How can a widely used custom button track which class its onclick is called from? -

in application, have custom button used in many different custom views. behavior differs depending on view button clicked in, want have 1 @onclick implementation in custom button class takes care of every case in order avoid having similar code in every custom view class. is there way can determine in @onclick block button clicked from? it looks like public class custombutton extends appcompactimagebutton { //stuff @onclick public void onbuttonclick(){ //handles general behavior //if (clicked customviewa) { //do stuff //} } } and have customviewa has custombutton within it, i'm not sure put in if statement, if that's proper way handle this you can use tag attribute. in xml layouts, add line android:tag="viewname" to xml button (in code can .settag("viewname") . can modify onclick check tag using this.gettag() , use identify click came from.

php - How to get password_verify to work for me -

using password_hash() able hash password , store long string in database. however, when try use password_verify(), having trouble confirming value entered matches hashed value stored in database can log in. $uid = $_post['uid']; $pwd = $_post['pwd']; $sql = "select * user uid='$uid'"; $result = $conn->query($sql); $row = $result->fetch_assoc(); $hash_pwd = $row['pwd']; if (password_verify($pwd, $hash_pwd)) { $sql = "select * user uid='$uid' , pwd='$hash_pwd'"; $result = $conn->query($sql); if (!$row = $result->fetch_assoc()) { echo "your username or password incorrect!"; } else { $_session['id'] = $row['id']; } }

dialog - uwp - How to make ContentDialog size according to contents? -

in contentdialog , have stackpanel 3 controls (vertical orientation). problem contentdialog's height stretches way bottom of window though contents don't occupy half of it. i'm having guess stackpanel 's issue, nevertheless how fix this? i set maxheight , have fill fixed values differ per contentdialog ... update this in mainpage.xaml (default starting page of vs uwp template). xaml shows creation of 1 use-case button, on click event: private async void button_click(object sender, routedeventargs e) { dataentrydialog dialog = new dataentrydialog(); //show dialog await dialog.showasync(); } dataentrydialog.xaml: <contentdialog x:class="app1.dialogs.useraccountdataentrydialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" ...

java - Websphere Liberty - How to fetch the keystore password from windows registry? -

i have application running on websphere liberty , trying explore ways fetch keystore password windows registry. for instance - adding keystore service object entry server.xml file. keystore element called defaultkeystore , contains keystore password. <keystore id="samplepkcs12keystore" password="mypassword" location="mykeystorefile.p12" type="pkcs12" /> is there way fetch password windows registry instead of having having in server.xml? can there hook established java code ( application code) server.xml ? thanks i not believe possible store passwords in non-filesystem storage. best option encrypt server.xml passwords , store decryption key in separate directory. note document describes, server needs access actual passwords, fundamentally, can ever obscure rather prevent unauthorized access passwords.

java - from Missed Function Call

i'm sorry if posted elsewhere (i can't find anything, problem rather specific), understand (or least in theory) error is; having trouble on how fix it. code supposed show how merge sort works; code runs, never hits function call "merge" (code below, know bad practice call in in imports, isn't major project, don't care; maybe preview, written import java.util. ; , import java.security. ;). import java.util.*; import java.security.*; public class merge { public static void mergesort(int[] data) { sortarray(data, 0, data.length - 1); } private static void sortarray(int[] data, int low, int high) { if ((high - low) >= 1) { int m1 = low + high; int m2 = m1 + 1; system.out.printf("split: %s\n", subarraystring(data, low, high)); system.out.printf(" %s\n", subarraystring(data, low, m1)); system.out.printf(" %s\n\n", subar...