Posts

Showing posts from September, 2010

Scala Spark App submitted to yarn-cluster and unregistered with SUCCEEDED without doing anything -

goal run our scala spark app jar on yarn-cluster mode. works standalone cluster mode , yarn-client, reason not run completion yarn-cluster mode. details the last portion of code seems execute on assigning initial value dataframe when reading input file. looks not after that. none of logs abnormal , there no warns or errors either. gets unregistered status succeeded , gets killed. on other deployment mode (eg. yarn-client, standalone cluster mode) runs smoothly completion. 15/07/22 15:57:00 info yarn.applicationmaster: unregistering applicationmaster succeeded i have ran job on spark 1.3.x , 1.4.x on vanilla spark/yarn cluster , cdh 5.4.3 cluster well. same results. possibly issue? job run command below , input file accessible through hdfs. bin/spark-submit --master yarn-cluster --class assocapp ../associationrulesscala/target/scala-2.10/associationrule_2.10.4-1.0.0.snapshot.jar hdfs://sparkmaster-hk:9000/user/root/breastcancer.csv code snippets this code in area d...

c++ - PCl No such file or directory -

when try build file involves pcl, error next each line try include pcl file. have tried moving files same directory, still same error. the visualization tutorial outdated, if error, @ actual documentation help.

xcode - How to make my app suitable for all iPhone sizes without using Auto-Layout? -

i using auto-layout , since having trouble using have disabled it. need make app suitable iphone sizes? you can add missing constraints @ resolve auto-layout issues. before should adjust wany , hany base values layouts.

sql server 2008 - How to populate 10 different query results with different columns and number of columns to a text file in MSSQL -

i doing project generate data extracts on daily basis. have ten different queries different columns , number of columns different. database mssql server 2008 r2 , tried ssis packet accomplish result.i used components datasource, sort , result of sort merge , text file. getting error when combining result saying columns different or something. can suggest solution or there other way accomplish this. thanks, sivajith can please provide error message? merge component can merge data flows various amount of columns, selecting input columns.

Visual Studio 2015 tooltip color -

Image
i starting use visual studio 2015, , have run annoyance tooltip color. new tooltips have colorized font - awesome - background color of tooltips clashes font color scheme, making unreadable. i've pored on font , colors settings, , can't seem find way change particular color. does know if possible change tooltip background color in visual studio 2015? here's example of i'm talking ( from here ): edit: there's uservoice post issue here if don't want go way of plugin, found following setting can used change background color tooltip: environment -> fonts , colors -> show settings for: "environment" -> tooltip

plone - How to set dates on content using a transmogrifier pipeline -

i'm importing content plone using transmogrifier pipeline , need set dates (creation, effective , modification) on items when creating them. the fields i'm trying update are: creation_date , effective_date , modification_date and, dexterity-based content types, can confirm updater works on fields listed on schema , ones stated before ignored. what's right way of accomplish task? have write pipeline section of there available in package?

activemq - Difference between "Active Non-durable Subscibers" and "Active Subscribers" for a particular Topic -

i'm trying understand problems i'm encountering temporary queues, need clear ambiguities in i'm reading admin console. when @ list of subscribers, there 272 "active non-durable topic subscribers" when @ "active subscribers activemq.advisory.tempqueue", there none. there 272 open connections, , 272 consumers "activemq.advisory.tempqueue" why don't see non-durable subscribers specified queue? activemq.advisory.* topics publish metadata activity in broker. used in "network of brokers" configuration (among other things). you looking info temp queues, not advisories temp queues. may able see such info using jmx (jconsole) or subscribing advisory topics (by writing program so)

excel - Refer to a workbooks by index number -

i using set newbook = workbooks.add to create new workbook. need refer workbook without saving it. using workbook index number refer new workbook, there way retrieve index number of last workbook open/created (the highest index number)? you can use last workbook set lastworkbook = workbooks(workbooks.count) but if have newbook variable, can't use that? reason because relying on workbook 's index may not give consistent results.

jquery - Else clause is running always if I remove (else code) everything working fine -

if remove else part of code working fine if statement correct executing else part also. why happening , how can resolve this? please me, new in javascript. <!doctype html> <html> <head> <title>priject 2</title> </head> <body> <label>name: <input type="text" id="name"> </label> <input type="submit" id="fetch"> <br /> <dl> <dt>age</dt> <dd class="age">-</dd> <dt>location</dt> <dd class="location">-</dd> <dt>job</dt> <dd class="job ">-</dd> <script src="jquery-1.11.1.js"></script> <script></script> </dl> <script src="jquery-1.11.1.js"></script>...

elasticsearch - Elastic Search - exclude index and type from json response -

when execute query on index this: { "_source":["bar"] , "size":100, "query": { "match_all": {} }, "filter": { "type" : { "value" : "foo" } } } the response includes index, type, etc. know index , type because specified it. information bloats size of json data. there way exclude these response? this get: { "took": 31, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 364024, "max_score": 1, "hits": [ { "_index": "foo_bar", "_type": "foo", "_id": "asdjj123123", "_score": 1, "_source": { "bar": "blablablabla" ...

javascript - Auto execute when input changes -

i started learning php , want make simple plugin wordpress. have written , set calculate $resultado on submit. working fine want $result auto-calculate everytime change input value can see result everytime , not have press button. is possible javascript? function formulario_webbudget(){ ?> <form action="" method="post"> nombre: <input type="text" maxlength="30" value="<?php echo htmlspecialchars($_post['nombre']); ?>" name="nombre" required><br> apellido: <input type="text" maxlength="40" value="<?php echo htmlspecialchars($_post['apellido']); ?>" name="apellido" required><br> correo: <input type="email" value="<?php echo htmlspecialchars($_post['correo']); ?>" name="correo" required><br> <hr> <input type="checkbox" name="check...

Store matrices and compare them in java -

i need store many matrices , compare of them retrieving last matrix added , previous one. i create these matrices using: int[][] matrix = new int[10][10]; my matrices have 0s, 1s , 2s. want compare matrices based on value of each position. in case, 2 matrices different long @ least 1 position has different value. each matrix created bases on elements detected via reactivision. elements not moved 2s, elements added 1s, , there isn't it's 0. for example: 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 and 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 would different. the number of matrices stored not fixed. if have 10 matrix created, effi...

javascript - HTTP POST using XHR with Chunked Transfer Encoding -

i have rest api accepts audio file via http post. api has support transfer-encoding: chunked request header file can uploaded in pieces being created recorder running on client. way server can start processing file arrives improved performance. example: http 1.1 post .../v1/processaudio transfer-encoding: chunked [chunk 1 256 bytes] (server starts processing when arrives) [chunk 2 256 bytes] [chunk 3 256 bytes] ... the audio files typically short , around 10k 100k in size. have c# , java code working know api works. however, cannot seem recording , upload working in browser using javascript. here test code post localhost transfer-encoding: <html> <script type="text/javascript"> function streamupload() { var blob = new blob(['gmnqpbu+nyrger4jpaw4djdqc19d']); var xhr = new xmlhttprequest(); // add event handlers here... xhr.open('post', '/', true); xhr.setrequ...

c++ - Create hana tuple with unmovable / noncopyable types -

i'm trying wrap head around great boost::hana , try figure out how translate old school tuple code. maybe it's bit special have types neither copyable nor moveable , want pack them in container. think policy design ... i guess i'm not getting how create hana tuple in value world. way i'm trying doesn't work because make<tuple>(compt{}...) needs types either copyable or @ least moveable. so not way it. or limitation of hana? thanks! struct nonmoveable { nonmoveable() = default; nonmoveable(const nonmoveable& other) = delete; int val; }; struct simple { int val; }; template <typename ...compt> struct oldschoolcontainer { template <int i> auto& getcomponent() { return std::get<i>(components); } std::tuple<compt...> components; }; template <typename ...compt> struct hanacontainer { using args_t = decltype(make<tuple>(compt{}...)); template <int i>...

telerik - How to make a connection between IOS app and WatchOS app (NativeScript) -

i have been reading information on watchkit samle app link - , i've got work own app. took bit of time on/off checking of controllers. well - issue is, need watch app require http , make requests - think "best practice" way implement logik in ios app , serve watchos app. (correct me if wrong). but i'm bit confused on how /platforms/ios/"watchappname" extension/app/bootstrap.js suppose communicate ios app. what approach on doing this? note: if having similar issue, know posted on github repo with watchos 2.0 need @ using watch connectivity framework instead of openparentapplication per docs: the framework provides options transferring data in background or while both apps active , replaces existing openparentapplication:reply: method of wkinterfacecontroller class.

dependencies by flavor in android studio build.gradle file, is it possible? -

image in build.gradle file have following dependencies: dependencies { compile 'com.android.support:support-v13:22.1.1' compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.jakewharton:butterknife:6.0.0' } and imagine have following product flavors defined: productflavors { germanymock { applicationid "org.mymocksite.mock" } usamock { applicationid "org.myqasite.qa" } } suppose want have dependency flavor only, this: dependencies { compile 'com.android.support:support-v13:22.1.1' compile 'com.android.support:appcompat-v7:22.1.1' usamockcompile 'com.jakewharton:butterknife:6.0.0'//this not work me } so above not work me thinking since there testcompile , think mockcompile shouldn't there flavor compile ? if not how can see "compiles" available me ? change usamockcompile change c c. dependencies { compile ...

c++ - Determine if code is running in specific thread -

in application run background operation using snippet: m_thread = std::thread(&myclass::backop, this); sometimes different threads (including m_thread itself, possibly) in application call function close() waits background thread complete operation: if(m_thread.joinable()) m_thread.join(); and unsafe behaviour, if right, may cause deadlock . can determine in close() function text, if running in background thread, skip "joining"? thank you! can determine in close() function if running in background thread, skip "joining"? yes, can use std::this_thread::get_id() function , compare m_thread.get_id() determine if routine runs within same std::thread instance.

angularjs - Broadcast event when state loaded and controllers are initiated -

i need broadcast event when state loaded , controllers initiated. i'm using angularjs v1.3.15 , ui-router v0.2.11. i'm trying use $statechangesuccess event, controller doesn't grab broadcasted event, because hasn't been iniatated when event broadcasted. in module run method have: $rootscope.$on('$statechangesuccess', function (event) { $rootscope.$broadcast('someevent'); }); my controller has following: $scope.$on('someevent', function () { $scope.getlist(); }); i tried using $viewcontentloading , $viewcontentloaded because have nested controllers/views, fires multiple times, $scope.getlist() runs multiple times. any solution problem? in case there no need put statechange listener. angular ui-router provide feature use case: resolving controller on state change see ui-router on github . further more should use service returning promise, since api call async, , inject service in controller. see "resolve...

html - Tab icon wont disappear -

i'm using bootstrap basic theme , have been editing it, deleted code in html: <link rel="icon" href="img/icon.jpg"> but icon wont go away, have saved , refresh icon staying there. i've deleted image @ located. you should try clear browser cache , refresh page.

android - How can I limit posts to my parse.com database based on time of day? -

my app allows users save "guess" database on parse, want cut off these guesses @ time, example 5:00 pm cst, , prevent multiple submissions same person. advice on how go this? you can create beforesave function in cloud code , reject saves outside of timespan. https://www.parse.com/docs/js/guide#cloud-code-beforesave-triggers

ruby on rails - Only users that created their own project can see the edit page and actually edit -

is there easy way allow users created own project able edit work? class project < activerecord::base belongs_to :user end class user < activerecord::base has_many :projects end how check if current_user logged in can edit stuff? if projects url's localhost:3000/projects/24 , want user created project can go localhost:3000/projects/24/edit view page , edit... at time of writing, i'm thinking might not best way? maybe need somehow localhost:3000/projects/username1/24 or something? , if edit, it'll localhost:3000/projects/username1/24/edit .... how can accomplish this? my routes: rails.application.routes.draw devise_for :users 'users/:id' => 'users#show', as: :user resources :projects end my controller basic stuff scaffolding maybe need somehow localhost:3000/projects/username1/24 or something? , if edit, it'll localhost:3000/projects/username1/24/edit .... how can accomplish this? since user h...

io - Using Pipes to read and write binary data in Haskell -

i trying read , write many ints in constant memory. have figured out how write ints memory have not figured out how read them back. import control.lens (zoom) import system.io (iomode(..), withfile) import pipes import qualified pipes.prelude p import qualified pipes.bytestring pb import qualified pipes.parse p import qualified pipes.binary p intstream :: monad m => proxy x' x () int m b intstream = go (0 :: int) go = yield >> go (i + 1) decoder :: monad m => int -> p.parser p.bytestring m [int] decoder n = zoom (p.decoded . p.splitat n) p.drawall main :: io () main = withfile "ints" writemode $ \h -> runeffect $ intstream p.encode >-> p.take 10000 >-> pb.tohandle h withfile "ints" readmode $ \h -> xs <- p.evalstatet (decoder 10000000) (pb.fromhandle h) print xs i got decoder function documentation pipes.binary . uses drawall according documentation drawall not idiomatic...

parsing - How to parse simple expressions? -

Image
my homework make expression parser in haskell. couldn't find case previous questions parsing in haskell on so. the expression defined follow: data expr = | const int | var string | add expr expr | sub expr expr | mul expr expr | pow expr int deriving show the type parser defined follow: type parser = string -> maybe (a, string) the parsers given in homework defined follow: --primitive parsers success :: -> parser success v = \inp -> (v, inp) failure :: parser failure = \_ -> nothing item :: parser char item = \inp -> case inp of "" -> nothing (c : cs) -> (c, cs) --sequential parsers (>>>) :: parser -> (a -> parser b) -> parser b p >>> f = \inp -> case p inp of nothing -> nothing (x, cs) -> f x cs (&&&) :: parser -> parser b -> parser b p &&& q = p >>> \_ -> q -- conditional pars...

python - sqlalchemy not setting timestmap default -

sqlalchemy isn't respecting default=datetime.datetime.utcnow or default=func.now() (i've tried both) datetime columns. python: class datastuff(base): """some data""" __tablename__ = 'datastuff' _id = column(integer, primary_key=true) _name = column(string(64)) json = column(sqlalchemy.unicodetext()) _timestamp = column(datetime, default=datetime.datetime.utcnow) mysql: mysql> describe datastuff; +---------------+--------------+------+-----+---------+----------------+ | field | type | null | key | default | | +---------------+--------------+------+-----+---------+----------------+ | _id | int(11) | no | pri | null | auto_increment | | _name | varchar(64) | yes | | null | | | json | text | yes | | null | | | _timestamp | datetime | yes | | null | | ...

What does positional PICK on an object do in Rebol 2, and what's the equivalent Rebol 3? -

in rebol 2: >> foo: make object! [a: 10 b: 20] >> foo/a == 10 >> foo/b == 20 >> first foo == [self b] >> second foo == [make object! [ a: 10 b: 20 ] 10 20] >> third foo == [a: 10 b: 20] >> fourth foo ** script error: fourth expected series argument of type: series date port tuple event ** near: fourth foo so can pick out of if block values 1, 2, 3. doing positional selection right out in rebol 3: >> first foo ** script error: cannot use pick on object! value ** where: first ** near: first foo i gather deprecated (like picking out of function parameter list). however, i'm trying translate code says like: bar: construct/with (third foo) mumble (a) point of code? (b) how translate rebol 3? a) construct builds object without evaluating spec block. implies spec of some [set-word! any-type!] form (which if using body of object). construct/with uses second object ( mumble ) prototype...

c++ - Why is the loop not being vectorized? -

i know vectorization can take place if objects being accessed contiguous in memory. have created struct has pointer , create vector of struct , ensure pointers inside vector of objects pointing contiguous data blocks set them point elements in vector of double same size. #include <iostream> #include <vector> struct vec { vec() {} double* a; }; int main(int argc, char* argv[]) { std::vector<double> vec_double(10000000, 1.0); std::vector<vec> vec_vec(10000000); (unsigned = 0; < 10000000; ++i) vec_vec[i].a = &(vec_double[i]); // why loop not vectorized (unsigned = 0; < 10000000; ++i) vec_double[i] += *(vec_vec[i].a); double sum = 0.0; (unsigned = 0; < 10000000; ++i) sum += vec_double[i]; std::cout << sum << std::endl; return 0; } however, o3 optimization loop @ line number 16 not getting vectorized. can please explain why happening? just guessing here, when looking @ s...

maven - Multi module project - redundant pom.xml -

i have project structure similar following: project-root |--pom.xml (parent pom) |--modulea |--pom.xml (redundant?) |--modulea1 |--pom.xml |--modulea2 |--pom.xml |--moduleb |--pom.xml look @ pom file @ root of modulea . there link modulea1 , modulea2 parent pom. using configuration, in parent pom reference module modulea , use possibly redundant module link sub modules. question :: acceptable remove redundant pom , link modules in parent pom follows, or break convention <module>modulea/modulea1</module> <module>modulea/modulea2</module> the reason find quite annoying have bunch of these "link type poms" installed in repository. thank you well, of course acceptable assuming set <parent><relativepath>../..</relativepath></parent> modulea1 , modulea2 , link parent on filesystem level (and not maven repository). i don't see strong reason against id...

java - Why does Jackson ignore @JsonCreator annotation in my auto-generated POJO Enum? -

as usual, there probaly simple solution problem: i have json schema snippet defines following enum: "title" : { "type": "string", "enum": ["mr", "miss", "mrs", "ms"], "description": "the person's title" } my company's framework uses jsonschema2pojo , maven create necessary pojo ( title lives in clazz , title part of clazz in json schema - clazz name being made - replace employee or customer or whatever like): generated pojo @generated("org.jsonschema2pojo") public static enum title { mr("mr"), miss("miss"), mrs("mrs"), ms("ms"); private final string value; private static map<string, clazz.title> constants = new hashmap<string, clazz.title>(); static { (clazz.title c: values()) { constants.put(c.value, c); } } private titl...

sql server - SQL: Trying to understand IF/ELSE -

select case r.sourceid when '1' 'itunes' when '2' 'sfr' when '3' 'orange' else 'others' end source , cast(sum (r.salesvolume) decimal(14, 4) ) volume , cast(sum (r.salesvolume * r.customerprice) decimal(14, 4) ) value rawdata r inner join product p on p.productid = r.productid inner join calendar c on r.dayid = c.dayid c.weekid between (20145227) , (20155230) , p.contentflavor in ('sd', 'hd') , p.vodest in ('vod','est') , p.distributor in ('m6snd') group case r.sourceid when '1' 'itunes' when '2' 'sfr' when '3' 'orange' else 'others' end the result of above query is: source volum...

java - How can I select with hibernate.query from an intermediate table -

i have 3 tables job , jobseeker , job_applications intermediate table. relation between job , jobseeker n n. how can write hibernate query or criteria select list(job) job.id , job.applicantscount counts how many jobseeker applied job. job entity: @manytomany @jointable(name="job_applications", joincolumns={@joincolumn(name="id_job", referencedcolumnname="id")}, inversejoincolumns={@joincolumn(name="id_job_seeker", referencedcolumnname="id")}) private list<jobseeker> jobseekers = new arraylist<jobseeker>(); @transient @expose private integer applicantscount = 0; ... jobseeker entity: @manytomany(fetch=fetchtype.lazy) @jointable(name="job_applications", joincolumns={@joincolumn(name="id_job_seeker", referencedcolumnname="id")}, inversejoincolumns={@joincolumn(name="id_job", refer...

meteor - How to connect mongodb local server? -

i on linux mint 17.1. run meteor js server runs mongodb in application stack. (all on local machine) installed mongochef (on local machine) , without setting parameter myself, able test connection mongodb. but when want use mongochef, need connect database. in list, seems not connect. do miss in setup? there way know exact port of mongodb server? can mongochef access in parallel of meteor app? insight welcome. you need set connexion port meteor default: 3001 . no problem accessing mongodb collections while running server.

gsp - Return Boolean value from Grails Tablib? -

this question has answer here: grails: call taglib g:if tag 1 answer i created custom grails tablib: def hasrole = { attrs, body -> boolean result = false if (attrs.roles) { if (springsecurityutils.ifanygranted(attrs.roles)) { result = true } } out << result } this can used this: ${cust.hasrole(roles:'role_admin') ? 'yes' : 'no' } the problem comparison alway results yes . seams expression not evaluated correctly. the returning class type of hasrole org.codehaus.groovy.grails.web.util.streamcharbuffer . how above expression evaluated correctly such hasrole() returns boolean value? the key going use of returnobjectfortags in taglib. default tag library outputs information output writer ( out ). in case want this: package example class footaglib { static namespace = ...

java program is not getting called by timer itself -

i have below code here , trying execute whole program on every second using timer, getting called once. called below program on first run command prompt. can guys me on this? import java.util.timer; import java.util.timertask; public class task3 { public static void main(string[] args) { final timer timer = new timer(); timertask task = new timertask() { @override public void run() { // task run goes here system.out.println("hello !!!"); try { dog677_copy.main(new string[0]); try { thread.sleep(1000); //1 min . } catch(interruptedexception ex) { thread.currentthread().interrupt(); } trm.main(new string[0]); tstnew.main(new string[0]); timer.cancel(); ...

c# - MouseWheel EventToCommand for StackPanel -

i have stackpanel listview inside. want able scroll inside window, change selecteditem. to clarify; want change viewmodels selecteditem when mousewheel scrolled. i cannot find way bind command event through eventtocommand i thought pulled off doing <stackpanel> <i:eventtrigger eventname="mousewheel"> <cmd:eventtocommand passeventargstocommand="true" command="{binding mousescrollcommand}"> </cmd:eventtocommand > </i:eventtrigger> <listview/> </stackpanel> but gets me error stating eventtrigger can assinged uielement. then tried inside listview - didn't work. how can bind event (with args) scrollwheel event? i think you're there, need wrap eventtrigger in system.windows.interactivity interaction class: <stackpanel> <i:interaction.triggers> <i:eventtrigger eventname="mousewheel"> <cm...

multithreading - Java - Run a method on Main thread, called from worker thread -

how can call , run method on main thread, called worker thread? main thread code, (foo() function accessible main thread): thread newthread = new thread(mythread, mythread.getthreadname()); newthread.start(); worker thread code (newthread): @override public void run(){ // need call here foo() function - has run on main thread } thanks! the words "call method in thread" have no meaning in java. you need understand thread , thread 2 different things: thread path of execution through code. thread java object can used start new thread , manage life cycle. a new thread begins when other thread calls t.start() t refers thread object. thread begins executing t.run() method, , wanders , out of function calls until reaches end of t.run() , @ point dies. meanwhile, other threads following own paths through code. at lowest level, only way 1 thread interact updating fields of shared objects , classes. thread can tell thread b execute function o...

cordova - Phonegap : Downloading large files on Windows Phones -

i'm developing mobile app phonegap , need download zip-files might on 50mb. i'm using cordova's file-transfer plugin job. now, on ios , android works fine, when same thing on windows phone application hangs out files larger 20mb. system.outofmemoryexception: insufficient memory continue execution of program. phongap documentation has line says downloading supported on ios , android? http://docs.phonegap.com/en/edge/cordova_file_file.md.html#filetransfer it possible (only on ios , android) download file remote server , save on device. but confuses me again site says support added on point(?) http://phonegap.com/2012/04/11/phonegap-1-6-released/ windows - file download api so, supported on windows or not? or there alternative way on windows phones. ok, didn't figure out how apache's file-transfer plugin directly. i found background downloader able download files around 100mb (probably larger) on windows phone 8.1. https:/...

android - How not to disable internet connection while screen is locked? -

how not disable internet connection in service while screen locked or application went background? have such problem. need service in application send request server every 5 minutes. after locking screen internet connection stops. heard power manager dont know hot use it. if service solely running every 5 minutes should use alarmmanager instead. have @ this anyway, service should not lose internet connection when running in background unless bound activities lifetime.

WebRTC to Gstreamer Bridge -

i'm trying stream audio browser gstreamer pipeline on server. i'm using kurento, , modifying hello world example try connect rtp endpoint pipeline -- having trouble. i know media getting there because when swap in recording endpoint, valid recording. the kurento node js is: pipeline.create("rtpendpoint", {}, function(error, rtpendpoint) { if (error) { console.log("recorder problem"); return senderror(res, 500, error); } console.log("creating webrtcendpoint"); pipeline.create('webrtcendpoint', function(error, webrtcendpoint) { if (error) { return senderror(res, 500, error); } console.log("processing sdpoffer @ server , generating sdpanswer"); webrtcendpoint.processoffer(sdpoffer, function(error, sdpanswer) { if (error) { webrtcendpoint.release(); ...

hibernate - Java JPA Unit Test saving 2 items -

i have simple @onetomany setup 2 entities - item , group , , having interesting problem. when integration test creates group , adds item , saves group , 2 instances of item end getting saved. ideas why? i'm using hibernate, if matters: the item entity @entity public class namedentity implements java.io.serializable { long id; @notnull string name; namedentitygroup namedentitygroup; namedentitytype type; @enumerated(enumtype.string) public namedentitytype gettype() { return type; } @id @generatedvalue public long getid() { return id; } public string getname() { return name; } @joincolumn(name = "namedentitygroupid") @jsonbackreference @manytoone(cascade = { cascadetype.all }, fetch = fetchtype.eager) public namedentitygroup getnamedentitygroup() { return this.namedentitygroup; } } the group entity @entity public class namedentitygroup implements s...

javascript - Regex to get scriptfunction body -

i have document , need function body in document this piece of document <script type="text/javascript"> //<![cdata[ (function(){ var = function() {try{return !!window.addeventlistener} catch(e) {return !1} }, b = function(b, c) {a() ? document.addeventlistener("domcontentloaded", b, c) : document.attachevent("onreadystatechange", b)}; b(function(){ var = document.getelementbyid('cf-content');a.style.display = 'block'; settimeout(function(){ var t,r,a,f, vsfcuji={"gqftzuokv":+((!+[]+!![]+!![]+[])+(+[]))}; t = document.createelement('div'); t.innerhtml="<a href='/'>x</a>"; t = t.firstchild.href;r = t.match(/https?:\/\//)[0]; t = t.substr(r.length); t = t.substr(0,t.length-1); = document.getelementbyid('jschl-answer'); f = document.getelementbyid('challenge-form'); ;vsfcuji...

php - How to sort 1 value in array to top? -

for example: $array = ("1", "2", "3", "4", "5"); now want sort number 3 on top, result: $array = ("3", "1", "2", "4", "5"); if want sort array except one, try : function cmptotop($a, $b){ if($a === '3') return -1; //change comparison value if($b === '3') return 1; //change comparison value if($a === $b) return 0; return ($a < $b) ? -1 : 1; } $a = array('3', '2', '5', '6', '3', '1'); cmptotop($a, "cmp"); //result : array('3', '3', '1', '2', '5', '6')

My previously working facebook script now getting OAuthException Code 1 error -

i have php script using following facebook api call: $apicall = " https://graph.facebook.com/ {$page}?access_token={$fbappid}|{$fbappsecret}"; this has been working fine long time , getting me data... since yesterday getting is: {"error":{"message":"an unknown error has occurred.","type":"oauthexception","code":1}} nothing has changed on end, don't understand problem is. have suggestions? your access token facebook may have expired. suggest going dev website again , requesting new access token.

Laravel: get() returning array? -

i have simple eloquent query: $comments = comment::where('approved',1)->orderby('created_at','desc')->get(); return view('comments.approved', compact('comments')); i trying access data in view using following syntax @foreach($comments $comment) {{ $comment->content }} @endforeach i getting following error trying property of non-object (view: ... i able resolve problem either of these {{ @$comment->content }} or {{ $comment['content'] }} however, fail understand why get() returning array instead of collection. isn't get() suppose return collection of objects? php compact() this, according http://php.net/manual/en/function.compact.php creates array containing variables , values. so you're changing array pass view. try without using compact() , see if response you're expecting. return view('comments.approved', ['comments' => $comments]);

Format String from TextBox to TimeValue in Excel VBA -

i have textbox in userform. using event _afterupdate(), want update format timevalue, "hh:mm" using code. private sub timetextbox_afterupdate() on error goto errorhandler timetextbox .value = format(timevalue(.value), "hh:mm") errorhandler: .value = format(timevalue(now), "hh:mm") end end sub the problem: fail, if enter 13:13 in box. how solve this? as @matthewd commented, you're creating infinite loop updating textbox inside update event. vba quits looping, it's not quite infinite. keep getting current time because don't exit sub prior errorhandler: . code under error handling label gets executed 100% of time. if put exit sub on line above errorhandler: code below executed if there's error. however, i'll propose different way. private mbeventsdisabled boolean private sub timetextbox_afterupdate() dim dttime date 'see if can convert text time on error resume next dttime = ti...

c# - What does GROUP "x" BY "etc" do? -

i couldn't find kind of query though searched in msdn , many books. maybe here able me. here's example: var query = document in database.documents group document.ownerid new { ownername= document.owner.ownername, releasedate= document.releasedate, ownerid= document.ownerid, status= document.statusid } grupo select new amountofdocuments { ownername= grupo.key.ownername, releasedate= grupo.key.releasedate, ownerid= grupo.key.ownerid, udocuments= grupo.count(), sdocuments= grupo.count() }; i ...

jquery - In css how to joining two div classes without space? -

Image
in css have following:-- body { background-color: #ffffff; font-family: arial, georgia, sans-serif; font-size: 16px; } .wrapper { width: 100%; position: relative; min-height: 1300px; background-color: yellow; -webkit-box-shadow: -10px 0 15px #000; -moz-box-shadow: -10px 0 15px #000; box-shadow: -10px 0 15px #000; -webkit-transition: -webkit-transform 0.2s ease; -moz-transition: -moz-transform 0.4s ease; -ms-transition: -ms-transform 0.4s ease; -o-transition: -o-transform 0.4s ease; transition: transform 0.4s ease; } .header1 { width: 100%; position: relative; min-height: 90px; clear:both; background: url(../images/tooplate_footer1.png) no-repeat; -webkit-transition: -webkit-transform 0.2s ease; -moz-transition: -moz-transform 0.4s ease; -ms-transition: -ms-transform 0.4s ease; -o-transition: -o-transform 0.4s ease; transition: transform 0.4s ease; } input[type="checkbox"]:checked ~ .wrapper { -webkit-transform: ...