Posts

Showing posts from April, 2013

javascript - Make Fixed Gridview Header to ignore browser Scroll-bar JQuery -

Image
is there way have fixed header respond 1 scroll bar in jquery? in case respond div scroll bar , not browser scroll bar. or there different solution. tried getting rid of browser scroll bar gridview contend wont accessible. background: have jquery cloned gridview header inside of div scrolling bars, code: function fixedheader() { // code copy gridview header style var gridheader = $('#<%=gridview1.clientid%>').clone(true).attr('id','clonedgrid'); //code remove rows except header row $(gridheader).find("tr:gt(0)").remove(); $('#<%=gridview1.clientid%> tr th').each(function (i) { // here set width of each th gridview new table th $("th:nth-child(" + (i + 1) + ")", gridheader).css('width', ($(this).width()).tostring() + "px"); }); // append header div controlhead $("#controlhead").append(g

java - Change fragment by function -

i got fragment based activity in android studio somefragment fragment = new somefragment(); android.support.v4.app.fragmenttransaction fragmenttransaction = getsupportfragmentmanager().begintransaction(); fragmenttttransaction.replace(r.id.frame,fragment); fragmenttttransaction.commit(); i invoke function, that: public void gotofragment(string classname) { ... } i've tried use class.forname(classname).newinstance() didn't work, android studio shows errors. thanks in thank in advance you can this: private void showfragment(string fragmentid) { fragmenttransaction ft = getsupportfragmentmanager().begintransaction(); fragment fragment = getsupportfragmentmanager().findfragmentbytag(fragmentid); if (fragment == null) { if (fragmentid.equals("type1") { fragment = type1fragment.newinstance(); }else if (fragmentid.e

html - scroll div with uncertain height -

i have situation have want scroll main content div not header. header has fixed height, , content div meant stretch rest of vertical space, scroll bar if content stretches beyond bottom of page. use absolute positioning on content div ( top:height-of-header, bottom:0, left:0, right:0 ), , set overflow-x auto . however, it's complicated fact have additional div between header , content has flexible height based on contents , appears (i have button toggles visibility of div). such, can't use absolute positioning content div because top distance varies. can't use percentage heights because want non scrolling portions just-right height content, rather based on percentage of page. here's simplified version of setup: <div id="header"></div> <--- fixed height <div id="adddiv"></div> <--- not visible. flexible height. <div id="content"></div> <--- 1 want scrolling edit: added jsfidd

emulation - kony : rm failed for -f, No such file or directory while try to emulate on android device -

when try emulate on android device, getting below error rm failed -f, no such file or directory i/activitymanager( 61): starting activity: intent { action=android.intent.acti on.main categories={android.intent.category.home} flags=0x10000000 comp={com.and roid.sdksetup/com.android.sdksetup.defaultactivity} } uninstalling kony application failure rm failed /sdcard/profiler_com.orgname.testapp1.txt, no such file or directo ry installing kony application 1343 kb/s (2887184 bytes in 2.098s) pkg: /data/local/tmp/luavmandroid.apk failure [-12] rm failed -f, no such file or directory starting kony application starting: intent { action=android.intent.action.main comp={com.orgname.testapp1/ com.orgname.testapp1.testapp1} } error type 3 error: activity class {com.orgname.testapp1/com.orgname.testapp1.testapp1} not exist. press key continue . . . anybody has idea regarding ?? if using "t3" emulator, have edit configuration use less memory , use google api

get function argument in php extension -

i new php extension writing , working on php extension capture called functions , arguments. able function name using following piece of code static void get_function_details(zend_execute_data *data, zend_op_array *op_array tsrmls_dc) { fprintf(fp,data->function_state.function->common.function_name); } however having difficulty in getting argument details. i tried following piece did not work char ** args; char * first_arg; args = (char**)data->function_state.arguments; first_arg = *args; fprintf(fp,first_arg); can please give me sample code function arguments.

location - nginx configuratio : alias and 404 error -

my actual problem wanted make "site.com/blog/index.php" direct "/srvx/www/blog/caller/index.php". althought straightforward direct "/srv/www/blog/index.php" using "root /srv/www/", that's not wanted. discovered "alias", , seem want. 1)first try : server { listen 80; server_name _; root /srv/www/blog/pages; index index.php; location /blog { alias /srv/www/blog/caller; } } there trying site.com/blog me 404 not found, , nothing pop /var/log/nginx/error.log 1)second try know happens : if change "alias /srv/www/blog/caller;" bad path, let "alias /srvx/www/blog/caller;" got same behaviour in browser, can see in /var/log/nginx/error.log : [error] 7229#0: *1 "/srvx/www/blog/caller/index.php" not found (2: no such file or directory), client: 192.168.1.200, server: 192.168.1.221, request: "get /blog/ http/1.1", host: "192.168.1.221" conc

java - mybatis stored proc not getting committed -

i calling mysql stored proc through mybatis. proc not getting committed in sql server , locking tables. have written in code autocommit jdbc call. me solve this. this below xml code call proc: <select id="getcontactupdated" statementtype="callable" resulttype=" xxx "> { call [cia-reporting].dbo.reports_returnroireports( #{custom1}, #{custom2}, #{custom3} )}`enter code here` java code: sqlsession sqlsession = sqlsessionfactory.opensession(); { try { mapper = sqlsession.getmapper(xxx.class); sqlsession.getconnection().setautocommit(true); } catch (exception ex) { system.out.println(ex); } } please let me know if require more info on this. thanks, shilpa.

jmeter - Can we use use ThreadGroup inside a ThreadGroup -

can use use threadgroup inside threadgroup? i know can run simultaneously can run threadgroup inside thread group need know. no cannot design. @schtever answer related java thread group, not jmeter thread group. why want ?

c++ - Getting primary domain SID without admin privileges -

i'm trying obtain computer's primary domain sid on windows using c++. have manged using lsaqueryinformationpolicy policyprimarydomaininformation parameter. i've opened lsa policy operation given: auto lsastatus = lsaopenpolicy(server, &objectattributes, generic_read | policy_view_local_information, &policyhandle); unfortunatelly, using lsaopenpolicy requiers administrator privileges run , project i'm working on, cannot, since of users not have it. question - there way of obtaining current computer's primary domain sid without invoking admin rights? if there is, how should go doing using visual c++/mfc? i have found solution problem. turns out made wrong assumption based on incorrect api description on msdn. can read here , lsaopenpolicy seems require administrator privileges , article access masks did not nor did lead me anywhere find information needed privileges. stack overflow user tripshock , comment on similar topic here found ou

javascript - Bootstrap 3 gallery auto slide activating after modal opens? -

i'm using bootstrap 3 , have gallery on home page , modal. have disabled auto slide on gallery using: function gallerycarousel() { $ub('.carousel').carousel({ pause: true, interval: false }) }; my issue when clicks on button bring modal, gallery starts auto slide again , continue until close modal. strange thing happens after click go second image in gallery start auto slide again. i've tried several ways fix no avail. you can see prototype working here: http://copy-writer-otter-74032.netlify.com/ simply advance gallery next slide, click on "profile" button @ bottom of page bring modal - wait few seconds , watch gallery start auto sliding again. the problem initializing slider data attributes. means default slider applied. reason seems not on auto, because slider won't move when hover on default. open modal, slider not receive hover, , start move. place mouse on header, or open 1 of dropdowns, , you

Ios uiwebview crash -

my app use uiwebview load web pages, randomly crash , can't reproduce it, register lr same pc,is stack destroy ? crash stack looks this: 0 libsystem_platform.dylib 0x000000019557845c __os_lock_corruption_abort 1 cfnetwork 0x0000000182f4c890 urlconnectionloader::_loaderevent_ackbytes(long long) 2 cfnetwork 0x0000000182e791b4 urlconnectionclient::_internal_capturedataarray() 3 cfnetwork 0x0000000182e78f24 invocation function block in urlconnectionclient_classic::_delegate_didreceivedataarray() 4 cfnetwork 0x0000000182f4550c invocation function block in urlconnectionclient_classic::_withdelegateasync(char const*, void (_cfurlconnection*, cfurlconnectionclientcurrent_vmax const*) block_pointer) 5 cfnetwork 0x0000000182e67ac8 runloopblockcontext::_invoke_block(void const*, void*) 6 corefoundation 0x0000000183408cdc cfarrayapplyfunction + 68 7 cfnetwork 0x0000000182e67974 runloopblockcontext::perform() 8 cfnetwork 0x0000000182e67828 multiple

Unique object literal keys- javascript -

var obj = {"":"empty string", "!":"bang", "hello world":"hello world"} -fix these lines of code works? whatever method i've tried, keep coming undefined property name "" or error when calling !. i'm new coding , not looking answer, maybe push in right direction..so please gentle , you must call obj array console.log( obj [''] ); // "empty string" console.log( obj ['!'] ); // "bang" var x='!'; console.log( obj [x] ); // "bang"

browsersync gulp proxing doesnt work well with wordpress get_template_path -

i have strange problem. use browser sync , gulp wp-project , strange thing appears. use gulp serve task: gulp.task('serve', ['styles'], function() { browsersync.init(null, { proxy : localhost:8888/mywpsite, debuginfo: true, open: true }); }); and gulp replace in wiredep task theme make wp like: gulp.task('wiredep', function() { var wiredep = require('wiredep').stream; gulp.src('**/*.php') .pipe(wiredep({ directory: 'bower_components' })) .pipe(replace(/(<script src=")(bower_components\/)/g, '$1<?php echo get_template_directory_uri(); ?>/$2')) .pipe(gulp.dest('')); }); this result in html markup on footer.php file this: <!-- build:js scripts/vendor.js --> <!-- bower:js --> <script src="<?php echo get_template_directory_uri(); ?>/bower_components/modernizr/modernizr.js"></script> <s

python - Django RestAPI- updating images through PUT method -

i having trouble updating images using django rest api. have browsed through of similar questions in stack overflow, did not help. the error following: exception value: __init__() got unexpected keyword argument &#39;files&#39; views.py @api_view(['put']) def screenshot(request,uid): try: details=portal.objects.get(uid=uid) except portal.doesnotexist: return response(status=status.http_404_not_found) if request.method=='put': serializer=portalimage(details, data=request.data, files=request.files) if serializer.is_valid(): serializer.save() return response(serializer.data,status=status.http_201_created) else: return response(serializer.errors,status=status.http_400_bad_request) serializer.py class portalimage(serializers.modelserializer): image=serializers.imagefield(use_url=true) class meta: model=portal fields=('image',) mod

c++ - I am getting a segmentation fault in this code and can't understand why? -

i trying code program takes program input , prints out comments written in program in separate line. #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { string str; while(getline(cin,str)) { int i; // cout<<str; for(i=0;str[i]!='/' && str[i+1] !='/';i++); //cout<<i; for(i;str[i]!='\n';i++) { // cout<<i; cout<<str[i]; } cout<<endl; } return 0; } i getting segmentation fault in code , can't understand why. part of code of problem in hackerrank https://www.hackerrank.com/challenges/ide-identifying-comments/copy-from/12957153 as commented in question code wrong. first treating std::string object, returned getline, character array. secondly loops never end if there no // or \n found in input string. crash. below modified code.

android - How to dynamically change the image rendered using RajawaliVR -

public class myrenderer extends rajawalicardboardrenderer { public myrenderer(context context) { super(context); } @override public void initscene() { log.d("debug1","initscene()"); sphere sphere = createphotospherewithtexture(new texture("photo",r.drawable.image)); getcurrentscene().addchild(sphere); getcurrentcamera().setposition(vector3.zero); getcurrentcamera().setfieldofview(75); } private static sphere createphotospherewithtexture(atexture texture) { material material = new material(); material.setcolor(0); try { material.addtexture(texture); } catch (atexture.textureexception e) { throw new runtimeexception(e); } sphere sphere = new sphere(50, 64, 32); sphere.setscalex(-1); sphere.setmaterial(material); return sphere; } } currently there fixed image preloaded in rajawalivr library. method used set image in called once @ beginning. want

mongodb - mongoose node.js how to insert location coordinates into array [ ] without double quotes or single quotes -

i need save location coordinates in array. storing within double quotes. using mongoose node.js need this "user_geo" : [ 8.725535976399259, 8.725535976399259 ] but data getting saved this "user_geo" : [ "8.725535976399259, 8.725535976399259" ] that is, getting saved double quotes. mongoose schema var venue_schema = new mongoose.schema({ venue_name:string, user_geo:[]}); please 1 solve issue. advance... as need pair of coordinates, create mongoose schema as var venue_schema = new mongoose.schema({ venue_name: string, user_geo_lat: number, user_geo_long: number }) or var venue_schema = new mongoose.schema({ venue_name: string, user_geo: [number]); if want array.

material design - Polymer 1.0 missing paper-select workaround -

since there no paper-select element, there way of using iron-dropdown apply material design below select type extension element? <dom-module id="my-products"> <template> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </template> <script> polymer({ is: 'my-products', extends: 'select' }); </script> </dom-module> this demonstrated in newly released paper-dropdown-element on github: https://github.com/polymerelements/paper-dropdown-menu

angularjs - How to update JSON file with Angular and Node? -

i'm totally new in backend, i'm trying data form , push json file. i've tried find solution, in situation examples or separated or mongodb, learning angular , node. have: in front-end have submit function says: "failed load resource: server responded status of 405 (method not allowed) http://127.0.0.1:8080/form/json/data.json " . of course. $scope.submit = function(person) { $http.post('json/data.json', $scope.data).then(function(){ $scope.msg = 'saved'; }); }; back-end. i'm new in node i've said, that's why server this: var http = require('http'); var express = require('express'); var server = express(); server.use(express.static(__dirname)); var port = 8080; server.listen(port, function() { console.log(port); }) as understand, need post request @ first angular controller server , server post request json file? please can explain steps how , simple code gre

java - Minecraft Item Texture Not Loading - Forge 1.8 -

Image
i getting minecraft modding, , when try load texture item (refined_iron) shows black , purple square. what notice in log this [client thread/error] [fml]: model definition location skistone:refined_iron#inventory not found appears twice in whole log. here is: java hotspot(tm) 64-bit server vm warning: using incremental cms deprecated , removed in future release [12:34:18] [main/info] [gradlestart]: extra: [] [12:34:18] [main/info] [gradlestart]: running arguments: [--userproperties, {}, --assetsdir, /users/hillfamily/.gradle/caches/minecraft/assets, --assetindex, 1.8, --accesstoken, {redacted}, --version, 1.8, --tweakclass, net.minecraftforge.fml.common.launcher.fmltweaker, --tweakclass, net.minecraftforge.gradle.tweakers.coremodtweaker] [12:34:18] [main/info] [launchwrapper]: loading tweak class name net.minecraftforge.fml.common.launcher.fmltweaker [12:34:18] [main/info] [launchwrapper]: using primary tweak class name net.minecraftforge.fml.common.launcher.fmltweaker [1

swift2 - What's the Swift 2.0 equivalent to parse.com's signUpInBackgroundWithBlock:()? -

Image
i got follow error when attempting build parse.com project via xcode 7.0/swift 2.0: there work around this? what's swift 2.0 equiv.? you can either: user.signupinbackgroundwithblock { (succeeded: objcbool, error: nserror?) -> void in // } or user.signupinbackgroundwithblock { succeeded, error in // } -- note, xcode can show appropriate types. example, if start type , let code completion show me method, see like: if hit enter , select block: pfbooleanresultblock? , hit enter again, i'll see: that shows me precisely types 2 parameters are.

polymer - paper-menu-button's dropdown (paper-menu) not overlaying other iron-list items -

Image
i'm running issue using polymer 1.0's paper-menu-button . it's dropdown menu isn't overlaying neighbouring iron-list elements. i building element displays items using iron-list , , each item has dropdown menu of options can performed on particular iron-list item. however, paper-menu-button 's paper-menu dropdown not appearing on top of neighbouring iron-list items, on top of it's own list item. i've tried inspecting items in chrome, , playing around z-index , overflow css settings no avail. can me out overlay issue? here extract of custom element's local dom template (and see further below screenshot): update: jsbin demonstrating issue: http://jsbin.com/kuyovuh/1/edit?html,output update #2: note in chrome 44 on mobile (android), paper-menu-button doesn't show dropdown @ in above jsbin case. <div id="projectsvertboundary" class="layout vertical"> <div id="projectshorboundary" cl

javascript - How to click on a map area only once? -

i'm creating medical assessment , there page can select body parts in pain. once click on body part, name of displayed below. problem display multiple times when clicked repeatedly. there way block click event repeating? here sample. http://jsfiddle.net/qpmxnv2g/6/ var map = document.getelementbyid("map"); map.addeventlistener("click", function (e) { callaction(e.target); }); map.one("click", function (e) { callaction(e.target); }); var body = []; document.getelementbyid("body").innerhtml = body; function callaction(area) { body.push(area.title); document.getelementbyid("body").value = body; } document.getelementbyid("clear").addeventlistener('click', function () { body.length = 0; document.getelementbyid("body").value = ''; }); change function this:- function callaction(area) { if (body.indexof(area.title) !== -1) { return; } body.push(area.

SQL - WHERE LIKE OR with bindParam -

i'm trying sql search multiple checkbox 3 options : -basico -avancado -interm when 2 first options selected suppose i'll have : select * candidates catiav4 %avançado% or catiav4 %basico% order candidate_id desc limit :debut,20 for need use bindparam way if ($metier13 != ''){ $metier13=implode("% or catiav4 %",$metier13); $metier13="%$metier13%"; $retour->bindparam(':catiav4', $metier13, pdo::param_str);} it works fine when 1 checkbox selected, when 2 selected not return results. i believe i'm missing can't seen find it. thank !

ios - Networking optimization for UITableView -

i'm writing super simple photo sharing app practice using parse.com server. i have tableview shows photos user has uploaded server. if nothing persisted , guy has million photos uploaded server, best way fetch photos? i know simple way make 1 request on viewdidload , store in memory before persisting it. there better way? ideally pull photos in batches, , user scrolled, pull new photos. perhaps there library know of helps this? if don't want entire thing yourself, should use sdwebimage a typical code example looks [imageview sd_setimagewithurl:[nsurl urlwithstring:@"https://graph.facebook.com/olivier.poitrey/picture"] placeholderimage:[uiimage imagenamed:@"avatar-placeholder.png"] options:sdwebimagerefreshcached];

r - Contour plots on a sphere surface -

Image
i have acquired data @ fixed distance r , various theta (from vertical axis) , phi (from x axis) angles obtain 3d representation of quantity of interest. please note while phi spans 360°, theta spans 70° 90°. i know how generate 3d plot plot3d package (namely, persp3d function) or contour plot, draw such contours on sphere using theta , phi angles information. would please point me appropriate online resource can find suitable solution? many , kind regards nicola this isn't 3d representation (e.g. in rgl ), maybe gets started: library(maps) library(mapproj) library(akima) set.seed(11) n <- 500 x <- runif(n, min=-180,max=180) y <- runif(n, min=-90,max=90) z <- x^2+y^3 param <- null proj <- "orthographic" orient <- c(45,15,0) xlim <- c(-180, 180) ylim <- c(-90, 90) nlevels=20 pal <- colorramppalette( c("purple4", "blue", "cyan", "yellow", "red", "pink&qu

java - PrimeFaces Tree - show different context menu when selecting multiple nodes -

i'm working on primefaces web app. started getting bear me. i have tree multiple types of nodes - each own context menu. problem want able show different context menus when single node selected , when multiple are. tree's selection mode should multiple . code: <!-- here should context menu when multiple nodes selected --> <!-- <p:contextmenu for="tree"> --> <!-- <p:menuitem value="multiple items selected"> --> <!-- </p:menuitem> --> <!-- </p:contextmenu> --> <p:contextmenu for="tree" nodetype="type1"> <p:menuitem value="type 1 selected"> </p:menuitem> </p:contextmenu> <p:contextmenu for="tree" nodetype="type2"> <p:menuitem value="type 2 selected"> </p:menuitem> </p:contextmenu> &l

routing - An error when I add $state service to my references in angularjs module -

i have problems use $state service on tutorial project. here module , config definition: (function () { "use strict"; angular.module("gamemanagement", ["ui.router", "nganimate", "ngresource"]) .config(["$stateprovider", "$urlrouterprovider","$state", function ($stateprovider, $urlrouterporvider,$state) { $urlrouterporvider.otherwise("/game/multistepform/step1"); $urlrouterprovider.otherwise("/game/home"); $stateprovider .state("home", { url: "/game/home", templateurl: "/app/game/gameview.html", controller: "gamecontroller", controlleras: "vm" }); $stateprovider .state("log", { url: "/game/log", templateurl: "/app/log/gamelogview.html"

python - Django Rest Framework with Social Auth And Request Post (CSRF-Security) -

Image
i need django rest , social auth.... have 1 view next structure... class obtainauthtokenfacebook(apiview): parser_classes = (parsers.formparser, parsers.multipartparser, parsers.jsonparser,) renderer_classes = (renderers.jsonrenderer,) serializer_class = authtokenserializer def post(self, request, backend): serializer = self.serializer_class(data=request.data) user = register_by_access_token(request, backend) and me fucntion login.... from django.contrib.auth import login @psa('social:complete') def register_by_access_token(request, backend, *args, **kwargs): access_token = request.data.get('token') user = request.backend.do_auth(access_token) if user: login(request, user) return user else: return 'error' when in view send response.... front end recieve this... http/1.0 200 ok date: fri, 07 aug 2015 18:53:31 gmt server: wsgiserver/0.1 python/2.7.9 vary: cookie x-fram

c++ - How do I create multipul Forms / .ui in qt? -

i'm new qt may basic question. want create multipul ui pages don't know how it. i've gone add new -> c++ class -> include qwidget . although creates new source , header files, not create , additional .ui file. i've tried building , running qmake hasn't helped. i've tried adding temperature.ui forms section of .pro files gives me ":-1: error: no rule make target 'temperature.ui', needed 'ui_temperature.h'. stop." error . suggestions? many one thing c++ class , thing qt class. first 1 has *.cpp , *.h , second 1 has, in addition, *.ui file contains ui made qt designer. so that, need add designer form class instead of c++ class

ios - EXC_BAD_ACCESS with NSRegularExpression matchesInString: -

i have line of code in app uses regular expression find pgp keys in string of user input. nsarray *pgpkeymatch = [pgpkeyregex matchesinstring:userinput options:0 range:nsmakerange(0, [userinput length])]; for cases works expected. i've run problem when particularly long key input (length of 334,629 instead of ~9,000). get: thread 1: exc_bad_access(code=1, address=0x8) , app crashes. i've tried using zombies instrument (which found nothing) , setting exception breakpoint (which didn't yield more information). stepping through code shows nsrange created successfully, goes wrong later in execution of matchesinstring: . does have insight on what's causing bad access? or why issue long key? below more complete excerpt of code: nsstring *userinput = self.inputkey.text; nserror *pgpkeyregexerror = null; nsregularexpression *pgpkeyregex = [nsregularexpression

excel - VBA, 'Left' Different Strings Dynamically -

Image
having trouble shortening strings in column making dynamic directory. ex: 3 strings in column, 1 string may continue 10 rows, string 20 rows, , 15 rows. each needing shorted different amount specifically: had several words either sepearated -, _ , +. example 1 sheet has pv01_52352, pv+50, pv-100, irvega_242422, irvega word works. pv's struggling with. desired results works before special characters, pv01, pv , irvega desired result . how can use left or anyway shorten these all? quite hard me since 1 string ill need first 4 characters, 5 characters shortened , need done throughout workbook. any input appreciated, thanks. i've found determining ascii character number code function (using upper function reduce possibilities) produces satisfactory results.          the array formula in b2 strictly alphabetic characters is, =left(a2, min(row(indirect("1:"&len(a2)))+((code(mid(upper(a2), row(indirect("1:"&len(a2))), 1))>64)*(

css - How to fill area with custom color under line in nvd3 linechart ? -

Image
i'm working nvd3 , i'm not hands-on styling (css properties) customize it. have line chart 2 data lines on it. code drawing lines following: nv.addgraph(function() { chart = nv.models.linechart(); chart.margin({ left : 100, bottom : 100 }).useinteractiveguideline(true).showlegend(true).duration(250); chart.xaxis.axislabel("date").tickformat(function(d) { var date = new date(d); return d3.time.format("%b-%e")(date); }); chart.yaxis.axislabel('').tickformat(d3.format(',.2f')); chart.showxaxis(true); d3.select('#startuprisklinechart').datum( preparedataobj(val1_y, val1_x, val2_y, val1_x)) .transition().call(chart); ; nv.utils.windowresize(chart.update); chart.dispatch.on('statechange', function(e) { nv.log('new state:', json.stringify(e

sql server 2008 - Number conversion with decimal -

how convert following numbers 0.065000 1.000000 to 0.065 1 thanks. try, declare @val sql_variant,@i sql_variant set @val=0.065000 select @i=sql_variant_property(@val, 'scale') select (cast(@val float) * power(10 , cast(@i int)) )/ power(10 , cast(@i int))

ios - UIView with AVCaptureVideoPreviewLayer doesn't resize -

i need have custom camera bottom layer camera, , layer on top of png picture hole in see part of camera through hole. both layers should in size of png photo, fit size of screen, , maintain png's original aspect ratio. in storyboard have uiview present camera, , uiimageview present png on top of it, both auto-layout superview. i've managed png right wanted using code (works fine): uiimage *passedimage = [uiimage imagenamed:self.phototitle]; cgrect imagebounds = cgrectmake(0, 0, passedimage.size.width, passedimage.size.height); self.imageview.frame = imagebounds; [self.imageview setimage:passedimage]; self.imageview.contentmode = uiviewcontentmodescaleaspectfit; i got camera displaying in uiview using avfoundation ( avcapturevideopreviewlayer ) code: avcapturevideopreviewlayer *previewlayer = [[avcapturevideopreviewlayer alloc] initwithsession:session]; [previewlayer setvideogravity:avlayervideogravityresizeaspectfill]; calayer *rootlayer = [self.camerafeedview

validation - Symfony2: how to validate UploadedFile without form? -

i need upload download file url server , persist uploadable (doctrineextensions) . works fine, approach is: download file curl temp folder on server create uploadedfile method , fill property values insert uploadable entity media do validation persist , flush the simplified code: // ... download file curl // create uploadedfile object $fileinfo = new file($tpath); $file = new uploadedfile($tpath, basename($url), $fileinfo->getmimetype(), $fileinfo->getsize(), null); // insert file media entity $media = new media(); $media = $media->setfile($file); $uploadablemanager->markentitytoupload($media, $file); // validate file (by annotations in entity) $errors = $validator->validate($media); // if no errors, persist , flush if(empty($errors)) { $em->persist($this->parententity); $em->flush(); } if skip validation, ok. file succesfully moved right path (configured uploadable extension in config.yml) , persisted database. validation manual

javascript - Is it possible to add tags to JSDoc? -

i using meteor has odd caveats compared normal javascript. want add tags in order make documentation more explicit. meteor.methods({ /** * upgrade user's role * * @where anywhere * @rolerequired 'admin' * * @module meteor.methods * @method roles.upgrade * @param {string|object} user userid or user document update * @param {string} role role add user * @throws meteor.error 401 if user trying upgrade not authorized * * @example * meteor.call('roles.upgrade', meteor.users.findone(), function (err) { if (!err) { console.log('user added role'); } else { router.error(401); } }) */ 'roles.upgrade': function (user, role) { if (roles.userisinrole(this.userid, 'admin')) { return roles.addusertoroles(user, role); } else { throw new meteor.error(401, "not authorized upgrade roles") } } }); the @where , @rolerequired more specific meteor based applicat

ldap - Writing a linux bash script to add a user to a group in eDirectory -

i want write shell script bulk add users group in edirectory. trouble is, i'm not sure begin regarding ldap calls , whatnot task. can point me helpful resource or demonstrate method accomplishing task? using straight-up ldap fine, imagine there must exist faster utilities/constructs can used in shell. netiq's ldapconfig or ndsconfig utilities seemed promising, don't see adding user group in documentation. turns out, don't have code solution this. instead of selecting each item , adding them group, there's tool buried deep inside imanager allows select users matching set of conditions , add them group.

How to apply password prompt javascript on acrobat pdf -

i have pdf needs javascript prompt asks username , password or 1 of these. have tried native javascript way inside javascript editor of acrobat. alerts work fine prompts not working me. var customername = prompt("please enter name", ""); have tried var customername = app.prompt("please enter name", ""); edit: tried remove complex parts of process guys can understand better. guess owe guys explanation on trying achieve. well have empty pdf going send users , when opened ask username/password submitted website through api. have api in place check correct credentials , on success print desired pdf content on php page, grabbed curl request through javascript inside empty pdf. , when want revoke access user delete user database on server. next time wants read pdf wont able pass through api security. well know there drawbacks on applying many restrictions pdf reader compatibility etc. if works on acrobat fine. later on try remove prin

jquery - I want to add auto slide to this script can any one help me out? -

hi friends have image slider on site slides images click on preview , next button. my question is: possible add auto start instead of onclik ? here codes: want add auto slide script can 1 me out?? doesn't have auto play option. slides on mouse click event. $(document).ready(function () { var showcaseitems = $('.show-case-item').hide(); var splashes = $('.splash').hide(); //get each image each slide , set background of slide // splashes.each(function () { // var img = $(this).find('img'); // var imgsrc = img.attr('src'); // img.css('visibility', 'hidden'); // $(this).css({ 'background-image': 'url(' + imgsrc + ')', 'background-repeat': 'no-repeat' }); // }); splashes.eq(0).show(); showcaseitems.eq(0).show();

asp.net - vb.net If condition in aspx page -

i trying use vb.net if condition in grid view item template in aspx page. tried below code not working expected. <itemtemplate> <%if ddlstatus.selectedvalue.tolower = "failed" then%> <asp:hyperlink id="hlfilepath" runat="server" text='<%# bind("file_path") navigateurl ='<%# bind("file_path") ></asp:hyperlink> <% else %> <asp:hyperlink id="filepath" runat="server" text='<%# bind("file_path")></asp:hyperlink> <% end if%> </itemtemplate>

c - Efficiency of structs of length 8, and uint64_t -

tldr: 8-byte structures handled efficiently 8-byte uint64_t? i have 3 data structures similar. 6, 7 , 8 bytes long. want put them in uint64_t variables. goal comparisons , assignments efficient. (these values used key in several (large) trees). example: have defined following data-structure, 1 7 bytes long. typedef struct { union { uint64_t raw; struct { uint8_t unused; uint8_t node_number; uint8_t systemid[systemid_length]; /* systemid_length 6 bytes. */ } nodeid; }; } nodeid_t; i can quick assignments , copies via raw union member. nodeid_t x, y; x.raw = y.raw if (x.raw > y.raw) { etc, etc. my question use in functions , in assignments. when pass struct value, compiler (gcc) recognize these structures 8 bytes long. , therefore treat if int64_t? example: there efficiency/performance differences between: int64_t my_function(); nodeid_t my_function(); in other words, gcc use 1 instruction put nodeid_t on stack, if integer? or

multithreading - Multi-threaded C# Selenium WebDriver automation with Uris not known beforehand -

i need perform simultaneous webdrivers manipulation, uncertain how this. what asking here is: what correct way achieve ? what reason exception getting (revealed below) after research ended with: 1 . way see people doing (and 1 ended using after playing api, before searching) loop on window handles webdriver has @ hand, , perform switch , out of window handle want process, closing when finished. 2 . selenium grid not seem option fore me - wrong or intended parallel processing ? since running in single computer, of no use me. in trying 1st option, have following scenario (a code sample available below, skipped stuff not relevant/repeat (where ever added 3 dots: i have html page, several submit buttons, stacked. clicking each of them open new browser/tab (interestingly enough, using chromedriver opens tabs, while firefoxdriver opens separate windows each.) as side note: can't determine uris of each submit beforehand (they must determined javascript, , @ poin

javascript - How To Retrieve Grid Rows From Grid after Grid Refresh in CRM 2015 Update 1? -

crm 2015 update 1 add ability create onload events grids. hooked event grid's onload event, hoping whatever values have been added grid, when attempt rows, returns 0 rows when being called registered onload event: // returns undefined when called grid's onload event, if user sorting grid xrm.page.getcontrol("contacts").getgrid().getrows().get(0); is there away rows grid after user adds or removes row? code works fine if triggered outside of grid onload event. here workaround not best way do. settimeout(function () { var allgridrowdata = []; var rows = xrm.page.getcontrol("contacts").getgrid().getrows(); console.log(rows.length); rows.foreach(function (row, i) { allgridrowdata.push(row.getdata().getentity()); console.log(allgridrowdata); }); }, 2000); it looks grid not loaded records when onload triggered.

javascript - using jQuery or CSS to swap around list items - is it possible? -

Image
so have list perfect desktop need move them around mobile - show images need order them differently mobile , wondering if possible in css or jquery. as can see screenshots, desktop left left, right right great mobile need have left, right, left, right etc.. cannot modiffy markup generated in smarty tpl need solution css or jquery have not idea how done though great if me on please :) for desktop works fine, this: item 1 | item 2 item 3 | item 4 item 5 | item 6 item 7 | item 8 for mobile , works this: item 1 item 2 item 3 item 4 item 5 item 6 item 7 item 8 but, want instead mobile : item 1 item 3 item 2 item 4 item 5 item 7 item 6 item 8 html list: <ul class="subcategories clearfix"> <li class="ty-subcategories__item"> <a href="/interior/gold-class-bean-bags/butterfly-sofa-bean-bags/"> <img class="ty-pict ty-subcategories-img " src="/images/detailed/3/category-panel-butterfly.j