Posts

Showing posts from February, 2010

git - How do I reword a commit (message) that is the parent of two branches? -

suppose have repo this $ git log --oneline --graph * 3e0a28f merge branch 'other_branch' |\ | * d4fd67a add else | * d0f16bf merge branch 'master' other_branch | |\ | |/ |/| * | 3684fe5 make change in master | * 45b3ecb make change |/ * b2a9034 added text, reword me * 7b1ac57 initial commit d0f16bf involves fixing merge conflicts. ( 3684fe5 , 45b3ecb modify same line). want reword b2a9034 $ git rebase -i b2a9034^ [detached head a9bd978] added text, reworded 1 file changed, 2 insertions(+) error: not apply 3684fe5... make change in master when have resolved problem, run "git rebase --continue". if prefer skip patch, run "git rebase --skip" instead. check out original branch , stop rebasing, run "git rebase --abort". not apply 3684fe570517de37e1ce7661e3821372e1eee967... make change in master is there way reword b2a9034 without fixing merge conflicts again? when "reword" assume mean "ch

c++ - OpenCV recognizes my camera but cant read -

i've been working on computer vision project while using webcam of laptop (it shows "hd webcam" 640x480 res) want use program camera of dji-inspire1 drone. camera recognized , opened fails read images it. in more detail: in player class load camera function: capture.open(-1); // opens window combobox showing //the cameras have. selecting dji camera fails //the read while selecting webcam fails , crashes. // capture.open(0); opens webcam succesfully // capture.open(1); open(1) seems try open dji-camera gives different values open(-1) , crashes after reading frame (the frames entirely black 720x480 cv_8uc3) in debug mode crashes whie reading frame segmentation fault , points dissassembly of "driverproc" (i guess?) , line movdqa command. // capture.open(2); oddly seems try , open dji-camera // 720x486 resolution resulting in black 720x486 cv_8uc3 image (no crashes). // above open(2) fails , crashes if(capture.isopened()){ /

c# - Store currency exchange rates in SQL Server and displaying them -

i'm trying allow user use page currency exchange rate few currencies (2-3 of them) , display them based on rates stored in sql server. want display 3 different rates each single currency when user clicks button convert can let user compare has best rate. what better it? using c#, asp.net , sql server. this sql table structure: create table currencyexchange ( currency char(3) not null, rate money not null, source varchar not null, primary key (currency, rate)) a better way it? never gave requirements of program. that's hard question answer when give 2-3 sentences worth. you might try , cache sql data somewhere (another hidden page, .csv document, or other) , retrieve values cache on page-load. way aren't bogging down sql server. sure make stored procedure on sql update cache find necessary. that's simplest way can imagine doing this. prevents having directly connect sql website, might want security reasons. but said, it's hard suggest method

mysql - php mysqli binding parameters -

i'm assuming php inserting single quotes around $id when binding parameters causing query fail. know $id issue because when manually put string in place of first ? query works. problem need query work using variable $id, suggestions on how can achieve this? if ($stmt = $mysqli->prepare("select count(1) friendships ? = (select id users username = ?) , friendstatus = ?")) { $stmt->bind_param("sss", $id, $username,$friendstatus); $stmt->execute(); $stmt->bind_result($result); $stmt->fetch(); $stmt->close(); } variable column names not possible prepared statements. in general variable column names not needed made queries. consider using join instead.

Cross platform program to get an iOS app to android/google play store? -

i plan once since i've moved on better game engine, have app on apple store want onto google play store. created in xcode , i've tried use apportable few times seem pretty reluctant both , well... work. i've tried myappconverter , it's not looking because i'm not experienced in java when converted code , gave me whole bunch of errors, wasn't sure how fix of them. spent several hours trying work, couldn't little knowledge of eclipse/java. marmalade seemed...alright, wasn't well. are there programs out there wrap code there virtually nothing when comes out used android reliable? i don't think there program port game ios android. assume using opengles code game? if yes, android supports opengles 2 well. if use unity or similar, it's possible port project platform.

css - How to make fireworks slices in td responsive with bootstraap and on the same line on wider screen -

Image
i have design have sliced fireworks , result of slice got table td , design displayed, have add css makes display in block <style type="text/css">td img {display: block;}</style> problem in quest make design responsive have been using bootstrap when use bootstrap row display images on same line not work for example when take row of table , want convert bootstrap row using images this <div class="row" > <div class="col-sm-12" > <img name="iimajinnewworkedon_r2_c1" src="images/decoupes/iimajin-new-worked-on_r2_c1.jpg" width="815" height="162" id="iimajinnewworkedon_r2_c1" alt="" class="float_left img-responsive"/> <img name="iimajinnewworkedon_r2_c7" src="images/decoupes/iimajin-new-worked-on_r2_c7.jpg" width="249" height="1" id="iimajinnewworkedon_r2_c7" alt="" / class="fl

html - How to make space between two column items? -

Image
i want display list of items in 2 columns. there less space between 2 column items. want more space between. should change? tried add more pixel padding. didn't work. #category{ background: #062134; color: white; display: table; width:100%; font-size: 20px; -webkit-box-align: center; -webkit-box-pack: center; -moz-box-align: center; -moz-box-pack: center; display: -webkit-box; display: -moz-box; } #category .column-title { margin-bottom: 30px; font-weight: bold; } #category > div { display: table-row; } #category > div > div { display: table-cell; padding-top: 50px; padding-bottom: 50px; padding-right: 50px; padding-left: 50px; } #category > div > div:first-child { padding-left: 5%; padding-right: 1%; } #category .column-title { margin-bottom: 30px; font-weight: bold; } #category > div { display: table-row; } #category > div > div { dis

php - Submitting html data and staying on same page -

i have form page <html> <body> <form action="insert.php" method="post"> app name: <input type="text" name="fname" /><br><br> app id: <input type="text" name="lname" /><br><br> <input type="submit" name="submitbutton"/> </form> </body> </html> and php page: <html> <body> <?php $con = mysql_connect("xxx","xxx","xxx"); if (!$con) { die('could not connect: ' . mysql_error()); } mysql_select_db("db", $con); $sql="insert app (fname, lname) values('$_post[fname]','$_post[lname]')"; if (!mysql_query($sql,$con)) { die('error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?> </body> </html> n

python - How to format a currency colum in Flask-Appbuilder? -

i have model price column. using modelview , want price column right aligned 2 decimal places , currency symbol. how change format of price column? upgrade flask-appbuilder 1.4.4 , use new @renders decorator this: custom model properties can used on lists. usefull formating values currencies, time or dates. or custom html. simple do, first define custom property on model , use @renders decorator tell framework map class method model property: from flask.ext.appbuilder.models.decorators import renders class mymodel(model): id = column(integer, primary_key=true) name = column(string(50), unique = true, nullable=false) custom = column(integer(20)) @renders('custom') def my_custom(self): # render columns bold on listwidget return markup('<b>' + custom + '</b>') on view reference method column on list: class mymodelview(modelview): datamodel = sqlainterface(mytable) list_columns = ['n

html - Hide element tr in table with css -

i try hide element inside table using css , problem no works , hide element , code it's next: .table_cols { width: 100%; height: 200px; margin: auto; } .td_cols { width: 20%; height: 200px; text-align: center; background-color: green; } .table_scale { display: none; } .table_scale_end { display: none; } <table class="table_cols"> <tr> <td class="td_cols">col 1</td> </tr class="table_scale_end"> <tr class="table_scale"> <td class="td_cols">col 2</td> </tr class="table_scale_end"> <tr class="table_scale"> <td class="td_cols">col 3</td> </tr class="table_scale_end"> <tr class="table_scale"> <td class="td_cols">col 4</td> </tr> </table> my idea it´s hide elements

sql - how to get max count of records in a belongs to many relation with a where clause -

i have 3 models representing programs , program segments attendees can register for. scheduledprograms which has many scheduledprogramsegments which belongs many attendees (which belongs many scheduledprogramsegments) attendees has field registered bool 1/0 indicate if attendee registered or not. i want query finds maximum attendee registration count in programsegments program. i.e. max( scheduledprogram::find(id)->scheduledprogramsegments->with([('attendees') => function($query) { $query->where('registered'); }])->count(); ); is there way write query in eloquent or query builder? using raw expressions query builder if way? edit: clarify, have pivot table field registered , eager load count of records, marked registered . so far seems not possible unless add , maintain count field don't want do, run running separate query count each individual record retrieve pivot table. try update part in q

html - Keep content div aspect ratio with fixed height header -

i'm trying create image slideshow fixed ratio of 4:3, filling whole viewport on website fixed height header of 80px. how can accomplish this? this question pretty close, it's lacking fixed header. any help? the layout should be: ------------------------------------- - | header: height = 80px, width = 100% | | ------------------------------------- | | main div | > total height = 100% | fixed ratio = 4:3 | | | centered | | ----------------------------- - |------------------v------------------| total width = 100% the following css trick: body { margin: 0; padding: 0; } header { width: 100vw; height: 80px; background: red; } article { /* height based on available space (100 height - 80px) */ height: calc(100vmin - 80px); /* width based on available space , aspect ratio (height /3 * 4

Javascript function for simple slider not executing onclick -

hello , looking up. have decided learn javascript trial , error , googling stuff need. far good, when tried bit tricky, slider, things got tough. i dont have knowledge syntax in javascript , how expressions should written in functions trying. so here have simple 4 images in div 2 arrows slider. when click arrow want counter decrease 1, want sure doesnt equal 0 , if change 4, , when done give respective image ( img[counter] ) z index of 50 example. doesnt work. reason. here fiddle of whole thing , hope dont trouble guys this. https://jsfiddle.net/wu2lysrv/3/ function slideengine() { var img1 = document.queryselector("#img1"); var img2 = document.queryselector("#img2"); var img3 = document.queryselector("#img3"); var img4 = document.queryselector("#img4"); var counter = 1; function slidel() { counter--; if (counter == 0) { counter = 4; } img[counter].setattribute(&q

ms access - When to use lookup field? -

whenever i'm considering option of making field's contents being extracted predefined list, should make new table list exclusively options, make query, make form-level lookup field select it? this seems creating lot of tables , queries tables, have lookup field. have no idea normal number should be, or if there clever way of doing queries without creating new tables everytime i'm not aware of. for example: have addresses table, , each address can of 3 types: home, professional, other. should make table exclusively list items , reference through query , lookup field in form? what's procedure here? in advance! use table lookup when going use lookup in entity or going allow end-user edit entries of lookup. in other cases, free confine use constant list of values. feel free ask more.

ios - I didn't migrate NSPersistentStore in new version, can I recover with an app update? -

Image
long story short, core data schema changed, , app submitted app store, caused updated app crash. crash caused missing nspersistentstore due not migrating data model properly. i still see .sqlite , associated database files in documents directory, , if downgrade older version works fine data. question is, can recover app update somehow migrating existing nspersistentstore , adding nspersistentstorecoordinator? edit: didn't change xcdatamodel myself, hence, "long story short". however, did remove xmppframework project , have feeling might have caused core data problem. edit: didn't make changes directly data model, have pinpointed problem. retrieving nsmanagedobjectmodel using [nsmanagedobjectmodel mergedmodelfrombundles:nil] merges data models present in bundle. included data models came xmppframework, , framework has been removed, nsmanagedobjectmodel passed [[nspersistentstorecoordinator alloc] initwithmanagedobjectmodel] different, causing crash. i

asp.net - After change varchar max length, do I have to update Entity Framework -

Image
i have production application asp.net webform entity framework database first. after noticed had 1 varchar column size short. changed on local database side. run , failed. have update entity framework database, succeed. couldn't see change on .edmx file. now expanded varchar size on live database. need republish local copy make change? entities reflect table schema, if changing break ef refer entity framework mapping this max length highlighted in image generated database scheme. changing break ef

java - Data Source Patterns - Where's to put table's level methods? -

at company work models based on "active record pattern", model methods related operations of single record database, example: class user { int id; string name; public boolean find (id); // sql / orm return object based on user's id; public boolean save (); // sql / orm save / update user public boolean delete (); // sql / orm delete user. } // create user "john" set objuser = new user (); objuser.name = "john"; objuser.save (); my question in relation database entity "user", have methods table level , not record, such method "getallactiveusers", returns me query object of active users. type of situation ends in own activerecord model, in opinion not make sense .. me understand advisable / elegant treat type of situation? read gateway , repository patterns may useful this, wondering if has same trouble , how did solve .. thank you!! i'm not big fan of active record pattern think consistent

seo friendly multilanguage with remove trailing slash on php apache -

i've been trying rid of apache's rewrite issues when try both removing trailing slash , seo friendly multilanguage page @ same time. to more clarify, able use functions of apache rewrite rules great codes below # remove .php extension rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^\.]+)$ $1.php [nc,l] rewriterule ^(.*)/$ /$1 [l,r=301] so achieve code ; example.com/status.php turns example.com/status that works great , code below assuming remove trailing slash every page ; # remove trailing slash rewritecond %{request_filename} !-d rewritecond %{the_request} \s(.+?)/+[?\s] rewriterule ^(.+?)/$ /$1 [r=301,l] so achieve code ; example.com/status/ turns example.com/status all till however, when try use multilanguage abuses reason tries remove trailing slash ; rewriterule ^([en|fr]{2})/(.*)$ $2?lang=$1&%{query_string} [l,qsa] so need achieve ; example.com/status?lang=fr it should turn below 404 err

jquery - Decrypt Javascript source -

i have been wrote javascript code , encrypt it.it similar : var _0xbf1b = ["\x2f\x70\x61\x67\x65\x73\x2f", "\x69\x6e\x64\x65\x78\x4f\x66", "\x74\x6f\x4c all code in jsfiddle i search in internet , no solution me decrypt script. please me decrypt source code. thanks by using http://jsbeautifier.org/ you may obtain: http://jsfiddle.net/vfnvx/ function getalarm() { try { var _0xdca7x2 = window['location'].tostring()['tolowercase']()['indexof']('/pages/'); var _0xdca7x3 = window['location'].tostring()['substring'](0, _0xdca7x2) + '/pages/alarm/alarm.aspx/getalarm'; $['ajax']({ type: 'post', url: _0xdca7x3, data: '{}', contenttype: 'application/json; charset=utf-8', datatype: 'json', success: function (_0xdca7x4) { i

c# - How do you see which exceptions are thrown with Intellisense in VS2015? -

Image
this addressed , fixed in vs2015 update 1 is there way show exceptions in vs2015? vs2015 vs2013 it no longer appears show in intellisense tooltip until write code. once code there hovering mouse on makes appear in full. note: appears have been fixed in visual studio 2015 update 1

javascript - iPad Popping Back to Page Top on Scroll -

i using wordpress, bootstrap, , skrollr . have skrollr disabled on mobile using following code: var myskrollrfunction = function () { var windowwidth = $(window).width(); // initialize skrollr if window width large enough if (windowwidth > 1024) { skrollr.init({ forceheight: false, smoothscrolling: true, mobilecheck: function() { //hack - forces mobile version off return false; } }); } // disable skrollr if window resized below 768px wide if (windowwidth <= 1024) { skrollr.init().destroy(); // skrollr.init() returns singleton created above } }; i not using bootstrap scrollspy , have not implicitly disabled it. main issue if stop scrolling in middle of disabled skrollr element, pops top pretty consistently. otherwise, happens randomly. since relatively new wordpress, not sure if wordpress problem, skrollr issue, or bootstrap issue. h

.net - How to add an icon to System.Windows.Forms.MenuItem? -

i tried add icon 1 of context menu items, couldn't it. can me? here's code i've written: private system.windows.forms.contextmenu notifycontextmenu; private void foo() { if (notifyicon == null) { notifyicon = new system.windows.forms.notifyicon(); } if (notifycontextmenu == null) { notifycontextmenu = new system.windows.forms.contextmenu(); notifycontextmenu.menuitems.add("exit"); // how add icon context menu item? } notifyicon.contextmenu = notifycontextmenu; } } mainmenu/contextmenu obsolete, should use menu strip classes instead. change notifycontextmenu = new system.windows.forms.contextmenu(); notifycontextmenu.menuitems.add("exit"); to notifycontextmenu = new system.windows.forms.contextmenustrip(); var exitmenuitem = notifycontextmenu.items.add("exit"); exitmenuitem.image

Deserialize XML into Entitylist using C# from XMLdocument -

refer below xml file multiple event nodes parent events tag <events> <event eventid="ahjy67kl" sessionid="1"> <eventtitle> <![cdata[ phoneeventchad_1 ]]> </eventtitle> <eventabstract/> <timezone>ind</timezone> <eventtimedate>wed, 24 jun 2015 06:00 pdt</eventtimedate> <archivestartdate>wed, 24 jun 2015 09:30 pdt</archivestartdate> <archiveenddate>thu, 23 jun 2016 09:30 pdt</archiveenddate> <length>195</length> <sponsor/> <keywords/> <location/> <eventprofile> <![cdata[ stonehenge profile (918) ]]> </eventprofile> <streamtype> <![cdata[ whitepaper ]]> </streamtype> <categories/> <eventstdfield1> <value/> </eventstdfield1> <eventstdfield2/> <eventstdfield3/> <eventstdfield4/> <eventstdfield5/> <audiencekeylock> <![cdata[ 770d14c9cc784e9d9d312563b093e9a5 ]]>

node.js - Avoid gulp task to finish automatically -

i need gulp task stop finish automatically. have file watchers works after gulp finish, prints that: [10:26:38] using gulpfile ~\gulpfile.js [10:26:38] starting "watch"... [10:26:38] finished "watch" after 1.34 ms [10:26:38] file modified abc.css. [10:26:38] file modified def.js. basically do: gulp.task("watch", function () { // using require("gulp-watch") startwatchers(); }); i found simple solution, don't know if best. returned instance of node stream . basically: gulp.task("watch", function () { // using require("gulp-watch") startwatchers(); // using require("stream"); return new stream(); });

asp.net mvc 4 - Check if email id is windows live id or not -

i developing mvc4 application , want authenticate application using windows live id. have developed page can invite users, want check if user's email id windows live id or not? i have tried different things, validating whether email id gmail id or not. i have tried below code. working gmail, not windows live id tcpclient tclient = new tcpclient("gmail-smtp-in.l.google.com", 25); string crlf = "\r\n"; byte[] databuffer; string responsestring; networkstream netstream = tclient.getstream(); streamreader reader = new streamreader(netstream); responsestring = reader.readline(); /* perform helo smtp server , response */ databuffer = bytesfromstring("helo kirtanhere" + crlf); netstream.write(databuffer, 0, databuffer.length); responsestring = reader.readline(); databuffer = bytesfromstring("mail from:&l

javascript - Creating nested DIVs - Tips for perfomance -

i need create html output composed of nested divs, when provided array of objects. at moment using following code, works. example simplistic in production, have many objects , complex html created , initialized. at moment using 2 loops, 1 opening , 1 closing divs. i know if suggest me alternative approach, considering performances, example avoiding double loop , on. (function () { var html = ''; var data = [{ id: 'a' }, { id: 'b' }, { id: 'c' }]; function open(item) { html += '<div id="' + item.id + '">'; } function close(item) { html += '</div>'; } (var = 0, len = data.length; < len; i++) { open(data[i]); } (var = 0, len = data.length; < len; i++) { close(data[i]); }

java - How to monitor application processing of Kafka messages for load testing -

there application (not mine) reads messages kafka, processing on them, , stores records in database. i've put program in java writes messages queue @ given rate. right now, simple measure of performance querying database @ end of test run ensure records in = records out. however, i'd expand periodically check queue see how many messages pending application hasn't yet processed see if it's getting backed up. i figure can check offset of application's group id in zookeeper. looked @ kafka documentation , gives basic consumer examples , api documentation sparse @ best, i'm not sure how go finding information. what apis need call in order find out in queue application at, , how many messages in queue behind position? i'm using kafka 2.10-0.8.2.1 single zookeeper instance , 3 kafka instances, , load tester using 0.8.2.1 java api. topic in question has 3 partitions (one on each kafka server), purpose of test there single consumer. i suggest

Convert all and any command line input to string in C++ -

i trying write small code @ beginning of program runs different functions depending on file extension of files passed when calling program command line. i want convert argv[2] string (called st ) can compare ".png" , ".txt" , etc. using strccmp . i found similar solutions around so, none of them addressed issue of saving argument string variable. whenever try use argv[1] or argv[2] , debugger complains subscript out of range, , @ loss how around this. int main(int argc, char** argv) { // first , simplest attempt sd::string st = argv[2]; // second attempt fails std::vector<std::string> all_arg; if (argc > 1) { all_arg.assign(argv + 1, argv + argc); } std::string st = all_arg[2]; // comparison st = st.substr(st.size() - 4, st.size() - 1); if (strcmp(st.c_str(), ".png")) { ... } else {...} } corrected obvious problems, code compiles , runs fine. #include <iostre

java - Incorrect evaluation of String using Collator -

i'm trying use collator fast way sort 2 string using following code: public static void main(string[] args) { string str1 = "test sortowania"; string str2 = "testowanie sortowania jeszcze raz"; system.out.println(compare(str1,str2)); } public static int compare(string s0, string s1) { boolean ignorecase = true; collator c = collator.getinstance(new locale("pl", "pl")); return (ignorecase ? c.compare(s0.touppercase(new locale("pl", "pl")), s1.touppercase(new locale("pl", "pl"))) : c.compare(s0, s1)); } as result got 1, means "test sortowania" > "testowanie sortowania jeszcze raz". however think should opposite, space character should less 'o'. am missing something?

php - Datatable Requested unknown parameter '1' for row -

i have following datatable <br><button id="addrow">add new row</button><br> <table class="table table-striped table-bordered table-hover " id="example" cellspacing=0 width="100%"> <thead> <tr> <th>image</th> <th>number</th> <th>creation_date</th> <th>ei</th> <th>name</th> <th>profit</th> </tr> </thead> <?php foreach ( $data_req_table $k => $v ) : ?> <tr style="text-align: center;">

qt5 - How to select file from MainMenu in Qt? -

i load text files folder mainmenu in qt application. void mainwindow::loadfilestomainmenu() { qstring pathtodir("/myfiles"); qdiriterator it(pathtodir, qstringlist() << "*.txt", qdir::files, qdiriterator::subdirectories); while (it.hasnext()) { qstring curpathname = it.next(); qstringlist filesegments = curpathname.split('/'); qstring curfilename = filesegments.at(filesegments.size() - 1); qaction* action = new qaction(tr(curfilename.tostdstring().c_str()), this); action->setstatustip(tr(curpathname.tostdstring().c_str())); ui->menufilelist->addaction(action); // if new style selected? connect(action, signal(triggered()), this, slot(onloadfile())); } } there create qactions files in folder 'myfiles' , connect these each of these ations slot onloadfile(): void mainwindow::onloadfile() { qaction *action = qobject_cast<qaction *>(sender()); if (action) { qdebug() <&

windows services - Autofac - How to dispose the root lifetime? -

i'm using autofac ioc container windows service. i have class connectionmanager registered singleton (and thus, tied root lifetime scope of autofac). the ioc container configured , initialized in service's onstart() method. usual stuff: private icontainer _container; public void onstart() { var builder = new containerbuilder(); //initialize it... _container = builder.build(); } i want make sure (singleton) instance of connectionmanager disposed when service stopped - namely when onstop() method called. want tell autofac container: "nice meeting you. prepare die ." my question is: how can hands on root lifetime scope in onstop() method can dispose of it? the answer staring me in face. the container root lifetime scope. dispose of container singletons disposed... public void onstop() { _container.dispose(); }

XML feeds and namespaces with PHP, SimpleXML and Xpath -

hi have been struggling puzzle time how data out of embedded namespaces here xml feed have cut down make easier read <?xml version="1.0" encoding="utf-8"?> <feed xmlns:atom="http://www.w3.org/2005/atom" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns="http://www.w3.org/2005/atom" xmlns:sc="http://schemas.sage.com/sc/2009" xmlns:crm="http://schemas.sage.com/crmerp/2008" xmlns:sdatasync="http://schemas.sage.com/sdata/sync/2008/1" xmlns:sdata="http://schemas.sage.com/sdata/2008/1" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sme="http://schemas.sage.com/sdata/sme/2007" xmlns:http="http://schemas.sage.com/sdata/http/2008/1"> <author /> <category term="tradingaccount" /> <gen

javascript - Why Froala Editor Don't keep format when retrieve data from database -

Image
i have used froala editor post content website working insert data database problem when retrieved data database don't keep format before , shown html tag , text too. issue text format don't keep after retrieved data database , past froala editor . here configure. $('#eng_dd,#kh_dd,#ch_dd').editable({ inlinemode: false, mediamanager: false, showinsertimage: true, imageuploadparam: 'up_img', sethtml: true, imageupload: true, imageuploadurl: 'http://localhost/cootel/gotoadmin/image/edit_img', imageerrorcallback: function (data) { if (data.errorcode == 1) { console.log('bad link') } else if (data.errorcode == 2) { console.log('bad response') } else if (data.errorcode == 3) { console.log('uplo

java - Loop several times with different values each time -

i need make loop goes through each time different values rowno. here part of code: int rowno = 2; file file = new file("path"); workbook workbook = workbook.getworkbook(file); string value = workbook.getsheet(0).getcell(1, rowno).getcontents(); the next row numbers 11, 20, 29 , on... declare array, list, or set rows need check: int[] rowstocheck = { 11, 20, 29 }; and iterate on array taking values: for (int = 0; < rowstocheck.length; i++) { string value = workbook.getsheet(0).getcell(1, rowstocheck[i]).getcontents(); system.out.println(value); } update: if numbers consecutive 11 + 9 = 20 + 9 = 29 + 9.... tarik suggested, make counter of loop increment 9. int numberofrows = // neeed (int = 0; < numberofrows; i+=9) { string value = workbook.getsheet(0).getcell(1, i).getcontents(); system.out.println(value); }

php - Is there a simple way to utilize Prestashop's login functionality? -

i looking through docs prestashop's web service api , it's great retrieving data. i planned on creating page display various data via web service wish protect page public. is there way can include administrative login functionality page? you can use web server basic authorization. (nginx): http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html (apache): http://httpd.apache.org/docs/2.2/howto/auth.html

odata - how to check variable type is GUID or not in jquery? -

i have database type guid , value of column "33c3ccbc-b6bb-4caa-ab10-338aa95f366e". in jquery type of guid column showing string, need perform operation in odata. how check if variable type guid or not in jquery. there no such thing guid in javascript. need string manipulation determine if given string valid guid. using regular expression seems ideal task. this regular expression match guid: /[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}/i this method test if given string valid guid (not tested, written top of head) function isguid(value) { var regex = /[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}/i; var match = regex.exec(value); return match != null; }

javascript - Bootstrap design on google search box -

how can personalize basic google search box simple bootstrap design? want search box this . here html want include search <form class="navbar-form" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="cautare" name="q"> <div class="input-group-btn"> <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> here basic google css , java script. and this . i try many things. maybe it's simple please not criticize me because did not know javascript. <ul class="nav navbar-nav navbar-left nav-search">

javascript - Append <Script> Tag to Body? -

Image
i want append script tag body of html page. added following in page: <script type="text/javascript"> function loadscript() { var script = document.createelement('script'); script.type = 'text/javascript'; script.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&' + 'callback=initialize'; document.body.appendchild(script); } window.onload = loadscript; </script> i tried run in jsfidle , there no problems. when run on html page runs on demo server following error in console: uncaught typeerror: undefined not function what causes error , how can prevent it? edit: removing type text/javascript not change anything. the error getting because there no initialize() function. if declare 1 there no error. function loadscript() { var script = document.createelement('script'); script.type = 'text/javascript';

datetime - How to pass the date into GregorianCalendar in JAVA? -

sorry, new this. this class private string name; private string code; private gregoriancalendar startdatetime; private gregoriancalendar enddatetime; this main coursedetail []c1={new course("java","aacs 2083", new gregoriancalendar(2015,06,20,14,00),new gregoriancalendar(2015,06,21,15,00))}; am close answer? may ask how pass date gregoriancalendar using method above?? sorry dummy question... you can directly use util date gregoriancalendar date date = new date(); gregoriancalendar gregoriancalendar = new gregoriancalendar(); gregoriancalendar.settime(date); directly set date gregoriancalendar gc = new gregoriancalendar(); gc.set(gregoriancalendar.year, 2015); gc.set(gregoriancalendar.month, 7); gc.set(gregoriancalendar.date, 23); constructors link public gregoriancalendar(int year, int month, int dayofmonth) public gregoriancalendar(int year, int month, int dayofm

java - How to call oracle function using Hibernate criteria? -

i new hibernate. building login portal. have used db function encrypt user password. seems using hibernate complex queries/functions/procedures on existing databases difficult. possible write below queries using hibernate criteria? sql query 1 : select first_name user.emp_group username = 'xxx' , user.decrypt(password, 2) = 'yyyy'; sql query 2 : select a.desc ,b.total user.status ,( select status ,count(*) total user.emp group status ) b a.type = b.status (+) user schema name , decrypt function name. i faced problem getting data views resolved stackoverflow post. how hibernate retrieve data existing database view? that. you can use native sql hibernate. the way (for example): string sql = "select first_name, salary employee"; sqlquery query = session.createsqlquery(sql); list data = query.list(); for(object object : data) { map row = (map)object;