Posts

Showing posts from May, 2015

json - Spring Data Rest. PUT for Projection -

i have problems put method. have entity: @data @entity public class idea { @id @generatedvalue private long id; private string title; @onetoone private style style; private double posx; private double posy; private long parentid; @onetomany(mappedby="parentid") private collection<idea> children; private idea() { } } projection: @projection(name="ideasummary", types = {idea.class}) public interface ideasummary { string gettitle(); style getstyle(); double getposx(); double getposy(); long getparentid(); collection<ideasummary> getchildren(); } repository: @repositoryrestresource(excerptprojection = ideasummary.class) public interface idearepository extends crudrepository<idea, long> { } the command json: curl -i -x put -h "content-type:application/json" -d '{"title":"chsild note","style":{"bold":fals...

java - How to write lambda expression with EventHandler javafx -

i'm trying rewrite code new eventhandler<mouseevent>() { @override public void handle(mouseevent event) { system.out.println(e.hashcode()); } }; as new eventhandler<mouseevent>(e -> system.out.println(e.hashcode())); and errors. mistake here? all code write @ beginning becomes : event -> {system.out.println(event.hashcode()); so in use (example) : somenode.addeventhandler(mouseevent.mouse_clicked, new eventhandler<mouseevent>() { @override public void handle(mouseevent event) { // todo auto-generated method stub system.out.println(event.hashcode()); } }); can : somenode.addeventhandler(mouseevent.mouse_clicked, event -> { system.out.println(event.hashcode()); }...

java - getActionView is deprecated? -

today decide translate android app java kotlin ! :) surprise when type : val searchitem = menu.finditem(r.id.action_search) val searchview = menuitemcompat.getactionview(searchitem) searchview and android studio told me : " 'getactionview(menuitem!):view!' deprecated. deprecated in java " so before ask solution ask google solution , believed find solution : "use getactionview() directly." so modified code : val searchview = menuitemcompat.getactionview() searchview but getactionview() still crossed don't understand @ all... i happy if can me :) thank ! the javadoc says: use getactionview() directly. hence, should is: val searchview = searchitem.getactionview() searchview

java - SonarQube “Class not found: javax.xml.rpc.handler.MessageContext” during maven sonar build -

using sonar cube version 4.5.2. apache maven 3.0.2 java version: 1.8.0_65 my maven build process comes several errors such class not found: javax.xml.rpc.handler.messagecontext how fix problem? sonar trying find package? you need add jaxrpc-api resolve issue. can fine dependecy below: <dependency> <groupid>javax.xml</groupid> <artifactid>jaxrpc-api</artifactid> <version>1.1</version> </dependency> you can use javax.xml.rpc resolve issue. can find dependency below: <dependency> <groupid>org.glassfish</groupid> <artifactid>javax.xml.rpc</artifactid> <version>3.0-b74b</version> </dependency>

Android how to not stretch scrollbar thumb? -

i want customize scrollbar. i've read similar questions on stackoverflow, can't needed result. i've created style: <style name="your_style_name"> <item name="android:scrollbaralwaysdrawverticaltrack">true</item> <item name="android:scrollbarstyle">outsideoverlay</item> <item name="android:scrollbars">vertical</item> <item name="android:fadescrollbars">false</item> <item name="android:scrollbarthumbvertical">@drawable/scroller_thumb</item> like in answer - https://stackoverflow.com/a/14487645/7478869 but in case scrollbar thumb image stretched vertically, tried use advise answer ( https://stackoverflow.com/a/20385183/7478869 ) , replaced android:scrollbarthumbvertical fastscrollthumbdrawable . scrollbar thumb doesn't appear on screen. how make custom scrollbar image without stretching? have simple scrollview linearlayout in i...

visual studio 2017 - AspNet Core MVC + Class Library (.Net Standard) with Entity Framework -

i'm using visual studio 2017 , i'm building first asp.net core mvc site , want create class library (.net standard) data access layer. in last library want use entity framework connect database. tried use entity framework core don't know how create edmx file map database. there way entity framework core? thanks in advance :) entity framework has power point may consider not explicitly mapping of database @ first. entity framework of mapping you. i in same boat year ago , got lot of example. contoso university example: https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application

sql - MERGE conflict foreign key constraint -

i use merge update or insert data database. when merge tables jw_materialdata or jw_materialdata2pl fk errors seen below. the merge statement conflicted foreign key constraint "fk_jw_materialdata_cmat_material". conflict occurred in database "test", table "dbo.cmat_material", column 'camosguid'. and the merge statement conflicted foreign key constraint "fk_jw_materialdata2pl_cmat_materialtext". conflict occurred in database "test", table "dbo.jw_materialdata", column 'camosguid'. i've tried different order of merge statements didn't help. tried first cmat_material , cildren. or first child jw_materialdata2pl , jw_materialdata , cmat_material . the dependencies these: cmat_material > jw_materialdata > jw_materialdata2pl cmat_material > cmat_materialtext cmat_pricelist > jw_materialdata2pl does have idea else can do? i've database same structure not same ...

regex - php extract Emoji from a string -

i have string contain emoji. want extract emoji's string,i'm using below code doesn't want. $string = "😃 hello world 🙃"; preg_match('/([0-9#][\x{20e3}])|[\x{00ae}\x{00a9}\x{203c}\x{2047}\x{2048}\x{2049}\x{3030}\x{303d}\x{2139}\x{2122}\x{3297}\x{3299}][\x{fe00}-\x{feff}]?|[\x{2190}-\x{21ff}][\x{fe00}-\x{feff}]?|[\x{2300}-\x{23ff}][\x{fe00}-\x{feff}]?|[\x{2460}-\x{24ff}][\x{fe00}-\x{feff}]?|[\x{25a0}-\x{25ff}][\x{fe00}-\x{feff}]?|[\x{2600}-\x{27bf}][\x{fe00}-\x{feff}]?|[\x{2900}-\x{297f}][\x{fe00}-\x{feff}]?|[\x{2b00}-\x{2bf0}][\x{fe00}-\x{feff}]?|[\x{1f000}-\x{1f6ff}][\x{fe00}-\x{feff}]?/u', $string, $emojis); i want this: $emojis = ["😃", "🙃"]; but return this: $emojis = ["😃"] and if: $string = "😅😇☝🏿" it return first emoji $emoji = ["😅"] try looking @ preg_match_all function. preg_match stops looking after finds first match, why you're ever getting first emoji ...

How to limit the scope of a Vue.js component's style? -

Image
i experimenting single file .vue components , first successful build surprised me scope of component style. speaking, under impression single file components self-contained, including scope of components. the component .vue file is <template> <div> hello {{who}} </div> </template> <script> module.exports = { data: function () { return { who: "john" } } } </script> <style> div { color: white; background-color: blue; } </style> it built via webpack though following webpack.config.js module.exports = { entry: './entry.js', output: { filename: 'bundle.js' }, devserver: { inline: true }, module: { rules: [{ test: /\.vue$/, loader: 'vue-loader' }] } } and entry.js import vue 'vue/dist/vue.js' import componentone './component1.vue' ...

Login filter java servlet -

i have simple implementation of login filter. public class loginfilter implements filter { @override public void init(filterconfig filterconfig) throws servletexception {} @override public void dofilter(servletrequest req, servletresponse res, filterchain chain) throws ioexception, servletexception { httpservletrequest request = (httpservletrequest) req; httpservletresponse response = (httpservletresponse) res; httpsession session = request.getsession(false); if (session == null || session.getattribute("loggedinuser") == null) { response.sendredirect(request.getcontextpath() + "/login.jsp"); } else { chain.dofilter(request, response); } } @override public void destroy() {} } when go registered page(i.e. /account?id=1 ) without session attribute loggedinuser , filter works fine. redirects me l...

facebook js sdk acting differently with fb.login() -

Image
trying connect facebook via js sdk asp.net. this.initfacebookapi = function () { var dfd = $.deferred(); (function (d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) { dfd.resolve(); return; } js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js"; fjs.parentnode.insertbefore(js, fjs); dfd.resolve(); }(document, 'script', 'facebook-jssdk')); return dfd.promise(); }; this.checkconnection = function (verifyconnection) { var appid = _this.viewmodel.appid(); fb.init({ appid: appid, xfbml: true, version: 'v2.9' ...

html - Have a white space to the right and repeating image to the bottom right with bootstrap -

Image
here's situation: this screen shot of www.dreamstreetentertainment.com, site still under construction live anyway. don't ask. customer wants that. suffice say, have white space right , repeating image bottom right. the background in pieces: the moving cloud segments on the background sky the hollywood /los angeles skyline the road hollywood the lamps (separate) , css set issue: the customer uses 27" monitors , image see, (i use 22" monitor) simulated down 80% of full screen. solution: how can fix side white space , repeating image lower right bottom? here's html, body { margin: 0; min-height: 100%; display: -ms-flexbox; display: -webkit-flex; display: flex; -ms-flex-direction: column; -webkit-flex-direction: column; flex-direction: column; font-family: 'open sans', sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; color: #ffffff; background-color:...

php - Apache Solr view on Drupal 7 -

i got , issue apache solr. need make search display results regardless of current language of website. @ moment trying apache solr view, still can't work properly. still gives me "ss_language" default value 'und' , 'en'. need search in languages. ps. kinda new on drupal. this module might https://www.drupal.org/project/apachesolr_multilingual

c# - Trouble with exceptions using regex -

i have line of code: textbox1.text = regex.replace(textbox1.text, "(?:\r\n)+", " \r\n"); which adds double spacebar line before line break: input : a b c d e output : a //<--- double spacebar after 'a' character b //<--- double spacebar after 'b' character c //<--- double spacebar after 'c' character d //<--- double spacebar after 'd' character e for formatting purposes on pages 1 or reddit, need either double break line or double spacebar in previous line , single line break afterwards make new line in formatting anyway, it's working, problem if have double spacebar after line, keeps adding , results in line many spacebars, unnecesary because need 2 work so i've tried doing exception [^ ], should not consider rule if has double spacebar before, this: (?:[^ ]\r\n)+ but doesn't work? input : a b c //<---- double spacebar before line break check if ignores d e outp...

mongodb - Mongoose complex queries with optional parameters? -

i'm relatively new mongo & mongoose, , i've hit problem. i have reasonably (for me anyway) complex query, allow user search entered terms. so if query so: var query = { '$and' : [ { "foo1" : "bar1" }, { '$and' : [ "foor2" : { $ne : null } }, { "foo2" : "bar2" } ] }, { "foo3" : "bar3" } ]}; doc.find(query); but user can enter number of combinations parameters, i.e. search items match foo1 & foo2, or items match foo2, or foo3, etc. is there way tell query parameter if isn't empty, or there way build searches programmatically? have seen other options, adding parameters this, seem add in standard { foo : 'bar' } format, , reason seem added query whether meet conditions of if statement or not. thanks. firstly, don't need $and operator want. comma separation implicit and . your example query should be: var query = { "fo...

easeljs - Button CreateJs -

can me. can´t make button work... used similar before. call gamemenu scene inside js. var scene = new game.gamemenu(); scene.on(game.gamestateevents.game, this.onstateevent, this, true, {state:game.gamestates.game}); stage.addchild(scene); the button here inside code: (function (window) { window.game = window.game || {} function gamemenu() { this.initialize(); } var p = gamemenu.prototype = new createjs.container(); p.btniniciar; p.container_initialize = p.initialize; p.initialize = function () { this.container_initialize(); this.addtitle(); this.addbutton(); } p.addtitle = function () { var titulo = new createjs.sprite(spritesheet, 'titulo'); titulo.x = screen_width / 2 - titulo.getbounds().width/2; titulo.y = screen_height / 2 - titulo.getbounds().height/2; this.addchild(titulo); } p.addbutton = function() { this.btniniciar = new createjs.sprite(spritesheet, 'btniniciar'); this.btniniciar.mouseenabled = true...

Python 2.7. Extracting data from some part of a string using a regex -

let's import regex. import re assume there's string containing data. data = '''mike: jan 25.1, feb 24.3, mar 29.0 rob: jan 22.3, feb 20.0, mar 22.0 nick: jan 23.4, feb 22.0, mar 23.4''' for example, want extract floats rob's line only. name = 'rob' i'd make this: def data_extractor(name, data): return re.findall(r'\d+\.\d+', re.findall(r'{}.*'.format(name),data)[0]) the output ['22.3', '20.0', '22.0'] . is way pythonic or should improved somehow? job, i'm not appropriateness of such code. thanks time. a non-regex way consists in splitting lines , trimming them, , checking 1 starts rob , grab float values: import re data = '''mike: jan 25.1, feb 24.3, mar 29.0 rob: jan 22.3, feb 20.0, mar 22.0 nick: jan 23.4, feb 22.0, mar 23.4''' name = 'rob' lines = [line.strip() line in data.split("\n")] l in lines: ...

Row issue with Ag-Grid -

Image
i'm trying manipulate style of data-table being used ag-grid plugin. background colour of each row seems cut off before end of table when it's inside of css overflow parent. can avoid cut off in colour?

windows - Should I create a new thread for RTSP client or just use custom IMFMediaSource in Media Foundation -

i'm writing rtsp client , using media foundation stream multiple ip camera video feeds windows display. understand built-in mf rtsp doesn't handle ip cameras i'll have write custom media source: writing custom media source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms700134(v=vs.85).aspx also following post gives useful tips not implementation details: capture h264/aac stream via rtsp using media foundation: https://social.msdn.microsoft.com/forums/windowsdesktop/en-us/8f67d241-7e72-4509-b5f8-e2ba3d1a33ad/capture-h264aac-stream-via-rtsp-using-media-foundation?forum=mediafoundationdevelopment if write rtsp code within custom media source object, able run sufficiently in it's own thread , use blocking "recv" network call receive camera stream data? or com object not separate thread can handle type of task? there potential conflict between blocking on "recv" call , blocking on com's work queue? or should create new thr...

java - Retrofit and GRPC -

been tackling 2 days. i'm trying use protoconverterfactory grpc not having luck it. public class retrofitservice { public void makerequest() { retrofit retrofit = new retrofit.builder() .baseurl("https://myurl:444") .addconverterfactory(protoconverterfactory.create()) .build(); retrofitserviceimp serviceimp = retrofit.create(retrofitserviceimp.class); serviceimp.gettoken(empty.getdefaultinstance()).enqueue(new callback<token.tokenresponse>() { @override public void onresponse(call<token.tokenresponse> call, response<token.tokenresponse> response) { log.d("success", "onresponse: "); } @override public void onfailure(call<token.tokenresponse> call, throwable t) { log.d("error", "onfailure: " + t.getlocalizedmessage() + t.getmessage()); ...

Is it possible to disable font embedding with wkhtmltopdf? -

we generate pdfs download or printing using wkhtmltopdf called through phpwkhtmltopdf on our ubuntu/php-driven site. when font-family not specified , default fonts used (the nimbussanl family, in our case), font subset needed document embedded automatically. not want embedding happen. there way of disabling it, either globally or per-document? have spent several hours failing find reference font embedding in software.

javascript - How to display remote video with webRTC and socket.io -

i'm following tutorial create private videochat app between 2 peers https://codelabs.developers.google.com/codelabs/webrtc-web/#0 it works try add improvements closer of https://appr.tc/ my main issue can't display 1 camera share same page. want know if it's possible use 2 differents pages each camera in same room , if it's possible, how proceed? thanks advance differents advices. the code use: index.js 'use strict'; var os = require('os'); var nodestatic = require('node-static'); var http = require('http'); var socketio = require('socket.io'); var fileserver = new(nodestatic.server)(); var app = http.createserver(function(req, res) { fileserver.serve(req, res); }).listen(8080); var io = socketio.listen(app); io.sockets.on('connection', function(socket) { // convenience function log server messages on client function log() { var array = ['message server:']; array.push.apply(array,...

c# - Microsoft Access Engine -

i'm trying add data visual studio access in c#. every time click button save data error message pops saying "microsoft database engine". have no clue problem is. pasted code below: private void btnsave_click(object sender, eventargs e) { oledbconnection conn = new oledbconnection(); conn.connectionstring = @"provider=microsoft.ace.oledb.12.0;data source=d:\my monroe\semester 5\advanced programming\final project\windowsformsapplication1\windowsformsapplication1\final exam .accdb"; string fname = first_nametextbox.text; string lname = last_nametextbox.text; string snum = ssntextbox.text; string city = citytextbox.text; string state = statetextbox.text; string telnum = telephone__textbox.text; oledbcommand cmd = new oledbcommand("insert customers(first name, last name, ssn,city,state,telephone# )" + " values(@fname,@lname,@snum,@city,@state,@telnum)", connect)...

c# - Delete filetable row in WPF -

i use entity framework .in form bind view file table grid.i defined key down event grid , when user press delete key call stored procedure delete selected row.i show photo file table using image control selection event on grid. my problem when press delete key must select other row of grid working deleting operation(if selection change programmatically not help).if not time out exception fired sql executing store procedure. should do? datagridtextcolumn binding="{binding createdatetime}"

jersey - JAX-RS deserialization of empty string instead of objects -

jax-rs (jersey) failing @ deserializing following: { "coveragestores": "" } now coveragestores supposed object, expect json be: { "coveragestores": null } instead, not. is there way tell jax-rs handle empty string if null object? saw accept_empty_string_as_null_object use annotation ideally. fwisw, ended doing this: private static jacksonjsonprovider jacksonjsonprovider = new jacksonjaxbjsonprovider().configure(deserializationfeature.accept_empty_string_as_null_object, true); // in method webtarget webtarget = clientbuilder.newclient() .register(jacksonjsonprovider) .target(urlpath); etc... i couldn't find annotation it, it's fine this.

python - findChildren() method is storing two of the same child rather than one -

from webpage opening urllib2 , scraping beautifulsoup , trying store specific text within webpage. before see code, here link screenshot of html webpage can understand way using find function beautifulsoup : html webpage and finally, here code using: from beautifulsoup import beautifulsoup import urllib2 url = 'http://www.sciencekids.co.nz/sciencefacts/animals/bird.html' page = urllib2.urlopen(url) soup = beautifulsoup(page.read()) ul = soup.find('ul', {'class': 'style33'}) children = ul.findchildren() child in children: print child.text and here output problem lies: birds have feathers, wings, lay eggs , warm blooded. birds have feathers, wings, lay eggs , warm blooded. there around 10000 different species of birds worldwide. there around 10000 different species of birds worldwide. ostrich largest bird in world. lays largest eggs , has fastest maximum running speed (97 kph). ostrich largest bird in world. lays largest eggs , has...

raspberry pi - I want to use "spi.h" in raspberrypi (spi.h is header file of arduino) -

i use arduino sensor in raspberry pi. since sample file sensor dedicated arduino, example header file dedicated arduino. the example code uses spi.h file. can download header file , use in raspberry pi? that wouldn't make sense various reasons , wouldn't work various reasons. spi serial interface. don't need arudino code communicate via spi on raspberry pi. there many examples on how on raspberry pi. the sensor doesn't need arduino. needs power , talk to. the fact ask question shows should invest time learning c/c++ , basic knowledge microcontrollers , serial interfaces. if you're lost in unknown jungle won't bring map unknown jungle... have do? learn jungles in general , day you'll able survive in of them.

grid search - Python - ARIMA parameters auto-tuning -

i trying adapt this example case, aim obtain similar auto.arima() : at_tuples = tuple(train['averagetemperature'].values) endog = at_tuples def objfunc(order, endog): fit = arima(endog, order).fit() return fit.aic() grid = (slice(1, 3, 1), slice(1, 3, 1), slice(1, 3, 1)) brute(objfunc, grid, args=(endog), finish=none) when run code get: typeerror: objfunc() takes 2 positional arguments 45 given i'm not sure it, suppose concern type of format of at_tuples .

java - Parsing LIUM Speaker Diarization Output -

how can know speaker spoke how time using lium speaker diarization toolkit? for example, .seg file. ;; cluster s0 [ score:fs = -33.93166562542459 ] [ score:ft = -34.24966646974656 ] [ score:ms = -34.05223781565528 ] [ score:mt = -34.32834794609819 ] seq06 1 0 237 f s u s0 seq06 1 2960 278 f s u s0 ;; cluster s1 [ score:fs = -33.33289449700619 ] [ score:ft = -33.64489165914674 ] [ score:ms = -32.71833169822944 ] [ score:mt = -33.380835069917275 ] seq06 1 238 594 m s u s1 seq06 1 1327 415 m s u s1 seq06 1 2311 649 m s u s1 ;; cluster s2 [ score:fs = -33.354874450638064 ] [ score:ft = -33.46618707052516 ] [ score:ms = -32.70702429201772 ] [ score:mt = -33.042146088874844 ] seq06 1 832 495 m s u s2 seq06 1 1742 569 m s u s2 how can extract times file? in line seq06 1 2960 278 f s u s0 you have field 1: 19981217_0700_0800_inter_fm_dga = show name field 2: 1 channel number field 3: 1 start of segment (in features) field 4: 317 length of segment (in features)...

machine learning - Features (Attributes) ranking -

i have dataset items , features (attributes). each item has features. total number of features ~400 feature. i want rank features based on importance. not looking classification, looking features ranking. i convert item-feature binary matrix fowllowing, 1 means feature exists in item , 0 otherwise. itemid | feature1 | feature2 | feature3 | feature4 .... 1 | 0 | 1 | 1 | 0 2 | 1 | 0 | 0 | 1 3 | 1 | 1 | 1 | 0 4 | 0 | 0 | 1 | 1 an example of real data hotels, features like: air condition, free wifi, etc. hotelid | air condition| free wifi .... 1 | 0 | 1 2 | 1 | 0 3 | 1 | 1 4 | 0 | 0 ..... i need know use , how use it. a sample code appreciated it looks looking algorithm such information gain . taken documentation of class: evaluates worth of attribute meas...

javascript - CSS media query correction -

i have structured breakpoints this, need 1024 break point. max-width 1199 getting conflict can 1 please me out this. // break-point // ------------------------------ /* landscape phones , portrait tablets */ @mixin bp-xsmall-only { @media screen , (max-width: 480px) { @content; } } @mixin bp-small-and-below { @media screen , (max-width: 767px) { @content; } } /* portrait tablets , small desktops */ @mixin bp-medium-only { @media screen , (min-width: 768px) , (max-width: 991px) { @content; } } /* landscape tablets , medium desktops */ @mixin bp-large-only { @media screen , (min-width: 992px) , (max-width: 1199px) { @content; } } /* large desktops , laptops */ @mixin bp-large-and-above { @media screen , (min-width: 992px) { @content; } } @mixin bp-xlarge-only { @media screen , (min-width: 1200px) { @content; } }

javascript - How to create individual IDs in a PHP loop -

i have developed php loop creates register form everyday each user in database. each form has 1 div contains variety of dropdowns , placed directly on 1 shows has has been submitted day. when 1 of dropdown boxes selected have used jquery make top div disappear , show answer on div below. if mistake made there reset button puts x database. i have created php query finds recent input each user every day (whether x or registered day). echoed div on top div (i use css hide it). what want have happen when loads page show people have been registered day. want having function hides top div who's string length >2. have tried multiple ways can't work. there way create unique id's , transfer these jquery? i have attached simplified version of code below shows have far. appreciated. i have tried using counter think have implemented wrong. can see how fix can call unique ids? here script have tried. <script> $(document).ready(function() { if ($("#needed<?...

html - Flexbox target wrapped items -

i target flex items (random number of items) wrapped can remove borders last non-wrapped item in each row or first wrapped item in each row. use css pseudo-selector such made "last-flexitem-in-row" right border in case not appear. know can use js seems suboptimal , heavy-handed have way. imagine container width shrinks during browser resize, amount of calculation crazy. any ideas? .flexcontainer { display: flex; flex-wrap: wrap; } .flexcontainer li { border-right: 3px solid #c00; list-style: none; flex: 0 0 100px; padding: 10px; } .flexcontainer li:last-item-in-row { border-right: none; } <ul class="flexcontainer"> <li>item one</li> <li>item two</li> <li>item three</li> <li>item four</li> <li>item five</li> <li>item six</li> <li>item seven</li> <li>item eight</li> <li>item nine</li> ...

php - How to pass csrf token in laravel 5.4 version for jqgrid? -

trying pass csrf token ace admin jqgrid template. jquery(grid_selector).jqgrid({ data: grid_data, datatype: "local", height: 250, colnames:[' ', 'id', 'name', 'email'], colmodel:[ {name:'myac', index:'', width:80, fixed:true, sortable:false, resize:false, formatter:'actions', formatoptions:{ keys:true, deloptions:{recreateform: true, beforeshowform:beforedeletecallback}, editformbutton:true, editoptions:{recreateform: true, beforeshowform:beforeeditcallback, beforesubmitcell: beforesubmitcell} } }, {name:'id',index:'id', width:60, sorttype:"int", editable: true}, {name:'name',index:'name', width:150,editable: true, editoptions:{siz...

performance - base case and time complexity in recursive algorithms -

i clarification regarding o(n) functions. using sicp . consider factorial function in book generates recursive process in pseudocode: function factorial1(n) { if (n == 1) { return 1; } return n*factorial1(n-1); } i have no idea how measure number of steps. is, don't know how "step" defined, used statement book define step: thus, can compute n ! computing (n-1)! , multiplying result n. i thought mean step. concrete example, if trace (factorial 5), factorial(1) = 1 = 1 step (base case - constant time) factorial(2) = 2*factorial(1) = 2 steps factorial(3) = 3*factorial(2) = 3 steps factorial(4) = 4*factorial(3) = 4 steps factorial(5) = 5*factorial(4) = 5 steps i think indeed linear (number of steps proportional n). on other hand, here factorial function keep seeing has different base case. function factorial2(n) { if (n == 0) { return 1; } return n*factorial2(n-1); } this same first one, except comput...

JQuery JTable fill table with records from ajax call -

i fill jtable records ajax call. records in json format, this: { "result":"ok", "records":[ {"personid":1,"name":"benjamin button","age":17,"recorddate":"\/date(1320259705710)\/"}, {"personid":2,"name":"douglas adams","age":42,"recorddate":"\/date(1320259705710)\/"}, {"personid":3,"name":"isaac asimov","age":26,"recorddate":"\/date(1320259705710)\/"}, {"personid":4,"name":"thomas more","age":65,"recorddate":"\/date(1320259705710)\/"} ] } function makes call: $("#btnsearchoffer").click(function () { $.ajax({ method: 'post', url: '/salesofferinvoicedeliverynote/searchoffers/', data: { corac_num: $("#inputorac_num").val(), ...

python - Find Indexes of a List of DataFrame that have NaN Values - Pandas -

i have list of data frames in data frames have nan values. far can identify nan values single data frame using link . how can find index of list data frame has nan values. sample list of dffs , [ var1 var1 14.171250 13.593813 13.578317 13.595329 10.301850 13.580139 9.930217 nan 6.192517 13.561943 nan 13.565149 6.197983 13.572509, var1 var2 2.456183 5.907528 5.052017 5.955731 5.960000 5.972480 8.039317 5.984608 7.559217 5.985348 6.933633 5.979438, var1 var1 14.171250 23.593813 23.578317 23.595329 56.301850 23.580139 90.930217 22.365676 89.192517 33.561943 86.23654 53.565149 nan 13.572509, ...] i need results in list indexes 0 , 2 have nan values. so far tried this, df_with_nan = [] df in dffs: df_with_nan.append(df.columns[df.isnull().any()]) per above for loop column names, var1 , var2 . however, need indexes of data frames when loop through it. or suggestion grea...

c# - Run NUnit test fixture programmatically -

i want perform quick test, , code in linqpad. so have main() entry point. can make nunit "run" fixture programmatically there? using nunit.framework; public class runner { public static void main() { //what do here? } [testfixture] public class foo { [test] public void testsomething() { // test } } } you can use nunitlite runner : using nunit.framework; using nunitlite; public class runner { public static int main(string[] args) { return new autorun(assembly.getexecutingassembly()) .execute(new string[] {"/test:runner.foo.testsomething"}); } [testfixture] public class foo { [test] public void testsomething() { // test } } } here "/run:runner.foo" specifies text fixture. mind have reference nunitlite.dll package well.

jquery - JavaScript move character. Change image on clicking right arrow -

hi i'm making rpg game. want move character arrows. working right now. want change image when clicking let's right arrow. right when click right arrow code: function rightarrowpressed() { var element = document.getelementbyid("image1").src = "/img/run_1.png"; element = document.getelementbyid("image1"); element.style.left = parseint(element.style.left) + 5 + 'px'; } the image change's run_1.png ant stays that. image slides in 1 pose. how change image again when click right arrow ? html <img id="image1" src="{{auth::user()->char_image}}" style="position:absolute;left:0; top:0;height: 45px; image-rendering: -webkit-optimize-contrast;"> you can use counter variable: var counter = 0; function rightarrowpressed() { counter = (counter === 4) ? 1 : counter+1; var image = "/img/run_"+counter+".png"; var element = document.getelementbyid(...

WPF C# Checkbox controlling a timer -

i'm stuck here. have checkbox. when checked, start timer. when unchecked stop timer. can use here. have tried checked, unchecked, , click events. nothing stopping timer. keeps running... xaml: (has 3 events show) <checkbox x:name="cbautorefresh" grid.row="1" cliptobounds="true" horizontalalignment="left" content="enable auto refresh" margin="10,0,0,0" width="150" click="cbautorefresh_click" checked="cbautorefresh_checked" unchecked="cbautorefresh_unchecked" /> c#: (all 3 attempts) private void cbautorefresh_click(object sender, routedeventargs e) { var atimer = new timer(); if (cbautorefresh.ischecked == true) { //start timer: atimer.elapsed += ontimedevent; atimer.interval = 60000; atimer.enabled = true; } else { atimer.enabled = false; } } private void cbautorefresh_checked(object sender, route...

javascript - Delete multiple Inputs on click with JS -

Image
i paginated project (endless, without click) , when next page loaded, input select2 input field in modal getting replicated. after bit of scrolling have couple duplicates. so tried delete duplicates like: $(".modalopen").click(function(){ $('.thelangu1:eq(0)').next("span").remove(); $('.thelangu1').children().find(...).remove(); $('.thelangu1:eq(1)').remove(); ... }) but nothing worked. code looks in console: so first 1 needs stay alive rest has removed. ( $('.thelangu1:eq(0)').remove(); remove except 1 deletes necessary 1 not help). another problem have multiple <input> , other select2 fields not done removing (i tried). needs in direction $(".thelangu1").children().find/next... any jquery expert here tell me how remove duplicates or inputs except first one? you can use not css psuedo-selector $('.thelangu1').parent() .find(".thelangu1:not('.thelangu1:fir...

c# - Cannot Implicity convert type of an object to an system.collection.generic.IEnumerable -

error cs0266 cannot implicitly convert type 'vidly.models.hotelinformation' 'system.collections.generic.ienumerable<vidly.models.hotelinformation>'. explicit conversion exists (are missing cast?) i receiving error when running application. have written hotel = new hotelinformation() (where receiving error) in view model writing public ienumerable<hotelinformation> hotel { get; set; } i've looked @ other solutions, didn't seem work. your property of type ienumerable<hotelinformation> . trying set value of type hotelinformation . error states, types different. if want set property list, create new list. like: hotel = new list<hotelinformation>(); conversely, if want set single instance of hotelinformation make property type: public hotelinformation hotel { get; set; } which solution should use , want property be. (though name implies should single instance.)

database - Asking for email checking in php for registration -

this question has answer here: check if row exists mysql 3 answers im working on php project while registration of users want user should not add same email exist in database while registring, i hope question clear , feel free ask if confuse question too. you should select users email emails equal entered email! this: $query = "select email users email='$_post[email]' limit 1"; $result = $mydb->query($query)->fetchall(); //to understand line search pdo in php if($result[0]['email'] != '') //email exist

c# - Dynamically created panels not responding to CSS for alignment -

i working on website act blog. issue comments section , deals alignment of child comment panels. try add css float panels right, stay on left. have tried setting horizontalalign of parent panels right. for more context, image of comments section: as can see, child comments panels sticking left. this method dynamically creating comments section exiting panel called panel1. protected void drawcomments(string id, int numtabs, panel parentpanel) { string hash = id; sqlconnection conn = new sqlconnection(secret stuff); string cmdstr = "select * comments parentid=@searchhash"; sqlcommand cmd = new sqlcommand(cmdstr, conn); cmd.parameters.add("@searchhash", sqldbtype.nvarchar).value = hash; try { conn.open(); sqldatareader reader = cmd.executereader(); panel temppanel; if (reader.hasrows) { while (reader.read()) ...