Posts

security - SSL trusted for local web server is possible? -

i have local server in home, runs website, provides service, use of php. right i'm using http protocol, doesn't not provide security, due clear-text (the authentication service username , password access protected page). want upgrade https , of course need use ssl. know is, know differences between self-certificate, , 1 issued company. there different kind of class. because don't want users/friends alerted browser ssl certificate isn't trusted, i'm asking if there free trusted certificate non-domain web server (i use static ip let user access website). in case bought domain (it cheaper), can have free trusted certificate ? thank you. regarding ssl certificates ip address, see linked thread: is possible have ssl certificate ip address, not domain name? if register domain name site, can obtain free ssl certificate startssl ( https://www.startssl.com/?app=1 )

ios - iOS8 custom keyboard - add UIImageView -

i built keyboard keyboard extension available in ios 8. created custom view , want create button image background, image not appear in keyboard. needs done put image on custom keyboard? my code (call view): uiview *layout = [[[nsbundle mainbundle] loadnibnamed:@"kyyboardlogic" owner:self options:nil] objectatindex:0]; [self.inputview addsubview:layout]; thanks: yakir. instead of adding subview, use code. adds view input view given superview. self.keyboard = [[[nsbundle mainbundle] loadnibnamed:@"keyview" owner:nil options:nil] objectatindex:0]; self.inputview = (id)self.keyboard;

multithreading - Can mutli-threading java client cause high CPU utilization of SQL Server 2008? -

i java developer, not dba, , consult issue encountered in high cpu utilization in sql server 2008 (not in java app server) . the java client uses multi-threading, simplify: 40 threads each select / insert / update (simple sql statements) table x - autocommit on 10 threads each select / insert / update (simple sql statements) table y , selects (again simple) table x (to check existence) - autocommit on both set of threadpools run simultaneously. each thread assigned "message queue" (a file), loads / reads assigned "message", , inserts / updates corresponding table. these 2 thread pools connections single connection pool via datasouce, example: <resource auth="container" driverclassname="com.microsoft.sqlserver.jdbc.sqlserverdriver" maxactive="100" maxidle="10" maxwait="10000" name="jdbc/abc_datasource" password="p" type="javax.sql.datasource" url="jdbc:sqlserv...

sharepoint search using rest api -

i doing search in sharepoint 2013 using rest api. working fine. when enter search term in search text box, crawls through whole content of site , shows pages in result contain search term. possible crawl through part of pages(e.g body content, leaving header , footer) , through page names only? i got answer. put class "noindex" on element don't want appear in search result. in case, put class "noindex" on divs containing header, footer , menuholder.

how to run and modify a cmd script or file in c -

@echo off set "yourdir=c:\users\asus\desktop" echo:list files: %%a in ("%yourdir%\*") echo %%~fa echo:list directories: /d %%a in ("%yourdir%\*") echo %%~fa echo:list directories , files in 1 command: /f "usebackq tokens=*" %%a in (`dir /b "%yourdir%\*"`) echo %yourdir%\%%~a pause i have cmd script , want include , run in c script and if possible modify (the cmd script contains variables ). do have solution ? update you can create script file on-the-fly in c program call from. note must handle characters " , \ , % specially when part of string literal, using \" , \\ , %% respectively. #include <stdio.h> #include <stdlib.h> void fatal(char *msg) { printf("%s\n", msg); exit (1); } void makebat(file *fp, char *dirname) { fprintf (fp, "@echo off\n"); fprintf (fp, "\n"); fprintf (fp, "set \"%s=c:\\users\\asus\\desktop\...

regex - Regular expression java to extract the balance from a string -

i have string contains " dear user bal= 1,234/ " . want extract 1,234 string using regular expression. can 1,23 , 1,2345 , 5,213 or 500 final pattern p=pattern.compile("((bal)=*(\\s{1}\\w+))"); final matcherm m = p.matcher(text); if(m.find()) return m.group(3); else return ""; this returns 3 . regular expression should make? new regular expressions. you search in regex word characters \w+ should search digits \d+ . additionally there comma, need match well. i'd use /. bal=\s([\d,]+(?=/). / as pattern , number in resulting group. explanation: .* match before bal= match string "bal=" \s match whitespace ( start matching group [\d,]+ matches every digit or comma 1 ore more times (?=/) match former if followed slash ) end matching group .* matches thereaft this untestet, should work this: final pattern p=pattern.compile(".*bal=\\s([\\d,]+(?=/)).*"); final matcherm m = p.matcher(text); if...

HttpURLConnection java.io.FileNotFoundException in android 5.0.2 -

i using below code downloading pdf file server , store sdcard. running fine on android 4.4 device. while not working on android 5.0.2 device. public static string downloadfile(string fileurl, file directory){ try { url url = new url(fileurl); httpurlconnection urlconnection = (httpurlconnection)url.openconnection(); urlconnection.setrequestmethod("get"); urlconnection.setdooutput(false); urlconnection.connect(); inputstream inputstream = urlconnection.getinputstream(); fileoutputstream fileoutputstream = new fileoutputstream(directory); int totalsize = urlconnection.getcontentlength(); byte[] buffer = new byte[megabyte]; int bufferlength = 0; while((bufferlength = inputstream.read(buffer))>0 ){ fileoutputstream.write(buffer, 0, bufferlength); } fileoutputstream.close(); resu...