Posts

Showing posts from August, 2014

javascript - Delete rows from Kendo Grid with Pagination -

i have kendo grid(with pagination enabled) entries. say, have 5 pages , have selected(clicked on checkbox) 1 row each page , clicked on top level action delete. not able figure out how delete entries grid , data source? i tried below code, deletes entries page visible in grid (on screen) var grid = $("#grid").data("kendogrid"); var userselectioninfo = usersservice.getuserselectioninfo(); for(var username in userselectioninfo) { if(userselectioninfo[username]) { var selector = '#' + username+ '_actions'; grid.removerow($(selector).closest('tr')); } } i tried 1 more approach: i created array of objects remain after deletion operation original array of objects , added grid data source. var newdata = []; var userselectioninfo = usersservice.getuserselectioninfo(); for(var = 0; < users.length; i++) { if(users[i].username&

angularjs - LeafletJS not loading all tiles until moving map -

Image
i trying load simple leaflet map in ionic 2 app. unfortunately not tiles loaded currectly until moving map. this.map = new l.map('mainmap', { zoomcontrol: false, center: new l.latlng(40.731253, -73.996139), zoom: 12, minzoom: 4, maxzoom: 19, layers: [this.mapservice.basemaps.openstreetmap], attributioncontrol: false });

android - Transparency made from interstection -

Image
pulling hear out on one. have background bitmap want overlay bitmap on top of has transparent cutouts. have no problem doing if cutout basic shape, need cutout intersection of 2 circles (sort of leaf shape). tried making third bitmap produce cutout template can't clean representation of cutout let alone work cutout template. anyone know how this? here (simplified) attempt: @override public void draw(canvas canvas) { float w = canvas.getwidth(); float h = canvas.getheight(); // used set proportions float off = 300f; paint paint = new paint(); // make background bitmap yellow green gradient bitmap bitmapbkg = bitmap.createbitmap((int) w, (int) h, bitmap.config.argb_8888); canvas canvasbkg = new canvas(bitmapbkg); paint.reset(); paint.setshader(new lineargradient(0, h/2 - off, 0, h/2 + off, color.yellow, color.green, shader.tilemode.clamp)); canvasbkg.drawrect(new rectf(0, 0, w, h), paint); // make overlay bitmap red magenta

api - snapshot of softlayer block device(Endurance volume) -

i created snapshot using below api of block storage (endurance) on softlayer. res = client['network_storage_iscsi'].createsnapshot('', id=12686459) i got result in showing volume id 'volumeid': 13348463 . when try list of snapshots volume empty list: res = client['network_storage_iscsi'].getsnapshotsforvolume(id=12686459) have missed anything? nop did not miss anything, command correct , works, got empty list because snapshot in "creating proccess" once completed should snapshot. try again. regards

sapui5 - Default Selected list item in Master view of the SplitApp -

i have 1 splitapp master -detail layout. know how can set first item in master view default on loading of application detail view shows information select list item. when user open application automatically first item in master should selected , detail view show information. i using objectlist item control master view. , using select event selecting list item. var olist = new sap.m.list("idmasterlist",{ mode: sap.m.listmode.singleselect, select: [ocontroller.onselectitem, ocontroller] }); onselectitem: function(oevent){ //var app = sap.ui.getcore().byid("splitapp"); var omasterlist = sap.ui.getcore().byid("idmasterlist"); var oselitem = omasterlist.getselecteditem(); var spath = oselitem.obindingcontexts.druginfo.spath; var oitem = sap.ui.getcore().getmodel("druginfo").getproperty(spath); var oselmodel = new sap.ui.model.json.jsonmodel(oitem) ; sap.ui.getcore().setmodel(oselmodel, "selecteditem&quo

android - How to align image and text one under another in two linear layouts for dynamic content -

xml file --->>>> <horizontalscrollview android:id="@+id/dashboard_hs" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="10dp" android:fillviewport="false" android:scrollbarsize="3dp"> <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/rlforimggallery"> <linearlayout android:id="@+id/imagegallery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="center_vertical" android:paddingtop="50dp"> </linearlayout>

Elasticsearch get aggregation bucket size (number of elements in the bucket) without retrieving all data -

i trying information aggregation in elasticsearch. i have index in store mail metadata (sender ip, subject etc.) i'm trying want number of ips send on 1000 mails. (so example let's have 3 ip addresses, 2000 mails sent first ip , 1500 second , 200 third ip . want see 2 aggregation result.) wrote following query: get /my_index/_search { "size": 0, "aggs": { "ipaddresses": { "terms": { "field": "senderipaddress", "min_doc_count": 1000, "size" : 0 } } } } i can bucket , calculate size in back-end implementation, need data in bucket in order this. slow , want bucket size without getting data. tl;dr, how can total size of aggregation bucket without retrieving whole data? this purpose of cardinality aggregation: { "size": 0, "aggs": { "ipaddressescount": { "c

Given a list of images, how do I get them to appear in order in JavaScript / HTML? -

i building flask app webpage receives list of images (and metadata) in particular order display in grid structure, similar how clothing website shows images of clothing. problem that, currently, images appearing in order of fastest loading and, hence, different order of images each time reload page. the get_similar_images function receive list of images , function populateimages append image , metadata html. essentially, not want for loop in get_similar_images move onto next iteration until previous image loaded. appreciate on how implement this! function populateimages(imageurl, retailer, name, price, retailerurl) { var block = document.createelement("div"); block.classname = 'image-block'; var img = document.createelement("img"); img.src = imageurl; img.classname = 'clickable-image'; // link external site var clickablelink = document.createelement("a"); clickablelink.href = retailerurl;

plot - r add lines or segments to barchart -

Image
i have stacked horizontal bar chart 1 bar. want label different segments, each label respective segment begins. however, because segments narrow, labels need @ different levels , should connected bar through straight line, in example. i can create barchart using barplot() , labels using mtext(..., side=3, line=1,...) cannot lines. segments() not seem work because coordinates in y-direction not funtion (or have not yet figured out coordinate system bar charts). does have hint on how create these lines using base graphics? ## bogus data dat <- c(1,3,1,2) nb <- length(dat) ## basic barplot barplot( cbind( dat ), col=1:nb, horiz=true, ylim=c(0,0.7), wid=0.2) ## location of vertical segments xdat <- c(0, cumsum(dat[-nb])) ## create vector of jagged heights label placement/vertical segment ends h1 <- 0.36 h2 <- 0.4 heights <- c(h2,h1,h2,h1) segments(x0=xdat, x1=xdat, y0=rep(0.1,nb), y1=heights) text(x=xdat+0.1, y=heights, paste("segment",1:

javascript - How to Plot x,y coordinates in c3.js chart library? -

how can pass x,y values generate chart x values not automatically sorted? if use example x starts on 2 because lowest value. var chart = c3.generate({ data: { x: 'x', columns: [ ['x', 50, 80, 2,100, 230, 300], ['data1',400, 200, 100, 50, 25, 12] ] } }); if want not sort x values, need treat category axis var chart = c3.generate({ data: { columns: [ ['data1',400, 200, 100, 50, 25, 12] ], type: "bar", }, axis: { x: { type: 'category', categories: [50, 80, 2,100, 230, 300], } } }); see http://c3js.org/samples/categorized.html

objective c - Import Cordova CDVPlugin.h in iOS framework's umbrella header -

firstly explain context of situation: created objective-c ios framework has embedded cordova framework project ( cordovalib ) trying emulate cordova app does, using ios framework instead of application. have ios native application uses framework. (i've attached image @ bottom understand better structure). since don't have cordova app, cannot use cordova plugin add command install plugins, when want use new plugin copy files manually , change other files depending on plugin in order install plugin manually. has been working alright plugins have installed, until tried same process iosrtc plugin ( https://github.com/eface2face/cordova-plugin-iosrtc ). plugin has bridging header import objective-c files swift files, when plugin used in “normal” application objective-c bridging header build setting has used specifying bridging header file path. this works alright in “normal” application, problem i'm not installing in application, i'm “installing” in ios framework

branch.io - Referral Credits not being recorded -

i have set 2 referral credit rules. all acting users 7 default credits every time trigger event mq_app_open referred acting users 10 default credits every time trigger event mq_app_open mq_app_open custom event recording on app open. i can see rule 1 getting applied can never rule 2 applied. what "referred acting users" mean? i think issue relates fact when open app (universal) deeplink see 2 events open mq_app_open for each of session referring branch link id, session referring click id , session referring link url null. oddly, when let app go background , foreground again see following events open referred session for these 2 events session referring branch link id, session referring click id have values session referring link url null. i not sure why of these values null when seem should reference link url clicked on. alex branch.io here: referred acting users rather confusing way 'users take action , open app after clicki

symfony - Doctrine annotaion to return null records in child table -

i want return child records , records have null foreign key's value using doctrine annotation. user entity: .... /** * @orm\onetomany(targetentity="appbundle\entity\deliverymethods", mappedby="owner") */ private $delivery_methods; .... and here delivery method entity(table child rows): .... /** * @orm\manytoone(targetentity="appbundle\entity\user", inversedby="delivery_methods") * @orm\joincolumn(name="owner", nullable=true) */ private $owner; .... what change need make in annotations? thanks you can write new repository class , add below : class deliverymethodsrepository extends entityrepository { /** * * @param type $owner * @return type */ public function getownerassociatedororphanentities($ownerid) { $qb = $this->createquerybuilder("dm") ->andwhere("dm.owner = :owner or dm.owner = null"

python - Matplotlib; open plots minimized? -

so i've got code going make couple plots, want/have window maximized in size. however, i'd ideally want these windows minimized when created (mostly because make testing things lot easier!) there way achieve this? i'm using python 2.7 on linux, matplotlib version 1.3.1 using backend tkagg. if other information needed, ask, , in advance (even if turns out it's not possible!). try after relevant plots: mng = plt.get_current_fig_manager() mng.window.showmaximized() mng.window.showminimized()

office365 - Binding.addHandlerAsync fails when using Add-in Commands -

we have built excel task pane add-in works tables. have code executes on office.initalize , attaches event handlers existing bindings we've created previously. code pretty straightforward (in typescript): document.bindings.getallasync(null, bindingresult => { let bindings = <office.binding[]>bindingresult.value; if (bindings) { bindings.foreach(b => { // attach our bindings if (b.id.indexof(table.bindingprefix) == 0) me.attachhandler(b); }); } }); attachhandler = (binding: office.binding) => { let eventtype = office.eventtype.bindingselectionchanged; binding.addhandlerasync( eventtype, this.onbindingselectionchanged, null, asyncresult => this.onhandleradded(eventtype, asyncresult) ); } this code has worked fine in past office online , desktop. however, modified our manifest include add-in command (which opens task pane) modifying sample add-in

What does a=&*A mean in C++ (in which A is a pointer)? -

this question has answer here: difference between &(*similarobject) , similarobject? not same? 3 answers i come across instruction a=&*a; in piece of c++ code, pointer. can explain semantics , in way different a=a ? if a iterator, *a gives value of iterator "pointing" to. & operator applied value address value. unless & operator overloaded. simple , stupid example: struct foo { // data... }; std::vector<foo> vector_of_foo; // code populate vector_of_foo (auto = vector_of_foo.begin(); != vector_of_foo.end(); ++a) { foo* = &*a; // requires pointer foo... }

spring - org.hibernate.hql.internal.ast.QuerySyntaxException: Circle is not mapped [from Circle] -

i building sample spring hibernate application.spring part working fine.in hibernate have mapped bean class , table.still error saying bean class not mapped.please find attached code reference.need fixing this. circle.java package re.test; import javax.persistence.entity; import javax.persistence.id; import org.hibernate.annotations.*; import javax.persistence.table; @entity @table(name = "employeemaster1") public class circle { @id private int id; private string name; public int getid() { return id; } public void setid(int id) { this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } } hibernatedaoimpl.java package re.test; import org.hibernate.query; import org.hibernate.sessionfactory; import org.springframework.beans.factory.annotation.autowired; import org.springframework.ste

html - How to make an HTML5 file grow? -

i writing logger in c++ generates html5 output in real time. html file must readable @ time, while growing. so far open file, delete last few lines close block ( </body></html> ), add new log messages , close block again. is approach, or there better solutions? another approach read (through xmlhttprequest) log file directly javascript inside html file , generate html within browser. may end being quite slow large log files though (100 mb+). if thing need wrap textual log file header , footer, can create markup needed , add <iframe src="log.txt"> tag between header , footer, src attribute point raw textual log file. wouldn't suite if need format log somehow, of course.

javascript - Get only property from object has only one property JQuery -

how property js object. when used $('body') return in object form , other times return property how can perform task on property. like.. $('body').html(); // return in object // [<body></body>] // or sometime return // <body></body> // if return in object got error like. uncaught typeerror: $(...).html not function how can make return property consistent? because want use in condition , can't use if want use every time in object or 1 property. if returns in object want use eq() don't know when return in object form , when return property how can use eq() because not use property. sometime means nothing in code. if there code defined $ (which happen), can replace jquery $ function $j . var $j = jquery; that's how can sure jquery object return, can use eq without worry. for example: $j('your_selector').eq(0); live example var $j = jquery; console.log($j('div').eq(0).ht

java - How to dynamically assert on word boundaries in raw text while pre processing a document? -

firstly, have researched , found matches closely deal word boundaries in sentences or @ maximum, suggest use of tokenizers not looking for. query follows: my current task related preprocessing unstructured data follow pipeline - conversion of pdf txt files gives out few sentences this: s e ar c h t h s s t r ing def e c t what want : search string defect all i'm looking few possible approaches such kinds of scenarios in nlp. in advance! use this file word list. from math import log # build cost dictionary, assuming zipf's law , cost = -math.log(probability). words = open("words-by-frequency.txt").read().split() wordcost = dict((k, log((i+1)*log(len(words)))) i,k in enumerate(words)) maxword = max(len(x) x in words) def infer_spaces(s): """uses dynamic programming infer location of spaces in string without spaces.""" # find best match first characters, assuming cost has # been built i-1

npm - Actual imported file when I specified an module in node_modules written in Typescript. -

i made typescript module(named modulea ). i'd publish package , want use typescript project. for present, installed 'modulea' 'npm install ../modulea' since test. , these file must placed below. b node_modules modulea dist index.ts as can see, there directory dist in root directory of modulea . want import index.ts typescript below. import 'modulea'; if there index.ts inside of modulea folder, work. , if javascript file, can write main property of package.json. however, in case, want use typescript directly , don't want put index.ts out of dist folder. and don't want make index.ts this. import d './dist/index'; export default d; because there several folders in dist, , i'd reference them project depends on modulea . is there way specify default typescript file of package? there option typescript specify in package.json. property of "typings" worked fine me. reference below.

c# - LINQ query slow, creates Timeout; generated SQL is fine? -

i have complex linq query slow, creates system.data.sqlclient.sqlexception : "the wait operation timed out". however, when log generated sql (by assigning textwriter datacontext 's log ), , execute directly on sql server, completes in 4 seconds, fine. where discrepancy come , how debug it? edit: i've noticed in sql server management studio's activity monitor processor time spiking 100% when query executing .net, 3% or when execute generated sql query. i'm not sure how posting code help, since requested, here code containing query: var db = myproject.getdatacontext(); var statuspaymentsuccess = new string[] { "success", "rembours", "afterpay" }; var items = db.orders.where(item => (siteid == null || item.siteid == siteid) && (ls_list.contains(item.orderorderlifecycles.orderbydescending(it => it.id).first().orderlifecycleid)) && (item.orderorderpaymentstatus.any(ops => statuspayme

iis - WCF - Access Denied when creating folder -

i've built wcf service , want host on iis. 1 of features want programmatically create subfolder in wcf webhost root, persist json files. i've tested on local dev iis express , works fine, no surprise 'cause have necessary permissions. now, want publish on public domain. this, i've created subdomain on plesk , subfolder within httpdocs. i've copied web.config file , bin folder dev machine folder on domain. but, when enter svc url on browser access denied exception (the folder created in dependency injected in service, that's why exception @ point). server error in '/' application. access path 'c:\inetpub\vhosts\««my domain»»\httpdocs\versioningservice\repository' denied. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.unauthorizedaccessexception: access path 'c:\inetpub\vhost

jquery - is it possible to set javascript:void(0) with #map for tabs in href? -

i want set javascript:void(0) #map tabs in h ref. want set javascript:void(0) responsible not load webpage on click. #map tab .so want set both javascript:void(0) , #map. code <li><a data-toggle="tab" href="#map" href="javascript:void(0)" onclick="getvalue('+val['product_id']+');" id="maptab">map</a></li> no need use both can use .preventdefault() when write javascript function <a> . $('li a').click(function(e){ e.preventdefault(); //... other code of function }) .preventdefault() prevents default function of element. page load prevented this.

zend framework2 - getdata on File input to return only filename, not array of details -

i have form has fieldset file upload field in it. when var_dump on $form->getdata() being shown array of data file field: array (size=13) 'logo' => array (size=5) 'name' => string 'my-image.gif' (length=12) 'type' => string 'image/gif' (length=9) 'tmp_name' => string 'c:\xampp\htdocs\images\my-image.gif' (length=35) 'error' => int 0 'size' => int 391 //... other fields here how element return name when call getdata ? e.g. array (size=13) 'logo' => string 'my-image.gif' (length=12) //... other fields here i using form other things , have overridden getdata keep answer located in fieldset. you can override getdata() method in form. public function getdata() { $data = parent::getdata(); $logo = $data['logo']; $data['logo'] = $logo['name']; return $data; } add necessar

node.js - Denormalized schema? -

mongoose schema: const postschema = new mongoose.schema({ title: { type: string }, content: { type: string }, comments: { count: { type: number }, data: [{ author: { type: mongoose.schema.types.objectid, ref: 'user' }, content: { type: string }, created: { type: date }, replies: [{ author: { type: mongoose.schema.types.objectid, ref: 'user' }, content: { type: string }, created: { type: date }, }] }] } }) i don't want normalize comments , replies because: i need post comments ( read in single go ) i never use comments query or sort anything it's easier create, update , delete post comments ( document locking ) if normalized it, have to: get post database get comments database get replies each

javascript - Changing URL without reloading in AngularJS -

i got function changes url on button click. problem: angularjs reloads on url change automatically. var newurl = ($state.current.url).replace('{navigationid}', $stateparams.navigationid).replace('{tabid}', tab.statereference); history.pushstate('', tab.statereference, newurl); how can change url without reloading page in angularjs? edit: i tried use reloadonsearch: false described here: https://docs.angularjs.org/api/ngroute/provider/ $routeprovider - still reloads page. you should have $state each & every state want navigate. can $state.go particular state $state.go('tostate'); if want pass parameters $state , should pass them on $state.go $state.go('view', { 'index': 123, 'anotherkey': 'this test' }); make sure $state ready accept parameters on params .state('full', { url: '/full', templateurl: 'js/content/templates/fullreadview.ht

apache kafka - druid schema concept - using multiple datasources or parsers in same spec file -

i have following scenario, 1 apache kafka topic multiple types of events pushed in. druid pick form topic , aggregate based on timestamp. say example below messages in kafka topic, type 1, {"timestamp" : "07-08-2016", "service" : "signup", "no_of_events" : 8} {"timestamp" : "08-08-2016", "service" : "signup", "no_of_events" : 10} type 2, {"timestamp" : "08-08-2016", "user" : "xyz", "no_of_events" : 3} {"timestamp" : "08-08-2016", "user" : "abc", "no_of_events" : 2} q1: can write 2 parsers within same spec file pointing events same topic? if yes, structure of spec file? any other suggestion on design welcome :) q2: understand better, possible have multiple datasources within in spec file? thanks in advance!! q2: yes can have 2 datasources within same spec

php - Laravel 5 polymorphic relationship with foreign key -

tables: roles -id -role users -id -role_id schools -id (primary, foreign-references id on users) -other attributes consultancies -id (primary, foreign-references id on users) -other attributes students -id (primary, foreign-references id on users) -other attributes school, consultancies , students specialization (or generalization?) of users. in model class, trying establish polymorphic one-to-one relationship. seems straight forward if there had not been roles table , role_id in user table had been string: role. but structure, how relationships work?

passing two parameters in index function using codeigniter -

i want pass 2 parameters in index function using codeigniter giving me error don't know why giving me error. here controller function index($one = null,$two = null) { $data['title'] = "product page "; $this->load->view('home/header/header',$data); $this->load->view('home/css/css'); $this->load->view('home/navbar/navbar2'); $this->load->view('products/product'); $this->load->view('home/footer/footer'); $this->load->view('home/js/js'); } here routes setting $route['product/(:any)'] = 'product/index/$1'; when set index function in 1 parameter working fine not working 2 parameters. you can try this, working $route['product/(.*)/(.*)']='product/index/$1/$2';

ruby on rails - Want to add dynamic list with dynamic data through js -

there main file in want add li in ul dynamic value. <ul class="selected_questions"></ul> in js.erb want show title. have debugged , @ques value there not showing in ul. following code. <% if @ques.errors.any? %> console.log('error'); $('#dialog-form').html('<%= escape_javascript(render('form')) %>'); <% else %> console.log('created'); $(".selected_questions").append('<li><span class="tab">"'+@ques.title+'"</span></li>'); $('#dialog-form').dialog('close'); $('#dialog-form').remove(); <% end %> i have tried following way : $('<li />', {html: @ques.title}).appendto('ul.selected_questions') simple string appended object controller not been shown. doing wrong ??? try change this $("#selected_questions").append('<li><span class="tab&qu

reactjs - What are the valid symbols for a React 'key' -

what valid symbols react key prop such; <div key="can use spaces example?"></div> in case want use url key const links = [ { label: 'foo label', href: 'https://example.com', }, { label: 'bar label', href: 'https://example.com', } ] links.map( link => (<a key={link.href} href={link.href}>{link.label}</a>) ); is valid? thinking use hash function pass href through first, pointless step if character guaranteed valid in key value. the reason i'm asking can't find example in doc uses non-alpha-numeric character key, , explicitly says that, if don't have id use key object you're rendering can hash part of make key . although because shouldn't use long keys, , should therefor hash content first truncate it's size, seems whole documentation implicitly says alpha-numeric characters should used key. requirements react's key be

Adding functions to a loaded node.js module -

about 2 years ago, wrote node.js module loads existing module ( jsts ) , adds functions it. here minimal example: global.jsts = require("jsts"); global.jsts.algorithm.test = function() {console.log("hi")} global.jsts.algorithm.test(); i ran in node (v0.10.18) , printed hi now, run same code in nodejs (v4.2.6) , prints: typeerror: global.jsts.algorithm.test not function is there way make work current version of nodejs? edit: did: global.jsts.algorithm.x = 1 console.log(global.jsts.algorithm) and here output: { centroid: { [function: ge] area2: [function], centroid3: [function], getcentroid: [function] }, cgalgorithms: { [function: he] orientationindex: [function], signedarea: [function], distancelineline: [function], ispointinring: [function], computelength: [function], isccw: [function], locatepointinring: [function], distancepointlineperpendicular: [function], computeori

c# - Validate string as Proper Base64String and Convert to byte[] -

i want validate if input string valid base64 or not. if it's valid convert byte[]. i tried following solutions regex memorystream convert.frombase64string for example want validate if "932rnqia38y2" valid base64 string or not , convert byte[] . string not valid base64 i'm getting true or valid in code. please let me know if have solutions. code //regex _rx = new regex(@"^(?:[a-za-z0-9+/]{4})*(?:[a-za-z0-9+/]{2}[aeimquycgkosw048]=|[a-za-z0-9+/][aqgw]==)?$", regexoptions.compiled); regex _rx = new regex(@"^([a-za-z0-9+/]{4})*([a-za-z0-9+/]{4}|[a-za-z0-9+/]{3}=|[a-za-z0-9+/]{2}==)$", regexoptions.compiled); if (image == null) return null; if ((image.length % 4 == 0) && _rx.ismatch(image)) { try { //memorystream stream = new memorystream(convert.frombase64string(image)); return convert.frombase64string(image); } catch (formatexception) { return null; } } just create

jquery - Bootstrap Modal not showing on second element -

hey new bootstrap. want build safe delete button modals. when click ask: want delete? , can choose yes or no. there more 1 element in field. @ first 1 works fine. @ second element same data shown in first one. if reload page , click second element backdrop shown , no dialogue. the code: <div class="modal fade" id="deletesecuredialoge" data-keyboard="true" data-backdrop="static" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" id="close" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">warning</h4> </div> <div class="modal-body"> <p>are sure delete {{item._id}}?</p> </div> <div cl

hibernate - Insert not working in Spring MVC -

my question: i have created spring mvc application, using hibernate. table person getting created, data supply view not getting inserted. browsed through many sites, not being able point out mistake. here files: this homecontroller, have specified 2 request mappings, 1 root , fort save method** package com.controller; @controller public class maincontroller { @autowired private personservice ps; @requestmapping("/") public string home() { return "index"; } @requestmapping(value="/save",method=requestmethod.post) public string save(@modelattribute person p) { ps.save(p); return "index"; } } this persondaoclass, contains save method package com.dao; import com.model.person; public interface persondao {

java - Actual file size and uploading file size gets differ android -

i want show uploading file size during web service. have used following 2 links httpclient post progress , multipartentitybuilder , gradle-hockeyapp-plugin found progresshttpentitywrapper.java class. using class have found uploading file size. using below method public string getfilesize(long size) { if (size <= 0) return "0"; final string[] units = new string[] { mcontext.getresources().getstring(r.string.bytes), mcontext.getresources().getstring(r.string.kilo_bytes), mcontext.getresources().getstring(r.string.mega_bytes), mcontext.getresources().getstring(r.string.giga_bytes), mcontext.getresources().getstring(r.string.tera_bytes) }; int digitgroups = (int) (math.log10(size) / math.log10(1024)); return new decimalformat("#,##0.#").format(size / math.pow(1024, digitgroups)) + " " + units[digitgroups]; } but gives wrong file size compare original file size. both actual , uploading total file siz

asp.net mvc 4 - Submitting custom content - Umbraco Forms -

i thinking of buying umbraco forms before wanted check whether 1 thing possible , easy do. as part of "book holiday package" form, want user see (currentpage.packagename) package name user booking package for. struggling "currentpage" not recognised in forms section. i want able track following fields : first name - can done using umbraco forms last name - can done using umbraco forms email address - can done using umbraco forms which holiday package enquiring for: "needs fetch current package name". (probably displayed on form label) at end of form, user should email package name he/she enquired , admin should email package has been requested user. is possible using umbraco forms ? or have write custom mvc , manually ? any appreciated. thanks, vishal you can add hidden field, , insert page level variable using special syntax. lets assume current package name field on page form sat on, , has alias "currentpackage&quo

html - Click on border don't activate event -

i have problem using animation in css , event handler in js. have specific styles button (normal , :active suffix). solution let's me simulate 'clicking button'. in html(this angular directive) have directive ng-click on button runs event when click body of button not border. css sets pointer on border , there animation on clicking border too. i looking best practice/solution repair incident. maybe must leave css style active suffix or add styles. css #addbutton { padding: 5px; float: left; background: linear-gradient(#92afde, #668fed); border: solid 2px #14438f; margin-left: 10px; border-radius: 10px; font-size: 20px; cursor: pointer; } #addbutton:active { transform: translatey(4px); } html <div class="card"> <img ng-click="selectcard()" style="width: 150px; height: 200px;" ng-src="cards/\{{cardid}}.png"></img> <button ng-click="addcard()" id=