Posts

Showing posts from July, 2010

ubuntu - Compiling CUDA looks for wrong CUDA version -

on ubuntu, had installation of cuda 6.5, , wanted upgrade cuda 7.0. so, deleted directory @ /usr/local/cuda-6.5, , installed cuda 7.0 /usr/local/cuda-7.0. changed symbolic link @ /usr/local/cuda point /usr/local/cuda-7.0. in bash.rc file, updated environment variables accordingly: export cuda_home=/usr/local/cuda-7.0 export ld_library_path=${cuda_home}/lib64 export path=${cuda_home}/bin:${path} if type in "nvcc --version", following expected: cuda compilation tools, release 7.0, v7.0.27 however, compiling code (the caffe deep learning library, precise) uses cuda, , getting following error message: error while loading shared libraries: libcudart.so.6.5: cannot open shared object file: no such file or directory so reason, still looking cuda 6.5 libraries, rather cuda 7.0 libraries. why this? how tell compiler 7.0 libraries? cannot find reference libcudart.so.6.5 in source code compiling, cuda compiler looking wrong version. obviously, didn't follow ...

git - How do I squash two non-consecutive commits? -

i'm bit new whole rebasing feature within git. let's made following commits: a -> b -> c -> d afterwards, realize d contains fix depends on new code added in a , , these commits belong together. how squash a & d , leave b & c alone? you can run git rebase --interactive , reorder d before b , squash d a.

javascript - How can I set the maximum number of object to show? -

i have following function create automatically new option if there folder inside. last folder contain html file , html going opened automatically when select parent folder. in case don't want create option . this code create new levels want stop create new 1 once there 4 option levels created: function processnewdfdata( respobj, $currentselectitem, strcurrentpath ) { fsstructure[strcurrentpath] = {'subfolders':[], 'subshtmls':[]}; if ( (respobj.subfolders.length > 0) || (respobj.subshtmls.length > 0) ) { for( var = 0; < respobj.subfolders.length; i++ ) { fsstructure[strcurrentpath].subfolders.push( respobj.subfolders[i] ); } for( var = 0; < respobj.subshtmls.length; i++ ) { fsstructure[strcurrentpath].subshtmls.push( respobj.subshtmls[i] ); } } rendselects( $currentselectitem, strcurrentpath ); }

angularjs - How to avoid nested call in ionic/angular? -

i'm totally new ionic/angular, code: .controller('postctrl', function($scope, posts, $cordovasqlite, $http) { $scope.getposts = function() { $http.get('http://localhost/postids').then(function(resp) { _.each(resp.data, function(id) { var query = "select id posts id = ?"; $cordovasqlite.execute(db, query, [id]).then(function(res) { if(res.rows.length = 0) { $http.get('http://localhost/post/' + id).then(function(resp) { var post = resp.data; var query = "insert posts (postid, title, user, content) values (?,?,?,?)"; $cordovasqlite.execute(db, query, [post.id, post.title, post.user, post.content]).then(function(res) { // success }, function(err) { console.log(err); }); }, function(err) { console.log(err); }); } }, function (err) { ...

How can I permanently save the last code until next restart in vim -

so question if writing code in vim & want go 20 minutes earlier, type :earlier 20m in vim. doesn't work if exit vim once or reboot system. understand stored temporary registers , once vim restarts, cleans whole register buffers. there way can save last changes & apply undo mechanisms. work on big project files & if wrong occurs, can not go back. in vim 7.3 or later, can use undo file. put in .vimrc. set undofile by default save 100 actions undo. if want more, can set manually adding .vimrc, whatever number want: set undolevels=100 persistent undo create undo files in same directories files work on. if want put these in separate directory don't clutter filesystem, add .vimrc: set undodir=~/.vim/undo then, need make directory. command line: mkdir ~/.vim/undo i using version control instead of relying on vim's persistent undo track changes in projects.

Numerically find energy eigenvalues of a large symbolic matrix in Mathematica for a given range -

i have 136x136 hamiltonian (matrix) , need find eigenvalues. it cannot solved analytically eigenvalues[h] required solve 136th order polynomial. i need solve numerically replacing symbolic terms values before computing eigenvalues. however, needs plotted range of values of symbolic term example -1 < x < 1. is there method numerically solve , plot range of values? { {10.1358 - 6.72029 x, 0., 0.},... {0., 10.1358 - 6.72029 x, 0.}, {0., 0., 10.1358 - 6.72029 x}, {0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}, {0., 0.204252, 0.}, {0., 0., 0.267429} ... corner of matrix example. matrix real , symmetric.

c - Warshall algorithm idea and improvement -

the warshall-floyd algorithm based on idea: exploit relationship between problem , simpler rather smaller version. warshall , floyd published algorithms without mentioning dynamic programming. nevertheless, algorithms have dynamic programming flavor , have come considered applications of technique. algorithm warshall(a[1..n, 1..n]) //implementswarshall’s algorithm computing transitive closure //input: adjacency matrix of digraph n vertices //output: transitive closure of digraph r(0) ←a k←1 n ←1 n j ←1 n r(k)[i, j ]←r(k−1)[i, j ] or (r(k−1)[i, k] , r(k−1)[k, j]) return r(n) we can speed above implementation of warshall’s algorithm inputs restructuring innermost loop my question on above text following what author mean idea " exploit relationship between problem , simpler rather smaller version" please elobaorate. how can improve speed author mentioned in above implemenation. the formulation 1...

python - How do i run nikto.pl file from wapiti.py file? -

i working on project involves wapiti , nikto web tools. have managed produce 1 report both these tool command python wapiti.py www.kca.ac.ke ;perl nikto.pl -h www.kca.ac.ke -display v -f htm -output /root/.wapiti/generated_report/index.html. but run command python wapiti.py www.kca.ac.ke and both wapiti , nikto web scan report. how achieve guys? a shell script work. save following 'run_wapiti_and_nikto_scans', run as: bash run_wapiti_and_nikto_scans www.my.site.com here script: #!/bin/bash site=$1 if [ -n "$site" ]; # -n tests see if argument non empty echo "looking scan $site" echo "running 'python wapiti.py $site'" python wapiti.py $site || echo "failed run wapiti!" && exit 1; echo "running 'perl nikto.pl -h $site -display v -f htm -output /root/.wapiti/generated_re...

javascript - Scroll movement not working in Safari -

i use below javascript scrolling, doesn't work in safari. i remove below code working in safari, not working smoothly. link here jquery(".scrollbg a").click(function(event){ event.preventdefault(); var window_width = jquery(window).width(); // alert(window_width); //jquery('html').animate({scrolltop:jquery(this.hash).offset().top-38+'px'}, 1000); if(window_width<=375){ jquery('html').animate({scrolltop:jquery(this.hash).offset().top+60+'px'}, 1000); } else if(window_width<=500){ jquery('html').animate({scrolltop:jquery(this.hash).offset().top+60+'px'}, 1000); } else { jquery('html').animate({scrolltop:jquery(this.hash).offset().top-38+'px'}, 1000); } }); please, know of working smooth scroll safari? omg. don'...

c# - Xamarin forms DisplayAlert not showing when called from a function called by a delegate -

when call greet inside size function displayalert displays alert expected when called delegate after event log output correct name (greet has been called) displayalert not show. public class custompage : contentpage { ... protected override void onvalidsizeallocated(double width, double height) { ... greet("test"); app.fb.getname(); app.fb.namerecieved += (s,e) => { greet(e.name); }; } public void greet(string name) { utils.log("hey " + name); displayalert("hey " + name, "welcome", "ok"); } } the code above outputs "hey test" , alert comes saying "hey test, welcome" ok button outputs "hey leo" (which correct because name facebook account) no alert shows. is namereceived fired inside getname function? ...

How to find the salt part from password hash of each user in openldap? ( sha 512 hash) -

i have user password in plain text format. want is, want find hash of plain text password using sha512 , compare result password retrieved openldap. problem here not find salt used openldap sha512 hashing. (i.e) in linux /etc/shadow , can find salt, $6$salt$hash similarly how find salt password hash stored in openldap system environment:- linux,c,c++

Chrome Apps Cordova webview shows a blank page -

Image
it's quite weird situation in. i've found out chrome apps ability, can port them automatically ios, android , windows. have problem, i've been writing application in javascript base , tested chrome editor, worked fine in windows mode. i've been struggling on porting android , when worked, webview empty. after 2 hours of trying, googling , messing around decided give , take sample , work there. samples aren't giving me webview. the webview stays empty, can see keep getting 4 errors not related script ( sychronous xmlhttprequest, failed load css , lost .html file chrome-extension ). debugging app; text shows up, webview stays blank. ever had same problem? the entire file contains following code; <!doctype html> <html> <head> <meta charset="utf-8"> <title>webview sample</title> <link href="index.css" rel="stylesheet"> </head> <body> <webvie...

aggregation - ElasticSearch multifield not working -

in documents have field collaboration on aggregation queries. want full-text searchable, figured out should make multifield. field may this: ... "collaboration" : "cms" or "collaboration" : ["atlas", "cms"] or "collaboration" : "lhcb" ... following advice: elasticsearch term aggregation changed mapping to: "collaboration": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, and run query: post /my_index/_search { "aggs": { "collaboration": { "terms": { "field": "collaboration.raw" } } } } and nothing: "hits": { "total": 5, "max_score": 1, "hits": [...] }, "...

c++ - OpenCV 3.0: Calibration not fitting as expected -

Image
i'm getting results don't expect when use opencv 3.0 calibratecamera. here algorithm: load in 30 image points load in 30 corresponding world points (coplanar in case) use points calibrate camera, un-distorting un-distort image points, don't use intrinsics (coplanar world points, intrinsics dodgy) use undistorted points find homography, transforming world points (can because coplanar) use homography , perspective transform map undistorted points world space compare original world points mapped points the points have noisy , small section of image. there 30 coplanar points single view can't camera intrinsics, should able distortion coefficients , homography create fronto-parallel view. as expected, error varies depending on calibration flags. however, varies opposite expected. if allow variables adjust, expect error come down. not saying expect better model; expect over-fitting, should still reduce error. see though fewer variables use, lower error. bes...

css - How to make the gradient border stay at the screen -

Image
jsfiddle html <div class="content">blabbles</div> css html, body { margin: 0; height: 100%; min-height: 100%; position: relative; } html{ border-image: linear-gradient(rgba(248,80,50,1), rgba(255,153,51,1)) 40% repeat; border-width: 10px; } attempted have gradient border stay around screen when content longer, content pass through , border scrolling up/down. tried both: position: fixed , background-attachment: fixed doesn't make border stay on screen no matter whether content longer or shorter. also how make content go through behind border if longer? codepen http://jsfiddle.net/d3ckg18e/5/ css code (no need set height / min-height html or body element body:before { box-sizing : border-box; position : fixed; z-index : 1; height : 100vh; width : 100%; content : ""; border-image : linear-gradient(rgba(248,80,50,1), rgba(255,153,51,1)) 40% repeat; ...

How to compare the two tables and get the column name in mysql? -

i have 2 tables listed below.i need compare both tables , need unmatched column name possible in mysql ? users +----+------------+ | id | login_name | +----+------------+ | 1 | chris | +----+------------+ | 2 | cherri | +----+------------+ users_temp +----+------------+ | id | login_name | +----+------------+ | 1 | chris1 | +----+------------+ | 2 | cherri | +----+------------+ so in case expected output want return login_name users_temp table.how can ? if want names don't match: select u.id, u.login_name, ut.login_name users u join users_temp ut on u.id = ut.id , u.login_name <> ut.login_name; note: finds users ids match, consistent how question phrased.

java - Having problems login into Gmail imaps (not using javamail) tag error -

i trying create typestate client program in java speaks gimaps having trouble getting login in. when enter details sends * bad invalid tag. presume tag sending. here's code i'll explain more. public class cmain { static final string crlf = "\r\n"; public static string saferead(bufferedreader readerc) { string readline = ""; try { readline = readerc.readline(); } catch(ioexception e) { system.out.println("input/output error, unable read"); system.exit(+1); } return readline; } public static void main(string[] args) { crole currentc = new crole(); bufferedreader readerc = new bufferedreader(new inputstreamreader(system.in)); system.out.println("connecting: "); string payload2 = currentc.receive_acceptedstringfroms(); system.out.println("received s: " + payload2); /...

java - "no conversation" error and stopping the program in android -

please see following code. analysed following code , not seem have wrong in coding. when run following code in emulator, no conversation error. draw.java public class draw extends view { paint paint; public draw(context context) { super(context); paint = new paint(paint.anti_alias_flag); } @override protected void ondraw(canvas canvas) { paint.setcolor(color.green); canvas.drawrect(50,30,100,120,paint); super.ondraw(canvas); }} mainactivity.java class mainactivity extends activity { draw draw; relativelayout relativelayout; @override public void oncreate(bundle s){ super.oncreate(s); relativelayout = new relativelayout(this); draw = new draw(this); relativelayout.addview(draw,240,320); setcontentview(relativelayout); } } install android studio again. code work well.

java - Load a fragment once and show it on more activities -

i have android application, has lot of articles. if open article new activity created. there part in activity same, send request server data. thinking make fragment load data once (probably in mainactivity) , show activities. possible , how do it? i tried creating fragment, still loads data every time new activity created. here xml code. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <textview android:id="@+id/textview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" /> <!-- there more layout, don't think needed --> </relativelayout> and java private class getmessage extends asynctask<void , void, void>{ @...

encryption - How to support password protection to a document similar to keynote in iOS -

Image
is there apple api support encryption of document similar keynote application(.key file) or in general how support encryption entire document. i can't encrypt entire folder because in icloud scenario small change trigger entire document upload looks missing something. i tried see how files encrypted in keynote. in below image left side document without password , other 1 password. thanks i think there no straight forward way encrypt entire document have file file.

javascript - Trigger update during animation -

i animating div (id="ani") using following css code. #ani { width: 100px; height: 100px; background: red; color:white; position :relative; animation: mymove 5s infinite; } @keyframes mymove { 0% {left: 0px;} 25% {left: 250px;} 50% {left:500px;} 75% {left: 250px} 100% {left: 0px;} } i know if there way display instantaneous value of css 'left' property changing i.e. value of 'left' should displayed time on screen. there way bind 'left' value text field ? angularjs seems not work in style-sheets. you can use demo $(function(){ var div = $('#ani'), showleft = $('#left'); setinterval(function () { showleft.text(div.position().left) }, 10); });

jquery - jQgrid toolbar searching - dynamically remove search box from any column -

i using jqgrid version 4.4.4 , right facing 1 problem related toolbar searching. mention in heading, want remove search box of toolbar search column "dynamically" during or after rendering grid. google didn't found relevant solution on problem. used selcolprop property $('#<gridid>').jqgrid('setcolprop', 'lotno', { search: false }); and mentioned in loadcomplete function due logical reason. if knows how this, kindly share valuable ideas. updated: using free jqgrid version 4.9.2 , functionality not happening on it. searching toolbar created once . includes searchable columns in searching toolbar. if need change search property dynamically have recreate searching toolbar after changing value of search property. need call destroyfiltertoolbar remove searching toolbar , call filtertoolbar once more time. alternatively can consider hide searching field after setting search property false . correspond...

windows - Cannot read registry key when using SRVANY -

i working on script needs read , write value hklm registry hive. while works fine when running script, registry access denied when running same code service using srvany utility. service created using srvany runs under local system context belive should have full access hklm registry hive. when running code script, running under administrator account. reg_key_path = "hklm\software\appname\serviceconfig" strfilename = objwshshell.regread(reg_key_path) the error above code invalid root in registry key "hklm\software\appname\serviceconfig" the trick use "c:\windows\sysnative\cscript.exe" launch cscript via srvany. full credit hans passant answer.

c++ - error C2825: 'F': must be a class or namespace when followed by '::' -

i'm having bit of trouble analyzing cause of error in code. code looks fine, , other devs says fine: void handle_read_headers(const boost::system::error_code& err, restclient::response& resp) { if (!err) { // start reading remaining data until eof. boost::asio::async_read(socket_, response_, boost::asio::transfer_at_least(1), boost::bind(&client::handle_read_content, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred, boost::ref(resp))); } } void handle_read_content(const boost::system::error_code& ec, size_t bytes_transferred, restclient::response& resp) { if (!ec) { // write of data has been read far. std::cout << &response_; // continue reading remaining data until eof. boost::asio::async_read(socket_, response_, boost::asio::transfer_at_least(1), boost::bin...

latex - R xtable: Wrap overflowing columns into subtables -

Image
this question related 1 here, feel solutions provided there don't answer question. split xtable ouput sub tables my question same. in r, have following aggregated data table: > agg2 x1.err x1.pct x2.err x2.pct x3.err x3.pct x4.err x4.pct x5.err x5.pct x6.err 1 s.noun_noun 0.13121019 s.noun_noun 0.19791667 s.noun_noun 0.16730769 s.noun_noun 0.17659574 s.noun_noun 0.18352941 s.noun_noun 2 s.verb_verb 0.12611465 s.verb_verb 0.13750000 s.verb_verb 0.14615385 s.verb_verb 0.14042553 s.verb_verb 0.13176471 s.verb_verb 3 s.det_det 0.04076433 s.det_det 0.04375000 s.det_det 0.05384615 s.prep_prep 0.04042553 s.coord_prep 0.04000000 s.prep_prep 4 s.verb_noun 0.03821656 s.prn_prn 0.03958333 s.coord_prep 0.04423077 s.prn_prn 0.03829787 s.det_det 0.04000000 s.det_det 5 s.prep_det 0.03312102 s.coord_prep 0.03750000 s.prep_prep 0.04230769 s.det_det 0.03617021 s.prep_det 0.03764706 s.prn_prn x6....

matlab - 3d plot with axes of same length -

i have 3d trajectories want plot. since vary lot in xy, less in z, default plot3 misleading, because automatically scales axes. i've been told use axes equal has no effect (see commented line used it). i came code, in opinion long achieve simple task: [d,rate]=read_vicon_ascii('csvdata/a1-0.csv'); % or replace above line d=csvread('stackoverflow-31289872.csv'); % stackoverflow-31289872.csv @ https://drive.google.com/file/d/0b5gjkidzk3f5uhlvquxkefo4sg8/view?pli=1 % indices of x,y,z columns x = 1+(2:3:14); y = 2+(2:3:14); z = 3+(2:3:14); bounds = [ min(min(d(:,x))) max(max(d(:,x))) min(min(d(:,y))) max(max(d(:,y))) min(min(d(:,z))) max(max(d(:,z))) ]; maxdelta = max(bounds(:,2)-bounds(:,1)); squarebounds = bounds; xyz=1:3 delta = squarebounds(xyz,2) - squarebounds(xyz,1); squarebounds(xyz,:) = squarebounds(xyz,:) + (maxdelta - delta) * [-0.5 0.5]; end figure hold on i=1:5 plot3(d(:,x(i)),d(:,y(i)),d(:,z(i)),'r-...

c++ - How do I typedef base class's member template? -

i'm trying make short form of rebind_alloc member template. the minimal part of code below: template <class t, class allocator = std::allocator<t> > struct { using allocator_type = allocator; template <class u> using rebind_alloc = typename std::allocator_traits<allocator>::template rebind_alloc<u>; }; template <class t, class allocator = std::allocator<t> > struct b : a<t, allocator> { using base = a<t>; using typename base::allocator_type; b(const allocator_type& alloc); // b(const base::allocator_type& alloc); template <class u> using typename base::rebind_alloc<u>; // error on line }; the reason wrote every base class's member type in class template inheriting class template cannot directly use member type use base::some_type form. a single type allocator_type okay, got error when try use using statements member template. how use it? there ten errors in...

java - How to get two dimentional array max size if different lengths -

i trying set array size in dynamically. here input values array values are int[][] dubarr={{2,5,6},{2,5,4,7}}; i want set array size int[][] size=new int[dubarr.length][dubarray[0].length]; but problem here cant store second array last value dont [dubarray[1].length] ; finding maximum length of second dimension , creating new array in single line makes array square, lose information shape. suppose want deep-copy of original array in original shape: if (dubarr == null) { return null; } final int[][] size = new int[dubarr.length][]; (int = 0; < dubarr.length; i++) { size[i] = dubarr[i].clone(); } return size; this work if dubarr null or empty.

c# - AnyCpu reference x64 valid? -

is valid scenario reference x64-dll anycpu dll when system run on sure 64bit system? i'm asking, because had issues here, getting exception follows: "could not load file or assembly 'xy' or 1 of dependencies.an attempt made load program incorrect format" i had problem several times different solutions in last couple of years. seems work , not. it valid anycpu assembly target x64 dll. but, ensure anycpu assembly executing x64 process. note later versions of visual studio have added "prefer 32-bit" option assemblies. need make sure turned off, , aren't using settings on machine override setting. also note if anycpu assembly references other assemblies may available x86 assemblies on target machine, run x86 process. frankly, if know want process ever run x64, imho makes sense compile x64 . @ least way, if wind running in incompatible environment, you'll better error message (i.e. event log contain information depende...

sql server - Once again: Stored Procedure vs. TV-UDF -

i know, discussed several times (most discussions years back...). but - looking through these discussions - feeling, there broadly spread common sense wrong: tv-udfs bad in performance. many people prefer sps collect data, why? when tv-udf, i'm speaking single-statement-udf ("inline-udf") only. optimizer handle right clever, if part written directly query. multi-statement-udfs perform worse... from point of view, why ever should use udf collect data, see these points: best performance (i did lot of comparisons!) you can use them join or apply , reach complex still readable queries (i use 1 "univers" query consisting of more 30 functions coming more 1000 columns - in seconds!) you can call them everywhere (e.g. fill excel-sheet 1 call via odc) you can mix them xml-calls perfectly if select needs sub-set of columns optimizer skip unneeded parts - not sp with inline-udfs optimizer can predict row count , able use capabilities of indexes, statis...

How to select <tr> that has <td>'s only, but not <th> using jQuery? -

i have table headers , table data. this: <table> <tr> <th>start time</th><th>end time</th> </tr> <tr> <td>12:00 am</td><td>01:00 am</td> </tr> <tr> <td>01:00 am</td><td>02:00 am</td> </tr> <tr> <td>12:00 pm</td><td>01:00 am</td> </tr> </table> now want select data rows only. header row should not selected. don't want add class td or tr elements i have in jquery, jquery specific solution acceptable too. any clue. you can use :has selector tr have td elements in it: $('tr:has(td)').css('name','value')

regex - Confused with the locale settings in R -

just answered removing characters after euro symbol in r question. it's not working me r code works others on ubuntu. this code. x <- "services defined in sow @ price of € 15,896.80 (if executed fro" euro <- "\u20ac" gsub(paste(euro , "(\\s+)|."), "\\1", x) # "" i think changing locale settings, don't know how that. i'm running rstudio on windows 8. > sessioninfo() r version 3.2.0 (2015-04-16) platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows 8 x64 (build 9200) locale: [1] lc_collate=english_united states.1252 [2] lc_ctype=english_united states.1252 [3] lc_monetary=english_united states.1252 [4] lc_numeric=c [5] lc_time=english_united states.1252 attached base packages: [1] stats graphics grdevices utils datasets methods [7] base loaded via namespace (and not attached): [1] tools_3.2.0 @anada's answer need add encoding parame...

jquery - Slider thumb easier to grab on tactile devices -

i using bootstrap sliders, thumb feels kind of hard grab on tactile devices though made pretty big. input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none !important; width: 20px; height: 20px; background-color: #ececec; border-radius: 30px; box-shadow: 0px 0px 3px #3c6d59; transition: 0.5s ease; border: none; padding: 15px; } i tried create add padding doesn't change feeling. tried create invisible div around thumb unsuccessful. open suggestions, cheers! this how made slider button bigger: transform:scale(2); the above code makes slider button 2 times bigger. jsfiddle demo here

Spaces between texts in listview android -

i have 3 textviews in listview rows. want space them equally. tried working gravity, isn't working. spaces provided should equally distributed among texts or can vary. below code: list.xml <listview android:layout_width="wrap_content" android:layout_height="457dp" android:id="@+id/payment_plan_list_view" android:layout_gravity="left|center" android:divider="@android:color/transparent" android:dividerheight="20dp" android:layout_margintop="10dp" android:layout_weight="3" /> list_item.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <tablelayout android:layout_width="match_parent" andro...

html - list of submitted forms bootstrap/php -

i trying list of users submitted forms, each image, title, description , edit , delete button. trying them in list without numbers or bullets, 1 after another, not succeding, appreciated. thank in advance. here code: <div class="container-fluid"> <p><a href="/validated/shows/create-show" class="btn btn-primary" role="button">create show</a></p> @if(sizeof($shows) > 0) @foreach($shows $index => $show) @if($index%3 == 0) <div class="row"> @endif <div class="col-sm-6 col-md-3"> <div class="thumbnail"> <img src="{{$show->path}}"> <div class="caption"> <h3>{{$show->title}}</h3> <p>{{$show->description}}</p> </div> <p><a href="/validated/shows/edit-show/{{$show->id}}" class="btn btn...

osx - My specific installation of Safari refuses to open my website -

my copy of safari refuses open website, example.com . every time try , visit http://example.com safari (not server!) redirects me https://example.com , , tells me: "safari can't open page " https://example.com " because safari can't connect server "example.com". the site not have https enabled or certificate installed (though once did) the site works in chrome the site works in ios safari the site works in safari on different computer it seems copy of safari has 'cached' https redirect or something. here have tried: clearing safari cache disabling safari cache clearing os x dns cache system reboots intentionally accessing https version intentionally accessing http version appending random query strings but still every time instantly message. appears in matter of milliseconds making me assume it's cached somewhere. when trying on guest account, problem goes away. however, both mac @ home , @ work affected...

php - Joomla: access article properties from tags module -

so i've got template, , design blog used blog.php , blog_items.php in html/ folder in template's folder. working on tag-search, that's not in com_content, it's in com_tags. created folder com_tags, tag folder inside and, since want posts same in tag search , common blog view, copied blog_item.php new folder, renaming default_item. have no problem including file default_items.php, $this->item seems different 1 in com_content component. so, code, when using lines <?php echo jlayouthelper::render('joomla.content.blog_style_default_item_title', $this->item); ?> generates lot of errors, that, example, $this->item->title unset. i've created simple workaround after investigation using print_r: $params = jcomponenthelper::getparams('com_content'); $this->params=$params; $this->item->params=$params; $this->item->title=$this->escape($this->item->core_title); $this->item->state=$this->escape($this->...

angularjs - Redirect to different ui-router state with same url from server? -

currently have state 'home' resides @ url '/'. after user connects, 'client' state loaded, resides @ url '/' , session updated. possible make if user reloads page, 'client' state loaded instead of 'home' state? if @ different urls, have server perform redirect them both @ base url '/'. there functionality in ui-router let me achieve this? here states: app.config(function($stateprovider, $urlrouterprovider,$locationprovider) { $stateprovider .state('home', { url: '/', controller: 'homepageconroller homectrl', templateurl: '/views/partials/home.html', onenter: function($http,$state) { $http.post('/checkconnected') .success(function(data,status) { if (data) {$state.go('client');} }); } }) .state('client', { url: '/', controller: 'clientcontroller clientctrl', ...

java - RESTful Hirerarchy with classes with JAXRS -

would create below hierarchical structure in rest jaxrs , jersey provider @post /origination/customers/ @put /origination/customers @get /origination/customers/{customerid} @post /origination/customers/{customerid}/inventory @put /origination/customers/{customerid}/inventory @get /origination/customers/{customerid}/inventory/inventoryid currently services written in single class originationservice, better encapsulation know if services can refractored customer origination in seperate class called customeroriginationservice , inventory origination inside customerinventoryservice (this example scenario, problem similar) is possible achieve above jaxrs(jersey) annotation definitely! ant that's standard way assemble set of http methods in different classes. need use @path example - @path("/{parameter}") . below code may useful - controller interface - package com.teducate.api; import java.io.unsupportedencodingexception; import javax.ws.rs.default...

css - Javascript class Vs className -

i learning javascript , found difficulties in understanding difference between class , classname. i wondering if there difference between class , classname. when learning javascript, found may use either of retrieve class name of specific node: e.g. var firstchildclass = firstchildname.classname; var firstchildclass2 = firstchildname.getattribute('class') a more detailed script can found on http://jsfiddle.net/hphchan/3ze3ug7r/ . i ask in implementation, there subtle differences between two? btw have been visited object.classname or object.getattribute("classname/class")? , , understand using getattribute('class') more universal classname since classname works on html, not others svg. difference exist between two? thanks. as @derek-朕會功夫 stated, getattribute onlt used retrieve value of class attribute while accessing directly classname attribute allows & set class names. furhtermore, getattribute function works kind of ...

ajax - Unable to send XMLHttpRequest via tampermonkey script with CORS enabled on server -

i have setup flask http server configured accept cors requests (for purpose of creating userscript web filter), unable send http requests via tampermonkey, following code. // ==userscript== // @name cors test // @namespace john galt // @version 1 // @grant none // ==/userscript== var request = new xmlhttprequest(); request.open("get", "127.0.0.1:5000", false); request.send(); alert("finished"); "finished" not alerted indicating failure of operation, , following error appears in console: xmlhttprequest cannot load %3127.0.0.1:5000. cross origin requests supported http. rand.html:1 error: execution of script 'cors test' failed! failed execute 'send' on 'xmlhttprequest': failed load '%3127.0.0.1:5000'. error: failed execute 'send' on 'xmlhttprequest': failed load '%3127.0.0.1:5000'. @ error (native) @ object.eval (eval @ <anonymous> (unknown source...

java - How to add only its own classes to a jar file without subpackages using ant script? -

let's package organization below: net.sf.myparentpackage class: requiredclass1.java class: requiredclass2.java net.sf.test.mysuppackage class: notrequiredclass1.java the code below includes classes , subpackages. <jar destfile="myjar.jar" manifest="manifest.mf"> <fileset dir=".." includes="net/sf/myparentpackage/**" </jar> i want include requiredclass1.java , requiredclass2.java without listing class names. you can put " .java" or " .class" instead of "**" <jar destfile="myjar.jar" manifest="manifest.mf"> <fileset dir=".." includes="net/sf/myparentpackage/*.java" </jar> https://ant.apache.org/manual/types/fileset.html

image - AWS Elastic Beanstalk -

i have rails app deployed aws elastic beanstalk. however, when open app through beanstalk environment, works fine except images not being shown. tried many things make show still not able to. can me? i assume using rails. if that's case, missing asset_path function. instead of: <img src = "/assets/abc.jpg" /> you have use like: <img src = "<%= asset_path('abc.jpg') %>" /> more info here: http://api.rubyonrails.org/classes/actionview/helpers/asseturlhelper.html#method-i-asset_path

regex - Regular Expression should not match other prefixes -

if instance have these words john=14 adam=21 ben=11 john=18 johan=17 john=141 ... and task find occurences of john=14 . came following regular expression: .*=[^14].*\n matches every string without leading 1 after equal sign. however, want match john=14 in example (and permutations of example). doesn't matter if there 1 or more john=14 . thought negation of regular expression, such want find every string isn't equal 1 want find had problem regular expression ( [^\bjohn\b=14]\n ). any appreciated :)! you need use negative lookahead. ^(?!john=14$).* negative lookahead @ start asserts string going matched won't contain exact john=14 string. if yes match chars. or ^(?!.*=14$).*

Groovy access multiple member variable -

is there convention in groovy access member variables class emp { string name string name1 } emp emp = new emp() emp { name = "name" name1 = "name1" } rather repeating object again , again emp.name = "name" emp.name1 = "name1" somewhere have seen convention this you can use with : class emp { string name string name1 } emp emp = new emp() emp.with { name = 'name' // -> emp.name = 'name' name1 = 'name1' // -> emp.name1 = 'name1' } assert emp.name == 'name' assert emp.name1 == 'name1'

jquery - how to check the click is single or double in javascript -

i trying check whether click on element single click or double click. i trying code. var clk_ch = document.getelementbyid('clk'); function singleclick() { alert("single click"); } function doubleclick() { alert("double click"); } var clickcount = 0; clk_ch.addeventlistener('click', function() { alert(); clickcount++; if (clickcount === 1) { singleclicktimer = settimeout(function() { clickcount = 0; singleclick(); }, 400); } else if (clickcount === 2) { cleartimeout(singleclicktimer); clickcount = 0; doubleclick(); } }, false); i not getting alert. going wrong? clk id of clicked element <input type="image" src="button.gif" id="clk" > no need of using settimeout . can add dblclick event listener. document.addeventlistener("domcontentloaded", function (event) { var clk_ch = document.g...

c++ - Failed to do checkpoint -

int ireturn = sqlite3_wal_checkpoint_v2(m_podb, null, sqlite_checkpoint_full, &isizeofwallog, &inumofcheckpointedframes); returns ireturn = 5 (sqlite_busy). writer wakes , then, adds or deletes number of rows database, checkpoint , goes sleep again. question 1: how possible if use wal mode , have 4 readers , 1 writer? question 2: in log messages have seen checkpointing works reports sqlite_busy. should concerned if works not always? can corrupt database? question 3: should not use sqlite3_wal_checkpoint_v2 or sqlite_checkpoint_full? a full checkpoint requires there no concurrent readers or writers. you try increase busy timeout, if try checkpoint regularly, away ignoring single failures.

javascript - Is it possible to fix the position of modal-popup window in center when bootstrap modal is open in ipad browsers? I am using Bootstrap v3.0.0 -

i facing issue bootstrap modal pop-up window.the issue when opens , when scroll background modal pop-up changing position.now need show the modal pop-up position in center of screen fixed if scroll background pop-up should not change position in web browsers , in mobile , ipad browsers. i tired css below : display: block; position: fixed; margin-top: 50px; but still pop-up scrolling background. please me out this. many in advance... here code modal pop-up window html: <div aria-hidden="false" style="display:block; position:fixed;margin-top:50px;" class="modal animated fadeinup" id="modal"> <form name="admincheckinoutform" id="admincheckinoutform"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" id="closeicon" cla...