Posts

javascript - How to convert website into multi language using AngularJs -

my approach translating 1 time when applied on element on angular template when applied multiple directive template making multiple time api call how avoid it. solution please comment var directive = { restrict: 'ae', scope: false, multielement: true, link: link }; $rootscope.cityname = cookieservice.getcookie('lang'); $rootscope.translatethese = []; $rootscope.translationdata = ''; $rootscope.translationcounter = 0; function link(scope, element, attr) { scope.$evalasync(function() { $rootscope.translatethese.push(element[0]); scope.$on('translateapisuccess', function(e, data) { angular.foreach($rootscope.translatethese, function(elem) { var translatedstring = $rootscope.translationdata[elem.innerhtml.trim().tolowercase()]; elem.innerhtml = translatedstring; // $compile(element....

jdbc - How to import data into Apache Solr index from LDAP -

i have ldap-server contains large set of user data , import apache solr index. question not whether idea or not (as discussed here ). need kind of architecture 1 of our production systems depends on solr index of our ldap data. i'm considering different options so, i'm not sure 1 should preferred: option 1: use apache solr dataimporthandler : this seems straight forward solr way of doing so. unfortunately there not seem datasource available work ldap. i tried combine jdbcdatasource jdbc-ldap-bridge . in theory might work driver looks quite dated (latest version 2007). another option might write custom ldapdatasource using of ldap-libraries java (probably spring ldap , directly via jndi or similar?). option 2: build custom feeder: another option might write standalone service/script bridges between 2 services. feels bit reinventing wheel. option 3: haven't thought of yet: maybe there additional options here haven't discovered yet. solved wr...

php - Insert newly created id value into the column of another table as Foreign key -

hello php , mysql noob here i'm creating form create new user , @ same time add contact user , contact in 2 different table and need newly user_id reference user_id (fk) in tbl_contact how it? first of insert user mysql_query("insert tbl_user (...) values (...)"); then retrieve last inserted id $liid=mysql_insert_id(); then insert contact id mysql_query("insert tbl_contact (user_id,...) values ($liid,...)"); refrence if want use mysqli $mysqli->query("insert tbl_user (...) values (...)"); $liid=$mysqli->insert_id; $mysqli->query("insert tbl_contact (user_id,...) values ($liid,...)");

arrays - Global Variable Not Working in Swift -

i have created small tabbed view program uses tabs switch between 2 views. there 1 global variable called list array containing information both views need access , change. however, when try use nsuserdefaults save array future use in app after closed, got error saying: "cannot convert value of type 'array<_>' expected argument type 'anyobject?'". here code second view: @iboutlet weak var reminder: uitextfield! @iboutlet weak var label: uilabel! override func viewdidload() { } @ibaction func submit(sender: anyobject) { if reminder.text == "" { label.text = "please type reminder!" } else { list.append(reminder.text!) reminder.text = "" label.text = "add reminder" } // below line giving error!!!!! // fact using variable "list" nsuserdefaults.standarduserdefaults().setobject(list, forkey: "reminders") } override func didreceivememor...

network programming - How do I make my automated Client-Server Java networking code output in the correct sequence? -

Image
let me start saying know lot of code, , please bear me. working on project, i'm porting oracle's knock-knock client/server example state-capital example. instead of knockknock jokes, runs series of state-capital queries. runs : server: may have permission send state-capital query? client: ok server: send me state , can send capital? client: alabama server: capital of alabama hunstville . want 1 (y/n) ? client: n the motivation doing project later demonstrate type of fail-safe ability (after work want use powershell , use run client-server single unit). back code. when run it's giving me following output, not i'm looking for. supposed synchronized client , server working on 1 state @ time. instead, client-side jumping ahead of server side, , isn't reaching last state of wyoming. tried add in synchronization as per question . i've linked full code on pastebin fixedmessagesequenceclient fixedmessagesequenceserv...

c++ - combining cv::remap and cv::warpAffine to simultaneously correct fisheye and roll effects -

looking @ cv::remap , can use de-fisheye image have translation table have prepared earlier particular model of lens, , use cv::warpaffine correct camera roll , suspect there significant cumulative loss of quality doing 2 operations sequentially versus combining both operations. unfortunately, maths aren't working out how preprocess maps, can help? (note, require opencv 2.x solution, not 3.x)

Can't import project with "android-support-v7-appcompat which resolves" error -

i can't import project https://www.dropbox.com/s/182zpz7acu5opyo/com.resulam.android.nufitchamna_nufi_francais_nufi_prototype.zipp.rar?dl=0 this full error project com.resulam.android.nufitchamna_nufi_francais_nufi:c:\users\gaewgan\desktop\dic\dics\project.properties: library reference ..\android-support-v7-appcompat not found path c:\users\gaewgan\desktop\dic\dics..\android-support-v7-appcompat resolves c:\users\gaewgan\desktop\dic\android-support-v7-appcompat how solve it? you missing appcompat-v7 library project have import workspace on top of existing project. more information refer these existing guides: for android studio: https://developer.android.com/tools/support-library/setup.html#add-library for eclipse: cannot add library android project in eclipse