Posts

Showing posts from January, 2011

javascript - How to define a controller for a directive in a separate js file? -

.directive('directivename', ['$scope', function ($scope) { return { restrict: 'e', templateurl: 'templateurl/abc.html', scope: { name: '@', flag: '=' }, controllerurl: 'controllerurl/xyz.html' } }]); while defining directives in angularjs, there way specify url controller of directive? (similar defining templateurl ) controllerurl parameter maybe? you can create controller in file , use controller: 'name-of-controller' . make sure file controller located gets imported in index.html

Download served from WebApi fails on Android device, works on Asp.Net MVC -

since newer version of android webview (currently running on v48), pdf downloads form application stopped work. downloading desktop browsers, wp10 , ios function properly. the behavior: says, download has started... few minutes later notification " download unsuccessful". the download comes webapi controller, hosted on azure. tried tons of different suggested https headers , combination of headers. compared headers coming other websites, download works on device. no success. got curious , impemlented download in asp.net mvc (5) controller (same project) , modified headers in webapi (2.2) counterpart. => download worked! . compared both responses in fiddler, except url - same. any idea else difference? here code bits: mvc test (working) public fileresult cooldocument() { // hardcoded binary data (minimum valid pdf) byte[] bytearr = new byte[] { 37, 80, ... }; // making headers same in webapi response response.addheader("content-dis...

Celery chain, how to run linked task locally -

i wrote canva task, chain task instance of celery task. each task on chain have linked tasks , linked error tasks. i need able run entire chain on same worker (.apply on chain). fine, expect linked tasks not executed on same worker. so there way run linked task locally ?

powershell - Execute CMD command and Stream CMD results to StreamWriter -

i trying execute cmd command , stream results of commands stream writer. reason log files trying sift through 1gb each , storing results variable can use several gigs of memory. pipe out streamwriter because of beautiful performance. here excerpt script. $streamwriter = [system.io.streamwriter] "test.txt" $searchstring = "2016_06_*" $searchlogs = "2016_*.log" "cmd /c gunzip.exe -c $searchlogs |grep -i `"$searchstring`"" | $streamwriter.writeline($_) $streamwriter.flush() $streamwriter.close() do not mix cmd , powershell. use 1 or other. told last time . do not use powershell v1 anymore. still supported windows system can run @ least powershell v2. upgrade now. you don't need cmd running executables powershell. had told well. if put commandline in quotes powershell echo it, not execute it. for filtering wildcard matches use -like operator. stream writers don't read pipeline. need wrap them in foreach-obj...

c# - choosing the right data type and logic storing custom array like records(values) -

say have object, has [id], [name] .. , other data-info call meta , real data (it's value) x:2 , y:3 l:6, t:5, n:0 ,genr:plate; x:12 , y:32 l:26, t:45, n:1 ,genr:temp; ..... x 20 what appropriate datatype ? as don't need store each element in array in it's own row /record use single record. what choose best practice, string ? byte array ? not in manner of mem consumption performance , elegance since data type comes in pair x:2 , y:3 l:6, t:5, n:0 ,genr:plate; x:12 , y:32 l:26, t:45, n:1 ,genr:temp; and since value can either number or text, in c#, consider of using dictionary<string, string> store 1 line. thus, if have 20+ lines of such, consider using list of dictionary<string, string> , is: list<dictionary<string,string>> data = new list<dictionary<string,string>>(); to add new data, create dictionary, split items, , add dictionary list: string line = "x:2 , y:3 l:6, t:5, n:0 ,genr:plate; x:12 ...

uistackview - XCode: Stack view and constraints -

why need contraints on elements live inside stack view? not idea of stack view stack elements automatically making need of explicit measures added? well said. stackview height , width content size . sometime cannot how content size ui element has. for example if have imageview inside stackview , assign image @ runtime. stackview grow imageview . question how much. depends on size of image. there can feel undesired results. fix stackview size using predefined constraints . also, stackview need constraints position. position stackview inside view of viewcontroller . need constraints positioning our stackview .

sql - Handle more than one returning value in stored procedure -

Image
i have following stored procedure alter proc spinparam ( @partycode nvarchar(50) ) begin declare @totalamount float declare @setloop int declare @setcnt int print 'party code '+@partycode; set @totalamount=(select totalamount billparticular partycode=@partycode) set @setloop=(select count(totalamount) billparticular partycode=@partycode) set @setcnt=0; while @setcnt<=@setloop begin print 'total bill amt.'+convert(nvarchar(50),@totalamount); set @setcnt=@setcnt+1; end return convert(nvarchar(50),@totalamount) end in stored procedure, select totalamount billparticular partycode=@partycode query returns more 1 values. (i.e. there 2 totalamounts particular @partycode ) how can take them in loop? i set while loop shown in code. this stored procedure compiled well. while executing, gave me following error: party code 0l036 msg 512, level 16, state 1, procedure spinparam, line 11 subquery returned more 1 value. not permitted when subquery follows =, !=...

android - How to use in a library a resource provided by the app that use the library -

i developping android hce payment sdk , include manifest part related apdu service in sdk provided android library (aar) our clients. <!-- service --> <service android:name="com.mypackage.myapduservice" android:exported="true" android:permission="android.permission.bind_nfc_service" > <intent-filter> <action android:name="android.nfc.cardemulation.action.host_apdu_service" /> <category android:name="android.intent.category.default" /> </intent-filter> <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/apduservice" /> </service> the problem apduservice.xml cannot defined in library because contains payment service description , banner should customized clients when build payment app on top of sdk. there way tell lib...

java - How do I convert an object from an ArrayList() or ArrayList<String> to ArrayList<Integer>? -

so, in code, read in .txt file single, unspecified arraylist, not converting int or integer when try parse out. text file looks this: name 1 number 1 number 2 number 3 name 2 etc. trying make number 1 increment when name 1 selected list. students initial arraylist (tried both arraylist , arraylist()) kb scanner players arraylist totalgames arraylist tries rewrite students(k+1) system.out.println(students.get(k)); if(kb.nextint()!=0) { players.add(k); totalgames.add((integer)students.get(k+1)); } but comes incompatible types error. there way make error go away without changing arraylists? arraylist students=new arraylist(); int num=0; while (qbrdr.hasnext()&&num<loop) { students.add(qbrdr.nextline()); students.add(new integer(qbrdr.nextint())); students.add(new double(qbrdr.nextdouble())); students.add(new double(qbrdr.nextdouble())); num+=4; } ...

linux - Ubuntu - sudo with ACL -

i sorry if obvious new linux. trying set git bare directory , installed acl on ubuntu. ran following commands: adduser git mkdir /repositories chmod 700 /repositories setfacl -m defaut:user::rwx /repositories sudo chown git:git /repositories everything fine until rebooted machine. unable execute sudo anymore. everytime myself following message: [[sudo]] password andre: sorry, try again the password enter same used, , don't have problem ssh these account credentials. knows happened , how fix it? i think issue setfacl. should have used 'repositories' instead of '/repositories'. in way set acl across root. ended reinstalling linux.

java - Why does Transformer return &lt and &gt instead of < and >? -

trnsformer.transform(domsource, streamresult); input in domsource contains many <br> tags, instead &gt , &lt instead of < , > <br> return &lt br &gt i know &lt &gt equivalent <> . how can make transformer class change encoding , return <br> instead ? xml creator public class creatxml { public static void main(string[] args){ try { file article = new file("article.txt"); scanner scan = new scanner (article); stringbuilder str = new stringbuilder(); while (scan.hasnext()) { str.append(scan.nextline()); str.append("<br>"); } documentbuilderfactory factory = documentbuilderfactory.newinstance(); documentbuilder builder = factory.newdocumentbuilder(); document doc = builder.newdocument(); element body = doc.createelement("div"); doc.appendchild(body); attr classattr = doc.createattribute("class"); ...

datetime - Convert a time to specified time zone using C#? -

i'm working on application in c# .net 3.5. have time zone value of user stored in db format (-05:00,1) , -5.00 represents est time zone value , 1 indicates time zone follows daylight saving (if 0 not daylight saving zone). now want convert date time value timezone value considering daylight saving value. any appreciated. thanks having offset , whether or not it's in daylight saving time isn't enough indicate time zone: there can several time zones same standard offset , dst offset, have dst transitions @ different times. is data in database, or still designing it? ideally should store time zone id - ones timezoneinfo works windows ids, isn't ideal imo (i prefer iana/olson ids rest of industry tends work with) @ least represent real time zone. once you've got timezoneinfo , instant want convert, converttimefromutc , converttimetoutc you're after - careful mean "any date time value"; need make sure know you're representing....

How Do I Backup Azure Tables and Blobs -

i store data in azure storage tables , blob storage. automatically backup data protect against accidental data corruption users or software issue. there isn't solution microsoft and, while there paid solutions automatic backups, seems there should straight-forward way backup , restore data. you can use 3rd party tools cerebrata azure management cmdlets or functionality asynchronous copy blob announced microsoft azure storage team allow copy data 1 storage account storage account without downloading data locally. check thread more: what best way backup azure blob storage contents . hope helps.

ios - variable used before being initialized -

hey guys im having problem this override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { let destviewcontroller = segue.destinationviewcontroller as! secondtableviewcontroller var secondarrays : secondtabledata if let indexpath = self.tableview.indexpathforselectedrow { secondarrays = secondarraydata[indexpath.row] } destviewcontroller.secondarray = secondarrays.secondtitle } im having error destviewcontroller.secondarray = secondarrays.secondtitle says: secondarrays used before being initialized, why getting error? please help, newbie swift. tia this because of way of initialising variables in swift, in swift class each property need default value before being used. class initialisation in swift two-phase process. in first phase, each stored property assigned initial value class introduced it. once initial state every stored property has been determined, second phase begins, , each class given ...

php - Multiple values in Database separated by comma show these values one by one in Dropdown list using Codeigniter -

i have shopping store many products have multiple color values or products have multiple size values like. small,medium,large,xl i'm store these values in database column , want show 1 one in dropdown select list. using codeigniter nothing show in dropdown list. here code. model public function get_all() { $this->db->select() ->from('vendor_products') ->order_by(1,'desc'); $data = $this->db->get(); $query = $data->result_array(); foreach ($query $result) { if (!empty($result['color_values'])) { $result['color_values'] = explode('||' , $result['color_values']); } if (!empty($result['size_values'])) { $result['size_values'] = explode('||',$result['size_values']); } } return $query; } controller public ...

How to handle alert that appears anytime through out the app with objective C Unit testing in iOS? -

i saw several questions in here alert handling described in javascript. need solution in objective c. so, know handle alert appears screen in definite time. how handle alerts indefinite? means, if alert appears anytime in application catch alert? before can catch alerts need able trigger them testing purposes in reliable way. @ criteria drives alert , figure out how simulate in testing situation. once there, can @ how verify contents of alert , appearing correctly. if not using it, suggest looking how ocmock can assist. when comes unit testing objective-c code, find invaluable in allowing me hack things , create varying situations need. note though, ocmock not work swift because of way swift code executes. if looking @ swift, testing techniques have change radically.

c++ - Error code C2451 cannot run basic program -

i trying create program asks question, , gives 1 of 2 answer based on response (response = yes or no). here code :- #include <iostream> #include <string> using namespace std; int main() { string answer, yes; cout << "is lucy top lass ? enter yes or no" << endl; cin >> answer; if (answer == yes) { cout << "correctomundo" << endl; } else { cout << " blasphemy ! " << endl; } return 0; } i getting error c2451. can please explain how must edit code in order work way want ? i using header files iostream, , string. not show reason contained within triangular brackets. thankyou. if (answer = yes) a) it's assignment ( = ) not equality check ( == ) b) yes has no value - meant string answer, yes = "yes"; or use "yes" directly instead of having variable yes .

How to do release handling for R projects -

i have project in r (set of codes written in r) uses several r libraries. everytime when want deploy project in new machine, r libraries have setup scratch - installing cran (including dependencies libraries). libraries upgraded cran community , when have setup things in new machine, r libraries not installed due dependencies failure. any recommendations/help on how release handling r projects? you should @ mran , provided revolution r/microsoft. enables load old versions of packages referencing backdated mirror of cran. should mitigate issue code rot.

java - Red5 save multiple audio streams as single file -

i using red5 1.0.6 there conference between 3 clients. 3 clients open different stream end. using saveas can save individual files. possible save 3 stream in single file? i doubt possible since recorded flv file uses "stream id" of 0. you'd want 1 stream id per audio (track). if wrote recorder yourself, nothing out there know how play it.

Declaring a 2D coordinate in Perl / C / C++ -

i trying declare variable in perl holds 2 values want declare variable acts 2d coordinate point. then need declare 'n' of these. need create n random points in graph. have study percolation theory , have algorithm in mind this. got stuck @ point. is possible in perl? if yes, please provide syntax same. thanks for c/c++, can create structure hold x , y value. typedef struct { double x; double y; } coordinate; inside main function, can initialize that: coordinate treasure = {1.5, 3.2}; to modify variable's value: treasure.x = 3.0; treasure.y = 4.0;

SQL Server : scalar function XML Result google maps api -

i'm trying reverse geocoding via google api , full address result of api, i'm going use sql server 2012 because have database on , need generate report existing lat/lon in database need function in sql result . i have sql query result without error declare @lat nvarchar(50),@lon nvarchar(50) set @lat = '22.298828' set @lon = '114.172596' declare @xml table ( yourxml xml ) declare @url varchar(max) declare @qs varchar(50) select @qs = '&date='+convert(varchar(25),getdate(),126) select @url = 'http://maps.google.com/maps/api/geocode/xml?latlng=' + @lat + ',' + @lon + '&sensor=false' + @qs declare @response varchar(max) declare @mxml xml declare @obj int declare @result int declare @httpstatus int declare @errormsg varchar(max) begin try exec @result = sp_oacreate 'msxml2.xmlhttp', @obj out exec @result = sp_oamethod @obj, 'open', null, 'get', @url, false exec @result = sp_oamethod...

php - Dynamic query where clause in yii -

i have query $res = propertydetail::find() ->joinwith('propertyimages') ->all(); $res = $res->where(['pkpropertyidprimary' => 1]); i receive error: call member function where() on array this query contains property image , property detail records. want add clause in dynamic. how can this? you need way, $res = propertydetail::find() ->joinwith('propertyimages'); $res = $res->where(['pkpropertyidprimary' => 1])->all();

Android error Unable to add window in onResume(), after binding failed in onCreate() -

i know there many questions , solutions error message. but problem little different. in activity oncreate() method doing bindservice() . binding didn't happen got log "binding unknown activity: token" my onresume method below @override protected void onresume() { log.d(log_tag,"onresume() in"); // status bar this.getwindow().addflags(windowmanager.layoutparams.flag_fullscreen | windowmanager.layoutparams.flag_layout_no_limits ); super.onresume(); } after line log.d(log_tag,"onresume() in"); in onresume() getting below error, "attempted add application window unknown token token. aborting." androidruntime: android.view.windowmanager$badtokenexception: unable add window -- token android.os.binderproxy@is not valid; activity running? i searched on internet issue comes when use wrong context. dont think problem in case. also issue reproduced once till now.

visual c++ - if/else statement doesn't work c++ -

Image
i'm new programming , code. #include <iostream> using namespace std; int main(int argc, char** argv) { char name[50]; cout << "please enter name : " << endl; cin >> name; if (name[0] = 'm') { cout << "your initial name m" << endl; } else { cout << "your initial name not m" << endl; } system("pause"); return 0; } when run code, typed "mark" in window , program said "your initial name m".that works fine when type "john" in window, program still said "your initial name m" instead of "your initial name not m" , wondering why.are there missing in code? time. if (name[0] = 'm') should have be if (name[0] == 'm') = used assignment operator. assign m name[0] . use == compare value. = assign value right hand side left hand side. == compare value of right hand side left hand side.

php - WooCommerce add quantity button to shop -

Image
i know how can add simple quantity button woocommerce shop products. here how modified loop/add-to-cart.php achieve this: <?php /** * loop add cart * * @author woothemes * @package woocommerce/templates * @version 1.6.4 */ if ( ! defined( 'abspath' ) ) exit; // exit if accessed directly global $product; ?> <?php if ( ! $product->is_in_stock() ) : ?> <a href="<?php echo apply_filters( 'out_of_stock_add_to_cart_url', get_permalink( $product->id ) ); ?>" class="button"><?php echo apply_filters( 'out_of_stock_add_to_cart_text', __( 'read more', 'woocommerce' ) ); ?></a> <?php else : ?> <?php $link = array( 'url' => '', 'label' => '', 'class' => '' ...

multithreading - C++ Micro Second Timer with parallel thread in Linux/Ubuntu -

i created timer , called every 0.1 millisecond. it's working good. problem faced thread calling timer. timer calling infinite time. i process 2 parallel thread or process inside timer(with 0.1 millisec). possible? i'm using ubuntu 12.04 lts. sample code follows int main(void) { if (start_timer(0.1, &timer_handler)) //0.1 millisec timer caleed { printf("\n timer error\n"); return(1); } while (1) { if (var > 10) break; } stop_timer(); return 0; } void timer_handler(void) { int ret = 0; pthread_create(&thread, null, test_thread, null); pthread_join(thread, (void **)&ret); printf("test_thread : %d\n", ret); } void *test_thread(void *arg) { pthread_exit((void*)cnt++); }

javascript - How to make overlay div in google map dragable? -

Image
i need drag position of div. used below code , not worked. think done mistake on here.also need rotate div can place image @ right position var overlay; debugoverlay.prototype = new google.maps.overlayview(); function initialize() { var mapoptions = { zoom: 15, center: new google.maps.latlng(40.743388, -74.007592) }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var swbound = new google.maps.latlng(40.73660837340877, -74.01852328); var nebound = new google.maps.latlng(40.75214181, -73.99661518216243); var bounds = new google.maps.latlngbounds(swbound, nebound); var srcimage = 'http://library.marist.edu/pix/libmap3.jpg'; overlay = new debugoverlay(bounds, srcimage, map); var markera = new google.maps.marker({ position: swbound, map: map, draggable: true }); var markerb = new google.maps.marker({ position: nebound, map: map, ...

reactjs - While rendering the output of summernote editor it shows with the raw html -

i used summernote editor input , input text formatted in editor. however, when rendered output of editor in html, renders html tags format have chosen. see image below better understanding problem. image source code http://pastebin.com/k6wky3ny

OR function in if (trim() == "") {}in PHP -

or function in if (trim() == "") {} in php? tried this, not work: if (trim($query) == "a" or "b") {$search= 'd'; } i want if either or b exist d goes $search learn php right way php manual . should be: if (trim($query) == "a" || trim($query) == "b") { $search= 'd'; } or can use in_array : if (in_array(trim($query), array('a', 'b'))) { $search = 'd'; } if wanna partial ones, can do: if (strpos("a", trim($query)) > -1 || strpos("b", trim($query)) > -1) {

javascript - Reactjs server side templates -

i wonder there way load react component template server? when worked vuejs or other js-library have add code view , after rendered server javascript starts running , rest. for instance, can type in symfony app localized string: {{ 'header.article_title'|trans }} , translated. however, since templates hardcoded reactjs-component can not use php/symfony/twig functions anymore. so, i'm wondering if there way fetch template server angularjs templateurl -option. finally how need. i've realized possible not have actual file url. so, if need /react/component/article.js url action. so, i've created new bundle, add controller , use 1 action view single react-component. the skeleton code looks this: /** * class componentcontroller * @package reactjsbundle\controller * * @route("/react/component") */ class componentcontroller extends controller { /** * @route("/article.js") */ public function articleaction...

Glusterfs can not quota on non-existing directory -

i using glusterfs 3.7.6. the gluster documentation says, note can set disk limit on directory if not created. disk limit enforced after creating directory. but, when try quota on non-existing directory, fails , shows below message. $ gluster volume quota testvolume limit-usage /quota1 10mb quota command failed : failed trusted.gfid attribute on path /quota1. reason : no such file or directory please enter path relative volume tested same thing on glusterfs 3.3.2 worked well. i've looked release note 3.5 through 3.7.1, couldn't find this. is glusterfs 3.7 doesn't support quota on non-existing directory? or wrong me?

BroadcastReceiver not receiving broadcast from IntentService in Android -

i'm sending progress value int progress = 10 via broadcast intentservice display progress of uploading file. protected void onhandleintent(intent intent) { broadcastintent = new intent(); broadcastintent.setaction(sendlist.mreceiver.test); try { broadcastintent.putextra("count",marraylist.size()); [...uploading data...] (int = 0; < marraylist.size(); i++) { broadcastintent.putextra("progress", i); sendbroadcast(broadcastintent); //... } } so in activity register receiver never called. public class sendlist extends activity { textview textresult; progressbar progressbar; boolean misreceiverregistered = false; broadcastreceiver receiver; @override protected void oncreate(bundle bundle) { super.oncreate(bundle); setcontentview(r.layout.sendlist); textresult= (textview)findviewbyid(r.id.maxfragments); progressbar = (progressbar) findviewbyid(r.id.progre...

c# - How i can save settings to the application Settings? -

i created new cell called mysettings mysettings the type string scope user. and in place want store last selected path: private void btndirectory_click(object sender, eventargs e) { folderbrowserdialog mydialog = new folderbrowserdialog(); mydialog.selectedpath = lbldirectoryname.text; if (mydialog.showdialog() == dialogresult.ok) { lbldirectoryname.text = mydialog.selectedpath; } } right after line mydialog.selectedpath = lbldirectoryname.text; i want store mydialog.selectedpath mysettings tried type: properties.settings. have there options first default. mysettings ? and , how load saved settings ? if (mydialog.showdialog() == dialogresult.ok) { lbldirectoryname.text = mydialog.selectedpath; properties.settings.default.mysettings=mydialog.selectedpath; properties.settings.default.save(); } you can retrieve store/saved value following: mydialog...

swift - Updating existing constraints does not work, wrong use of .active property? -

Image
i have storyboard contains : a "tab bar" on left 5 tabs a container on right side of tab bar contains 6 image views share same space looks : each image view configured occupy 1/3 of container's width , 1/2 of height. however, different ratios can provided @ runtime (from json file) example, 1st image view's height become 70% of container's height , 50% of width (therefore, 2nd , 3rd image views widths occupy 25% of container's width , 4th image view, 2nd line column 1 has height of 30% of image view). to here tried : -create 2 arrays of outlets (width , height constraints image views) : // height constraints @iboutlet var heightconstraints: [nslayoutconstraint]! // width constraints @iboutlet var widthconstraints: [nslayoutconstraint]! -create outlet container of image views // drawings - container @iboutlet weak var drawingview: uiview! -create stored properties update constraints (these not outlets) // drawing height property va...

How to convert date to numeric calendar date in Java? -

this question has answer here: java string date conversion 13 answers change date format in java string 16 answers wanted convert following dates format: mar 10th 2016 mar 1st 2016 mar 2nd 2016 mar 3rd 2016 mar 22nd 2016 into 10-03-2016 01-03-2016 02-03-2016 03-03-2016 22-03-2016 tried couple of things failed desired output. try string manipulation. read input, split based on space , write logic own converter

reactjs - Problems using a custom history in react-router 2.0.0 -

specifically want use "basename" option can run application in sub directory. i have following code set-up history. var createhistory = require('history').createhistory; var userouterhistory = require('react-router').userouterhistory; var browserhistory = userouterhistory(createhistory)({ basename: "/subfolder" }); i have following route config <router history={browserhistory} classname="react-container"> <route path="/" component={template}> <indexroute component={diary} /> <route path="diary(/:zoom)" component={diary} /> <route path="login" component={login} /> </route> </router> i can route without problems in components using: this.context.router.push('login'); but when try , push new route history in flux store doesn't work. change url in address bar correct value, component not change. can refresh p...

java - auto database creation in hibernate with mysql -

this code, done mistake. while running test.java getting error "the requested resource not available". kept files in same package hibernate.cfg.xml <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.url"> jdbc:mysql://localhost:3306/studentdb </property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">root</property> <property name="connection.pool_size"> 1</property> <property name="hibernate.dialect">org.hibernate.dialect.mysqldialect</property> <property name="hbm2ddl.auto">create</property> <property name="show_sql">true</property> <!-- list of xml mapping files --> ...

html5 - Chrome won't play .mp4 file -

i'm trying html5 video work. working off local server. <video id="headervideo" controls> <source src="<?php echo base_url(); ?>assets/home.mp4" type="video/mp4"> browser not support video tag. </video> however, file refuses play. when access absolute path shows player play button greyed out. issue here? browsers internet explorer , safari support .h264 codec plays mp4 files. firefox support theora codec plays .ogv files. chrome supports both .h264 , theora. make video works across browser need encode mp4 video different formats using application handbrake. amke code : <video id="headervideo" controls> <source src="<?php echo base_url(); ?>assets/home.mp4" type="video/mp4"> <source src="<?php echo base_url(); ?>assets/home.webm" type="video/webm"> <source src="<?php echo base_url(); ?>assets/home.ogv...

spring - form:radiobuttons wrong list order -

brownser showing bad radio buttons order. dont know why changes showing order. i want this actually showing this(wrong) code shown in brownser(wrong): <input id="sdh.iesdfact1" name="sdh.iesdfact" type="radio" value="3"/> <label for="sdh.iesdfact1">con facturas</label> <input id="sdh.iesdfact2" name="sdh.iesdfact" type="radio" value="2"/> <label for="sdh.iesdfact2">facturas requeridas</label> <input id="sdh.iesdfact3" name="sdh.iesdfact" type="radio" value="1" checked="checked"/> <label for="sdh.iesdfact3">sin facturas</label> aplication code: jsp code: <label for="sdh.iesdfact”> <spring:message code="sdh.sol.fac"/></label> <form:radiobuttons path="sdh.iesdfact" items="${lista_facturas}" /...

javascript - Why does my jquery delegated click fire multiple times? -

i copying element , adding a list of elements. first, sonme html using ajax call: var setbuttonclick = function (url, btn) { $.ajax(url, $('form').serialize(), 'html').then(function (data) { $(btn).parent().find(sel.addlistitem).on('click', function () { addlistitem(data, this, btn); }); addlistitem(data, btn, btn); }); } addlistitem looks this. var addlistitem = function (data, context, btn) { var $template = $(data); // stuff not related removed brevity $(btn).before($template); } i have remove function using delegate: $(sel.editablelist).delegate(sel.removelistitem, 'click', function () { // fires once every element sel.removelistitem selector } i need click event fire once clicked element only. can basic version of delegate working inserting content this: $( "body" ).delegate( "p", "click", function() { ...

google chrome - The files served by my Apache Server are not being saved on browser cache -

i have installed , configured apache server virtualhost serves images. when load page images on browser second time (the images should on cache after first time page loaded), browser doesnt images (or files) cache, , think should. what wrong? using google chrome, , when load other web other server cache works, think have problem apache, not sure. thank much. the response video-segment played dash player. response headers: accept-ranges:bytes content-length:194431 date:wed, 09 mar 2016 07:42:07 gmt etag:"2f77f-52acd33f8b167" last-modified:tue, 02 feb 2016 17:55:12 gmt server:apache/2.4.18 (unix) openssl/1.0.2e php/7.0.2 status:200 after doing that: expiresactive on # set caching on media files 1 year (forever?) <filesmatch "\.(mp4|m4s)$"> expiresdefault "access plus 3600 seconds" header set cache-control "public" header set content-type "video/mp4" header set vary "host" header set access-control-allo...

java - Do you think I'm abusing of statics? -

i'm new in java programming , think have clear objects , how work them. however, i'm writing program have noticed have used lot 'static' keyword methods, , i'm doubting if because neccesary , logical or if because have not internalized in mind oo concepts. to more specific, program should read txt file , put each line in arraylist, code: public class filebody { private static final string separator = ";"; private static string headerfield1 = "regex"; private static string headerfield2 = "origin"; private static string headerfield3 = "destination"; private static final string header = headerfield1 + separator + headerfield2 + separator + headerfield3 + separator; // getters & setters public static string getheader() { return header; } public static string getheaderfield1() { return headerfield1; } public static void setheaderfield1(string...

sql server 2008 - Multiple document types in crystal report -

i try fetch multiple doc types in crystal report.. if doc type cn amount in - , if amount doc type dn must + ... . want this crystal report no. doctype docno docdate customer exempteddate s.tax rate s.t amount 1 ci 12 01-01-2016 abc 150 20% 15200* 1 cn 12 01-01-2016 abc -32 20% 1234* this tried crystal report no. doctype docno docdate customer exempteddate s.tax rate s.t amount 1 ci 12 01-01-2016 abc 150 20% 15200* whatever amount write rough amount query ...i paste specific line and acdochdr.doctype='cn', 'dn' ,'ci' any solution?

angular filters - How to hide a container when all entries are filtered in angularJS? -

i use filter in angularjs 1.4.3 application. if vm.nightservices filtered no entry shown (so filtered) div container should hidden. have tried ng-show="vm.nightservices.length > 0" not work. <div ng-show="vm.nightservices.length > 0" ng-repeat="nightservice in vm.nightservices | filter:institutionofuserfilter.institutionname"> you can create new filtered list in ng-repeat can check length in ng-show. <div ng-repeat="nightservice in filtered = ( vm.nightservices | filter:institutionofuserfilter.institutionname )" ng-show="filtered.length > 0">

php - Laravel check if collection is empty -

i've got in laravel webapp: @foreach($mentors $mentor) @foreach($mentor->intern $intern) <tr class="table-row-link" data-href="/werknemer/{!! $intern->employee->employeeid !!}"> <td>{{ $intern->employee->firstname }}</td> <td>{{ $intern->employee->lastname }}</td> </tr> @endforeach @endforeach how check if there $mentors->intern->employee ? when : @if(count($mentors)) it not check that. you can count collection. example $mentor->intern->count() return how many intern mentor have. https://laravel.com/docs/5.2/collections#method-count in code can this foreach($mentors $mentor) @if($mentor->intern->count() > 0) @foreach($mentor->intern $intern) <tr class="table-row-link" data-href="/werknemer/{!! $intern->employee->employeeid !!}"> <td>{{ $in...

ios - How do sort custom object in an array in swift? -

this question has answer here: swift how sort array of custom objects property value 13 answers class myclass { var name: string? var address: string? init(name: string, address: string){ self.name = name self.address = address } } let array = [myclass(name: "john", address: "usa"), myclass(name: "smith", address: "uk"),myclass(name: "paul", address: "aus"), myclass(name: "peter", address: "rsa")] now how can sort array name of myclass object. let sortedarray = array.sort { $0.name < $1.name } this should trick.

javascript - Calculate value/price based on rows in textarea -

im trying calculate price depending on how many rows use in textarea. have come far. problem won't calculate, think have looked @ or something. let me explain little, first of som textads. there flatfee minimum of 2 rows , additional 10 each new row, maximum of 10 rows. var flatfee = '70.00'; var perrow = '10.00'; function rowcount(area, maxlength) { //var area = document.getelementbyid("textarea-1") // trim trailing return char if exists var text = area.value.replace(/\s+$/g, ""); var split = text.split("\n"); if (split.length > maxlength) { split = split.slice(0, maxlength); area.value = split.join('\n'); alert("you can not enter more " + maxlength.tostring() + " lines"); } return false; } var div = $('span.rowcount'); jquery('textarea#textarea-1').on('input', function($) { var count = rowcount(this.value); div.html(count....

php - Controller method not found when using route parameters -

i'm trying build application forces users confirm email adreses when sign up. send email, containing link this: http://localhost:8000/verifieren/token&user=username now, when try visit link, following error pops on screen: notfoundhttpexception in controller.php line 91: controller method not found. from stack trace, got following at controller->missingmethod(array('verifieren', 'gilde-jowpbrhcow1fufg77xnb0kgm22cum4&user=wesley')) what think means tries call verifieren method? this route i'm using: route::get('/verifieren/{{ confirmation_code }}&user={{ username }}', 'authentication\authenticationcontroller@mailconformation'); and route corresponds following method: public function mailconfirmation($code, $username) { $user = user::where(["confirmation_code" => $code, "username" => $username])->first(); $user->active = '1'; $user->confirmat...

POJO compilation fails (Algo: GBM, H2o-Version 3.8.1.3, Javac: 1.8.0_45, Mac OSX 10.11.3 / Fedora 23) -

i try locally compile pojo of gbm prediction model generated h2o 3.8.1.3; follow instructions in pojo class: create folder download h2o-genmodel.jar folder with: curl http://myh2oinstancesurl:myh2oinstancesport/3/h2o-genmodel.jar > h2o-genmodel.jar download trained gbm model named 154 folder with: curl http://myh2oinstancesurl:myh2oinstancesport/3/models/154/java > 154.java compile sources in folder javac 1.8.0_45 under max osx 10.11.3 or fedora 23: javac -cp h2o-genmodel.jar 154.java result bunch of compilation errors: 154.java:24: error: <identifier> expected public class 154 extends genmodel { ^ 154.java:24: error: illegal start of type public class 154 extends genmodel { ^ 154.java:24: error: ';' expected public class 154 extends genmodel { ^ 154.java:25: error: illegal start of expression public hex.modelcategory getmodelcategory() { return hex.modelcategory.binomial; } ^ 154.java:25: err...

eclipse - Error running Django tests -

i'm trying run django tests ( version 1.8 ) but error from django.test import testcase class jobtypesresourcetest (testcase): def setup(self): testcase.setup(self) def test_basicget(self): return true traceback (most recent call last): file "c:\users\user\.p2\pool\plugins\org.python.pydev_4.4.0.201510052309\pysrc\runfiles.py", line 234, in <module> main() file "c:\users\user\.p2\pool\plugins\org.python.pydev_4.4.0.201510052309\pysrc\runfiles.py", line 78, in main return pydev_runfiles.main(configuration) # note: still doesn't return proper value. file "c:\users\user\.p2\pool\plugins\org.python.pydev_4.4.0.201510052309\pysrc\pydev_runfiles.py", line 835, in main pydevtestrunner(configuration).run_tests() file "c:\users\user\.p2\pool\plugins\org.python.pydev_4.4.0.201510052309\pysrc\pydev_runfiles.py", line 793, in run_tests mydjangotestsuiterunner(run_tests).run_tests([]) f...

Custom sorting in ngTable using AngularJs -

i looking forward custom sorting in ngtable, according http://ng-table.com/#/ replacing default sorting algorithm custom sort still pending. in case, want sort dataset respect days of week i.e, starting monday , ending @ sunday. there way this? kind of , suggestions appreciated. on day, have column display 1 property , sort on another. suggest having object dayname , daysort, dayname day of week ("monday") , daysort sort order (1). see working codepen below. http://codepen.io/storytimesolutions/pen/nndvzo table: <table ng-table="demo.tableparams" show-filter="true" class="table table-bordered table-striped"> <tr ng-repeat="row in $data track row.id"> <td title="'day of week'" filter="{dayname: 'text'}" sortable="'daysort'">{{row.dayname}}</td> <td title="'workout'" filter="{workoutplan: ...

Sending data from Salesforce to Wordpress -

im using salesforce store recruitment details , job positions. i'm building wordpress site, , wondering if there way can use salesforces api automate sending data wordpress, can publish job opportunities, example? has had experience automating data salesforce wordpress? possible? have looked @ zapier ? has connectors both salesforce , wordpress. without more detail can't if can want, might worth checking out.

Perform advanced queries on data stored in Azure Tables (DW? MR?) -

we adtech company , store large amount of data in azure tables. things page views, page actions, sessions etc each user. reason chose azure tables on sql server sheer volume of data (tens of thousands every second). we looking take 1 step further , perform advanced queries on data. somehow possible in azure ecosystem? maybe through loading data in data warehouse offering or through map reduce queries? in addition, if above possible thinking ingest data in micro-batches in data warehouse make sure have relatively fresh copy , not have load huge batches. azure supports? thanks with azure tables can query data using query operators these: https://msdn.microsoft.com/en-us/library/dd135725.aspx build custom application using azure table capabilities deeper analysis. alternatively, if interested in doing big data analysis data, within azure using existing software framework, consider hdinsight or data lake analytics. offers more sophisticated. hdinsight: https://azure....

reactjs - Difference between let import React from 'react/addons' and import { PropTypes } from 'react/addons' -

what difference between two: import react 'react/addons'; let {proptypes} = react; vs import react, { proptypes } 'react/addons'; is there proper convention should follow? often, compiling these es5 babel's repl great way understand what's going on. import react 'react/addons'; let {proptypes} = react; becomes: var _addons = require('react/addons'); var _addons2 = _interoprequiredefault(_addons); function _interoprequiredefault(obj) { return obj && obj.__esmodule ? obj : { default: obj }; } var proptypes = _addons2.default.proptypes; compared to: import react, { proptypes } 'react/addons'; which becomes: var _addons = require('react/addons'); var _addons2 = _interoprequiredefault(_addons); function _interoprequiredefault(obj) { return obj && obj.__esmodule ? obj : { default: obj }; } the first 2 statements in each identical. import statements become calls require , there...