Posts

Showing posts from January, 2010

spring mvc - Why do I get java.net.SocketException: Connection reset when deploying app? -

i trying deploy web application on machine. doesn't app. , when attempted, got - java.net.socketexception: connection reset: warning *********** netbeans http monitor ************ request cannot recorded because netbeans http monitor module disabled. monitorfilter::warning: monitor filter must first filter in chain. notifyutil::java.net.socketexception: connection reset @ java.net.socketinputstream.read(socketinputstream.java:209) @ java.net.socketinputstream.read(socketinputstream.java:141) @ java.io.bufferedinputstream.fill(bufferedinputstream.java:246) @ java.io.bufferedinputstream.read1(bufferedinputstream.java:286) @ java.io.bufferedinputstream.read(bufferedinputstream.java:345) @ java.io.filterinputstream.read(filterinputstream.java:133) @ sun.net.www.protocol.http.httpurlconnection$httpinputstream.read(httpurlconnection.java:3335) @ sun.nio.cs.streamdecoder.readbytes(streamdecoder.java:284) @ sun.nio.cs.streamdecoder.implread(streamdecoder.java:326) @ sun.nio.cs.stream

In JavaScript, what are the differences between "recursion", "a non-terminating procedure that happens to refer to itself", and "repeated scheduling"? -

this question intended canonical question/answer disambiguation descriptive term "recursion", or "recursive". , extent applicable, "a non-terminating procedure happens refer itself" , "repeated scheduling". in javascript definitions of , differences between "recursion"; "a non-terminating procedure happens refer itself"; , "repeated scheduling" i see term "recursion" used when function repeated calls itself, though unambiguous definition of "recursion" in javascript ? rarely have viewed terms "a non-terminating procedure happens refer itself" or "repeated scheduling" used when describing pattern of function; "recursive" or "recursion" used describe pattern within body of function call, function call made original function began process. in javascript , when "recursion" not applicable particular function pattern; , unambiguous d

image processing - ImageMagick - alpha channel extract, different results (darker) on 6.7 vs 6.9 -

Image
i'm working in cross-platform environment results of same, simple alpha channel extraction operation different between imagemagick 6.7.7-10 , imagemagick 6.9.3-7. the command extract alpha channel is: convert image.png -alpha extract alpha.png or equivalently: convert image.png -channel -separate alpha.png here original, 6.7 output, , 6.9 output: testing original in gimp, in middle of top dark bar, can see original alpha value 80% or 204: the 6.9 output has grayscale value of 204, while 6.7 output has grayscale value of 154. now question: believe 6.9 version correct, visual result provided 6.7 version. can understand how 6.7 version working (maybe different formula / luminence / color space?) , same result 6.9 version? maybe apply curve 6.9 output? or switch make use different formula / color space? (do color spaces apply pngs?) post processing 6.9 output simple gamma adjustment gives close approximation of 6.7 output: convert /tmp/alpha_channel_6.

typescript - Angular 2 select or deselect checkboxes on condition -

please, note want avoid jquery , use angular 2. being said, here plunk i have custom checkboxes, more 1 can selected. storing selected items in array this: eventchkarr: = []; updatechecked(value: any, event: any) { if (event.target.checked) { this.eventchkarr.push(value); } else if (!event.target.checked) { let index = this.eventchkarr.indexof(value); this.eventchkarr.splice(index, 1); } } when user selects more 1 check box, modal pops (this modal not popping in plunk reason) , ask if want select multiple checkboxes. now, trying if user clicks on no button last clicked button before modal popup remain checked , on user's further clicking 1 checkbox selected @ time. if click on "yes" multiple checkboxes can selected. but, how achieve that, help? tia. https://plnkr.co/edit/yu4p3zsq3qah9vby8m3i?p=preview you can save checked value of each checkbox in 'eventtypechkbox' ar

wordpress - How can i embed videos from websites with no embed option? -

i looking embed videos websites not offer oembed support. here example emdeb support : openload.co/f/mi7ehbgpov

c# - Reply with "Is Typing" message in Microsoft botframework -

Image
i developing chatbot using microfsoftbotframework on c#.net , luis cognitive services. i want when user type should reply typing or bot typing.. public async task<httpresponsemessage> post([frombody]activity activity) { trace.traceinformation($"type={activity.type} text={activity.text}"); if (activity.type == activitytypes.message) { //await microsoft.bot.builder.dialogs.conversation.sendasync(activity, () => new contactonedialog()); //implementation of typing indication connectorclient connector = new connectorclient(new system.uri(activity.serviceurl)); activity istypingreply = activity.createreply("shuttlebot typing..."); istypingreply.type = activitytypes.typing; await connector.conversations.replytoactivityasync(istypingreply); await conversati

Should a wrong parameter passed via REST call throw an error? -

i accessing rest calls, when passed wrong parameter request not throw http error. should design changed throw http error or wrong parameter can passed rest call. example 1:(parameters optional) https://example.com/api/fruits?fruit=apple give list of apple elements example 2: https://example.com/api/fruits?abc=asb give list of fruits my question related example 2, should example 2 throw error or behaving properly? it's pretty common ignore parameters aren't expecting. think example 2 behaving should. i know depending on browser append variable timestamp make sure rest call wouldn't cached. like: https://example.com/api/fruits?ihateie=2342342342 if you're not explicitly doing parameter can't see harm in allowing it.

python - Automatic selection of file handler depending on file extension -

this how see it: class basehandler: def open(self): pass def close(self): pass class txthandler(basehandler): def open(self): pass def close(self): pass class xmlhandler(basehandler): def open(self): pass def close(self): pass def open_file(file_path): handler = basehandler(file_path) for example, if file_path '..\file.xml' must return xmlhandler. please tell me, need implement functionality? i know can implement via if-elif-else statement, i'm trying avoid dozen elif. this preferred pythonic way: import os handlers = {'.xml': xmlhandler, '.txt': txthandler} def open_file(file_path): ext = os.path.splitext(file_path)[1] handler = handlers.get(ext, basehandler) in above code associate handlers extensions using dictionary. in open_file function extract extension , use handler dictionary, considering case key doesn't exist. i so: if ext in handlers: handler = handlers[ext] else: h

java - My main class doesn't seem to add a object -

i'm kind of new-ish java. i'm trying add footer jpanel swing app. i'm doing having jpanel footer in separate class. this footerbar-class has jpanel properties in it: public class footerbar extends jpanel { private jpanel footerpanel = new jpanel(); private jlabel label; public footerbar() { // footer test footerpanel.setpreferredsize(new dimension(640, 16)); footerpanel.setlayout(new boxlayout(footerpanel, boxlayout.x_axis)); footerpanel.setborder(new bevelborder(bevelborder.lowered)); jlabel label; label = new jlabel("test"); label.sethorizontalalignment(swingconstants.left); footerpanel.add(label); label = new jlabel("test 2"); label.sethorizontalalignment(swingconstants.center); footerpanel.add(label); } } and have in main class. (called mainframe) public class mainframe extends jframe { private textpanel textpanel = new te

css - Linear background image doesnt work properly on safari -

i have following code: body{ background:red; } div{ width:100%; height:100%; background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(255, 255, 255, 1)), to(rgba(0, 0, 0, 0))); background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: -o-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-image: linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)); background-repeat: repeat-x; } and html: <div> test </div> as can see here, displayed differently between chrome , safari: http://codepen.io/anon/pen/apwogj why happening? check out, goes white, white 0 transparency. seems work same on chrome , safari me. div{ width:100%; height:100%; backgroun

function - Taking a slice out of a string incorrectly C++ -

i attempting write function outputs string of 5 characters string of concatenated primes 1000 characters long starting @ point (n) user specifies. have gotten program compile seem running errors in program , have not yet been taught of tools me see issue in programming. believe issue in getting , displaying slice itself, not concatenated string...but again, may be/probably wrong. advice appreciated. -aspiring computer crim. major #include<iostream> #include<string> std::string get_concatenated_primes() { unsigned int base, test, cap=1000, prime=0; std::string plist; (base=0; base < cap; ++base) { (test=2; test < base; ++test) { if (base % test == 0) break; else { prime=1; } } if (prime == 1 && plist.length() < 1000) {

What is the Colorpicker Field available for ExtJS6? -

i trying find color picker field use in form it's hard find 1 extjs 6. found https://github.com/sw4/ext.ux.colorpicker don't know how bind form. actually there colorfield component included in extjs 6. note this component resides in package . in order use it, need specify "ext-ux-colorpick" package name, in app.json , in require config, additional packages specified.

java - jOOQ code generation with postgresql does not generate anything -

when run jooq code generation against database, says there 0 tables, , generates no code. first, let's see schemas in database. if log in using same credentials giving jooq, same database, , run \dn (as per https://dba.stackexchange.com/a/40054/115875 ) output: list of schemas name | owner --------+---------- public | postgres (1 row) and running \dt , tables: list of relations schema | name | type | owner --------+------+-------+------- public | user | table | me06 (1 row) just 1 user table , in 1 schema, 'public'. next, here jooq configuration: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.9.0.xsd"> <jdbc> <driver>org.postgresql.driver</driver> <url>jdbc:postgresql://localhost:5432/webapi</url> <user>webapi</user> <password>password</password> </jdbc>

Create shadows for a layout in Android Studio -

layout shadow i create same shadow , layout shown in above figure tried http://inloop.github.io/shadow4android/ not able clear 9 patch lines on top , left side of image using material design, can done elegantly using elevation: <textview android:id="@+id/myview" ... android:elevation="2dp" android:background="@drawable/myrect" /> https://developer.android.com/training/material/shadows-clipping.html

Passing attribute to custom element in Polymer as a function -

i'm trying simple in polymer. i'm trying pass attribute using function. <dom-module id="my-fixtures"> <template> <fixtures-list fromdate="[[_requiredday(24)]]"></fixtures-list> </template> <script> polymer({ : 'my-fixtures', properties: { fromdate: string }, _requiredday: function (offset) { // 1 day before var d = new date(new date().gettime() - parseint(offset) * 60 * 60 * 1000); var n = d.tojson(); return n; } }); </script> </dom-module> but it' not working. if change function static srting value works. help? thanks the fromdate property should on fixtures-list not on my-fixtures https://jsbin.com/jucevujeyo/edit?html,console,output

android - AutoCompleteTextView with keyboard done button and maxLines -

i trying implement autocompletetextview multiline text , keyboard done button. done button not show on keyboard (shows enter button). same thing have tried android:singleline="true" , text comes in single line done button. <autocompletetextview android:id="@+id/txtvillagename" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/edt_border" android:cursorvisible="true" android:maxlines="4" android:hint="enter location" android:imeoptions="actiondone" android:textcolor="@color/text_color" android:textcolorhint="@color/lblcolor" android:textsize="@dimen/te

php - Two buttons in one line -

how can put buttons in 1 line? <form method="post"> <button type="submit" name="render_button" class='btn btn-block btn-primary' style="width:100px;height:30px;" > render </button> <button type="submit" name="check" class='btn btn-block btn-primary' style="width:100px;height:30px;" > render2 </button> </form> if uses bootstrap, i'm guessing btn btn-primary tags, add display: inline-block; each style tag: note: may have 0 out margin-top on second button, i'll add well. <form method="post"> <button type="submit" name="render_button" class='btn btn-block btn-primary' style="width:100px;height:30px;display:inline-block;" > render </button> <button type="submit" name="check" class='btn btn-block btn-primary' style="

embedded - Getting error while running blink example of CC3200 in Energia IDE -

error: msp430: error initializing emulator: no usb fet found failed: msp430: error initializing emulator: no usb fet found error: msp430: error initializing emulator: no usb fet found i'm using code composer 7, can same error. message indicates tool looking msp430 board connect to, allthough have cc3200 board connected. in ccs achieve opening target window , importing cc3200.ccxml file (right click , set default). in energia, you'll have set target well. default cc3200 isn't provided, go board management: board management , scroll down. there you'll find topic cc3200 boards. click , install button appear: install cc3200 target after installation, board should appear in target list , should able select it:

html - Save web page as pdf with vba -

i having trouble saving web page pdf format. have pdf creator. printing on paper works, pdfcreator default printer doesn't save pdf. here have until : dim wshnetwork object set wshnetwork = createobject("wscript.network") wshnetwork.setdefaultprinter "pdfcreator" ie.execwb 6, 2 'olecmdid_print, olecmdexecopt_dontpromptuser call pdfprint("c:\" & "filename" & ".pdf") and : sub pdfprint(strpdfpath string) 'prints web page pdf file using adobe professional. 'api functions used specify necessary windows while 'a wmi function used check printer's status. 'by christos samaras 'http://www.myengineeringworld.net dim ret long dim childret long dim childret2 long dim childret3 long dim comboret long dim editret long dim childsavebutton long dim pdfret l

jquery - HTML required validation retriggers on form submit -

i have form 4 inputs, of have required attribute. form reset on submit 'submit form': function(event){ ... $("#addorupdateform").trigger("reset"); } this seemingly works encountered unusual behaviour in use case: the submit button clicked without entering values as result validation triggered , doesn't allow submission values entered , form submitted immediately after submission, validation triggered , fields highlighted in red why validation triggering after submission, without attempting submit blank values?

rust - Matching on a Box -

this code shown in the rust programming language : #![feature(box_syntax, box_patterns)] fn main() { let b = some(box 5); match b { some(box n) if n < 0 => { println!("box contains negative number {}", n); } some(box n) if n >= 0 => { println!("box contains non-negative number {}", n); } none => { println!("no box"); } _ => unreachable!(), } } but when run it, following error occurs: error[e0554]: #[feature] may not used on stable release channel i tried fn main() { let b = some(box 5); } error: box expression syntax experimental; is because version of rust not latest? how can content in box::new() ? tried fn main() { let b = some(box::new(5)); match b { some(box::new(y)) => print!("{:?}", y), _ => print!("{:?}", 1), } } error[e0164]: `box::new` not name

css - Styling md-no-float placeholders -

normally, doing takes care of placeholder styling: md-input-container[md-no-float]> input::-webkit-placeholder { color: #eee; } well...not in angular material, i'm assuming? know how around this? have input field html <md-input-container class="form-group search" md-no-float> <input type="text" placeholder="enter keyword..."> <span class="ti-icon ti-search"></span> </md-input-container> the text in naturally black default website dark. need placeholder white. thanks you close. it's ::webkit-input-placeholder , not ::-webkit-placeholder . cross browser: md-input-container[md-no-float] ::-webkit-input-placeholder {color: #eee} md-input-container[md-no-float] :-moz-placeholder {color: #eee} md-input-container[md-no-float] ::-moz-placeholder {color: #eee} md-input-container[md-no-float] :-ms-input-placeholder {color: #eee}

Find all substrings in a string using recursion Python 3 -

how make list of possible substrings in string using recursion? (no loops) know can recurse using s[1:] cut off first position , s[:-1] cut off last position. far have come this: def lst_substrings(s): lst = [] if s == "": return lst else: lst.append(s) return lst_substrings(s[1:]) but make list of substrings sliced first position if worked fun problem, here's solution - feedback appreciated. output in [73]: lstsubstrings("hey") out[73]: ['', 'y', 'h', 'hey', 'he', 'e', 'ey'] solution def lstsubstrings(s): # base case: when s empty return empty string if(len(s) 0): return [s] substrs = [] # string substring of - definition of subset in math substrs.append(s) # extend list of substrings substrings first # character cut out substrs.extend(lstsubstrings(s[1:])) # extend list of substrings substrings last # character cut

folly - Proxygen http client using a connection pool (keep-alive) -

i writing proxygen server needs make http request other service. have connection pool other service (using keep-alive), , whenever need make request service, peak 1 of connections , issue request. then, after request finished, return connection pool can reused. read curl client in examples of proxygen project, makes 1 request , close connection. can give me insights on how make http client handles connection pool using proxygen/folly ? proxygen/folly have way of handling connection pools ? in case can read ? thanks in advance

c# - Open File Dialogue for FTP location -

i have issue open file dialogue when user browse ftp location. path openfiledialogue local path (local setting temp folder) instead of actual ftp path selected. how actual ftp path. what version of windows running/testing on? there's feature of windows 7 (not sure if it's in vista well, or perhaps xp) if specify web location (be http or ftp), windows downloads file location , passes path of downloaded file, hence temp folder, application. far can tell openfiledialog documentation on msdn there's no way disable behaviour. you'll have either roll own implementation, or see if there's pinvoke method can use persuade not exhibit behaviour.

virtualenv - create an env that points to a specific python installation -

i have python installation several packages linked access calling python2.7 . create virtual env can type python , access particular installation without reinstalling associated it. how accomplish (virtual env, symlink, etc...) without changing default env? virtualenv allows specify python executable want use --python (or -p ) option, e.g.: virtualenv --python=/usr/bin/python2.7 path/to/env you can use --system-site-packages include packages installed globally.

Android Manifest merger error -

i keep on getting manifest merger error. gradle dependency shown in image attached . error:execution failed task ':app:processdebugmanifest'. > manifest merger failed : attribute meta-data#android.support.version@value value=(25.3.1) [com.android.support:customtabs:25.3.1] androidmanifest.xml:24:9-31 present @ [com.android.support:design:26.0.0-alpha1] androidmanifest.xml:27:9-38 value=(26.0.0-alpha1). suggestion: add 'tools:replace="android:value"' <meta-data> element @ androidmanifest.xml:22:5-24:34 override. it's either find library using different support library version or use resolution strategy , add @ end of app module build.gradle: configurations.all { resolutionstrategy.eachdependency { dependencyresolvedetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startswith("multidex")) { d

c# - Fake it easy with actions - Says it can't find call but shows it in list -

Image
i'm using fake easy : var callbackaction = a.fake<action<object>>(); //act token.registerchangecallback(callbackaction, "hi"); //assert a.callto(() => callbackaction.invoke(a<object>.ignored)).musthavehappened(); and i'm getting error fakeiteasy.expectationexception : assertion failed following call: system.action`1[system.object].invoke(obj: <ignored>) expected find once found #0 times among calls: 1: system.action`1[system.object].invoke(obj: "hi) this seems odd me. understand if had found none or if overriding equals() odd has found call , i'm using ignored not matching them up. using actions? this due fact thread spawned waits condition , action called in thread. while in test condition true , thread returns after starting still doesn't call action in time assert. assume after collects calls have happened object error message , @ point thread has returned , call has happ

html - Bootstrap table with no padding/margin? -

Image
i have table: <table class="table table-bordered table-condensed col-md-12"> <thead> <tr> <td>input</td> </tr> </thead <tbody> <tr> <td><input type="text" /></td> </tr> </tbody> </table> i use bootstrap framework , looks this: how can stretch input width & height fit table cell? i'm using css on input: width: 100% i've tried css on td: padding: 0; margin: 0; as @araz comment: tr td{ padding: 0 !important; margin: 0 !important; }

login intercepter do not work in spring -

all. using spring4 in project. , add , interceptor extends handlerinterceptoradapter, overwrite prehandle method. found not work when doing spring mock test. have configure in springmvc-servlet.xml , this: <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**"/> <bean class="com.suerpay.common.interceptor.logininterceptor"/> </mvc:interceptor> </mvc:interceptors> and here code of logininteceptor: public class logininterceptor extends handlerinterceptoradapter { @autowired loginserviceredis loginserviceredis; @autowired userservicedb userservicedb; logger logger = loggerfactory.getlogger(getclass()); public boolean prehandle(httpservletrequest request, httpservletresponse response, object handler) { logger.info("start login interceptor"); if (isloginrequired(handler)) { string ticket = request.getheader(globalconstants.ticket_header); if (stringutils.ise

java - CompletableFuture#whenComplete not called if thenApply is used -

i have following code (resulting my previous question ) schedules task on remote server, , polls completion using scheduledexecutorservice#scheduleatfixedrate . once task complete, downloads result. want return future caller can decide when , how long block, , give them option cancel task. my problem if client cancels future returned download method, whencomplete block doesn't execute. if remove thenapply does. it's obvious i'm misunderstanding future composition... should change? public future<object> download(something something) { string jobid = schedule(something); completablefuture<string> job = pollforcompletion(jobid); return job.thenapply(this::downloadresult); } private completablefuture<string> pollforcompletion(string jobid) { scheduledexecutorservice executor = executors.newsinglethreadscheduledexecutor(); completablefuture<string> completionfuture = new completablefuture<>(); scheduledfuture&

Connect two serial port into one serial port -

Image
i want connect 2 serial port 1 serial port. suppose there 3 system a,b , c. a,b , c connected each other using serial communication (rs232 port) star connection. so, here situation. when system c send data system , system b, send both system. when system or system b send data not received system c. so want know how communicate serial port device other serial port device (multiple device). this cannot work. have connect 2 tx lines 1 rx line, rs-232 (unlike e.g. ethernet) not shared-medium protocol , cannot detect tx collisions (when 2 devices try talk @ same time). you need implement device in middle forwards receives other devices. then, have know protocol other devices speaking prevent interrupted messages (e.g. stopping @ newline characters).

Android - Last position in seekbar is difficult to reach -

i have seekbar 4 positions, first 3 works well, reach last position have move finger outside seekbar. i'll try put example: 1 2 3 4 ↓ ↓ ↓ ↓ -------------------- | seekbar | -------------------- ↑ ↑ ↑ ↑ 1 2 3 4 the arrows above steps set, arrows below zone have put finger set arrow in position, first 3 positions works zones near them, last must @ position or after (i can't touch after that, because there no screen left). this seekbar java file import android.app.activity; import android.content.context; import android.content.contextwrapper; import android.graphics.lineargradient; import android.graphics.shader; import android.graphics.drawable.shapedrawable; import android.graphics.drawable.shapes.roundrectshape; import android.util.attributeset; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.imageview; import android.wid

node.js - How to update a whole record in sequelize (not just single field) -

i know how update particular field in sequalize project.update( { title: 'a new value' }, { where: {id: 1} }) .success(function () { }) .error(function () { } ); however, update whole row of values/fields. { "field1":"foo", "field2":"bar", "field3":"bar2" } the documentation on website not clear : http://docs.sequelizejs.com/en/latest/api/model/ just pass object new data first parameter update function project.update( { title: 'a new value', field1: "foo", field2: "bar" }, { where: {id: 1} })

html - Using Custom Javascript Date Variable with IMG SRC Element -

i trying use custom javascript date variable in img src elements on website having trouble it, code not recognizing utcdate variable.. have decided use moment.js me achieve generating current date (in utc format). purpose of drive (and display) images in gallery live in directory named today's date in yyyymmdd format. html code: <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment.js"></script> <script type="text/javascript"> $(document).ready(function() { // set element $("#date").val( moment().format('yyyymmdd') ); // set variable var utcdate = moment().format('yyyymmdd'); }); </script> <div class="gallery" align="center"> <h1>title goes here</h1> <br /> <div class="thumbnails"> <img onmouseover="preview.src=img1.src" name="img1" src="http://some

html - Bootstrap grid, padding issue causing background to overflow -

situation using boostrap v4, , when add background colour div , element appears become unaligned other elements in columns. have applied box-sizing: border-box yet isn't staying within container. never had issue before. aim to keep element within column html <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/css/bootstrap.min.css"> <section class="container padding-bottom--md"> <div class="row"> <div class="col-md-6 bg--orange text-md-center padding-bottom--md padding-top--md"> <h5 class="text-uppercase txt--white">lorem ipsum</h5> <p class="txt--white no-margin-bottom">a load of pish posh text</p> </div> <div class="col-md-6 bg--orange text-md-center padding-bottom--md padding-top--md"> <

c# - How To add JavaScript function for a user control in ASP.net that can be called using control ID -

i want create simple user control supports own javascript functions called using control id , example if have following control : <%@ control language="c#" autoeventwireup="true" codebehind="mycontrol.ascx.cs" inherits="controls.mycontrol" %> <script type="text/javascript"> function controlclicked(id) { alert('hello control:'+id); } </script> i want able following on page contains user control <%@ page title="" language="c#" masterpagefile="~/light.master" autoeventwireup="true" codebehind="main.aspx.cs" inherits="control.main" %> <%@ register src="~/controls.mycontrol.ascx" tagprefix="uc1" tagname="mycontrol" %> <script type="text/javascript"> function btnclicked() { mycontrol.controlclicked('mycontrol'); } </scri

javascript - I am building a survey application using bootstrap,in that i have two image buttons thumbs up(likeq1()) and thumbs down(unlikeq1()) button -

i building survey application using bootstrap,in have 2 image buttons thumbs , thumbs down on page , when click thumbs button should selected , when click on thumbs down button should select button deselect thumbs button.and want validate user must select button without selecting should not process or navigate other page. my code button : <div class="row"> <div class="col-md-10" align="left"> <h5> products solve real world problems.</h5> </div> <div class="col-md-1"> <h4><button type="button" class="btn-link" value="0" id="like1" onclick="likeq1()" > <span class="fa fa-thumbs-up" ></span> </button></h4> </div> <div class="col-md-1"> <h4> <button type="button" class="btn-link" value="0" id=&q

sql - How to catch null vales and display comment -

i have bascic query: select col1, nvl(col1,to_number(null)) table1 colx = :new update baiscly, during upload i'm checking if :new inside table1.colx . if yes, want display col1 , if not null value (i can't put zero). nvl(col1,to_number(null)) return blank. can change this: nvl(col1,0).

angular - setDefaultViewContainerRef' does not exist on type MdlSnackbarService -

i'm new in angular. want use snackbar angular material design lite in project. generated project angular-cli , added mdlmodule mgmodule imports. copy code doc , error: property 'setdefaultviewcontainerref' not exist on type 'mdlsnackbarservice'. this bug in docu (will fixed soon). please refer page instructions: https://github.com/mseemann/angular2-mdl/wiki/how-to-use-the-mdldialogservice you need setup step in root app component: constructor( private dilalogouletservice: mdldialogoutletservice, private viewconatinerref: viewcontainerref) { this.dilalogouletservice.setdefaultviewcontainerref(this.viewconatinerref); }

Use inside Python code that has been written on IronPython -

i wrote on ironpython code, compile dll try use python ctypes. # mydll.py code on ironpython class pa(object): def convert(self): # code use c# dll # compile way # ipy.exe tools\scripts\pyc.py mydll.py /out:mydll /target:dll /standalone # python interpreter # try use c = ctypes.cdll.loadlibrary("c:\\mydll.dll") c.pa() # attributeerror: function 'pa' not found by way can use inside python code has been written on ironpython. possible convert python bite code? maybe wrote extension on cpython ?

jquery - How to change class active for a menu which is partial ASP.NET MVC -

i have partial view used views menu i import menue above of views line code @html.partial("_mainmenu") mainly want change class:"active" between views don't know how possible in structure. my problem want when user opens link in menu, first omit class:"active" of tags , add class active same link user opens. example when user in home-index tag has class active home text in menu has lighter color , when user example in contact_us view want contact text in menu has lighter color giving active class. appreciate help. thanks this partial menu view if needed , default home index <div id="mainnav" class=""> <nav class="navbar navbar-default" role="navigation"> <div id="topmenu" class="fixsaz"> </div> <div class="row"> <div class="navbar-header col-md-4 col-sm-6"> <a class=""

reactjs - Two different header components in React? -

just quick question. i'm creating react app needs have different rendition of header. on login page it's header logo (the form different component) , when user logged, header gets , menu , logout button. need 2 different headers/components or 1 conditional rendering? thanks. you create wrapper component: class loginheader extends react.component { render() { return <div>i'm login header!</div> } } class otherheader extends react.component { render() { return <div>i'm other header!</div> } } class header extends react.component { render() { return isloggedin() ? <otherheader /> : <loginheader /> } } code nicely separated way

php - How to create comma separated list from array and return as json enode array -

i trying create json comma delimited string.now code this $sql="select pri_name nri_privilege"; $getvalue=mysqli_query($mysqli,$sql); while($result=mysqli_fetch_assoc($getvalue)) { $getallresults[]=$result; } foreach($getallresults $rereult) { print_r($rereult); name =$rereult['pri_name']; name .=$name .','; //echo $name; //echo json_encode($name); } i fetching data database , loop inside foreach. how create json comma delimited string? based on title of post described. $array = ["foo", "bar", "bat"]; //some array form e.g. db $glued = implode(",", $array); //implode , $json = json_encode($glued); //and json encode what think want this: $array = ["foo", "bar", "bat"]; //some array form e.g. db $json = json_encode($array); //json encode array without step 2. guess want send json encoded array on wire somewhere else. in case

twitter bootstrap - aria-hidden on custom popup -

in bootstrap (i'm using v4), when open model, body scroll desactived. far understand, done aria-hidden="true" property. i have custom popup in application, , reproduce same behavior. prevent body scroll if popup open. there many ways know if possible using bootstrap features.

javascript - Selenium WebDriver using Java throwing error in IE -

public static string switchtopopupwindow() throws interruptedexception { string popupwindowhandle = null; try { // save current window handle future reference defaultwindow = driver.getwindowhandle(); // window handles 1 one (string windowhandle : driver.getwindowhandles()) { // save new window handle if (!windowhandle.equals(defaultwindow)) { popupwindowhandle = windowhandle; } } // switches pop-up window driver.switchto().window(popupwindowhandle); // maximize browser window driver.manage().window().maximize(); // log result application_logs.debug("switched pop-up window"); return "pass : switched pop-up window"; } catch (throwable switchtopopupwindowexception) { // log error application_logs.debug("error while switching pop window : " + switchtopopupwindowexce

How do I filter numbers which end in other numbers in Haskell? -

for instance, want extract list numbers end in 67: 1637767, 9967, 523467... compare them modulo 100: let result = filter ((== 67) . (`mod` 100)) numbers

api - Real-time acceleration processing in Jawbone devices -

i need device way process acceleration values @ least 3 times per second, best 16 times. processing can delayed collected history or online via bluetooth, data frequency required. processing performed @ host such iphone if jawbone not such vendor, tell me other. or available on smart watches?

Loading JSON data gives undefined object in Angular 2 - asynchronous? -

...component.ts: import { component } '@angular/core'; import { valgteskolerservice } '../valgteskoler.service'; import { datoservice } './datoer.service'; @component({ selector: 'kalender', providers: [datoservice], templateurl: 'app/kalendervisning/html/kalender.html' }) export class kalendercomponent { private valgteskoleruter: array<any> = []; public datoer: any[] = []; constructor(private valgteskolerservice: valgteskolerservice, private datoservice: datoservice) { this.datoservice .getdato() .subscribe(datoer => { this.datoer = datoer; }); } ngoninit() { this.valgteskolerservice.hentlagretdata(); this.valgteskoleruter = this.valgteskolerservice.deltevalgteskoleruter; } antallruter: number = 0; j: number = 0; ukeen(mnd: number, aar: number) :cell[] { var cells: array<cell> = []; this.antallruter = 0; (this.j

php - ( ! ) Parse error: syntax error, unexpected '<<' (T_SL) on line 6 -

( ! ) parse error: syntax error, unexpected '<<' (t_sl) on line 6 the error line 6 display block have removed spaces , closed it. code still wont run when removed ; whole code goes yellow. have code has same error , tried removing the(<<) nothing closed still same thing. time reads past when remove ;. whole code after line turns yellow <?php include 'ch19_include.php'; if (!$_post) { //haven't seen form, display $display_block = <<<end_of_block; <form method="post" action="$_server[php_self]">; <p><label for="subject">subject:</label><br/> <input type="text" id="subject" name="subject" size="40" /></p> <p><label for="message">mail body:</label><br/> <textarea id="message" name="message" cols="50" rows="10"> </textarea>

c++ - Get icon process from HWND, process name OR other process identifier -

i have process name , handle (hwnd) of window. i want relative icon (if available) . searching through msdn, found extracticon() handle icon given exe name, , geticoninfo() "information" of icon hicon . i don't know if it's right way this, , how retrieve correct information show (in second moment) icon without handle icon. i have send information process (through socket) has show icon. in iconinfo structure there hbitmap fields contains bitmap (black&white , colour). useful? you can use api getclasslong retrieve icon associated program use sendmessage api passing hwnd of of window want change it's icon. in example extracted icon application set calculator. windows calculator open before sending icon: case wm_lbuttondown: // explanation left clicking in client area , see result { hicon icon = (hicon)getclasslong(hwnd, gcl_hicon); hwnd hcons = findwindow(null, "calculator"); // opened windows calculator. can use other wind