Posts

Showing posts from September, 2013

ruby on rails - Failure/Error: response.should render_template(:new) expecting <"new"> but rendering with <""> -

posts_controller.rb class postscontroller < applicationcontroller respond_to :html, :xml, :json before_filter :authenticate_user!, :except => [:show, :index] before_filter :admin_only, :except => [:show, :index] def new @post = post.new end end spec_helper.rb # file copied spec/ when run 'rails generate rspec:install' env["rails_env"] ||= 'test' require file.expand_path("../../config/environment", __file__) require 'rspec/rails' require 'forgery' require 'populators' # requires supporting ruby files custom matchers , macros, etc, # in spec/support/ , subdirectories. dir[rails.root.join("spec/support/**/*.rb")].each {|f| require f} rspec.configure |config| config.mock_with :rspec # remove line if you're not using activerecord or activerecord fixtures config.fixture_path = "#{::rails.root}/test/fixtures" config.before(:suite) databasecleaner.strategy = :t

reactjs - Karma chrome launcher starts, but crashes immediately -

the karma chrome launcher starts, crashes.. have included error log.. rookie, please me sort out ! in advance ! :) npm debug log looks this... 0 info worked if ends ok 1 verbose cli [ 'c:\\program files\\nodejs\\node.exe', 1 verbose cli 'c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'test' ] 2 info using npm@3.8.6 3 info using node@v5.11.1 4 verbose run-script [ 'pretest', 'test', 'posttest' ] 15 silly lifecycle ~~~~~box@0.0.1~test: args: [ '/d /s /c', 'karma start' ] 16 silly lifecycle ~~~~~box@0.0.1~test: returned: code: 1 signal: null 17 info lifecycle ~~~~~box@0.0.1~test: failed exec test script 18 verbose stack error: ~~~~~box@0.0.1 test: `karma start` 18 verbose stack exit status 1 18 verbose stack @ eventemitter.<anonymous> (c:\program files\nodejs\node_modules\npm\lib\utils\lif

c# 4.0 - notification sound in build version in c# -

i created 1 notification using kendo ,when notification araises kept system.media.systemsounds.hand.play() , it working fine while project running,when publish project , run in build version notification sounds not coming? what should do? public jsonresult demonotification() { list<demonotification> res = new list<demonotification>(); datatable dt = functions.gettbl(cmd); if (dt.rows.count > 0) { for(int i=0;i<dt.rows.count;i++){ demonotification obj = new demonotification(); obj.companyname = dt.rows[i]["companyname"].tostring(); obj.demodate =convert.todatetime(dt.rows[i]"demodate"]); res.add(obj); system.media.systemsounds.hand.play(); } } return json(res); } function load() { $.ajax({

How to get Kafka Topic Name from Spark Streaming createStream API -

i using spark streaming 1.6.1 , kafka 0.9.0.1 on hdp 2.4.1, due open open bug in hdp 2.4.2 not able use createdirectstream api spark streaming,so using createstream api spark streaming. have requirement need topic name dstream on basis of topic name need processing. using below code read message kafka topic, not able retrieve topic name dstream coming null. can please me on this. val record = kafkautils.createstream[string, string, stringdecoder, stringdecoder](ssc, kafkaparams, topicmap, storagelevel.memory_only_ser_2) val keys =record.map(_._1) keys.print

sparql - Transaction in Virtuoso over HTTP -

i trying use transaction in virtuoso on http sparql/web service endpoint. in this link using isql tool not sparql query , endpoint. is there way perform transaction operations on http?

algorithm - why do we use RAM model of computation for algorithmic analysis when it corresponds to harvard architecture? -

as per wikipedia , rasp model of computation corresponds von neumann architecture while ram model of computation corresponds harvard architecture , von neumann architecture closest computers since have ram memory in our computers stores data instructions in , while ram model has different program memory , different data memory , why use ram model algorithmic analysis ? https://en.wikipedia.org/wiki/random-access_stored-program_machine unless algorithm uses self-modifying code, distinction doesn't matter, reasons margaret points out. also, far real hardware concerned, (almost?) modern cpus have cache have split instruction/data l1 caches, actual cpu core more harvard-like von neumann. instruction-fetch competes data access. wikipedia's modified harvard architecture article goes more detail, , mentions other ways mostly-harvard architectures can still programmed programs.

symfony - How use Facebook and google+ login in sylius alpha version? can anyone provide simple guide for it? -

can provide me simplest guide facebook , google+ login or connect sylius base project? thanks i've started writing guide sylius docs. using this guide now. give more feedback next week. follow sylius github :) edit : we've updated documantation @ sylius. check out here!

ios - how to implement Deferred deeplink using HOKO Links? -

i have implement smart link using hoko in ios app . and works fine, when my app installed link app hokdeeplink *deeplink = [hokdeeplink deeplinkwithroute:@"viewcontroller/:product_id" routeparameters:@{@"product_id": @"2"} queryparameters:@{@"referrer": @"jax1"} metadata:@{@"coupon": @"20"}]; [[hoko deeplinking] generatesmartlinkfordeeplink:deeplink success:^(nsstring *smartlink) { nslog(@"smartlink == %@",smartlink); //[[social sharedinstance] shareproduct:self.product link:smartlink]; } failure:^(nserror *error) { nslog(@"error = %@",error.description); // share web link instead //[[social sharedinstance] shareproduct:self.product link:self.product.weblink]; }]; by using above code create link inside app and when tap on link redirect me app [[hoko deeplinking] maproute:@"viewcontroller/:prod

django - sorl-thumbnail not save cache -

i used sorl-thumbnail. when viewed modern template, path /media/cache/25/b8/25b8886a95680ecb25d29cf67f4ba131.jpg displayed , thumbnail image not saved. mysetting base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) templates_dirs = (os.path.join(base_dir,'templates'),) debug = true template_debug = true thumbnail_debug = true allowed_hosts = [] installed_apps = [ .... 'django.contrib.staticfiles', 'blog', 'sorl.thumbnail', ] # static files (css, javascript, images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ base_dir = os.path.dirname(os.path.abspath(__file__)) static_url = '/static/' static_root = os.path.join(base_dir,'static') media_url = '/media/' media_root = os.path.join(base_dir,'/media') models from django import models form sorlthumbnail import imagefield class post(models.model): author = models.fore

symfony - Symfony2 (version 2.8.13): I am lost on where to place and access my CSS, JS, and Image files -

i'm new symfony2, , struggling rewriting running in existing codeigniter site symfony2 new symfony2 version of site. after installing symfony2 version 2.8.13, standard edition on remote server, have been able run app.php , app_dev.php pages in computer's chrome browser. used 'create first page' instructions begin learning symfony2, , incrementally applying knowledge begin rewriting old codeigniter index.php page run in new symfony site. because old codeigniter site used php, css, javascript, jquery, few plug-ins, , codeigniter functions connect supporting database , render output pages, i've decided not rewrite views in twig. instead i'm using symfony controller house 'logic' of codeigniter controller , view files. later on i'll break controller/view file multiple files of 1 sort or create reusable component files used in codeigniter site, rewritten use symfony2 framework. with of said, here questions: 1) how 'tell' rendered w

evil mode - emacs, narrow-to-defun, hs-show-block -

this question has answer here: why emacs functions not available via `m-x`? 1 answer i have defined following: (defun narrow-into [] (narrow-to-defun) (hs-show-block)) (define-key evil-normal-state-map (kbd "zi") 'narrow-into) my goal the goal can open file, hit "zi", , (1) narrow current defn , (2) open editing. my problem when try run it, "wrong type argument: commandp, narrow-into" question what doing wrong , how fix it? you need declare function interactive if want call interactively. explains error getting. other that, brackets should parens: (defun narrow-into () (interactive) (narrow-to-defun) (hs-show-block))

floating point - x86_64 Assembly double comparison not working as intended, some of the time -

i'm aware of floating point inaccuracies, need way around them. so, need graph traversal, , i'm doing getting nodes stack, adding routes neighbors, adding large route non-neighbors, going through , finding best routes. works fine routes created neighbors, breaks on routes created large number. here's relevant sections of code. here large route assigned. movsd xmm0, [big] mov [r11+rax+tar], r9 movsd [r11+rax+dis], xmm0 mov [r11+rax+hop], r9 here comparison made, in order see if better route found. ucomisd xmm0, xmm2 ja bmbd jmp embd bmbd: mov rax, [r8+rot] mov [rax+r13+hop], r11 movsd [rax+r13+dis], xmm2 embd: the above block of code problem is, following breakdown of believe code doing. d asks d better route, nothing happens: good. d asks a, finds 1 , calculates distance 3.3+5.4=8.7, it's better , replaces it's current route: good. d asks b, finds 1 distance of 8.7+0=8.7. reason regarded better , it's route replace

mysqli - get enter hours from the table using mysql -

this question has answer here: multiple query same table in different columns mysql 5 answers this query: how value of 3 select query name,hours entered',hours approved,hours rejected select e.ename 'name', sum(l.hours) 'hours entered' labors l, emps e l.empsid = e.empsid , approved = 'n' , l.empsid = 'agiucl01' , l.date_work between '2016-10-30' , '2016-11-05' union (select e.ename 'name', sum(l.hours) 'hours approved' labors l, emps e l.empsid = e.empsid , approved = 'a' , l.empsid = 'agiucl01' , l.date_work between '2016-10-30' , '2016-11-05') union select e.ename 'name', sum(l.hours) 'hours rejected' labors l,empse l.empsid = e.empsid , approved = 'r' , l.empsid = 'agiucl01' , l.date_work

javascript - Typescript interface readonly fields (Cannot find name 'readonly') -

i have following issue, "cannot find name 'readonly'" when defining interface readonly properties. have installed following version of typescript: v 2.0.8 , using visual studio 2015. here sample: typescript interface car { readonly engine: string; readonly model: string; } any ideas appreciated. you need figure out error. within visual studio (i.e. intellisense or during project build). or during compilation node (webpack or something) uses package.json e.g., have 2.0.8. since have not seen 2.0.8 visual studio, updated version node. bet error visual studio version of typescript. need update visual studio. unfortunately cannot directly extensions view, should work. need download yourself: https://www.microsoft.com/en-us/download/details.aspx?id=48593

ios - Apple App Transport Security (ATS) for Enterprise Application -

i developing enterprise application. far every thing working fine in simulator when deploy on physical devices crashes. crash happening because app connecting web services via "http" instead of "https". i have added ats exceptions in info.plist file. need know enterprise application continue work after 2016 (apple's deadline) http ? application hosted in our own servers, , apple doesn't review enterprise applications. update 1 need know enterprise application continue work after 2016 ats exceptions or not ? <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>cfbundledisplayname</key> <string>xxxxxxxx</string> <key>cfbundleidentifier</key> <string>com.xxxxxxx.xxx</string> <key&

Show different login formsand use different login auth Laravel Authentication -

is possible modify laravel app authentication? want show different forms per different login route, if have 2 different login routes admin , user. admin login route, can access admin dashboard /app/system/login user login route, can access user page /app/system/user/login i tried do php artisan route:list and see this logincontroller@login logincontroller@showloginform but don't know find them modify requirements. help, ideas please? you can edit auth controller in http/controllers/auth/authcontroller.php, functions import file illuminate/foundation/auth/authenticatesusers.php. read documentation how create other auth .

c# - IRazorViewEngine outside mvc -

i trying implement html template rendering using razor rendering engine. have windows service application partially uses mvc 6 , have found successful implementation works web part of application. public viewrenderservice(irazorviewengine razorviewengine, itempdataprovider tempdataprovider, iserviceprovider serviceprovider) { _razorviewengine = razorviewengine; _tempdataprovider = tempdataprovider; _serviceprovider = serviceprovider; } public async task<string> rendertostringasync(string viewname, object model) { var httpcontext = new defaulthttpcontext { requestservices = _serviceprovider }; var actioncontext = new actioncontext(httpcontext, new routedata(), new actiondescriptor()); using (var sw = new stringwriter()) { var viewresult = _razorviewengine.findview(actioncontext, viewname, false); if (viewresult.view == null) { throw new argumentnullexception($"{viewname} not match available v

android - Convert image x,y, coordinates to View coordinates when Scale,Translation and Rotation apply -

Image
in 1 of project using face detection api .after getting points(x,y) bitmap need convert view points(x,y) . have applied scale, translation,rotation image please check code float point[] = {(float)mface.facelandmarks.nosetip.x, (float)mface.facelandmarks.nosetip.y}; matrix matrix = new matrix(); matrix.prescale(imageview.getscalex(), imageview.getscaley()); matrix.postrotate(imageview.getrotation()); matrix.settranslate(imageview.gettranslationx(), imageview.gettranslationy()); matrix.mappoints(point); xp = ((point[0] * adjustpicturestep2.getwidth()) / mbitmap.getwidth()); yp = (((point[1] * adjustpicturestep2.getheight()) / mbitmap.getheight())); values used above origional points : x= 2595.5, y=1764.0 point after mapping p[0]=2595.5, p 1 =1764.0 translationy -815.51404 translationx -114.501785 rotation -12.940008 scale 4.0 please me if wrong in understanding.

xamarin.android - I have created a xamarin camera app ,i need help set the camera app a default camera u sing the manifest -

i have created xamarin camera app, , need set camera app default camera using manifest. you can find manifest code below, can please me set camera app default app. how can set app default app when open web app uses camera can see 1 of available use <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"> <uses-sdk android:minsdkversion="15" /> <application android:label="menikocamera.droid"></application> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.camera" /> <uses-feature android:name="android.hardware.camera" android:required="true"/> <activity android:name="menikocamera.mainactivity" android:label="@string/app_name" android:configchanges="screensize"

c - How can I add items into a struct without creating variables -

i using struct store string , integer so: struct movement { char *direction; int steps; }; i can add items struct doing this struct movement m1= { "right",20 }; struct movement m2= { "left" ,10 }; the end result trying achieve collect user inputs (e.g. "right 20"), , store in struct. how can store unknown number of user inputs struct without use of variables (m1, m2 etc) since not know how many items there @ end. use linked list. recursive data structure great want. here example code wrote while ago might help: #include <stdio.h> #include <stdlib.h> #include <string.h> /* basic linked list structure */ typedef struct node node_t; struct node { char *direction; int steps; node_t *next; }; /* pointers head , tail of list */ typedef struct { node_t *head; node_t *foot; } list_t; list_t *initialize_list(void); list_t *insert_nodes(list_t *list, char *direction, int steps); void free_lis

classification - Basic Hidden Markov Model, Viterbi algorithm -

i new hidden markov models , trying wrap head around pretty basic part of theory. i use hmm classifier, so, given time series of data have 2 classes: background , signal. how emission probabilities estimated each class? viterbi algorithm need template of background , signal estimate prob(data|state)? or have missed point? to classification viterbi need know model parameters. background , signal 2 hidden states. model parameters , observed data want use viterbi calculate sequence of hidden states. to quote hmmlearn documentation : the hmm generative probabilistic model, in sequence of observable x variables generated sequence of internal hidden states z. hidden states not observed directly. transitions between hidden states assumed have form of (first-order) markov chain. can specified start probability vector π , transition probability matrix a. emission probability of observable can distribution parameters θ conditioned on current hidden state.

Is it possible to create a custom page and use WordPress Codex? -

i want ask can create file favorite name , use wordpress codex in ? how can ? want load posts of unique category in ... note: don't want create page wp dashboard. thanks ! it better create page template , write code displaying post category. assign template of page in wordpress dashboard.

ios - How to set frame for TapGesture Recognizer -

i have imageview , want tap on 1 side of imageview. possible set frame gesture? can solution? use uigesturerecognizerdelegate , think can idea on how compare: -(bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldreceivetouch:(uitouch *)touch { if ([touch locationinview:yourview].x < somepoint.x) { return false; } else { return true; } }

python - pymongo date field converted to unknown date format -

i getting data 1 collection using python , processing , storing in collection. in processed collection of date fields looks different date(-61833715200000) . i use below code data , processing , bulk insert values new collection. fleet_managers = taximongo.users.aggregate([{ "$match": { "role" : "fleet_manager"}}]) fleet_managers = pd.dataframe(list(fleet_managers)) fleet_managers['city_id'] = fleet_managers['region_id'].map({'57ff2e84f39e0f0444000004':'chennai','57ff2e08f39e0f0444000003':'hyderabad'}) pros_fleet_managers.insert_many(fleet_managers.to_dict('records')) the collection looks this: { "_id" : objectid("58006678ee5e0e29c5000009"), "deleted_at" : nan, "region_id" : "57ff2e84f39e0f0444000004", "reset_password_sent_at" : date(-61833715200000), "current_sign_in_at" : isodate("2016-10-14t06

java - Do i have to use "Spring Rabbit" instead of "Spring Cloud Stream" -

i'm working on project tries adopt messaging-driven framework. (different independent components communicate messages routed message broker) rabbitmq chosen broker finally. for framework, @ first try use spring cloud stream , when try leverage rabbit characteristics, such as: exchange, routing key, alternate exchange... find hard use them in spring cloud stream. so question is: do have use spring rabbit (or maybe spring integration) instead of spring cloud stream? do have suggestions/best practices them? spring cloud stream opinionated queues, exchanges, routing keys; considering adding more flexibility in future release but, now, can use spring amqp directly , it's not lot different - @rabbitlistener instead of @streamlistener example. whether or not add spring integration depends on application needs are.

scala - In mllib LinearRegressionWithSGD, I can not control numIterations, why? -

i have 1 ml task, 34461 samples , use linearregressionwithsgd train model. results of 2 training result(mse , correlation) same: train model (setnumiterations( 5 )) val linearregressionwithsgd: linearregressionwithsgd = new linearregressionwithsgd() linearregressionwithsgd.setintercept(true) linearregressionwithsgd.optimizer.setstepsize(0.1) linearregressionwithsgd.optimizer.setnumiterations(5) train model (setnumiterations( 10000 )) val linearregressionwithsgd: linearregressionwithsgd = new linearregressionwithsgd() linearregressionwithsgd.setintercept(true) linearregressionwithsgd.optimizer.setstepsize(0.1) linearregressionwithsgd.optimizer.setnumiterations(10000) i can not control number of iterations, why?

azure - unable to choose hdfs file under upload table tab (Hive view - Ambari) -

i'm using hortonworks-sandbox in azure. when clicked browse button under upload table tab in hive view (ambari), can upload files local file system (not sandbox local fs). , i'm not able select files hdfs. there no such option select files hdfs in interface. there way select files hdfs? yes, can select files hdfs if selecting files mean being able upload files. no, cannot select files hdfs if selecting files mean being able graphically choose them. back being able select files: should see hdfs path: enter full hdfs path box. enter there path uploaded data file. example /user/[user_name]/[file_name] .

sql - Trim left non ascending elements from array -

i have table in postgresql-9.3 integer array column. need trim arrays such keep elements starting end of array ascending. example array: {2,6,8,3,4,5,8,9,11,3,5,7} trimmed: {3,5,7} the code not need fast or pretty, gets run once fix bad data. i did not expect manage, did solve myself: select arr[(select coalesce(max(row_number)+1,1) ( select unnest, lead(unnest) over(), row_number() on () ( select unnest(arr) test id=c.id ) ) b unnest>lead):array_upper(arr,1)] test c;

r - Programmatically change class to custom class -

using package openxlsx prepare writing of dataframe excel workbook, able run example in openxlsx's vignette using column per column way change variable's class . ## data.frame write df <- data.frame("date" = sys.date()-0:4, "logical" = c(true, false, true, true, false), "currency" = paste("$",-2:2), "accounting" = -2:2, "hlink" = "http://cran.r-project.org/", "percentage" = seq(-1, 1, length.out=5), "tinynumber" = runif(5) / 1e9, stringsasfactors = false) ## below comes custom class assignation used excel formatting class(df$currency) <- "currency" class(df$accounting) <- "accounting" class(df$hlink) <- "hyperlink" class(df$percentage) <- "percentage" class(df$tinynumber) <- "scientific" ## works ! class(df$percentage) [1] "percentage" in order work own dataset use dplyr change class of column

xslt - Xquery to concatenate names if available -

we have incoming message name field below, "givenname" field unbounded: <name> <surname>louis</surname> <givenname>john</givenname> <givenname>andy</givenname> </name> we need pass message other end system as: <name> <fullname>louis, john andy</fullname> </name> so, if givenname field not present in input, transformation should produce: <name> <fullname>louis</fullname> </name> and if multipe givenname present in input should concatenate seperating space. i tried using concatenate function not giving desired result. tried using: <ns1:fullname>{ fn:concat($submittedby/ns1:name/ns1:surname,", ", (for $givenname in $submittedby/ns1:name/ns1:givenname return fn:concat(data($givenname), "")) ) }</ns1:fullname> but producing like: <name> <fullname>louis, johnandy</fullname> </name> i having trou

c# - Cancellation async in IDisposable class -

in project use manager control plugin. main idea plugin must work in single thread in multythreads wpf application. there 1 instance of plugin in plugincontroller. so when call start method: stops plugin (if running) , start new argument. few times second plugin notificate caller it's state, , viewmodel shows in wpf window. when call method start times 1 after one, see previous instance of viewmodel not destroyed, sleeps after stop. , calls update method god new 1 instance. interface twiches becouse 2 instances updating it's state. in log see alternately lines first 1 , second one. but when call start(...) stop() , start(...) again works fine. so somemanager.start(...); somemanager.start(...); works errors. and somemanager.start(...); somemanager.stop(); somemanager.start(...); works fine. can explain me mistake? down lied simplified code. public static somemanager { public static void start(somearg arg) { stop(); // forgotten code

Unable to see list of emulator devices for Xamarin Android in VS 2015 -

Image
i using vs 2015 enterprise update 3. after fresh installation, created new project--> cross platform tools--> blank xaml app(xamarin.forms portable). made andriod project default project solution explorer. tried select device none available, altough when open sdk manager can see 3 devices. andriod error list of devices did setup android project startup project? werid because in screenshot shows portable project startup project. how looks when debug android project.

regular expression for url validation handle multiple forward slashes using java -

i want validate below mention url using java "http://localhost//app/page1/result" my validation condition here dont want allow (multiple) forward slashes. means after localhost 2 forward slashes came want validate , throw exception. if(url.isvalid){ .. } don't allow forward slashes place except after schema. i tried urlvalidator, java.net.uri replace slashes return original url. want throw exception dont want replace it. please me thanks sanjay

SQL Server: Auto increment decimal column -

i need auto increment decimal column in sql server 2014. you should tell want achieve, 1 way emulate auto-incremented decimal column define computed , connected auto-incremented normal (integer) column. e.g.: definition: create table autoincrementdecimaltest ( id int not null identity(1, 1), sometext nvarchar(200) not null, -- may declare persisted, if space not problem autoincrementdec cast(id * 0.2 numeric(18, 2)) ) of course, limitations apply expression, pointed out here . testing: insert autoincrementdecimaltest (sometext) values ('test1'), ('test2') go select * autoincrementdecimaltest go

XML Oracle SQL character sets ORA-31011: XML parsing failed -

i have xml sql statement i'm using (see below oracle11g sql) overcome passing error (below), sql statement works strip out characters not specified in regexp_replace statement example following É Ë È need included in xml output file, include these , more there short cut include these characters in regexp_replace without naming long list of characters. have tried sql select dbms_xmlgen.convert(t.title) i've been told strips out invalid characters failed same parsing error below. the reason why i'm using regexp_replace , failing because of characters (for example char(160) none-breaking space) in title database field. is there simpler solution or have included long list of characters in regexp_replace . thanks in advance. declare * error @ line: ora-31011: xml parsing failed ora-06512: @ line 8 the trouble because i'm dealing different character select xmlagg ( xmlelement ("referenceavgroup",

ios - switch between multiple version of cocoapods -

i have xcode 7.3.1 , xcode 8 , using both of them 2 different projects. each project needs different version of cocoapods. have have 2 cocoapods versions installed. how can switch between 2 versions ? in other words when use xcode 7 need version , when use xcode 8 need other version of cocoapods. thanks pod --version lists version of coco pods in system pod _1.0.1_ install #uses 1.0.1 version

I need to show video with separate audio files (PHP or HTML) -

i want show video 3 separate audio files this: video: publicidad.mp4 (duration: 40 seconds) audio1: publi1.mp3 (duration: 10 seconds) audio2: publi2.mp3 (duration: 10 seconds) audio3: publi3.mp3 (duration: 20 seconds) as see, video , audio have same duration, need play 3 audio files because have form, , depending options choose in it, may play different audio files, audio files have same duration video. please, how can make php, html, html5 or other?. thanks!!.

c# - Entity framework performance slow -

Image
we using ef 6.0, .net 4.5 , using code first approach , our database has around 170 entities(tables) , main table holding around 150,000 records on first load of entity framework takes around 25 seconds. trying improve time slow , number of records increases becomes slower. have tried generating native images, tried using pre generated interactive views couldn't achieve significant improvements. can please me on this? thanks. you can consider entity framework pre-generated mapping views .you can use ef power tools create pre-generate views. using pre-generated views moves cost of view generation model loading (run time) compile time. while improves startup performance @ runtime, still experience pain of view generation while developing. there several additional tricks can reduce cost of view generation, both @ compile time , run time. you can refer knowing more : entity framework pre-generated mapping views you can use caching in entity fram

hortonworks data platform - How to solve the relationship failure? -

i have processor appears creating flowfiles correctly (modified standard processor), when goes commit() session, exception raised: 2016-10-11 12:23:45,700 error [timer-driven process thread-6] c.s.c.processors.files.getfiledata [getfiledata[id=8f5e644d-591c-4df1-8c79-feea118bd8c0]] failed retrieve files due {}  org.apache.nifi.processor.exception.flowfilehandlingexception: standardflowfilerecord transfer relationship not specified i'm assuming supposed indicating there's no connection available commit transfer; however, there "success" relationship registered during init() in same way original processor did it, , success relationship out connected processor input should be. any suggestions troubleshooting? what changes did make standard processor? if calling methods on processsession object, ensure saving latest "version" of flowfile returned method calls, , transfer latest version "success". flowfile references immutable; in c

javascript - Clipboard.js not working in Bootstrap modal -

i trying copy input value clipboard.js: https://clipboardjs.com/ . input located in modal: http://codepen.io/deka87/pen/ebjoky new clipboard('#copy', { text: function(trigger) { return $("#copy-input").val(); } }); while works outside of modal, fails work when input , copy button located in modal window. tried init clipboard function after modal window open: $(".modal").on("shown.bs.modal", function() { new clipboard('#copy', { text: function(trigger) { return $("#copy-input").val(); } }); }); however, didn't solve issue. ideas? try fork: http://codepen.io/anon/pen/nbxwbq forgot remove console.log ignore :) <input type="text" class="form-control" id="copy-input" value="copied successfully!"/> <br /> <a href="#" id="copy" data-clipboard-target="#copy-input" class="

android - How to show slide option in ListView in appcelerator -

Image
i'm building simple app in appcelerator , have using listview custom template. so result can obtain if try start ma app. this ok, want implement delete function in mail's app. want if slid list item left right, system show cancel option this: so code of custom listview: <listview id="elementslist" defaultitemtemplate="elementtemplate" onitemclick="listitemclick"> <templates> <itemtemplate name="elementtemplate" class="itemtemplate"> <view id="atomproperties"> <label bindid="name" id="name" iditem="" idomnia=""/> <view id="secondline"> <label class="line2 fieldlabel" text="from: " /> <label class="line2" bindid="datestart"

jpeg - Can I get some general info about image file like .png . jpg? -

can , how can based on this link general of photo size in px , size in mb ... , maybe more info ? you need write that: identifies type of image stream using file signature. reads header information each stream type prints information out. you need examine stream format specifications each type interested in. jpeg, interested in sos marker , maybe various appn markers used different file formats.

javascript - Php and Html chart using Canvas.js using mysql database -

i trying fetch data mysql database , plot line graph using canvas.js way.....i want know how pass values have fetched database datapoints: x , y values....i;e..x contain time , y contains temperature.i trying plot time vs temperature graph here.. i have received these 2 data values database in php using code. $sql1 = "select time sdata order id desc limit 10;"; $response1 = mysqli_query($connect, $sql1) or die(mysqli_error($connect)); while($row1 = mysqli_fetch_all($response1)){ $r1[]= $row1; } $sql2 = "select temperature sdata order id desc limit 10;"; $response2 = mysqli_query($connect, $sql2) or die(mysqli_error($connect)); while($row2 = mysqli_fetch_all($response2)){ $r2[]= $row2; } here when give echo , see r1 , r2 values able see database values.... --these datetime values database: [[["8/30/2016 9:37"],["8/30/2016 9:33"],["8/30/2016 9:32"],["8/30/2016 9:32"],["8/30/2016 9:32"],["8/3

javascript - Hiding a component with React -

i have couple of react classes in code. when app fires up, user presented this: <div> <h1 classname="headings" id="heading"> football </h1> <input type="text" placeholder="name" /> <input type="email" placeholder="use noths email" /> <input type="submit" onclick={() => this.handleclick()}/> { this.state.results ? <decision /> : null } <thanks /> </div> the state result works because when click button above turns state false true. returns underneath input fields. rather replaced input fields above. how can achieved? in summary, once user enters user name , email , hits submits, want code render on page instead of input fields rather beneath declare output variable within render() method: let output; note: use var if you're not supporting es6. then use conditional statement populate variable:

eclipse - [Java][Jboss]classToLaunch cannot be null -

i'm beginner (java/jboss), , i'm trying launch jboss on java ee, got same error when launch server eclipse : with jboss 7.1.1 an internal error occurred during: "starting jboss 7.1 runtime server". classtolaunch cannot null or jboss eap 6.1.0 an internal error occurred during: "starting jboss eap 6.0 runtime server". classtolaunch cannot null when configure server runtime environment, have choice : [jboss community] jboss 7.0 runtime or jboss 7.1 runtime [jboss enterprise middleware] jboss enterprise application platform 6.x runtime one thing import think : can't have internet connection i'm installing server (but can copy local machine) versions : eclipse java ee, kepler release 2 (build id: 20140224-0627) jboss-as-7.1.1.final jboss-eap-6.1 go window-> preferences-> server-> runtime enviroments-> click on runtime enviroment(which server want start)-> click edit-> check home

elixir - Keyword-based query returns undefined function for binding -

i trying use keyeword-based queries in order use lateral joins i copy-pasting docs automessage |> join(:inner, [am], in assoc(am, :app)) but complain with undefined function a/0 any ideas doing wrong? ps. running on ecto. 2.0.5 most ecto.query.join/3 macro not imported scope, , query interpreted regular elixir code compiler. ps. keyword-style query 1 using from/2 macro, using other macros pipe-style or direct-style (not sure terminology used here).

shareactionprovider - Show share menu like other apps on my android phone -

Image
i have added share action on app's actionbar , followed these steps: http://www.codewithasp.net/2016/11/share-action-provider-android-application-actionbar-appcompat-v7.html this showing nice simple looking share menu on actionbar. problem other application on phone have different share menu , of them similar. here how share menu look: here how other apps showing share menu on device instead of creating drop-down menu share options, should call share intent once you've clicked on share button or menu option. way list of possible apps shown on example you've pasted. here example of how it. intent sendintent = new intent(); sendintent.setaction(intent.action_send); sendintent.putextra(intent.extra_text, content); sendintent.settype("text/plain"); getcontext().startactivity(sendintent);

github - Doing code review on pull requests in xcode -

i made pull request on github, feature pulled main branch. team i'm working with, has done code review on github, , commented on of changes in pull request. is there way open pull request in xcode, can see comments in version editor? i'm using xcode 8.1

Zend routing: removing null parameters from the URL -

if have route defined this: /event/:id/:instance_id/view it appears in url when both parameters set. example.com/event/1/15/view however, instance_id optional, , therefore may null, url looking (as created url helper): example.com/event/1//view i want this: example.com/event/1/view how remove unnecessary forward slash? the above question zend 1 , below solution zend 2, please dis-regard answer. route not 'instance_id' optional. can achieve doing this 'route' => '/event/:id[/:instance_id]/view', it should fix url problem. ideally, 'view' should after 'event', if possible in scenario. 'route' => '/event/view/:id[/:instance_id]', any fix text should ideally come first in route , optional last.

javascript - How to add google fonts to tinymce? -

Image
this question has answer here: google fonts , tinymce 6 answers hey how add google fonts tinymce ? want add google fonts dropdown says "fonte"(check image) already tried same of other question: i added on content.min.css (just above body): @font-face{ font-family:'aka_dora'; src:url('fonts/akadora.eot') format('eot'), url('fonts/akadora.woff') format('woff'), url('fonts/akadora.ttf') format('truetype'), url('fonts/akadora.svg#akadora') format('svg'); font-weight:normal; font-style:normal; } and on tinymce.init() font_formats: 'aka_dora=aka_dora;' + 'andale mono=andale mono,times;'... this happens, appears font no styling , when type it's im typing without style... this font http://www.1001fonts.com/akadora-font.

Does compression change the hash value? -

i have large file need compress, need ensure original file has same hash value compressed one. tried on smaller file, hash values different thinking might because of metadata change. how ensure files don't change after compression? it depends on shash using. if using crc32 it's pretty trivial make hashes same. md5 might possible (i don't know start of art there), sha1 doable in few years. if using sha256, better give up. snark broken crypto aside, unless hash algorithm knows compression setup or input file crafted provoke hash collision: hash change before , after compression. means standard cryptographic hash change upon compression. all hash algorithm sees stream of bits without meaning. not know compression schemes, , should not.

Moving UIView within UIImageView's UIImage in Swift -

Image
i trying move 1 image on base image. if moving uiview , crosses uiimageview's image. how restrict uiview's move within uiimageview's image? should supports square , rectangle. moving view should not cross border. kindly guide me. in screen shots, uiimageview background color black color. moving uiview in white color. white color view crossing image [screen shot 2]. how restrict within image ? code: @ibaction func panacn(sender: uipangesturerecognizer) { if sender.state == .began || sender.state == .changed { let translation = sender.translationinview(self.myimgvw) // note: 'view' optional , need unwrapped sender.view!.center = cgpointmake(sender.view!.center.x + translation.x, sender.view!.center.y + translation.y) sender.settranslation(cgpointmake(0,0), inview: self.myimgvw) } } need output: my output you may try : @ibaction func panacn(sender: uipangesturerecognizer) { if se

Json file as amp-list source in Azure AppService -

Image
i have created sample amp page <amp-list width=auto height=100 layout=fixed-height src="https://my-azurewebsite/data/services.json" > its showing error below : o 'access-control-allow-origin' header present on requested resource. if opaque response serves needs, set request's mode 'no-cors' fetch resource cors disabled. i enabled cors using azure portal. still not working. can access json via browser directly. please have try import amp-list , amp-mustache components in header, more details please refer document the amp-list component fetches dynamic content cors json endpoint , renders using supplied template. <script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script> <script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.j

ios - Launch failed. The app could not be launched on xamarin -

i getting following error when trying run visual studio/xamarin built application on ios simulator. launch failed. app 'app2' not launched on 'iphone 7 plus ios 10.1'. please check logs more details. "app2" created using tab template, , no code changes after rolling application. windows environment: windows 10 w/visual studio 2015 update 2 mac environment: imac sierra patched. xcode 8.1 (what ever date). i have connected mac remote , pc. can launch iphone simulator on mac visual studio on pc. i error when trying run "app2". compiles fine, won't run on simulator. i've searched here, , similar results speak of vs crashing. mine doesn't crash, presents error. note: there's nothing in log can find details way. ideas? thanks! edit: loaded parallels on imac , ran win 10/vstudio. same error. again, xamarin remote agent connected , can start simulator pc, can't deploy it. after research , here comes d