Posts

Showing posts from February, 2012

html - Video thumbnail that links to other page for playing -

i have small thumbnail video file. user can hover on thumbnail , lights up. when user clicks thumbnail video, should lead him category page video can played may user choose so. now code lets video played directly in thumbnail upon clicking, thats not want. is possible have user click video thumbnail "video player look" , video not play, instead user directed page can play video in full screen?? got link working, problem have video should not play in thumbnail user can see "video player controls" knows video can view in category page. html: <div class="videofile"> <video controls=""> <source src="https://commons.wikimedia.org/wiki/file%3aanimaci%c3%b3n_de_escanciar.ogv" type="video/ogv"</video> </div> css: .videofile:hover { opacity:.3 } fiddle: fiddle a video control never used sure overkill - add play button watermark abo

authentication - LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1 -

ldap: error code 49 - 80090308: ldaperr: dsid-0c0903a9, comment: acceptsecuritycontext error, data 52e, v1db1 i know "52e" code when username valid, password invalid. using same user name , password in apache studio, able establish connection succesfully ldap. here java code string username = "*******"; string password = "********"; string base ="dc=psltestdomain,dc=local"; string dn = "cn=" + username + "," + base; hashtable env = new hashtable(); env.put(context.initial_context_factory,"com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "ldap://******"); env.put(context.security_authentication, "simple"); env.put(context.security_principal, dn); env.put(context.security_credentials, password); ldapauthenticationservice ldap = new ldapauthenticationservice(); // ldapcontext ctx; dircontext ctx = null; try {

javascript - How to avoid repeating http requests angularJS -

is there way in angular avoid repeating http requests? can see in code above i'm making call retrieve detailed info of product. fact call associated button... avoid repetitive calls. if have clicked on detailed-product-button don't need make call again service....the proper way load info once , show , hided; don't know how manage on angular. (also don't want load detail product scrach product, want loaded on user's clic demand, once) $scope.seeinfo= function(id){ $http.get('/shop/getdetailinfo/'+id). success(function(data, status) { $scope.info = data.detailinfo; if (data.detailinfo>0) $scope.showdetails=true; else $scope.showdetails=false; }); }; you can store every item user request in factory , check if content in factory before ajax call. $scope.seeinfo= function(id){ var detailinfo = somefactory.get(id); //get item data factory if exist if (angular.isundefi

html - font-size with display:inline-block fails -

i have problem css font-size cannot figure out. problem: simple website footer. footer consists of 2 columns, each column links. columns based on display:inline-block. the font-size set in rem , works fine on desktop. on mobile, ie android chrome, font-size not scale: text gets unreadable tiny, other text ie in p-tags readable expected. if remove display:inline-block footer-nav-column text scales expected loss of column-layout. i tried float columns too, text scales tiny hieroglyphs. what's wrong here? plz ;-) html: <footer class="footer-nav"> <div class="layout-center"> <ul class="footer-nav-column"> <li><a href="/contact">contact</a></li> </ul> <ul class="footer-nav-column"> <li><a href="/legal">legal</a></li> <li><a href="/privacy">privacy</a></li>

c# - cannot send email through button asp.net -

im planning send email image attached receiver. when click on button, nothing happens. error or success note not visible. can me out on this? thank you. here codes: aspx <%@ page title="" language="c#" masterpagefile="~/admin/site1.master" autoeventwireup="true" codebehind="submitpurchaseorder.aspx.cs" inherits="islandgas.admin.submitpurchaseorder" %> <asp:content id="content1" contentplaceholderid="title" runat="server"> </asp:content> <asp:content id="content2" contentplaceholderid="content" runat="server"> <form id="form1" runat="server"> <div> <table style=" border:1px solid" align="center"> <tr> <td colspan="2" align="center"> <b>purchase order supplier</b> </td> </tr> <tr> <td> gmail username: </td> &

jquery - Show link only in JSON -

i have following json string - { "fruits":[ { "name":"apples", "id":"1" }, { "name":"bananas", "id":"2" }, { "name":"oranges", "id":"3" }, { "name":"pears", "id":"4" }, { "name":"grapes", "id":"5" }, { "name":"strawberries", "id":"6" } ], "links":[ { "source":"1", "target":"2" }, { "source":"1", "target":"3" }, { "source":"1", "ta

java - mousePressed method won't respond -

i'm trying basic: write program draw line on frame between 2 points: point mouse pressed on , point mouse released on. i have these classes: import java.awt.graphics; public class line implements drawable{ private int x1,x2,y1,y2; public line( int x1,int x2,int y1,int y2){ this.x1=x1; this.x2=x2; this.y1=y1; this.y2=y2; } public void draw(graphics g){ g.drawline(x1, y1, x2, y2); } } import java.awt.graphics; public interface drawable { public void draw(graphics g); } import java.awt.graphics; import java.awt.point; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.util.arraylist; import javax.swing.jpanel; @suppresswarnings("serial") public class linepanel extends jpanel { arraylist<line> lines = new arraylist<line>(); public linepanel() { addmouselistener(new mouseadapter() { point p1, p2; @override

c++ - List functions in *.lib on Windows -

when run lib /list mylib.lib see contained .obj files, no information functions similar this: path\file1.obj path\file2.obj path\file3.obj if open .lib file archieve can see there number of files 1.txt, ..., n.txt in addition object files. txt files seem contain information functions in .obj files on format: : path\file1.obj ?function_name@... : thus info can retrieved way. but isn't there better way function info ? example using lib.exe , dumpbin.exe or tool ? in more readable/demangled format ? far had no luck finding that. there related question here not discuss object files contained in .lib file. you need use dumpbin . (see dumpbin on msdn more information.) dumpbin /symbols /exports mylib.lib you can use dumpbin followed undname . (see undname .) example: dumpbin /all /exports mylib.lib > mylib.txt undname mylib.txt of course need command prompt visual studio tools in path. install dumpbin , undname at: c:\program files (x86)\mic

c# - How to Debug a Post to an OWIN Service? -

Image
i have owin self host service. another service (which dont have access to) posting data on local network ip address (though computer name gives same results). the problem have value 'null' in controller. i've tried fiddler, cannot see traffic. know sending correct data, service (which cannot see) getting something. from appbuilder.use() statement, know service being hit , navigate controller. how can find out what's wrong or know going wrong please? setup public void owinwebserverconfiguration(iappbuilder appbuilder) { appbuilder.use(async (environment, next) => { //note: post hit can't find content of message debug.writeline(environment.request.uri); await next(); debug.writeline(environment.response.statuscode); }); // configure web api self-host. httpconfiguration config = new httpconfiguration();

linux - Run a specific java program as a different user -

we doing testing , need run java program user other root. on centos 6.5 box. java 8. script calls , executes java program. did following on script without luck. chown user:user script chmod 06755 script this still runs process root. following part of script calls java program , generate process. best way run user instead of root. #showclasses="-verbose:class" showclasses= exec /opt/jdk32/bin/java $showclasses -xms80m -xmx120m com.integra.linkage.programdirector "$@" when try , run script modification following error su -c "exec /opt/jdk32/bin/java $showclasses -xms80m -xmx120m com.integra.linkage.programdirector "$@"" -s /bin/sh esadmin programdirector: no operational mode chosen. usage: programdirector [-wsdl programname ...] -wsdl - generate wsdl file programname - name of 1 or more program classes -mcs - connect mcs , wait messages. as taken how run script user without password try usin

javascript - onclick load/run this code -

i trying create html file load/run following code on clicking button. had tried method below. <!-- custom --> <div id="custom1"> </div> <script> function custom() { var dummy = '<div id="custom1" style="display: block; position: absolute; top: 0px; left: 0px; z-index: 9999900; width: 100%; opacity: 0.8; height: 768px; visibility: visible;" ></div> <div id="custom1" style="display: block; text-align: center; line-height: normal; visibility: visible; position: absolute; top: 0px; left: 0px; z-index: 9999910; width: 100%; height: 667px;" ><div id="close_button_div" align="center" style="position: absolute; width: 100%; z-index: 9999930;"></div><div style="background: transparent; height: 768px; z-index: 9999915;">

spring boot - Javascript not loading on internal thymeleaf link -

when open new form, js works, upon edit fails load internal js. please work under assumption of data , routing hooked appropriately. i've got link open form existing object: <a th:if="${foo.typename} == a" href="edit" th:href="@{/afoo/{id}(id=${foo.id})}">view</a> controller methods: new object: @requestmapping(value="/afoo", method=requestmethod.get) public string newafooform(model model) { fooviewmodel fooviewmodel = new fooviewmodel(type.a); model.addattribute("fooviewmodel", fooviewmodel); return "fooform"; } load existing object: @requestmapping(value="/afoo/{id}", method=requestmethod.get) public string editafooform(@pathvariable("id") long id, model model) { fooviewmodel fooviewmodel = assignfooviewmodel(id); model.addattribute("fooviewmodel", fooviewmodel); return "fooform";

docusignapi - how to give docusign connect listener page? -

in docusign connect url can give js file http://xxxx.xxx.xxx/index.js or server side scripting.how give docusign connect listener page? you can supply url docusign connect api . you can supply url envelope event notification parameter . enables register web hook url part of envelope send method. in both cases supplying "web hook" url--your url called docusign dtm platform. means url must visible on public internet. if url behind firewall, must have opening in firewall enable docusign call url. the software behind url can written in language. can't static web page, needs page can receive , process information receives docusign. as alternative writing own "listener," check out docusign retrieve product .

c - How can I link my JSON extension to the correct Ruby version? -

if install ruby 2.1.6 (or 2.2.2, etc) , try require 'json' , segfault. reported this , told "your json extension linked ruby 2.0.0, not ruby 2.1.6." i install ruby versions ruby-install , , don't understand details of compiling ruby. how can extension link right version of ruby? clarification this question compiling c source of ruby executable. requires c knowledge answer, not ruby knowledge; that's why tagged both languages. my real goal able rails server latest ruby version (currently 2.2.2) . doing require 'json' triggers segfault, rails s does. update i'm looking walk me through figuring out , fixing this. i've tried moving entire ~/.rubies folder ~/.old_rubies , doing ruby-install ruby 2.2.2 scratch. i've tried uninstalling every json gem let me (although won't let me remove default gem). irb; require 'json' works, starting rails server segfaults. it sounds you're dealing classic dep

android - button object returning null -

<com.bakar.core.materialdesign.views.buttonfloat android:id="@+id/buttton_float" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentright="true" android:layout_marginright="24dp" android:background="@color/app_primary_color" materialdesign:animate="true" materialdesign:icondrawable="@drawable/ic_action_new" /> this declaration of button in layout this custom class of button. package com.bakar.core.materialdesign.views; import android.animation.objectanimator; import android.annotation.targetapi; import android.content.context; import android.graphics.bitmap; import android.graphics.bitmap.config; import android.graphics.canvas; import android.graphics.paint; import android.graphics.porterduff.mode; import android.graphics.p

python - Flask - Store values in memory between requests -

i have single page application - angularjs on front , flask on backend lets user upload file (xlsx, csv...) , interactively analyze/query file essentially user loads file memory on first upload , subsequent ajax calls tap file in memory. im not sure how keep file in memory between subsequent requests (ajax). the g variable erased after each request , if understand right used access values across request (set before_request , available through views the request context local request. did manage set value on current_app , able access in subsequent ajax calls # on first file upload, load file memory , set variable on current_app: flask import current_app @app.route('/upload', methods =['post']) def upload(): ... upload file memory ... current_app.file = file_in_memory @app.route('/subsequent_call') def subsequent(): # i'm able access file in memory through current_app.file set earlier return current_app.file.number_of

javafx - Scala - Get FXML UI-Elements -

i´m working on scala/javafx project intellij , plugin scala. typical way in java access elements of fxml-file set id each element want access , in controllerclass declare variable "@fxml private label mylabelid;". in scala works same way can see in source code. nullpointerexception in line 73 (marked problem-comment). label, set null. tried diffrent things. every single element getting set expected apart missinginputlabel. loginview.fxml: <?xml version="1.0" encoding="utf-8"?> <?import java.net.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <gridpane xmlns:fx="http://javafx.com/fxml/1" fx:controller="logingui.logincontroller"> <stylesheets> <url value="@/data/gtevstyle.css" /> </stylesheets> <label text="ssh-nutzername:" gridpane.columnindex="0" gridpane.rowindex="0" /> <textfield fx:

zoom - Leaflet in R: SetView based on range of latitude and longitude from dataset -

Image
in ggmap, can set view of map based on longitude , latitude of input data, 2 columns of csv longitude , latitude, i.e. sep <- read.csv("31r_sep_assets_csv.csv") # map bbox <- make_bbox(sep$longitude, sep$latitude, f = 0.3) map <- get_map(bbox) i searching similar function in leaflet, far, find setview() takes in actual value latitude , longitude, i.e. m <- leaflet() %>% setview(lng = -71.0589, lat = 42.3601, zoom = 12) m %>% addtiles() what function use? here's code far library(ggmap) library(ggplot2) library(historydata) library(leaflet) library(rgdal) setwd("d:/gis/31r") sep <- read.csv("31r_sep_assets_csv.csv") sub1 <- sep[grep("sep.12", names(sep))] sep$newcol <- 100*rowsums(sub1)/rowsums(sep[4:7]) # create new grouping variable percent_sep12_assets <- ifelse(sep[,8] <= 33, "less 33%", ifelse(sep[,8] >= 66, "more 66%", "between 33% , 66%")) leaflet(dat

javascript - Security of writing/retrieving data from JS through PHP -

i have web app lets users make todo-lists, save them server , retrieve them id (no login/user session, id, if guess id...). the id passed jquery php via post. if id correct , not password-protected, php echoes data jquery. new items saved post jquery php. no database. every list sits in own file, {id}.txt. front-end code used render webpage, ractive.js, escapes html characters. i'm checking no fields jquery php , sent id in format i've chosen. location of {id}.txt's not accessible outside. is safe? i'm new php security. have no idea if there's simple thing cannot see. i'm guessing should fine since data stored in txt files , checked validity. do need sanitize inputs in way? cannot find real reason it. php checks valid ids using file_exists(). ok? thank lot. ask other details if needed.

java - Exception when clicking navigation button during render response phase -

i have jsf application using myfaces 2.2.8 , primefaces 5.2 running inside tomcat 8.0.23. all pages built using facelets top menu , content area below. on pages content area takes bit longer render (multiple primefaces datatables inside primefaces accordion; accordion tabs rendered using c:foreach). when click menu in small timeframe when header rendered content area not, nullpointerexception. the menuitem tag looks this: <p:menuitem value="text" action="#{bean.dosomething()}" ajax="false"/> bean.dosomething() returns string navigation target. the nullpointerexception occurs in org.apache.myfaces.view.facelets.el.faceletstatevalueexpression.getwrapped() line 73 because facescontext.getviewroot() returns null. value trying resolve ui:param set inside c:foreach. here full stacktrace: javax.servlet.servletexception: java.lang.nullpointerexception @ org.omnifaces.filter.facesexceptionfilter.dofilter(facesexceptionfilter.java:69) @ org

php - How to remove count in layered navigation in Magento? -

i using magento 1.8.1 website tcollar.com. how remove count in side bar left category in magento? you can disable count directly admin panel, without modifying templates: system -> configuration -> catalog -> (layered navigation) -> display product count

jsf - Creating custom tag for Converter with attributes -

i have found converter online , changed needs far could. problem though need add flag (i.e. string) must checked , converter must apply pattern string. custom converter: @facesconverter("convtest.urlconverter") public class urlconverter implements converter { @override public object getasobject(facescontext facescontext, uicomponent component, string value) { stringbuilder url = new stringbuilder(); if(value!=null){ if(value.length()==13){ string tempstring; tempstring=value.tostring(); string finalstring= tempstring.substring(0, 4) + "-" + tempstring.substring(4, 8) + "-" + tempstring.substring(8, 13); url.append(finalstring); }else{ url.append(value); } }else url.append(""); try { new uri(url.tostring()); } catch (urisyntaxexception e) { return null; }

excel - Pass VBA Sub a Range -

i keep getitng error "type missmatch" i want able format cells in spreed sheet passing range , value i'd displayed. can point out i'm going wrong? sub layout() call create_box("a1:a2", 10) end sub sub create_box(r range, v string) dim box object set box = range(r) box .merge .value = box_value .horizontalalignment = xlcenter .verticalalignment = xlcenter .border.style = continous .border.color = black .border.weight = xlthick end end sub` the parameter passing in not range object ; string represenfting range object's local address property . sub layout() activesheet '<-set explicitly sheets("sheet1") call create_box(.range("a1:a2"), 10) end end sub sub create_box(r range, v string) r .merge .value = box_value .horizontalalignment = xl

javascript - TypeError: AWS.SimpleDB() is not a constructor -

i'm trying access aws simpledb javascript. code following: <script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.38.js"></script> <script type="text/javascript"> aws.config.update({accesskeyid: 'mykey', secretaccesskey: 'mysecret'}); aws.config.region = 'us-east-1'; </script> <script> var simpledb = new aws.simpledb(); </script> i'm getting error: typeerror: aws.simpledb() not constructor i tried creating aws.s3() object , works fine. what's proper way initialize , use simpledb simple javascript? it not appear more recent versions of javascript sdk supports simpledb. inspected js source of library attempting use , recent version of browser sdk , neither have functionality (access simpledb). here list of services supported in current sdk. please let me know if i'm misunderstanding: http://docs.aws.amazon.com/awsjavascriptsdk/guide/browser-services.h

java - Understanding lock scope -

from link , understand "since lock() , unlock() method calls explicit, can move them anywhere, establishing lock scope, single line of code scope spans multiple methods" so understand above statement is public class test { lock l = new reentrantlock(); void mymethod1() { l.lock(); // stuff here } void mymethod2() { // more stuff here l.unlock(); } } so 1 can call method1 , method2 in sequence , assume call thread safe. i not sure if it's true said above. what if calls method2 when executing method1/method2 pair? doesn't complicate things. i think lock should acquired , released in function itself, before control returned function. understanding correct? answer first question: what if calls method2 when executing method1/method2 pair? doesn't complicate things. suppose thread calls unlock() method on reentrantlock object then illegalmonitorstateexception thrown . because

d3.js - how to drag element with mouse move -

after appending or creating new circle on drag, want able drag circle around. tried following code using .call(d3.behavior.drag()...) don't know why isn't working preview: http://jsbin.com/vabowofiqe/1/edit?html,output code: var svgcontainer = d3.select("body").append("svg") .attr("width", 800) .attr("height", 803); //draw circle var circle = svgcontainer.append("circle") .attr("cx", 35) .attr("cy", 145) .attr("r", 25) .style("stroke-opacity", .9) .style("stroke", "green") .style("stroke-width", 2) .style('cursor', 'move')

Create a partials path in rails -

im using mailboxer gem allow message sending on app. i page showing inbox,sent, trash show on single page rather uses having go page see this. in order have set partial follows: index.html <%= render :partial => 'conversations/index', :locals => {:box => @box } %> that works fine , see inbox,send , trash links. however when click on inbox takes me page inbox, send , trash. original conversations/index.html.erb (as opposed _index). reason because _index code follows: <div class="row"> <div class="col-sm-3"> <ul class="nav nav-pills nav-stacked"> <%= mailbox_section 'inbox', @box %> <%= mailbox_section 'sent', @box %> <%= mailbox_section 'trash', @box %> </ul> </div> <div class="col-sm-9"> <ul class="list-group"> <%= render partial: 'conversations/conversation', c

PHP Image display error -

<?php $im = imagecreatetruecolor(120, 20); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, 'a simple text string', $text_color); header('content-type: image/jpeg'); imagejpeg($im); imagedestroy($im); ?> this code displaying error- the image" http://localhost/untitled.php " cannot displayed because contains errors. i trying make image editor using php , here trying create image using php , upload in on server. code showing error stated above. what problem don't understand. <?php $my_img = imagecreate( 200, 80 ); $background = imagecolorallocate( $my_img, 0, 0, 255 ); $text_colour = imagecolorallocate( $my_img, 233, 14, 91 ); $line_colour = imagecolorallocate( $my_img, 233, 14, 91 ); imagestring( $my_img, 4, 30, 25, "a simple text string", $text_colour ); imagesetthickness ( $my_img, 5 ); imageline( $my_img, 30, 45, 165, 45, $line_colour ); header( "

r - Can ggplot2 find the intersections - or is there any other neat way? -

Image
in experiment, blood pressure measured @ several time points. blood pressure rises , declines during experiment. need plot blood pressure reaction (the easy part) , find time points (x values) blood pressure has doubled (the tricky part). wondering whether information retrieved in ggplot? here example: # generate data time <- c(10, 60, 90, 200, 260, 300, 700) value <- c(1, 6, 8, 40, 50, 60, 70) df <- data.frame(time, value) # first value of "value" first observation. # when first "value" increased ten times, equal 10 # question @ time point did value increase ten times according graph? ggplot(data=c, aes(x=time, y=value,)) + geom_line() + geom_hline(y=10, colour="red") + annotate("text", hjust=0, x=170, y=15, label="i need find x value @ intersection") any solutions? no, can't done ggplot2. however, it's easy do: v0 <- 10 f1 <- approxfun(df$time, df$value) #we use numeric

ios - nsstring causing my app to crash -

i created dictionary hold post params. nsdictionary *post_params = [nsdictionary dictionarywithobjectsandkeys: [[asidentifiermanager sharedmanager].advertisingidentifier uuidstring], @"advertisingid", [[nsbundle mainbundle] objectforinfodictionarykey: @"cfbundleshortversionstring"], @"appversion", [[uidevice currentdevice]systemversion], @"devicesystemversion", [[nsuserdefaults standarduserdefaults] objectforkey:@"apnstoken"], @"apnstoken", [[nsuserdefaults standarduserdefaults] objectforkey:@"userid"], @"userid",nil]; the above post params appended post request code : for (id key in params) { [body appenddata:[[nsstring stringwithstring:[params objectforkey:key]] datausingencoding:nsutf8stringencoding]]; } the above code executed within send_post_request function. i received crash report 0 corefoundation 0x182a982d8 __exceptionpreprocess + 132 (nsexception.m:162) 1