Posts

Showing posts from March, 2014

FFMPEG: extract images from video with fixed interval, first few frames messed up -

i wanted extract frames video fixed interval, used command lines like: ffmpeg.exe -i input.mp4 -r 5 results\%d.jpg` however, interval between first few frames different of rest. for example, if both ffmpeg.exe -i input.mp4 -r 25 -t 5 test\%d.jpg , ffmpeg.exe -i input.mp4 -r 5 -t 5 test2\%d.jpg (for fps 25 video), expect results in test2 subsequence of results in test interval 5. got are: screenshot of results from thumbnails, obvious images 112~125 in test not appear in test2 . close inspection reveals correspondence between 2 set of results follows: test | test2 1&2 | 1&2 (those 2 frames identical) 3 | 3 4 | 4 9 | 5 14 | 6 19 | 7 ... | ... 104 | 24 109 | 25 (actually, when comparing last frames, realized results in test had mosaic. fixed adding option -q:v 1 .) as can seen, first few frames test2 have interval 1, instead of expected value 5. what reason behavior, , how fix it? in case want see ffmpeg output

jquery - Custom render returning binary data to ajax call in django-rest framework -

i making ajax call rest api , expect raw binary data. $.ajax({ url: 'verify', type: 'post', contenttype: "application/json; charset=utf-8", data: json.stringify({ "url": url, }), datatype: "application/octet-stream", success: function(response, textstatus, jqxhr) { if (response) { try { // } catch (e) { displayerror(e); } } }, error: function(jqxhr, textstatus, errorthrown) { // loader.remove(); // $.unblockui(); console.log(textstatus); // parsererror console.log(errorthrown); // no conversion text application/octet-stream var err = parseerror(jqxhr, textstatus, errorthrown);

javascript - How to iterate and parse JSON from query in Express/Jade? -

i new nodejs i'm thinking simple cannot find way pass json data select query jade view. using node.js tools visual studio create project uses express + jade. here index.js file: exports.products = function (req, res) { var request = new sql.request(connection); console.log("connection successful."); request.query('select * product', function (err, data) { console.log(data[i]); res.render('products', { title: 'products', year: new date().getfullyear(), message: 'products page devices', name: 'rodney', result: data[i] }); }); this view i'm using in jade render results: - product = typeof(result) != 'undefined' ? result : { } p in product h3 #{product.name} i getting error i not defined makes sense, can show 1 record if change result: data[0] . here sample of how json structured: { id: 56, name: 'motion', modelstring: '1234-g', d

dictionary - Can I have a javascript object remove itself from memory by having it set its map value to null? -

would game object remove memory when kill game called? var gamesmap = {}; var count = 0; function game (players, privategame) { if (privategame) this.privategame = true; else this.privategame = false; this._id = count++; this.players = players; this.judge = this.setjudge(); this.killgame() = function() { gamesmap[this._id] = null; } } if there no other references particular game object (including event handlers , other lasting things that), clearing last reference clearing reference in gamesmap make eligible garbage collection when killgame() method finishes executing. but, fact able call obj.killgame() means else has reference reference needs released too. i suggest rather set property null delete property in map this: delete gamesmap[this._id]; so you're cleaning after game done.

rotational matrix in R -

Image
i want achieve algorithm in r. cannot start code because having proble figuring out problem clearly. problem related rotational matrix, actully pretty challenging. the problem follow: the historical data of monthly flows x transformed y transformation matrix r where, y = rx (3) procedure obtaining transformation matrix described in detail in appendix of tarboton et al. (1998), here summarize description. transformation matrix developed standard basis (basis vectors aligned coordinate axes) orthonormal not have basis vector perpendicular conditioning plane defined (3). 1 of standard basis vectors replaced vector perpendicular conditioning plane. operationally amounts starting identity matrix , replacing last column . basis set in no longer orthonormal. gram schmidt orthonormalization procedure applied remaining 1 standard basis vectors obtain orthonormal basis includes vector perpendicular conditioning plane. last column of matrix y, , , r matri

javascript - SmoothState onAfter callback -

i have site has elements slider on pages. trying implement smoothstate js running issue of second page breaking. know through documentation need add onafter callback wondering , how applied. apparently can tricky if unfamiliar ajax. here documentation on issue. and code have fires script: $(function(){ 'use strict'; var $page = $('#uber'), options = { debug: true, prefetch: true, cachelength: 2, onstart: { duration: 250, // duration of our animation render: function ($container) { // add css animation reversing class $container.addclass('is-exiting'); // restart animation smoothstate.restartcssanimations(); } }, onready: { duration: 0, render: function ($container, $newcontent) { // remove css animation reversing class $container.removeclass('is-exiting');

java - trouble passing input from one JTextArea into another JTextArea -

my issue lies in documentlister arealistener. can't seem figure out how pass in text user enters 1 of jtextareas conversions , return other jtextarea. the goal of program take in user entered roman or arabic number in 1 of fields, convert , return value of conversion other field in real time. my gui , conversion methods work, can't seem wrap head around obtaining string user , printing in real time. public class arabictoromangui_hard extends jframe { private static final long serialversionuid = 1l; jpanel panel = new jpanel(); //constructor add text fields frame public arabictoromangui_hard() { jtextarea left = new jtextarea(10, 20); jtextarea right = new jtextarea(10, 20); setlayout(new gridlayout(1, 2)); add(new jscrollpane(left)); add(new jscrollpane(right)); mirrordocument leftdoc = new mirrordocument(); mirrordocument rightdoc = new mirrordocument(); left.setdocument(leftdoc); right.setdocument(rightdoc); leftdoc.

progress bar - How to get Horizontal Progressbar with text in android -

Image
i want acheive horizontal progressbar text update steps completed in android.but don't know how acheive it. finally found library suits needs.that library available in github: https://github.com/tobiasbuchholz/snappingseekbar

Jquery Datatable - Horizontal scroll in Google Chrome and FireFox -

i need use horizontal scroll in jquery datatable, used property: scrollx: true but work in internet explorer. in google chrome , firefox, breaks table on header , don't show horizontal scroll (bringing blank line in own header). someone has gone through problem or know how solve? my code: // datatable var tipoacao = $("#hdn_tipoacao").val(); var modulo = $("#hdn_modulo").val(); var form = null; var formhtml = ''; form = $('#fdsdamiss'); form.remove(); form = $('<fieldset id="fdsdamiss" class="formulario">').appendto('div.conteudo'); formhtml += '<div class="conteudo">'; formhtml += '<h1 class="titulo">lista de dam-iss</h1>'; formhtml += '<hr class="separadortitulo" />'; formhtml += '<table id="idtabeladamiss" class="datatable table stripe hover row-border order-column">'; form

apache - Moodle installation - Service Unavailable error -

when installing moodle, when moodle creating database tables after 10 seconds or error: "service unavailable server temporarily unable service request due maintenance downtime or capacity problems. please try again later. additionally, 404 not found error encountered while trying use errordocument handle request." the server has cloudlinux limits cpu, memory, io, processes temporary disabled (set unlimited) thank help in short, issue because outdated mod_lsapi cloudlinux uses serve php. after update moodle installation went ok.

java - What SQL Parameter Type to use for an IN condition when using MappingSqlQuery -

i having trouble declaring parameter in condition when use mappingsqlquery feature of spring jdbc. using oracle database. i have tried use integer , array without result. import org.springframework.beans.factory.annotation.autowired; import org.springframework.jdbc.core.sqlparameter; import org.springframework.jdbc.object.mappingsqlquery; import org.springframework.stereotype.component; import javax.sql.datasource; import java.sql.resultset; import java.sql.sqlexception; import java.sql.types; import java.util.list; @component public class testquery extends mappingsqlquery<list<object>> { @autowired public testquery(datasource ds) { super(ds, "select test_id, name test_table test_id in (?)"); ///////////////////////////////// // sql type declare here? declareparameter(new sqlparameter(types.)); ///////////////////////////////// compile(); } @override protected list<object> map

java - Log4j.xml dynamic file attributes -

i deploying application in websphere server , want set param file attribute of log4j.xml. locally doing like <param name="file" value="c:\\logs\\cle_error.log" /> my server name app_admin , path want generate debug.log file /waslib/appadmin/uat/logs. you use system property like: <param name="file" value="${mylog.path}" /> and when start application, pass system property like: java -dmylog.path="/waslib/appadmin/uat/logs" ...

asp.net mvc - How to assign string data to viewmodel in mvc? -

this code public class studentviewmodel { public list<student> studentid{get;set;} } public calss student { public list<string> marks {get;set;} public string id{get;set;} public string name{get;set;} } i have string data like [{"id":"101","name":"abc","marks":[["67","34"]]},{"id":"102","name":"xyz","marks":[["98"],["85]]}] in above student view model contains list class student. have number of student details. how assign above string data view model in mvc controller. you need parse string data c# object using json parser e.g. newton soft , convert c# object. var student = jsonconvert.deserializeobject<list<student>>(strinput); or can use system.web.script.serialization.javascriptserializer , code follows var students= new javascriptserializer().deserialize<list<student>>(strinp

Visual Studio 2015 stucks while saving xaml -

i've been using visual studio 2015 2 months. , run following problem: vs 2015 stucks while saving xaml file (it doesn't fall exception show infinite saving animation). use ssd disk, , don't use resharper. problem happens on vs 2015. know how solve problem?

python - Pass a dictionary from Djanjo view to another view via javascript -

i have view passes dictionary (along couple of forms , strings) html template. template has js file. accessing dictionary in js this: <script type = "text/javascript"> var request_dict = {{request_dict|safe}}; </script> now, want pass on view via post(not necessarily, can change). format of request.post in second view should dictionary inside dictionary. dictionary(request_dict) comes list instead of dictionary. how can resolve this? have use json? please mention if explanation wierd. use json, safe. view: retutn render(request, 'template.html', { 'request_dict': json.dumps(request_dict), } templete: <script type = "text/javascript"> var request_dict = json.parse('{{request_dict|safe}}'); </script>

python - Getting Rpy2 to work with rgdal to spatially subset points -

so have r code works. takes bunch of points data , spatially subsets against shapefile in method of http://robinlovelace.net/r/2014/07/29/clipping-with-r.html . #data .csv file lon lat points data_points <- spatialpoints(data) proj4string(data_points) <- crs("+proj=longlat +datum=wgs84 +no_defs +ellps=wgs84 +towgs84=0,0,0") data_ll <- sptransform(data_points, crs("+proj=longlat +datum=wgs84 +no_defs +ellps=wgs84 +towgs84=0,0,0")) melbourne <- readogr("melbourne_australia.land.coastline","melbourne_australia_land_coast") #this shapefile https://mapzen.com/data/metro-extracts subset <- data_ll[melbourne,] plot(melbourne) points(subset) i'm trying convert corresponding rpy2 script. far have; import pandas pd import numpy np import rpy2.robjects ro import rpy2.robjects.numpy2ri rpy2.robjects.packages import importr rgdal = importr('rgdal') base = importr('base') rpy2.robjects.numpy2ri.activate() data =

winapi - How to connect a source filter to an encoder DMO? -

Image
i have directshow app generating silent videos, filter graph is my video frame generator -> selectable video compressor -> avi mux -> file writer or just my video frame generator -> avi mux -> file writer this works expected, unless selected compressor dmo, in case pfiltergraph->connect() call source compressor fails - typically vfw_e_type_not_accepted or vfw_e_cannot_connect. make dmos work too. found deprecated sample (aviencoderdshow) able tweak compress input avi file wmv9 dmo, seemed promising on score. filter graph is pfiltergraph->addsourcefilter(avi file) -> avi splitter -> dmo wrapper wmv -> avi mux -> file writer so thought swap out source filter filter (or bouncing ball directshow sample it's based on). trying gives same connection failures though. source i'm supplying 32 bit rgb, wmv9 should accept. might stumbling on? edit: details of preferred media type are: majortype: mediatype_video subtype: mediasubtyp

ruby on rails - omniauth-facebook does not return set scope -

in omniauth.rb omniauth.config.logger = rails.logger rails.application.config.middleware.use omniauth::builder provider :facebook, rails.application.secrets[:facebook_app_id], rails.application.secrets[:facebook_secret], :scope => 'email,public_profile', :display => 'popup', :info_fields => 'email,public_profile' end client side, javascript: return fb.login(function(response) { if (response.authresponse) { return window.location = '/auth/facebook/callback; } }, {scope: 'email,public_profile'}); as per fb api docs. when fb popup opens ask permissions, correctly asks email , public_profile. hit ok , request.env['omniauth.auth] provides me only: {"provider":"facebook","uid":"xxxxxxx","info":{"name":"xxxxxxx xxxxxxx","image":" http://graph.facebook.com/xxxxxxx/picture "},"credentials":{"token":"

r - Plot LOESS (STL) decomposition using Ggvis -

Image
i want able plot 3 different elements of seasonal trend decomposition using loess (stl) ggvis. however, recive error: error: data_frames can contain 1d atomic vectors , lists i using nottem data set. # seasonal trend decomposition using loess (stl) ggvis # load nottem data set library(datasets) nottem <- nottem # decompose using stl() nottem.stl = stl(nottem, s.window="periodic") # plot decomposition plot(nottem.stl) now, information interested in. in order make plot can play around transform data frame using xts-package. far good. # transform nottem.stl data.frame library(xts) df.nottem.stl <- as.data.frame(as.xts(nottem.stl$time.series)) # add date data.frame df.nottem.stl$date <- data.frame(time = seq(as.date("1920-01-01"), = ("months"), length =240)) # glimpse data glimpse(df.nottem.stl) # plot simple line of trend plot(df.nottem.stl$date, df.nottem.stl$trend, type = "o") this pretty plot want. however, want

javascript - Select date and time automatically -

i've got custom date/ time selector. looks this: <select name="date_d"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <

c# - Access Network Drive That is Marked Red Rather than Green Before Running a Process That Accesses a File on The Network Drive -

i've written application accesses , reads file on network drive. if end-user has booted computer , logged vpn network drive shows red mark rather green mark. prior clicking button run process end-user must first open network drive. if end-user doesn't manually access network drive prior clicking button application throws exception drive cannot accessed. how can use c# winforms programmatically access network drive prior running process? instead of using "f:\path\file" use "\server\drive_name\path\file"

Grouping and finding max using awk -

the data needs grouped, each group having 6 values, , needs find max in each group. data: 0.0759313 0.0761037 0.0740772 0.0736791 0.0719802 0.0715406 0.0828038 0.0826728 0.0802384 0.0798476 0.0785342 0.0777939 0.0738756 0.0733486 0.0709046 0.0707067 0 0 used awk statements, not getting result. awk '{for(x=i+1;(x<=(i+5))&&(x<=nf);x++){a[++y]=$x;if(x==(i+5)){c=asort(a);b[z++]=a[c];i=i+6;y=0}}}end{for(j in b) print b[j]}' i go this: awk 'nr % 6 == 1 || $0 > max { max = $0 } nr % 6 == 0 { print max }' file always set max first value in each group of six, or if value greater current maximum. @ end of each group, print value. you may want include additional logic deal printing maximum of last few numbers, in case number of lines not divisible 6: end { if (nr % 6 != 0) print max }

c# - Caliburn.Micro Value Converter -

in wpf mvvm (caliburn micro) application need bind datetimeoffset property wpf datepicker control (selecteddate property). i think can use caliburn micro's value converter feature convert datetimeoffset datetime , vice versa. please provide me steps sample code? <datepicker selecteddate="{binding dateofbirth}"/> <datepicker selecteddate="{binding dateofbirth, converter={staticresource dateconverter}}" /> means need write converter datetime datetimeoffset. not hard. has nothing caliburn micro, not sure docs referring to..

swift - 'resignFirstResponder()' returns true and the text field loses focus but the keyboard does not dismiss -

i have storyboard scene has 2 uitextfield .the first 1 left untouched , fresh out of object library. second 1 has delegate outlet connected viewcontroller 's code. app's interface the second text field's connection in ib (sorry have post images way, because stackoverflow won't let me.) the code simple. of it. class viewcontroller: uiviewcontroller, uitextfielddelegate { func textfielddidbeginediting(textfield: uitextfield) { textfield.resignfirstresponder() } } the thing dismiss keyboard when it's come up. the first 1 shows keyboard normally. second 1 doesn't show keyboard because it's dismissed. it works on own, until click first text field bring keyboard, keyboard on screen , click second text field. happens next, second text field loses focus, keyboard remains on screen. using print(:) , i've verified that, when call resignfirstresponder on second text field, first responder, , return value of call true , ,

r - Compute stepwise regresion Model containing intercept, linear terms, and all products of pairs of distinct predictors -

i have dataframe df df<-structure(list(p = c(794.102395099402, 1299.01021921817, 1219.80731174175, 1403.00786976395, 742.749487463385, 340.246973543409, 90.3220586792255, 195.85557320714, 199.390867672674, 191.4970921278, 334.452413539092, 251.730350291822, 235.899165861309, 442.969718728163, 471.120193046119, 458.464154601097, 950.298132134912, 454.660729622624, 591.212003320456, 546.188716055825, 976.994105334083, 1021.67000560164, 945.965200876724, 932.324768081307, 3112.60002304117, 624.005047807736, 0, 937.509240627289, 892.926195849975, 598.564015734103, 907.984807726741, 363.400837339461, 817.629824627294, 2493.75851182081, 451.149000503123, 1028.41455932241, 615.640039284434, 688.915621065535, nan, 988.21297, nan, 394.7, 277.7, 277.7, 492.7, 823.6, 1539.1, 556.4, 556.4, 556.4), t = c(11.7087701201175, 8.38748953516909, 9.07065637842101, 9.96978059247473, 2.87026334756687, -1.20497751697385, 1.69057148825093, 2.79168506923385, -1.03659741363293, -2.44619473

java - How to control the @PostConstruct when integration testing using Spring -

i have spring bean class redisrepo inside initialising database connection @postconstruct: @postconstruct public void init() { logger.debug("redisrepo, init."); client = new redisclient(redis_host, redis_port); ... } i creating bean using java config @ springconfiguration.class: @bean @scope("singleton") public redisrepo redisjrepo() { return new redisrepo(); } i started build integration tests using spring. using same configuration class (springconfiguration.class) tests: @runwith(springjunit4classrunner.class) @springapplicationconfiguration(classes = springconfiguration.class) my test class using embedded-redis need init right before start tests: @before public void init() throws ioexception { //init embedded-redis } the problem when start tests @postconstruct of redisrepo class executed before integration-test init() class (past below) leading me null since embedded redis hasnt initia

python - Scikit-learn Random Forest out of bag sample -

i trying access out of bag samples associated each tree in randomforestclassifier no luck. found other informations gini score , split feature each node, looking there : https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx does know if possible out of bag sample related tree ? if not maybe possible 'in bag' sample (subset of dataset used specific tree) , compute oob using original data set ? thanks in advance you can figure out source code, how private _set_oob_score method of random forest works. every tree estimator in scikit-learn has it's own seed pseudo random number generator, it's stored inside estimator.random_state field. during fit procedure every estimator learns on subset of training set, indices subset of training set generated prng , seed estimator.random_state . this should work: from sklearn.ensemble.forest import _generate_unsampled_indices # x here - training set of examples n_samples = x.shape[0] tre

c++ - QT Start explorer process parameters -

to start application in qt can use process function common languages, , can pass parameters in usual way. however, trying start explorer , pass parameter. so code: qprocess process; qstring test("/select,\"e:\\data\\testimage.dat\""); process.startdetached("explorer.exe", qstringlist() << test); should open explorer , highlight file testimage.dat, in folder e:\data. however, opens explorer , highlights documents. so tried same function in c#: string test = "/select,\"e:\\data\\testimage.dat\""; process.start("explorer.exe", test); this expect, opening explorer , highlighting file. from see on here, qt code should same. using startdetached qt version works first time saying running. know arguments same copied , pasted them. windows 8.1 , qt5.2 msvc10 solved still puzzled. in command line, entry explorer /select,"e:\data\testimage.dat" works, command explorer /select,e:\data\

java - How to get the IP and Port number from bluemix? -

i want use server ip address , port number 1 of applications. unable find bluemix server ip , port number java application hosted. the server ip address , port change each time restart or restage application. access server ip address , port app instance using can folowing system properties java application: vcap_app_host vcap_port

javascript - NVD3 line chart single record issue -

Image
hi, i facing strange issue while using nvd3 line chart. single record showing data in middle of graph , multiple data working perfectly. issue single data showing future dates relly dont want display. nv.addgraph(function() { var chart = nv.models.linechart().x(function(d) { return d.x }).y(function(d) { return d.y }).color(d3.scale.category10().range()) .useinteractiveguideline(true); chart.forcey([0,unitinterval]); chart.yaxis.scale().domain([ 0, 9999999 ]); var format = ',f'; chart.yaxis.tickformat(function(d) { return nformatter(d); }).axislabel('no. of records'); chart.margin({ bottom : 50, left : 75 });//set margin chart.xaxis.axislabel("duration").tickformat(function(d) { return d3.time.format(

javascript - Html: load convenient image size at page loading time? -

i have image in gridview (table) has various number of columns according screen resolution. html code this: as can see, have 6 columns on 'ld' resolutions ; 4 column on 'md' resolution ; etc... at end, actual/displayed resolution of image image_resolution_xxx.jpg not known in advance. depends on screen resolution of device (and consequently of number of columns of grid). my images stored on server in different folders according resolution : folder '128x128', '256x256', etc... what want avoid load big resolution images in gridview (ex: image_resolution_512.jpg) if smaller resolution required (ex: image_resolution_256.jpg). also, want avoid load small resolution image if higher resolution required. how can load correct resolution @ loading time ? perhaps simplified way define image resolution of xxx pixels xs devices , of yyy pixels md devices, etc... possible ? thanks ! you along lines of... <link rel="stylesheet&qu

angularjs - static resource not loaded in node app.js file -

Image
my app.js below var express = require('express'); var path = require('path'); var bodyparser = require('body-parser'); var mongoose = require('mongoose'); //add mongo support mongoose.connect('mongodb://localhost/flappernews'); //connect mongo var index = require('./routes/index'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'ejs'); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: false })); app.use(express.static(path.join(__dirname, 'public'))); //rout views app.use('/', index); app.get('/', function (req, res) { res.send('application started'); console.log("application started.") }); app.listen(3000); module.exports = app; my directories follows root -> node_modules -> resource root -> public -> javascripts -

Field updates only if I update browser in dynamics crm -

Image
i wrote plugin crm. update field of entity a when create new entity b . have form entity a , in form have tab entity b . when create new entity b tab plugin change field in entity a . can't see change until reload browser page. you're somehow losing sight of fact plugin running on server, , updates data in database on server. there no built in method of having database update trigger notification on particular client (or all). have 2 options: trigger xrm.page.data.refresh (or save work well, since pull down new values) within context of entity a , after performing save of entity b . use polling , crmwebapi or odata endpoint query crm value updating on server side, , updating on client well. your question little difficult understand, #1 may difficult if don't have way of knowing in context of entity a user should have created entity b . #2 work, not scale if have hundreds of users sitting there polling.

html - php DOM changes not saving -

i use php simple html dom parser open html file, change src of images , save. echo shows changes no actual src changes occur html file. here code , use xamp test code. <?php include_once'simple_html_dom.php'; $html = file_get_html('index.html'); $dom = new domdocument; $dom->loadhtml($html); $nodes = $dom->getelementsbytagname('img'); foreach ($nodes $node) { $node->setattribute('src', 'images/jelly.png'); } $dom->save('index.html'); echo $dom->savehtml(); exit; what cause changes not save? if says permissions set 4 options of accessing on files properties write ie: system, auth users, admin , users no luck. please refer the documentation , should more so: <?php include_once'simple_html_dom.php'; $html = file_get_html('index.html'); foreach ($html->find('img') $element) { $element->src = 'images/jelly.png'; } $html->save('index.html'); echo

mongodb - Spring Data Mongo DB Repository FindBy not working -

i'm trying add custom query mongorepository instance, it's not working. section 10.3 in here describes i'm trying do. i've tried 4 different ways of doing it, nothing seems work... my code public interface myrepository extends mongorepository<studenteo,customid>{ //1st attempt. //studenteo findbyfirstname(string firstname); //2nd attempt. //@query("{ 'firstname' : ?0 }") //studenteo findbyfirstname(string firstname); //3rd attempt. //list<studenteo> findbyfirstname(string firstname); //4th attempt @query("{ 'firstname' : ?0 }") list<studenteo> findbyfirstname(string firstname); } @document(collection = "data_point_metadata") public class studenteo { @id private customid id; private string firstname; private string lastname; private studenttype studenttype; ... getters , setters... } @component public class stringtostuden

java - I cannot insert value in the table using textfield -

i need create program in values can inserted using textfield in java. database getting connected ... bt cannot insert values using jtextfield ....need help.. shows error .. java.sql.sqlexception: parameter index out of range (1 > number of parameters, 0). package youtubetest; import java.sql.*; import java.awt.event.*; import javax.swing.*; public class youtubetest extends jframe{ private static final string username = "root"; private static final string password = "****"; private static final string conn_string = "jdbc:mysql://localhost:3306/youtube"; connection conn; preparedstatement stmt; jbutton b1,b2; jtextfield t1,t2; jlabel l1,l2; string fname; string lname; public youtubetest() { setsize(600,600); setdefaultcloseoperation(jframe.exit_on_close); setresizable(false); setlayout(null); add(t1 = new jtextfield(30)); t1.setbounds(10,10,200,50); add(t2 = new jtextfield(30)); t2.setbounds(10, 100

c# - Argument type 'object' is not assignable to parameter type 'string' -

i have following tag in aspx page <input type="checkbox" id="chkflags" name="chkflags" value="<%#databinder.eval(dataitemcontainer, "dataitem.tag_id") %>" <%#selecttags(databinder.eval(container, "dataitem.tag_id")) %>/> i getting following error: argument type 'object' not assignable parameter type 'string' the section of line highlighted is: <%#selecttags(databinder.eval(container, "dataitem.tag_id")) my routine selecttags follows: public string selecttags(string tag_id) { string[] atags = mobjformat.stripobjecttostring(request.form["chkflags"]).split(convert.tochar(",")); //added square brackets request.form , syntax convert string char 10/21/15 max // string sitem = ""; string sreturn = ""; mobjsecurity.messagestack_insert("procedure", "selecttags",

javascript - d3 axes behaving strangely with a pow scale -

i learning data visualization d3.js, following scale behaves strangely d3.svg.axis var scalefunc = d3.scale.pow() .exponent(1.6) .domain(d3.extent(arr, numfunc)) // numfunc returns float between 0 - 5 .range([ ( maxplotheight -axes.bufferbottom ), axes.buffertop ]) axis function : d3.svg.axis() .scale(scalefunc) .orient("left") .ticks(5) if extent in scale starts 0 works 4 ticks, , if extent start above 0 ( 1.2, 1.4 ) shows 6 ticks values : .5, .0, .5, .0, .5, .0 somewhat working y-axis image broken y-axis image please me understand problem from docs on axis.ticks([arguments…]) the arguments later passed scale.ticks generate tick values and pow.ticks([count]) the specified count hint; scale may return more or fewer values depending on input domain. this why not getting exact number of ticks might have expected when calling .ticks(5) . the series of tick values .5, .0,... caused since there not enough spa