Posts

Showing posts from January, 2013

mysql - Caused by: java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile -

i have replaced sqoop metatsore mysql db. when try run saved sqoop job command line, "asks" me password , run job when supply it. however, need run job through oozie. --password not recognized valid argument here in command line while executing sqoop saved job , anyway, keeps asking password through prompt. now, when try run through oozie, i get caused by: java.sql.sqlexception: database in use process: org.hsqldb.persist.niolockfile@950abfc6[file =/home/yarn/.sqoop/metastore.db.lck, exists=false, locked=false, valid=false, fl =null]: java.io.filenotfoundexception: /home/yarn/.sqoop/metastore.db.lck (no such file or directory) what , why this? directly connecting mysql metatsore , have configured sqoop-site.xml accordingly. why trying to connect hsqldb? why locked? how fix this? also, how supply password execution of sqoop job in oozie?

css - Assigning :hover to a class rather than an element -

i'm working on decent-sized project in there bunch of elements want fade when user hovers on them. current code: .brand-images img, .horlist li a, .producto__descripcion a, .slider-btn, .social-media__banner a, .marca-productos__foto, .marca-productos__nuevos-productos a, .producto-zona__image a, .campanas { opacity: 1; } .brand-images img:hover, .horlist li a:hover, .producto__descripcion a:hover, .slider-btn:hover, .social-media__banner a:hover, .marca-productos__foto:hover, .marca-productos__nuevos-productos a:hover, .producto-zona__image a:hover, .campanas a:hover { opacity: .5; } this not concise. question is: possible assign :hover pseudo class normal css class? had in mind: .hover-fade { opacity: 1; } .hover-fade:hover { opacity: .5 } that way i'd able apply class elements want. if it's not possible, other suggestions of how cut down css welcome. you can apply :hover valid css selector has :hover pseudo element. div.wrapper a[nam...

spring - Using java I need to send Notification Message, by calculating time automatically everyday at 5AM -

i need send notification messages registered customers, using mail service need send mail everyday @ 5am calculating time automatically. have mail service code completely. how execute 1 job @ specified time everyday. you can use spring scheduler: @scheduler(cron="0 0 5 * * *") public void emailjob() { // code } also need annotation on class level: @enablescheduling

catch the parameter post from view on same controller spring framework -

i have code in php language using codeigniter framework. need translate spring framework, little confuse translate send parameter controller paramater : $tipe = $this->input->post("tipe_lst"); because in spring using: @requestparam("tipe_lst") string tipe_lst how catch parameter on same controller?, because parameter not have value, can null parameter, if use @requestparam, result can error. you can set required = false in @requestparam annotation. this;) @requestparam("tipe_lst", required = false) string tipe_lst

ios - UIGestureRecognizerStateChangedv called twice when moving bezier image in a subView -

i implemented square draw using uibezierpath. in order move same square, implemented uilongpressgesturerecognizer can check if square pressed , move square freely in subview. here of code: square.h ... //square coordinates , size static const float xpoint = 10; static const float ypoint = 16; static const float width = 10; static const float height = 20; //bezier bitmap context static const float contextwidht = 300; static const float contextheigh = 300; ... square.m ... -(void)build{ uibezierpath *squaredraw = [uibezierpath bezierpathwithrect:cgrectmake(xpoint, ypoint, width, height)]; uigraphicsbeginimagecontext(cgsizemake(contextwidht, contextheigh)); // graphic context cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextsetstrokecolorwithcolor(context, [uicolor bluecolor].cgcolor); cgcontextsetfillcolorwithcolor(context, [uicolor clearcolor].cgcolor); [squaredraw fill]; [squaredraw stroke]; // image graphic context uiimage *bezierimag...

c++ - When to use pthread_mutex_t -

can please explain in scenario's beneficial use std::mutex vs pthread_mutex_t. dont understand why ever use pthread_mutex_t. thanks std::mutex thin wrapper around pthread_mutex on systems supporting pthreads. in general, operations on std:: thread primitives quite limited vs native versions (pthreads or windows threads). if don't need features, should use std:: versions, if need advanced features, have no choice use native version.

Cassandra vs Hbase for real-time data -

i'm looking distributed, real-time data access tool. i've read hbase hadoopsql solution java clone of google big table, more suited batch jobs real time access (and slow because of read-write). i've read cassandra "high availability". is understanding of correct? cassandra better suited real-time database (that's distributed) hbase or bigtable? is cassandra better suited real-time database (that's distributed) hbase or bigtable? yes, cassandra more suited oltp workload whereas hbase more suitable olap workload, in general

javascript - What is a more elegant way to overcome Error: Expecting object specifier. Argument has no object specifier when sending an SMS via Messages via JXA -

this fails work (application("messages")) { send(text, {to: services["sms"].buddies[phone]}) } with error: expecting object specifier. argument has no object specifier. text valid , not null. phone valid , not null. if hard code values works. decided try 'dynamic' hard coding worked. command = 'with (application("messages")) { send("' + text + '", {to: services["sms"].buddies["' + phone + '"]}) } ;' ; eval(command) ; is there more elegant way of overcoming this? why eval work code variables not? breaking code out smaller pieces helps me. var text="foo" var phone="+14159999999" var messages = application('messages') var service = messages.services[0] var recipient = service.buddies.byname(phone, { of: service }) messages.send(text , { to: recipient })

javascript - Restrict Bootstrap Input tags maximum 100 tags -

Image
hi friends i'm using bootstrap tags input project , require 100 tags entered after should not allow tags entered input field . html : <input type="text" class="form-control" id="skill_nameone" name="skill_name" data-role="tagsinput" /> js: bootstrap-tagsinput.min css : bootstrap-tagsinput.css image : this input field should accommodate 100 tags . in above pic contains 7 tags . thanks in advance . you can limit maximum number of tags using maxtags this: $('input').tagsinput({ maxtags: 100 });

visual studio 2010 - Deploying a C# application - user form (novice) -

i'm virtually complete novice, i've tried googling answers , become totally confused. using visual studio 2010, have c# application email notifier friend. external (arduino) hardware works, main code (from website) works i'm sending on other side of world use , 'non-technical' - hence need 'setup form'. i have created form can enter comm port (selected list), username , password (all used main code), form should run when application first installed on pc. at moment runs in vs-2010 (though need iron out couple of snags), validates , hides - don't know how a) store data , make available main code, b) ensure form runs @ setup, or c) need or include create installable application. could either or direct me tutorials don't assume understand terminology? i want create can instal memory stick. know can done , it's proababy quite simple understand - i'm trying learn i'm no longer young , it's struggle. thanks a) st...

linux - How to modify the cat command -

so i'm trying show contents of text file every occurrence of particular word highlighted. don't want use grep shows sentences word in. want use cat command. i still suggest use grep command, , specify big context value print out lines "near" matching lines, e.g: grep -c 999999999 needle haystack

.net - Powershell : same input command, but different outputs depending on remote / local execution -

i have check if driver installed on virtual machine. need output drivers list using powershell (msinfo32.exe -> software components, system drivers). (impersonated) user account want check "test". when run command locally "test" using remote desktop, works fine, drivers : ps c:\users\test> get-wmiobject win32_systemdriver so can check if concerned driver running : ps c:\users\test> get-wmiobject win32_systemdriver | where-object{$_.name -eq "vsepflt"} displayname : vfilefilter name : vsepflt state : running status : ok started : true now need computer, doesn't output full list (just 3 instead) : ps c:\users\lh> get-wmiobject win32_systemdriver -computername $ip -credential $credtest displayname : common log (clfs) name : clfs state : running status : ok started : true displayname : netbt name : netbt state : running status : ok started : true displayname ...

visual studio - How to change background color of solution explorer tab in Productivity Power Tools? -

Image
i have docked solution explorer window tabbed document solution explorer, , changing background colors of file types such as: (.html, .js, .css, , on) using productivity power tools. is there possibility change background color of solution explorer tab in custom document well? p.s: visual studio vs2015 community edition. my installed vs2015 version professional should still work: enable color coding regex tools-> options -> productivity power tools -> custom document -> general: in group box "tab appearance" switch on color tabs regular expressions color coding solution explorer tools-> options -> productivity power tools -> custom document -> color coding: on bottom, type in new reg. ex value solution explorer , pick wanted color.

jquery - JW player showing blank page in Internet explorer with no errors -

Image
i want play video in browser. below code working fine in chrome , firefox not working in ie8 or lower. blank page coming no errors. need kind suggestion improve code tablet, browsers,iphone, , on mac. is there suggestion improving performance in ie. <!doctype html> <!--[if lt ie 7 ]><html class="ie ie6" lang="en"> <![endif]--> <!--[if ie 7 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if ie 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte ie 9)|!(ie)]><!--><html lang="en"> <!--<![endif]--> <head> <!-- basic page needs ================================================== --> <meta charset="utf-8"> <title>demo</title> <meta name="description" content=""> <meta name=...

Delphi 'Output unit dependency information' - what does it do? -

there option in delphi compiler - 'output unit dependency information' - unsure does, although seems try , set --depends option when application compiled, there no output. does know does? autodependency information embeds list of .cpp file's recursively #included headers , timestamps .obj. information used build system rebuild .obj if of #included headers change. note option "disable autodependency information" - include default. if it's turned off, .objs not contain information , won't automatically rebuilt when headers change. from http://embarcadero.newsgroups.archived.at/public.delphi.ide/200809/0809301085.html further reference can found on compiling section of embarcadero documentation

mysql - Admin page to create new posts -

i created login , admin page. on admin page created 2 text fields, first 1 title , second content. created submit button. i have database table called: node. in table created: id(1,2,3...), author_id (1=me), header (it'd title), text (it'd content) , date(when posted). now want when push submit button, author, header, text , date appear on page new post. it's pretty same thing when push 'post question' button here. here's webpage i've created 3 test news posts sql, it's working, it'd better if admin page. :) i'd appreciate if write down nicely, i've never done , don't know how one. before anyone'd offer: not want create joomla or drupal website. final working version: (thanks bansi) <?php ob_start(); session_start(); ?> <meta charset="utf-8"> <link rel="stylesheet" href="style.css" type="text/css" media="screen"/> <?php if (isset($_cookie[...

php - How to structure correctly a Symfony2 controller - deal with huge classes -

i have existing php project have move on symfony. working symfony 6 month , found nice use. hovewer, have question: in old code, have big classes of 6000 each :| now, in new project, have controller should done (including 2 or 3 classes of 6000 lines). what best practcice symfony , creating bundle per huge class , call functions of 2 or 3 bundles in controller, or else? read on symfony more , answers may fall place, services http://symfony.com/doc/current/book/service_container.html edit look @ code , divide logically. have no idea controller does, valid 1 class - unlikely. @ class , make decisions how best split up. do diagram or on paper first! doing in code first takes much longer , harder fix when inevitably make mistake first time around.

Header in QML column -

i have piece of code in qml, i'm not able add static text header of each column. i tried looking online don't seem find asnwer. or don't it. component { id: pedido item { id: item width: parent.width; row { id: row width: parent.width anchors.verticalcenter: parent.verticalcenter column { width: parent.width * 0.3 text { text: " " + codigo; font.family: "helvetica" font.pointsize: 14 font.bold: true color: item.listview.iscurrentitem ? "white" : "black" } column { ...

python - how to control a function of TextCtrl as dynamic in wxpython? -

i'm wxpython user. have question how control textctrl function. want build program if click button, textctrl's value changed. source code followed. #!/usr/bin/python import wx class tom(wx.dialog): def __init__(self, parent, id, title): wx.dialog.__init__(self, parent, id, title, wx.defaultposition, wx.size(400, 420)) panel = wx.panel(self, -1) vbox = wx.boxsizer(wx.horizontal) self.write = wx.textctrl(panel, -1, style=wx.te_multiline, value=self.message) button_send = wx.button(panel, 1, label='b'+'1', 'send') vbox.add(self.write, 1, wx.expand | wx.top | wx.right | wx.left | wx.bottom, 15) vbox.add(button_send, 0, wx.align_center | wx.top | wx.bottom, 20) self.bind(wx.evt_button, self.onsend, id=1) panel.setsizer(vbox) self.centre() def onsend(self, event): b=event.geteventobject().getlabel() if b.endswith('1'): self.m...

node.js - HOWTO run browser-sync with a web app deployed in JBoss EAP 6.3.3? -

issue details is there specifc steps run browser-sync web app deployed in jboss eap 6.3.3 ? i installed node.js (version 4.4.3 ), runned npm install -g browser-sync . web application (myapp.war) deployed in running server jboss eap. runned browser-sync start --proxy "http://localhost:8080/myapp" --files "src/main/webapp/**/*" new browser window opened url http://localhost:3000/myapp . when changed content of file (xhtml,css,js), browser-sync detected , refresh browser no changements appear. please specify version of browsersync, node , npm you're running browsersync [ 2.12.5 ] node [ 4.4.3 ] npm [ ] if cli, please paste entire command below browser-sync start --proxy "http://localhost:8080/myapp" --files "src/main/webapp/**/*" thanks

c# - SyntaxWalker Visit method -

i have problem class syntaxwalker , method: visitmemberaccessexpression(memberaccessexpressionsyntax node) i node type , if equal example: "person" add list. use: if(semanticmodel.gettypeinfo(node).type.name == modelname) list.add("stack"); but have error: "object reference not set instance of object" why? fields: private isemanticmodel semanticmodel; public string modelname { get; private set; } set model name: modelname = type.basetype.typearguments[0].name.tostring(); i've been on few days , not know please please. in accordance advice: how define "node" type in roslyn?

PHP Warning while checking PHP version -

whenever i'm trying check php version installed on computer through cmd line, following warning message pop up php warning: unable load dynamic library 'c:\xampp\php\ext\php_gd.dll'- specified module not found. in unknown on line 0. after warning shows php version.

How can I set priority for messages in Netty sending queue -

i have situation use small buffer size outbound messages in channel. , try send lot of messages on channel. sounds there queue used on netty level because when submit messages netty manages send them away after period of time. my question is: possible specify priorities messages way regulate order of sending? instance, have messages in sending queue, last message have submitted should sent first. (i.e. should go beginning of sending queue). btw, netty version 4.0.0.cr6. without knowing internals of netty 4, still that, no, not possible. once chunk of bytes reaches channel sink (that concept in netty 3) @ mercy of internal buffering , queuing, , therein no idea of priority, order. of course, outbound handler (downstream in netty3) buffer messages, reorder them according algorithm or rules, , release them sink, (certainly ?) not op wants.

asp classic - Lost ASP Session Variable IIS 6.0 to 7.5 -

Image
i've read lot topic, don't solution. i've tried solutions community has posted, not success. i migrating site iis 6.0 7.5. site has both asp , asp.net applications, set 2 different pools. asp.net apps work without problems. where have problems asp applications. asp apps use app objective grant user. problem becomes when granting-user app creates session ("accepted") variable , gets lost when redirecting. this feature working in iis 6.0 i've traced problem , confirmed error comes when redirecting. what i've tried , checked fix problem: session properties enable session state = true time-out: 00:20:00 mode settings: in process cookie settings = use cookies use hosting identity form impersonation = checked port access site: :8685 i've checked web-gardening , it's not enabled there's 1 working process set. i attach screen captures consider relevant i've coded asp page shows session variable contents. before ...

Can we have search widget other than toolbar in android -

Image
i understand can have search widget in activity toolbar. per requirement can't use tool bar search widget, possible can have search widget separate entity in activity below tool bar or want (just text view or button)? i have created search view xml , use including want. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorprimary" android:padding="16dp"> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" app:cardbackgroundcolor="@android:color/white" app:cardelevation="4dp"> <linearlayout android:layout_width="match_parent" ...

ruby on rails - How To update the date in Postgresql db -

i want save date in postgresql database. therefore have written following code in controller: def create @app_config = appconfig.new(app_config_params).to_date @app_config.save respond_with(@app_config) end private def app_config_params params.require(:app_config).permit(:freeze_attendance_till) end but throwing error this: actioncontroller::parametermissing (param missing or value empty) so unable save date in db. doing wrong? i created database using following code: class createappconfigs < activerecord::migration def change create_table :app_configs |t| t.date :freeze_attendance_till t.timestamps null: false end end end

php - XMLHttpRequest within service worker -

i'm trying create push notification system on chrome. have php fetches data mysql , echoes json, i'd call function getjsoncode() it's activated when push notification arrives , reads json data. within service worker i've created standards functions. problem when create getjsoncode xmlhttprequest tells me it's not defined self.addeventlistener('install', function(event) { self.skipwaiting(); console.log('installed', event); }); self.addeventlistener('activate', function(event) { console.log('activated', event); }); self.addeventlistener('push', function(event) { console.log('push message', event); getjsoncode(); ); }) getjsoncode() { coderequest= new xmlhttprequest(); coderequest.open('get', 'myfilewithjson.php', true); coderequest.send(); datajson = coderequest.responsetext; console.log('rispostajson'); } is possible call external file within service worker or...

language agnostic - Is floating point math broken? -

0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 why happen? binary floating point math this. in programming languages, based on ieee 754 standard . javascript uses 64-bit floating point representation, same java's double . crux of problem numbers represented in format whole number times power of two; rational numbers (such 0.1 , 1/10 ) denominator not power of 2 cannot represented. for 0.1 in standard binary64 format, representation can written as 0.1000000000000000055511151231257827021181583404541015625 in decimal, or 0x1.999999999999ap-4 in c99 hexfloat notation . in contrast, rational number 0.1 , 1/10 , can written as 0.1 in decimal, or 0x1.99999999999999...p-4 in analogue of c99 hexfloat notation, ... represents unending sequence of 9's. the constants 0.2 , 0.3 in program approximations true values. happens closest double 0.2 larger rational number 0.2 closest double 0.3 smaller rational number 0.3 . sum ...

c# - SerializationException: End of Stream encountered before parsing was completed -

this inherited code fails can not figure out why. using(networkstream stream = client.getstream()) { binaryformatter formatter = new binaryformatter(); formatter.serialize(stream, message_); if(responsehandler_ != null) { message response = (message) formatter.deserialize(stream); // <-- fails here responsehandler_(response, stream); } } i have googled death. have tried seeking suggestions networkstream can not seek. edit: doesn't fail. on occasion. appreciated. in such case i'd suggest copying networkstream memorystream , can seek - can find examples here . with memorystream , can reset stream's location after serialized using(var ms = new memorystream(stream) { binaryformatter formatter = new binaryformatter(); formatter.serialize(ms , message_); if(responsehandler_ != null) { ms.location = 0; message response = (message) formatter.deserialize(ms); responsehandler_(response...

pointers - Changing a c code to work line by line -

#include <mhash.h> #include <stdio.h> #include <stdlib.h> int main(void) { int i; mhash td; unsigned char buffer; unsigned char *hash; td = mhash_init(mhash_whirlpool); if (td == mhash_failed) exit(1); while (fread(&buffer, 1, 1, stdin) == 1) { mhash(td, &buffer, 1); } hash = mhash_end(td); (i = 0; < mhash_get_block_size(mhash_whirlpool); i++) { printf("%.2x", hash[i]); } printf("\n"); exit(0); } hi, have above code mhash example page. need change it, keep reading stdin , , calculate hash line line, instead of waiting eof cat textfile | whirlpool_line_hash my understanding keep while loop (which waits eof ) , make hash calculation , print after received 10 (0x0a). after print mhash needs reset, right? not c @ all, need fast program, want in c. fail @ comparing pointer integer ;-) can please h...

php - a mysql request, nothing happen? -

in php; got mysql request: $q=@mysql_query("insert personnes(login,pass,user_email,logged_ip,created,user_first_name,user_last_name,user_organization,user_address1,user_address2,user_city, user_country,user_zip,user_phone,userer_fax) values ('".mysql_escape_real_string($login)."', '".mysql_escape_real_string($pass)."', '".mysql_escape_real_string($user_mail)."', '".mysql_escape_real_string($ip)."', '".mysql_escape_real_string( $dates)."', '".mysql_escape_real_string($first_name)."', '".mysql_escape_real_string($last_name)."', '".mysql_escape_real_string($organisation)."', '".mysql_escape_real_string($address1)."', '".mysql_escape_real_string($address2)."', '".mysql_escape_real_string($city)."', '".mysql_escape_real_strin...

c# - Call method when app is opened -

i'd call method when application shows, , not on launch. example, when app starts , presses home button, clicks app icon again, want method called. is there way this? thanks in advance! there various appdelegate methods available. when press home button, following methods called - (void)applicationwillresignactive:(uiapplication *)application { } - (void)applicationdidenterbackground:(uiapplication *)application{ } while when again touch on icon, these methods called- - (void)applicationwillenterforeground:(uiapplication *)application { } - (void)applicationdidbecomeactive:(uiapplication *)application { } so can write code in these methods.

asp.net - How to encrypt the connectstring section of web.config in MVC website? -

i want encrypt connectionstring section of web.config. have tried following below steps: open developer command prompt vs2013 aspnet_regiis -pef "connectionstrings" -app "/e:\new folder\webapplication1\webapplication1" it thorwing me error " a configuration file cannot created requested configuration object. failed " i did google not able why facing this. have tried change permissions of website folder? do need set website in iis? please me solve issue. thanks in advance. <configuration> <configprotecteddata defaultprovider="sampleprovider"> <providers> <add name="sampleprovider" type="system.configuration.rsaprotectedconfigurationprovider, system.configuration, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil" keycontainername="samplekeys" usemachinecontainer="true" /...

ruby on rails - Cannot validate empty nested fields -

i have nested form creating members inside enrollment class enrollment < activerecord::base has_many :atendees, dependent: :destroy accepts_nested_attributes_for :atendees, reject_if: :all_blank, allow_destroy: true end and validations on member model. if submit enrollment form blank member fields, enrollment saves empty members array. if input member field , submit it, member model validations take action. any ideas why happening? i tried checking 1 column: accepts_nested_attributes_for :atendees, , reject_if: proc { |attributes| attributes['first_name'].blank? }, allow_destroy: true to me seems expected behaviour. reject_if should 'silently' ignore fields fail meet condition. if removed reject_if clause usual model validation should occur member instances. if not, can use validates_associated in enrollment model validates_associated :atendees

windows - extract zip files silently using batch file -

i have written below bat file extract zip files. not working when execute jenkins. suspect because since trying launch copy ui , service preventing doing windows services dont allow work uis. there way edit below script unzipping silently? if there other tools, please provide example. @echo off /d %%p in ("%cd%\setups\*.*") rmdir "%%p" /s /q call mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -drepourl=http://10.101.15.190:8081/nexus/content/repositories/releases/ -dartifact=k:update-service:1.0.3 -ddest=setups/services/update-service.jar call mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -drepourl=http://10.101.15.190:8081/nexus/content/repositories/releases/ -dartifact=k:installer-prerequisites:1.0.0 -ddest=setups/prerequisites/installer-prerequisites.zip -dpackaging=zip call mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -drepourl=http://10.101.15.190:8081/nexus/content/repositories/releases/ -dartifact=k:-app...

wordpress - want to add different header file to custom template -

i want add different header file custom wordpress page template. created new template custom post type. want add header file using get_header() function, not want use regular header of theme. can paste entire changed header file template, don't think correct way. suggestions helpful. thanks you can create header file every template, example, call header-blog.php: need get_header('blo');

fiware - Why cygnus crashes when using ngsiv2 in orion? -

recently start working ngsiv2 cygnus start crashing. may have not cofigurated right? v1 works flawless. my startup trace error in here: http://pastebin.com/np2am8gw the error said: error appending event channel. channel might full. consider increasing channel capacity or make sure sinks perform faster. time=2016-05-09t05:58:28.866cdt | lvl=warn | trans=1462791485-602-0000000000 | srv=papel-club | subsrv=events | function=intercept | comp=cygnus | msg=com.telefonica.iot.cygnus.interceptors.groupinginterceptor[135] : no context responses within notified entity, nothing done time=2016-05-09t05:58:28.867cdt | lvl=warn | trans=1462791485-602-0000000000 | srv=papel-club | subsrv=events | function=dopost | comp=cygnus | msg=org.apache.flume.source.http.httpsource$flumehttpservlet[203] : error appending event channel. channel might full. consider increasing channel capacity or make sure sinks perform faster. org.apache.flume.channelexception: unable put batch on required channel: org...

yesod - If it is possible to define locally data type in Haskell? -

recentlly, find interesting question when i'am writing code in haskell. for example, in yesod framework, if need write route parse json parameters, need define data type this: data args = args { :: int } instance fromjson args putsampler :: handler () putsampler = args{..} <- requirejsonbody <balabalabala> it works fine. becomes pulzzled if have lot of these routes need parameters parsed. i may have args1, args2, args3 , there field must different, args1{a1}, args2{a2}, args3{a3} it annoying me. so, if possible write code way: putsampler :: handler () putsampler = args{..} <- requirejsonbody <balabalabala> data args = args { :: int } instance fromjson args to define data variables locally?

java - Maven deploy two jars with different classifiers from two separate pom.xml -

Image
i want deploy 2 jar artifacts different classifiers, @ moment fails because both supply own version of pom.xml . how can fix that, both pom.xml s can uploaded along artifacts? example - have com.test.company.somelib-1.0.0-cmp1.jar , com.test.company.somelib-1.0.0-cmp2.jar , cmpx classifier. both packages contain (logically) same code , classes (of same version), differ in way preprocessed. classifier annotation there due backwards compatibility need maintain. long story short, first artifact uploads fine, second 1 fails forbidden , because our repository not allow overwriting artifacts (and want keep way). there different pipeline creates both packages, easier have builds separate. want deploy them 2 packages of same name , different classifier. thanks help edit: has been suggested use maven profiles. can see work, not ideal. consider setup have depicted on picture below - there ci server (teamcity). there "starter" build (sources). build checkouts requ...

php - Codeigniter controller not found -

i have create controller in codeigniter. problem when hit controller name , function name in url give me error 404 not found. new codeigniter , did not understand going wrong here controller <?php if(!defined('basepath')) exit('no direct script access allowed'); class home extends ci_controller{ function __construct(){ parent::__construct(); } function you(){ $this->load->view('home_view'); } } ?> and view this <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>my first codeigniter practice</title> </head> <body> <h1> hello ci buddy...!</h1> </body> </html> i creating first project on codeigniter , stuck in p...

c# - How to fill a custom typed List<> from SQL Server -

i have class named author.cs defined as: public class author : interfaces.inode { private list<inode> _targetlist; private list<iattribute> _attributeobject; // author class constructor public author() { _targetlist = new list<inode>(); } //implementazion of _targetobject inode method public list<inode> _targetobject { { return _targetlist; } } //implementazion of _attributeobject inode method public list<iattribute> _attributeobject { { return _attributeobject; } } public int _aid { get; set; } public string _aname { get; set; } // 'coauthor', 'venue' , 'paper' classes // implements interface i.e. `iattribute` public list<coauthor> _acoauthors { get; set; } public list<venue> _avenue { get; set; } public list<paper> _apapers { get; set;...

c# - ContextDependent instance as Singleton in Simple Injector -

i have question regarding contextdependentextensions of simpleinjector library. have following extension add possibility adding elements injector context: contextdependentextensions example: var container = new container(); container.registerwithcontext(logger => new simplelogger("logger constructor parameter")); here 1 interest line: should transient! so, mean? , can use here lifestyle.singleton or lifestyle.scoped lifestyle? can explain me? in advance. with registerwithcontext extension method, register predicate allows build instance using information consuming component. information supplied predicate extension method. since means can built different instance per consuming type, making registration else transient, lead weird behavior. imagine instance registration of ilogger abstraction create logger<t> implementation t type of consuming component: container.registerwithcontext(c => (ilogger).container.getinstance( ...

javascript - Recursive traversal of unknown json object/tree and actions based on returned json -

i'm using api returns json on request. json has either names next level url's or filename. the problem code has recognize json returned. if json has names next url levels create url , it. recursively new set of names or files, recognize , over. can go menu levels deep required. 1 * if has filename should , render html. (this solved) example of json {id: 'new_url_1_level_1', id:'new_url_2_level_1', id:'new_url_3_level_1'} //or {id:'001200.file.ext',id:'001300.file.ext'...} these turn http://my.api.call.com/new_url_1_level_1.../new_url1_level_2/ ... the problem how loop on url's , filename example: http://my.api.call.com/new_url_1_level_1/new_url_1_level_2/new_url_1_level_3/001300.file.ext my current script is: var json; var urllevel= '/first_level'; var api = 'http://my.api.call.com'; var re = /^\d+/g; // regex match filename (decide if json has filenames or urls; files sta...

javascript - babylon.js repeating texture seam/artifact -

Image
i've started dabbling in shader programming using babylon.js. i'm trying write fragment shader supports repeating textures. used pretty trivial way it, can tell link. http://www.babylonjs.com/cyos/#caru2#1 vec2 xy = vuv; vec2 phase = fract(xy / vec2(1.0/vscale,1.0/vscale)); vec3 color = texture2d(texturesampler, phase).rgb; the problem creates strange pixelating effect on seams of repeating texture, shown following image. how can fix this? must wrong fragment shader, because using standard material doesn't yield problem. if eternally grateful. wow okay i'm idiot, scaling image in stupid , inefficient way. don't think understood line: vec2 phase = fract(xy / vec2(1.0/vscale,1.0/vscale)); was doing. i'm still not 100% on it, logical way multiply uv vector repeating factor. vec2 phase = vec2(xy.x*vscale,xy.y*vscale); you can see result here: http://www.babylonjs.com/cyos/#caru2#2

javascript - Angular2 - *ngIf : How to show a specific element? -

i willing show specific element using ngif ; however, reason, not work. the issue: when click show specific element, other elements shows up! the code: html (elements taken async request) <ion-col *ngfor="#finalformat of elements"> <div *ngif="currentelement"> <div>show element</div> </div> <div (click)="showthis(finalformat.elementname)" *ngif="!currentelement">click show</div></ion-col> js: showthis(element){ if(this.currentelement === element){ return; } this.currentelement = element; } i update test this: <div *ngif="currentelement === finalformat.elementname"> (...) </div> same "click show" block: <div (click)="showthis(finalformat.elementname)" *ngif="!currentelement !== finalformat.elementname"> click show </div>

html - Pressing PageUp while in textarea moves website out of the window -

Image
what happens when cursor in <textarea> , i've typed few lines (a.k.a. pressed enter few times) , press pageup, entire website shifts cursor in left top of page, while still in <textarea> . contents of page shifted left, no horizontal scrollbar appears, way work page again refresh it. it seems happening due many wrappers margins used plus overflow: hidden blocks scrollbar appearing, necessary styling page. what can stop happening, while @ same time not screwing on entire layout? (about 4000 lines of css... have make have) example: http://jsfiddle.net/arq35/ (funny side effect: jsfiddle shifts out of position when reproducing issue) (only in chrome , opera) html: <div id="ultrawrap"> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <section id="content" class="content"> <h1>fiddle of situ...

c# - how I attribute unit test with data driven and expected exception -

i have unit test function, attribute 'datadriven'. calls function expected throw exception. if attribute both first method or twice "expectedexception" fails, , doesn't continue other rows on data source. should do? you can use assert.throws() method in nunit verify method within test throws exception. assert.throws<filenotfoundexception>(() => thismethodthrowsfilenotfound()); the expectedexception attribute meant used on test method (the 1 test attribute). decorating other method has no effect.

git - How to copy a specific commit to another Branch? -

in git master have 2 branches production , testing . work testing. @ present example production version 5. testing version 20. update production version testing version of 15. for that, how can select testing version of 15 , copy or merge production version of 5? ( if new testing version commit id of 6 in production version that' fine ) if wrong here please excuse me. i don't have idea. please me. i suggest checkout ( git checkout ) testing branch @ specific commit version 15. create temporary branch git checkout -b version15merge , merge git checkout production && git merge version15merge stuff production branch.

java - ClassNotFoundException with Apache POI -

i using apache poi v3.9 , following statement giving classdefinitionnotfound exception hwpfdocument document=new hwpfdocument(file); java.lang.classnotfoundexception: org.apache.poi.hwpf.hwpfdocument @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1680) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1526) @ com.anz.actions.converteraction.execute(converteraction.java:39) @ org.apache.struts.chain.commands.servlet.executeaction.execute(executeaction.java:58) @ org.apache.struts.chain.commands.abstractexecuteaction.execute(abstractexecuteaction.java:67) @ org.apache.struts.chain.commands.actioncommandbase.execute(actioncommandbase.java:51) @ org.apache.commons.chain.impl.chainbase.execute(chainbase.java:191) @ org.apache.commons.chain.generic.lookupcommand.execute(lookupcommand.java:305) @ org.apache.commons.chain.impl.chainbase.execute(chainbase.java:191) @ org.apache....

c# - add items in list from view -

i have model class public class cv { ... public list<education> education { get; set; } public education neweducation { get; set; } public void addeducation(cv cv) { cv.education = cv.education ?? new list<education>(); cv.education.add(cv.neweducation); } ... } and in view have: @model solution.models.cv ... @html.textboxfor(m => m.neweducation.faculty) ... and desired textboxes education class. want add these items in list after click add button: <div class="add-education"> <a href="" class="add-education-button">add education</a> </div> how can that? in cv class there lists too. want way (from 1 model) try post controller's action html input: <form method="post" action="yournamecontroller/nameaction"> <div> @model solution.models.cv ... @html.textboxfor(m => m.neweducation.faculty) </div...

jquery - Export CSV using jqxgrid in Safari browser and iOS is not working -

in web application have option export "jqxgrid" data ".csv" format. it working expected in chrome & firefox browsers. but, if, tried export option in 'safari' browser opening in tab, instead of download separate file. is possible download separate file? sample code: $("#gridexport").click(function () { exportdata = []; var exporttype = getexportformat(); //csv (or) xls exportinfo = $("#jqxgrid").jqxgrid('exportdata', exporttype); exportinfo = replaceall(exportinfo, '&lt;br/&gt;', ' '); try { var prm = {}; prm.exportinfo = exportinfo; savemyfile("$('submitform')", "test" + "." + exporttype, exportinfo, "text/" + exporttype + ";charset=utf-8"); } catch (e) { console.log('export error: ' + e); } }); function sav...

vb.net - MySQL data in listview gets looped (?) -

i have listview went wrong today, data inside looped endlessly. what's wrong? public sub list1() sqls = "select * petugas" using cmd new odbc.odbccommand(sqls, conn) dr = cmd.executereader while dr.read listpetugas .items.add(dr("kd_petugas")).tostring() .items(.items.count - 1).subitems .add(dr("nm_petugas").tostring()) .add(dr("j_kel_petugas").tostring()) .add(dr("almt_petugas").tostring()) .add(dr("tlp_petugas").tostring()) end end end while end using end sub why dumping dr listpetugas? what context listpetugas? please show event calling sub. you should use dt instead if holding data in object.

multithreading - Python: TypeError in Threading. function takes x positional argument but y were given -

i working python @ moment. have start-function, gets string message. want start threads every message. the thread @ moment should print out message this: def startsuggestworker(message): print(message) def start(): while true: response = queue.receive_messages() try: message = response.pop() start_keyword = message.body t = threading.thread(target=startsuggestworker, args = (start_keyword)) t.start() message.delete() except indexerror: print("messages empty") sleep(150) start() at moment typeerror , don't understand why. exception message one: exception in thread thread-1: traceback (most recent call last): file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/threading.py", line 914, in _bootstrap_inner self.run() file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/threading.py", l...