Posts

Showing posts from August, 2010

runtime - Hi,I am using log4j in my system.Is there a tag which automatically recognises change of level,so that i dont require to start stop my server -

i using log4j.xml store logs. @ runtime need change level @ production, , want execute making changes in log4j.xml have used maxinterval not reflect once change log levels. i need find way change logger level @ runtime @ log4j.aml level. is possible?

amazon web services - Can't collectstatic in Travis CI using django -

in project make 2 parts 'development' 'production' in development staticfiles_storage = 'pipeline.storage.pipelinecachedstorage' in wef/settings/production staticfiles_storage = 'wef.storage.s3pipelinemanifeststorage' default_file_storage = 'storages.backends.s3boto.s3botostorage' aws_access_key_id = os.environ.get("aws_access_key_id") aws_secret_access_key = os.environ.get("aws_secret_access_key") aws_storage_bucket_name = os.environ.get("aws_storage_bucket_name") in local project when command python wef/manage.py collectstatic --noinput it's ok (it has no problem) development command staticfile saved local storage and when command python wef/manage.py collectstatic --settings=wef.settings.production it's ok too, staticfiles uploaded aws s3 storages(finished double check) so decide run unnit test in travis ci(testing static file load success) here .travis.yml in .travis.yml

RECYCLERVIEW SPACE BETWEEN ITEMS ON ANDROID APPLICATION -

i have project developing have come face problem large gap appearing between 2 items on android application ,i had tried on every previous suggestions here on how solve problem none has worked me here layout causes problems <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_gravity="center" android:gravity="center" android:layout_height="match_parent" android:orientation="horizontal"> <android.support.v7.widget.recyclerview android:id="@+id/prodct_list" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparenttop="false" android:scaletype="fitxy" android:padding="0dp" android:adjustviewbounds="true"/> <android.support.design.widget.floatingactionbutton android:id="@+id/actionbutton"

switchcompat - Getting crash while start the activity -

java.lang.nullpointerexception @ android.text.staticlayout.(staticlayout.java:59) @ android.support.v7.widget.switchcompat.makelayout(switchcompat.java:602) @ android.support.v7.widget.switchcompat.onmeasure(switchcompat.java:522) @ android.view.view.measure(view.java:16845) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:5374) @ android.widget.linearlayout.measurechildbeforelayout(linearlayout.java:1621)

dictionary - I am trying to read a .strings file in plist version. I have <key> and <string>. I am not sure how to read these inputs in my javascript code. -

i have javascript code type string , find expected in predictive cell , tap on it. simple , working fine. have given plist data not sure how read , use in code. here example of plist provided me: <plist version="1.0"> <dict> <key>animal</key> <string>cat | dog | chicken | cow</string> <key>fruits</key> <string>apple | cherries | kiwi</string> </dict> </plist> so first how read each section? understand when type cat, expected result animal according plist. question how following: i want read , assign value used later need read , assign in array example: var inputstringarray = ["cat","dog","chicken","cow"]; var expectedinput = "animal"; the "plist" format xml can parse plist other xml in javascript using domparser : // code goes here var pliststring = '<plist version="1.0"><

angular - Angular2 RC7 ng2-datetime Error- ($(...).datepicker is not a function) -

Image
i declare var , replace $ jquery. 1.i declare var jquery: any; 2. replace $ jquery; (error clear in ts) 3. configure in system.config.json , import in app.module 4. , have bootstrap-datepicker in node-module the error datetime input box didn't work , error show in console ($(...).datepicker not function). changed $ jquery in ts.please me. ng2-datetime.ts import { component, output, input, eventemitter, hostlistener, afterviewinit, ondestroy, simplechanges, onchanges } '@angular/core'; import { controlvalueaccessor, ngcontrol } '@angular/forms'; import { timepickerevent } './timepicker-event-interface'; declare var jquery: any; @component({ selector: 'datetime', template: ` <div class="form-inline"> <div id="{{iddatepicker}}" class="input-group date"> <input type="

amazon web services - AWS send bulk email error with message - "Domain contains dot-dot" -

i trying send large chunk emails , got error message "domain contains dot-dot". know why getting error? #0 /var/www/vhosts/domainame.com/vendor/aws/aws-sdk- php/src/aws/common/exception/namespaceexceptionfactory.php(76): aws\common\exception\namespaceexceptionfactory->createexception('aws\\ses\\excepti...', object(guzzle\http\message\entityenclosingrequest), object(guzzle\http\message\response), array) #1 /var/www/vhosts/domain.com/vendor/aws/aws-sdk-php/src/aws/common/exception/exceptionlistener.php(55): aws\common\exception\namespaceexceptionfactory->fromresponse(object(guzzle\http\message\entityenclosingrequest), object(guzzle\http\message\response)) #2 [internal function]: aws\common\exception\exceptionlistener->onrequesterror(object(guzzle\common\event), 'request.error', object(symfony\compone in /var/www/vhosts/domainname.com/vendor/guzzle/guzzle/src/guzzle/service/exception/commandtransferexception.php on line 25 php fatal error:

php - How to make a join query on Symfony with Doctrine? -

i'm kinda stuck on using querybuilder create join query. there table called "person" , table called "vacancy". if person linked vacancy person.id , vacancy.id saved in table called "candidacy". how persons linke vacancy.id 1? so have initiate appbundle:candidacy entity? $entity = $em ->getrepository('appbundle:person') ->createquerybuilder('p') ->join('p.id', 'c') ->where('c.vacancyid= 1') ->getquery() ->getresult(); thank in advance. example in repository : public function getpersonvacancy($personid) { $qb = $this->createquerybuilder('p'); $qb->leftjoin('p.vacancy', 'v'); $qb->select('v.name', 'v.id'); $qb->where('p.id = :personid'); $qb->setparameter('personid', $personid); return $qb ->getquery()->getresult(); this give example may not work copy

visual studio 2015 - VS15 Source files in different folders from project -

i have priject xx.vcxproj @ folder a. next there library has it's own folders , files. have path towards them in project properties in additional libraries , additional include files. @ diferent location, lets fodler b have source files , headers of project. included in project. when build project says cannot find included xyz.h file. way of including: 1. in project put path project library folder of file xyz.h need. 2. in file want use function xyz.h file put include "xyz.h" am doing wrong ? , why file cant see xyz.h header ?

android - Unable to convert image bitmap to byteArray -

i using following code encode image bitmap byte[] , string @ time of encoding byte[] says unable encode.. bitmap bm = bitmapfactory.decodefile(path); bytearrayoutputstream stream = new bytearrayoutputstream(); (bm).compress(bitmap.compressformat.jpeg, 100, stream); bm.recycle(); byte[] byteformat = stream.tobytearray(); string encodedimage = base64.encodetostring(byteformat, base64.no_wrap); the app working fine, stuck here. suggest issues. public static byte[] bitmaptobytearray(bitmap bitmap){ bytearrayoutputstream stream = new bytearrayoutputstream(); bitmap.compress(bitmap.compressformat.png, 100, stream); byte[] bytearray = stream.tobytearray(); bitmap.recycle(); return bytearray; }

mdm - Windows 10 MD enrollment - getting device data -

i able enroll windows 10 mobile device using https://msdn.microsoft.com/en-us/library/windows/hardware/dn925031(v=vs.85).aspx . want devicedetails device. have request data specifying paths according https://msdn.microsoft.com/en-us/library/windows/hardware/dn920025(v=vs.85).aspx . know how this. or there other way data device.

postgresql - Moving the data folder to a new machine -

hi know if following ok do. i have 2 windows 10 (home) pcs. both have same version of postgresql installed. if turn off postgresql service on both machines ok delete contents of postgresql data folder on 1 , replace them simple copy , paste of contents of data folder on other? i have tested , seems ok wondering if missing gotcha don't know about.

javascript - TypeError:cannot read property 'on' of undefined -

Image
i have gulp task read data file , write file. for doing : var gulp = require('gulp'); var fs = require('fs'); gulp.task('readfile', function() { return gulp.src('app/dataconfog.json') .pipe(fs.readfile("app/dataconfog.json", function(err, data){ fs.writefile('app/scripts/apiconfig.js', data); })) .pipe(gulp.dest('./dest/')) }) but getting following error: any appreciated try using this var fs = require("fs"); gulp.task('dosometing', function() { return gulp.src(dirs.src + '/templates/*.html') .pipe(fs.readfile("path/to/file.something", "utf-8", function(err, _data) { //do data })) .pipe(gulp.dest('destination/path')); });

Dat GUI - size and position of menu (javascript / css) -

i trying use dat gui add controls three.js project. , feel of controls provided dat gui. however, having problems positioning menu within page. need centre menu horizontally , vertically , set custom width , height menu. surely must possible? currently trying following. menu centering horizontally, working. not centering vertically (its stuck top of page) , size of menu not changing @ (the width , height parameters have no effect). can me out this? javascript: var gui; var menuclass = function() { this.speed = 0.5; }; var themenu = new menuclass(); gui = new dat.gui(); gui.domelement.id = 'gui_css'; gui.add(themenu, 'speed', -5, 5); css: #gui_css { position: absolute; left: 50%; top: 50%; width: 400px; height: 200px; } try: add div container dat.gui element <div id="gui_container"></div> then in code var gui = new dat.gui({ autoplace: false }); gui.domelement.id = 'gui&

php - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 5 -

i can't data form load mysql database. please help! error get: error: insert add_review (name,email,details) values ( 'darron brown', 'blank@gmail.com', 'ldldjd', ) have error in sql syntax; check manual corresponds mysql server version right syntax use near ')' @ line 5 <?php // connect mysql // a. variables $host = "hostname"; $username = "user"; $password = "secretpassword"; $dbname = "mydatabase"; // b. connection $connection = mysqli_connect($host, $username, $password, $dbname); // c. check our connection if(mysqli_connect_errno()) { die("database connection failed: " . mysqli_connect_error() . " (" . mysqli_connect_errno() . ")" ); } // insert our data $name = isset($_post["name"]) ? $_post["name"] : ""; $email = isset($_post["email"]) ? $_post["email"] : &q

javascript - Trouble in passing prop to child -

i having problem passing props child element. have parent renders child(four times) having button. want execute "console.log(id);" everytime click button. problem onclick gets executed if don't click button. in console can see gets printed in once. here code. tagsbrief_array array of json objects. parent component export default class tagsbrief extends component{ handleclick(id){ console.log(id); } render() { var populate = tagsbrief_array.map((value)=> { return( <tagbriefitem id={value.id} onclick={this.handleclick} description={value.tag_name} percent={value.tag_percent}/>) }); return ( <muithemeprovider> <div classname="tagsbrief"> {populate} </div> </muithemeprovider> ); } } child component export default class tagsbriefitem extends component { render() {

node.js - How do I save embeded docs without error "key $__ must not start with '$'(…)" while using devtool and Mongoose 4.x -

i in process of upgrading mongoose 3.8.22 4.x seemed working nicely until started debugging issue devtool have been using without issue month while using mongoose 3.8.22. while running node server not encounter errors or problems when running server using npm package 'devtool' save includes sub-documents fails following error: "key $__ must not start '$'(…)". has experienced issue or found fix? as example: i start 2 schemas, person , customopts var customoptions = new schema({ optstype: { type: string, required: true }, someoption: { type: boolean, required: true } }); var person = new schema({ name: { type: string, required: true }, customopts: [customoptions] }); next create x new customopts , add them new person var newopts = new locator.db.customoptions({ optstype: 'some_opts', someoption: true, }); var newperson = new locator.db.person({ na

java - Doesn't show H2 tables in browser -

hello, i have problem displaying h2 tables in browser i've created on java web application ( spring 4, hibernate 5, thymeleaf 3, h2database 1.4.192 , etc.). has java-based configuration. my datasource: @bean(name = "datasource") public datasource getdatasource() { logger.info("setting datasource properties."); embeddeddatabasebuilder builder = new embeddeddatabasebuilder(); embeddeddatabase embeddeddatabase = builder .continueonerror(true) .settype(embeddeddatabasetype.h2) .addscript(create_script) .addscript(init_script) .build(); return embeddeddatabase; } my 'create_script': create table clients ( client_id int primary key auto_increment, client_name varchar(99) not null, agreement boolean default false ); create table items ( item_id int primary key auto_increment, item_name varchar(99) not null, price decimal(10,2) not null ); create table clients_item

javascript - Slider value addition picks up previous value -

i have made 2 sliders add 2 numbers , outputs in box. my problem total box picks previous value of sliders. example: both sliders valued @ 2. total comes out 3. console.log proved value output previous value(before slide). i appreciate help, thanks. here's code snippet demonstrate: $(document).ready(function() { $('#slider1').slider({ value: 1, min: 1, max: 5, step: 1, slide: function(event, ui) { $("#one").val(ui.value); $("#equals").val(add()); } }); $('#slider2').slider({ value: 1, min: 1, max: 5, step: 1, slide: function(event, ui) { $("#two").val(ui.value); $("#equals").val(add()); } }); function add() { = $('#slider1').slider('value'); b = $('#slider2').slider('value'); total = + b; return total; } }); <script src="https://ajax.

How do I execute get data c# code page_load() using jquery? -

converted console application c# code asp.net application added code page_load() event. gets data azure table , want display on page using simple html , index.aspx.cs protected void page_load(object sender, eventargs e) { // retrieve storage account connection string. cloudstorageaccount storageaccount = cloudstorageaccount.parse( cloudconfigurationmanager.getsetting("storageconnectionstring")); // create table client. cloudtableclient tableclient = storageaccount.createcloudtableclient(); // create cloudtable object represents "devicedata" table. cloudtable table = tableclient.gettablereference("devicedata"); // retrive data tablequery<customerentity> query = new tablequery<customerentity>(); foreach (customerentity entity in table.executequery(query)) { // bind data simple html table //response.write("{0}

html5 audio - Integrating javascript with computer sound input device -

i developing app javascript records audio using html 5 audio context. want develop feature needs whether current active sound device connected microphone or default laptop/computer microphone , adjust settings decreasing volume. there way achieve ? you can use mediadevices.getusermedia() api method. user prompted permission use audio input device. browser support limited chrome, firefox , opera,see http://caniuse.com/#search=mediarecorder . navigator.mediadevices.getusermedia({ audio: true }) .then(function (stream) { // audio stream available here recorder = new mediarecorder(stream); // listen dataavailable, gets triggered // when audio blob available recorder.addeventlistener('dataavailable', onrecordingready); }); function onrecordingready(e) { // e.data contains blob represents recording }

android - Crashlytics with Hello Jni App -

i got issues crashlytics. think cannot set crashlytics androidndkout , androidndklibsout paths. first question gradle's default output path ndk according gradle settings ? second if settings correct why saw ndk errors "???" on crashlytics dashboard? here app build.gradle // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' classpath 'io.fabric.tools:gradle:1.21.7' } } allprojects { repositories { jcenter() maven { url 'https://maven.fabric.io/public' } } } task clean(type: delete) { delete rootproject.builddir } here module's build.gradle: apply plugin: 'com.android.application' apply plugin: 'io.fabric' android { compilesdkversion 24 bu

c++ - Encrypting a "stream" with AES -

i continuously produce string need write local file (encrypted). as i'm having aes library in application, prefer use aes - if possible. approach 1: aes has block size of 16 bytes, need buffer 16 bytes of data in memory might lose if computer crashes. approach 2: writing data file first , periodically encrypt whole file aes-cbc. way, user access unencrypted file short period of time. is there other way? since can't write 15 bytes disk anyway, pad out data multiple of 4kb (minus whatever header need) , encrypt padded data.

java - Compatibility between Instant and ZonedDateTime -

it understanding zoneddatetime enhanced version of instant . has data instant has (precise value along utc timeline), plus time zone information. naïve assumption zoneddatetime is-an instant , method taking instant happily take zoneddatetime instead. furthermore, expected isbefore() , isafter() etc. work seamlessly between instant s , zoneddatetime s. looking @ api documentation instant , zoneddatetime , none of case. can compare instant s instant s , zoneddatetime s zoneddatetime s, 2 classes seem incompatible. what's more, third-party code threeten-extra's interval seem work exclusively instant s. is there reason why instant , zoneddatetime not meant mixed? because translation not injective. take sunday, october 30th 2016 2:15 in germany/munich example: instant date/time represent? not independently answerable without assumptions because don't know if time should translated instant before or after offset daylight saving time (dst) should a

How to configure WebPack only for SASS to CSS -

i'm noob webpack i try find simplest configuration code using tranform sass file css file someone give me sample? get sass-loader then add in config module: { loaders: [ { test: /\.scss$/, loaders: ["style", "css", "sass"] } ] } after can require scss files require("./styles.scss").

Run a Powershellscript by clicking a button on HTML/PHP -

i'm trying find out, how can run simple powershellscript clicking on button. doing wrong? i tried following: <input type="button"> onclick="<?php hello.ps1; ?>"> and one: <input type="button" onclick="hello.ps1" value="send" name="button"/> inside .ps1 following: write-output "hello world"

sql server - java.sql.SQLException: No suitable driver found for jdbc:sqlserver... (intellij, maven) -

i have above error , wondering do. have done following things already: downloading sqljdbc4.jar microsofts website installing local maven repository including in pom.xml this: com.microsoft.sqlserver sqljdbc4 4.0 since using jdbc4, read not have call class.forname , can build connection database directly. why still nosuitabledriver error? edit: when using classforname below, classnotfoundexception. class.forname("com.microsoft.jdbc.sqlserver.sqlserverdriver"); //i tried class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver") string dburl = "jdbc:sqlserver://localhost;databasename=test;integratedsecurity=trues"; conn = drivermanager.getconnection(dburl); first need make sure driver classpath correct classpath : class.forname("com.microsoft.jdbc.sqlserver.sqlserverdriver"); changed to: class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver"); second need make sure dburl correct dbu

php - Create daily offer -

so i'm trying create daily offer exam project - idea extract information db , make kind of random function calls out random product each day, i'm pretty stuck nowhere. any great guides or solutions? here's how : create sql table store daily product (two columns id_product , date should suffice) -- let's call daily_products create php script select product id today's date daily_products if there none, sql request on products table return 1 line order rand() , store product id , today's date in daily_products if there one, nothing call php script daily either cronjob execute every day, @ 00:01 or on first daily visit of website (in case, should called before website rendering)

mysql - ASP.NETCore - Friends System -

i`m building application try make friend system. now, work 2 tables that. 1st: default aspnetusers store user information. 2nd: friends table below: public class aspnetfriends { public int id { get; set; } public string friendfrom { get; set; } public string friendto { get; set; } public bool isconfirmed { get; set; } } in table both "friendfrom" , "friendto" string type, , receiving registered users id. what want achieve when display table on view, want show username of same userid thats either in "friendfrom" or "friendto" column. you need change class followed (i didn't test this): default application user of asp.net core using microsoft.aspnetcore.identity.entityframeworkcore; namespace project.models { // add profile data application users adding properties applicationuser class public class applicationuser : identityuser { } } model public class aspnetfriends { pub

python - debugging Apache: multiple -DFOREGROUND processes taking up a lot of memory -

Image
we running apache mod_wsgi/python. observing multiple -dforeground process has been running. these process talking 2-40 % of memory utilization , run more 8 hrs. the pid of these process not in apache access.log 1. how find cause process? 2. why these pid not present in access.log 3. can kill them ?

python - Numpy assignment behaviour -

b array([-0.06106568, -0.10843541, -0.0694688 , 0.02464023, -0.03686665, -0.0582096 , -0.13476669, -0.08505708, 0.00391955, -0.12300518, -0.01183732, -0.05374973, -0.12300518, -0.05312849, 0.01963862, 0.00155719, -0.10843541, -0.08490177, -0.08505708, -0.02026149, -0.01777489, 0.01183732, -0.11575136, 0.04278603, -0.0694688 , -0.06106568, -0.08755022, -0.01660802, -0.06087603, -0.06582411]) = b a[a <= 0] = 0 a[a > 0] = 1 with code above replace elements in a, b changes... please explain me mistake? by using expression a = b copy reference b . if want copy value, should rather walk through b 's items , copy values a . in numpy should use copy function. >>> import numpy >>> b = numpy.array([-0.06106568, -0.10843541, -0.0694688 , 0.02464023, -0.03686665, ... -0.0582096 , -0.13476669, -0.08505708, 0.00391955, -0.12300518, ... -0.01183732, -0.05374973, -0.12300518, -0.05312849, 0.

c# - Calculate hypotenuse from height and angle -

Image
i'm bit rusty on math department , want calculate hypotenuse of right angle triangle given height (h) , opposite angle (c). tried this: double = h / math.sin(v); the whole code snippet: string line; while ((line = console.readline()) != null) { string[] split = line.split(new char[] { ' ' }, stringsplitoptions.none); long h = int64.parse(split[0]); long v = int64.parse(split[1]); double res = h / math.sin(v); console.writeline(res); } however doesnt give me right answer. instance if height 10000 , angle c 89, hypotenuse should ~10001 ~11626. i've tried in javascript , c# same faulty answer, calculator gives correct answer. ideas of i'm doing wrong? angle c must in radians not degrees to radians use c * math.pi/180

highcharts - KineticJS issue with x-coordinates displaying as bold in some cases -

there scenario graph shows coordinates bold in machines cases not knowing. so can me when font of graph in x-axis gets bold . also have horizontal line plotted on graph gets scattered. is issue highcharts or kineticjs. bcoz hightcharts , kineticjs been used drwing graph.

json - php read from array inside class -

when use print_r response api url got following result: stdclass object( [messages] => array ( [0] => stdclass object ( [messageid] => 990950058 [recipient] => 966000000000 [status] => queued ) [1] => stdclass object ( [messageid] => 990950059 [recipient] => 966500000000 [status] => queued ) ) [numberofunits] => 1 [cost] => 0.00000 [balance] => 2.89050 [timecreated] => 2016-11-10 14:03:49 [currencycode] => sar ) the problem want make loop read values messageid how can it? so simple use foreach used loop through each key/value pair foreach($your_variable->messages $row) { echo $row->messageid; }

c++ - OpenCV cannot compile in custom directory -

i on ubuntu , want install different version of opencv(2.4.13) on custom directory. followed tutorial here: http://code.litomisky.com/2014/03/09/how-to-have-multiple-versions-of-the-same-library-side-by-side/ i cannot simple main.cpp program compile. cannot create cv::mat image, can obtain opencv version fine!: #include <iostream> #include <opencv2/core/version.hpp> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> int main(int argc, char ** argv) { std::cout << "opencv version: " << cv_major_version << "." << cv_minor_version << "." << cv_subminor_version << std::endl; cv::mat image; //without line, works! return 0; } here makefile: cpp = g++ -std=c++0x # opencv 2.4.13 cppflags = -l/home/myname/desktop/myfolder/rewrite/opencv-2.4.13/release/installed/lib \ -i/home

sql server - how to add the value of the next row within a group in sql -

how can result column? p_key staff amt emi result 372175 9174 1584 1 1584 372176 9174 1619 2 3203 372177 9174 1654 3 4857 372178 9174 1689 4 6546 372179 9174 1726 5 8272 699334 22057 1136 1 1136 699335 22057 1161 2 2297 699336 22057 1186 3 3483 699337 22057 1212 4 4695 699338 22057 1238 5 5933 699339 22057 1265 6 7198 699340 22057 1292 7 8490 699341 22057 1320 8 9810 699342 22057 1349 9 11159 you seem want cumulative sum. in sql server 2008, 1 method apply : select t.*, t2.result t cross apply (select sum(amt) result t2 t2.staff = t.staff , t2.emi <= t.emi ) t2;

c++ - Gamma Correction with pow -

i use gamma correction image. so, have pow every pixel intensity of source image g = 0.6. have problem cause destination image wrong. maybe have casting problem when take pixel source image. here code: #include <opencv2/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> #include <opencv2/imgproc/imgproc.hpp> using namespace cv; using namespace std; int main() { mat src = imread("spine1.jpeg"); mat dst = mat(src.rows, src.cols, cv_8uc1); cvtcolor(src, src, cv_8uc1); dst = scalar(0); (int x = 0; x < src.rows; x++) { (int y = 0; y < src.cols; y++) { int pixelvalue = (int)src.at<uchar>(x, y); dst.at<uchar>(x, y) = pow(pixelvalue, 0.6); } } namedwindow("input", cv_window_autosize); namedwindow("output", cv_window_autosize); imshow("input", src); imshow("output", dst); waitkey(0);

table output from r to html -

app_test.r library(shiny) ui <- fluidpage( includehtml("www/index.html") ) server <- function(input, output, session) { data <- reactive({ f1<-paste(read.csv(input$file)) return(f1) }) output$text <- rendertable({ x=data() }) } shinyapp(ui, server) index.html <!doctype html> <html> <head> <title>samp r html</title> </head> <body> <form> choose file:<input type="file" name="file" id="file" /> </form> <p id="text" class="shiny-html-output" ></p> </body> </html> these 2 r , html files. want display csv file table uploaded user. iam getting error:'file' must character string or connection do need use html template? there example in shiny gallery http://shiny.rstudi

How to find potential unchecked exceptions in Java? -

Image
in accordance java specification, java compiler verifies automatically checked exceptions caught, based on "throw" statements , method signatures, , ignores unchecked exceptions. however, useful developer find out unchecked exceptions can thrown, instance 3rd party code might throw unchecked exceptions in situations developer tend expect checked exception (like long.parselong). or developer might throw unchecked exception placeholder future checked exception , forget replace it. in these examples, theoretically possible find these uncaught unchecked exception. in first case, signature of long.parselong indicates throws numberformatexception, , in second case, source code available, compiler knows unchecked exceptions thrown. my question is: there tool can report these cases? or maybe way let java compiler treat temporarily unchecked exceptions checked exceptions? useful verify manually , fix potential bugs otherwise cause crash of whole thread or application @ runt

What is the fastest algorithm for intersection of two sorted lists? -

say there 2 sorted lists: , b. the number of entries in , b can vary. (they can small/huge. can similar each other/significantly different). what known fastest algorithm functionality? can 1 give me idea or reference? assume a has m elements , b has n elements, m ≥ n . information theoretically, best can is (m + n)! lg -------- = n lg (m/n) + o(n) m! n! comparisons, since in order verify empty intersection, have perform sorted merge. can within constant factor of bound iterating through b , keeping "cursor" in a indicating position @ recent element of b should inserted maintain sorted order. use exponential search advance cursor, total cost on order of lg x_1 + lg x_2 + ... + lg x_n, where x_1 + x_2 + ... + x_n = m + n integer partition of m . sum o(n lg (m/n)) concavity of lg .

ecmascript 6 - Closuer compiler having error like "namespace never provided' -

i compiling es6 modules es3 via clouser compiler getting error, what doing wrong? see issue i've posted on github https://github.com/google/closure-compiler/issues/2139 fixed using **/*.js (which cause files included in compiler)

json - Angular 2 method is not subscribing to the observable -

i'm trying json data using service class. service class import { injectable }     from '@angular/core'; import { http, httpmodule, response } from '@angular/http'; import { generaltab }     from './generaltab'; import 'rxjs/rx'; import { observable }     from 'rxjs/observable'; @injectable() export class generaltabservice {      constructor(private _http : http) {         console.log("http call");     } getstatus(): observable<any> {     return this._http.get('http://samd.server.lan.at/taskmanagement/rest/taskconfigs/ind?language=en&access_token=200')          .map((res:response) => <generaltab[]>res.json())          .do(data => console.log("all: " +  json.stringify(data))) .catch(this.handleerror); } private handleerror (error: any) {          let errmsg = (error.message) ? error.message :         error.status ? `${error.status} - ${error.statustext}` : 'ser

sql server - Update SQL but only on fridays -

Image
in database have 2 columns, 1 date , hour , have in hour column time interval , change. , every friday , put in specific hour nothing working. this code search hour , change, , working: update [dbo].[clockings] set [hour] = dateadd(second, (abs(checksum(newid())) % 900), '07:45:00.000') [hour] > '04:00:00.000' , [hour] < '07:45:00.000' update [dbo].[clockings] set [hour] = dateadd(second, (abs(checksum(newid())) % 900), '17:30:00.000') [hour] > '17:45:00.000' , [hour] < '23:59:59.000' to search date table nothing worked. answer sql-server 2012 or later: update clockings set ... datepart(dw, [date]) = 5; --friday note, check day first day of week. https://msdn.microsoft.com/en-au/library/ms181598.aspx datename() function may suit.