Posts

Showing posts from February, 2011

Can anyone suggest some examples of using angular 2 release candidate animations? -

i didn't find animation examples of how add animations project, should add logic in controllers ? if add in controllers there interface should implamented ? code examples usefull since there no documentation yet :(

Failing to activate a feature using COM in SharePoint 2010 -

guid featureid = new guid("0af5989a-3aea-4519-8ab0-85d91abe39ff"); clientcontext clientcontext = new clientcontext("http://mysite:786/"); site clientsite = clientcontext.site; clientcontext.load(clientsite); featurecollection clientsitefeatures = clientsite.features; clientcontext.load(clientsitefeatures); clientcontext.executequery(); // activate feature clientsite.features.add(featureid, true, featuredefinitionscope.site); //clientsitefeatures.remove(featureid, false); clientcontext.executequery(); messagebox.show("success"); when running code, getting exception: feature id "0af5989a-3aea-4519-8ab0-85d91abe39ff" isn't installed in farm , can't added scope. i got feature id link http://social.technet.microsoft.com/wiki/contents/articles/7695.list-of-sharepoint-2010-feature...

What is the best practice for Django project structure? -

i know if there best practice structure of django projects. in particular, located virtualenv folder project? do think better following solution: /myproject /myenv manage.py /mysite settings.py urls.py wsgi.py __init__.py or think better have folder environments, example in home directory: /virtualenvs /myproject1_env /myproject2_env ... /myprojectn_env i use virtualenvwrapper keep virtualenv @ same place , access them. can recommand use :) features - organizes of virtual environments in 1 place. - wrappers managing virtual environments (create, delete, copy). - use single command switch between environments. - tab completion commands take virtual environment argument. - user-configurable hooks operations (see per-user customization). - plugin system more creating sharable extensions (see extending virtualenvwrapper). i have no relation project, use on daily basis , it. hope can :)

python - Regular Expression: (or not) Looking to print only data after the header -

some homework appreciated. using socket, need parse data website ( http://www.py4inf.com/code/romeo.txt ). i'm using regular expression '^\s*$' locate first blank line after header , above data. any tips on how extract data (and not print header)? import socket import re mysock = socket.socket(socket.af_inet, socket.sock_stream) try: userurl = raw_input('enter url: ') d = userurl.split('/') d.remove("") host = d[1] mysock.connect((host, 80)) mysock.send('get %s http/1.0\n\n'%(userurl)) while true: data = mysock.recv(3000) if len(data) < 1: break print (''.join([x x in re.findall(**'^\s*$'**,data,re.dotall)])) except exception e: print (str(e)) i'm assuming since it's homework problem have to use socket , can't use more user-friendly requests . i first loop until have complete response in string, , iterate on th...

clojure - Garden Generated Inline-styles in Reagent's Hiccup -

in reagent, 1 can specify inline css styles this: [:div {:style {:border "1px solid red"}} "my text"] garden can make such css properties containing several values in list more generic. vectors comma separated lists , nested vectors (used here) space separated lists: (require '[garden.core :refer [style]]) (style {:border [[:1px :solid :black]]}) ;= "border: 1px solid red;" how can things combined? reagent seems stubborn accepting hash-maps style attribute. accepting string solution here. generally, of inline-styles aren't choice in long term. 1 solve attaching class div , specifying style globally gardens css function. class example: [:div.myclass "my text"] (css [:.myclass {:border [[:1px :solid :black]]}]) ;= ".myclass {\n border: 1px solid black;\n}" however, it's start inline styles, so: there way way described above? the hash-map can optionally supplied reagent's hiccup vectors abs...

Fresco prefetch multiple pictures,How to listen progress? -

i try user datasource<void> datasource datasource.getprogress() ,but getprogress() return 0.0 ,log print once. so,what do? when obtain datasource imagepipeline , need subscribe it. of explained in fresco documentation . datasubscriber<t> datasubscriber = new basedatasubscriber<t>() { @override public void onnewresultimpl(datasource<t> datasource) { ... } @override public void onfailureimpl(datasource<t> datasource) { ... } @override public void onprogressupdate(datasource<t> datasource) { float progress = datasource.getprogress(); } }; mdatasource.subscribe(datasubscriber, muithreadimmediateexecutor);

python - Which is the simplest way to make a polynomial regression with sklearn? -

Image
i have data doesn't fit linear regression, in fact should fit 'exactly' quadratic function: p = r*i**2 i'm miking this: model = sklearn.linear_model.linearregression() x = alambres[alambre]['mediciones'][x].reshape(-1, 1) y = alambres[alambre]['mediciones'][y].reshape(-1, 1) model.fit(x,y) is there chance solve doing like: model.fit([x,x**2],y) ? you can use numpy's polyfit . import numpy np matplotlib import pyplot plt x = np.linspace(0, 100, 50) y = 23.24 + 2.2*x + 0.24*(x**2) + 10*np.random.randn(50) #added noise coefs = np.polyfit(x, y, 2) print(coefs) p = np.poly1d(coefs) plt.plot(x, y, "bo", markersize= 2) plt.plot(x, p(x), "r-") #p(x) evaluates polynomial @ x plt.show() out: [ 0.24052058 2.1426103 25.59437789]

javascript - how to access variables in google map api to use in every function -

i having problem utilizing autocomplete of google map search. here trying function initialize() { directionsdisplay = new google.maps.directionsrenderer(); //add map, type of map var map = new google.maps.map(document.getelementbyid('map-canvas'), { zoom: 6, center: haight, maptypeid: google.maps.maptypeid.roadmap }); autocomplete = new google.maps.places.autocomplete(document.getelementbyid('address')); google.maps.event.addlistener(autocomplete, 'place_changed', function () { var place = autocomplete.getplace(); var lat = place.geometry.location.lat(); var lng = place.geometry.location.lng(); }); alert(lat); } if try generate alert out of addlistner function not working, working inside addlistner. there way can access lat,lng out of addlistner? and can use variable lat,lng outside of initialize function in runtime? edit var markers = new google.maps.marker({ ...

edi - Talend : Generate and populate txt file and put in on FTP -

Image
i have question in talend : i need create file name "file_" + talenddate.getdate("ccyy-mm-dd hh:mm:ss") + ".txt" , populate result of sql query , add "\t" separator on each column of each row. after that, need connect ftp (through tftpconnection component), , put file on folder (through tftpput component) the main problem encounter don't know composent should use when i'll create text file ? should use tfileoutputpositional ? tfileoutputdelimited ? component ? moreover, have issue : when i'm connecting ftp, no worries when i'm on tftpput component, have issue : java.net.sockettimeoutexception: accept timed out any idea ? thanks first need execute sql query. to generate file should use tfileoutputdelimited on row data , change field separator tab "\t". set filename directly in tfileoutputdelimited component. keep in mind path contains forward slashes, e.g.: "c:/my-folder/file...

php returning file corrupt on mp4 readfile access to folder outside root directory -

am trying load mp4 file on page corrupt file message. am using php file load private folder outside root directory , open directly browser see if video plays directly firefox browser: if(!empty($_get['video'])) { if (strpos($_get['video'], "\0") !== false) die(''); $video = $_request['video']; $path_parts = pathinfo($video); $file_name = $path_parts['basename']; require_once("config.php"); if(isuserloggedin()) { //construct order object $ispaid = new order($reference=$loggedinuser -> user_id,$pesapal_tracking_id=null,$orderstatus = null); //check if paid if($ispaid->ispaid()) { //private folder $file = $_server['document_root'].'/../privatelogged/'. $file_name; header("expires: mon, 26 jul 1997 05:00:00 gmt"); header("cache-control: no-store, must-revalidate"); header("content-type: v...

django call admin.site.register from view -

i try register model admin site view.py, model's admin interface appear after go matching url. when go matching url model's name without reference appears, models instances doesn't display. it's necessary register model views. models.py from django.db import models class poll(models.model): question = models.charfield(max_length=200) pub_date = models.datetimefield('date published') views.py from django.contrib import admin django.shortcuts import redirect polls.models import poll def index(request): admin.site.register(poll) return redirect('/admin') solution: from django.contrib import admin polls.models import poll django.http import httpresponse django.shortcuts import redirect django.core.urlresolvers import clear_url_caches django.utils.importlib import import_module django.conf import settings def index(request): admin.site.register(poll) reload(import_module(settings.root_urlconf)) clear_url_c...

For MS Access SQL, want to use EXCEPT in Access for three columns in table1 to 1 column in table 2 -

i have 3 columns in table a. trying design query call out values (in 3 columns) not apepar in 1 column have in table b. if helps make more clear, table b list of currencies in iso codes , table 3 columns of currencies being used, identifying values not using iso codes denote currency. currently, can't seem them match 1 column, made 2 more columns in table b can match them individually. constraints are, cannot change table , must in 1 query. got far below. select m.currency1, i.iso_code, m.currency2 , i.iso_code1, m.currency3, i.iso_code2 m left join b on m.currency=i.iso_code , m.currency2=i.iso_code1 , m.currency3=i.iso_code2 i.iso_code null or i.iso_code1 null or i.iso_code2 null; i wouldn't bother making multiple columns in 'b'. played in sqlfiddle , got work. something this: select m.currency1, i.iso_code, m.currency2, j.iso_code iso_code1, m.currency3, k.iso_code iso_code2 from m left join b i on m.currency1 = i.iso_code left jo...

asp.net - Trouble hosting SQL Server database via Plesk panel -

Image
first give information products subscription, have 1 year "ultimate" subscription windows hosting plesk in addition have subscribed 1 year of sitelock. trying host asp.net websites sql server databases, having hard time doing so. firstly via plesk panel did following: i created sql server database, tried upload .bak version of database unfortunately got msg: feature unavailable. unavailable feature ms database i created new database user database created in step 1, connected sql server management studio , tried create or import databases, unfortunately user has no admin permission. users plesk panel allow create user has limited permission viewing databases only. permission denied is there way create admin user sql server database via plesk control panel? please advice. it maybe because of new 12.5 default permissions, check tools&settings > database hosting settings :

apache - Enabling 'strict_types' globally in PHP 7 -

i'm migrating website php5 php7, , i've started using strict typing feature added. requires me begin files following line: <?php declare(strict_types=1); // other code here // ... so wondering, there way enable strict_types globally using php.ini or apache configuration file don't have write line every time, , if how enable this? this deliberately not possible, because implementation adopted after extremely long discussion of scalar type hints one: https://wiki.php.net/rfc/scalar_type_hints_v5 it explicitly gives choice of how scalar types checked caller of function, not author, that: if write library scalar type hints, functions guaranteed parameter types requested, if called code not written in strict mode (the types coerced instead) if write library , want traditional weak typing, can still make use of libraries use type hints (because don't force perform strict type checking) contrarily, if write library , want strict typing for functi...

C# - Windows Service - Remote WMI query throws error: RPC not found -

i developing wmi query windows service query network servers. if run application in console, works expected service fails complete wmi query. there way can setup service rpc doesn't fail due insufficient privileges? using credentials in wmi query connect remote pc should not problem. thanks probable reason: firewall configuration (rpc connections blockage) you don't have enough permission run wmi queries. second point valid if trying run queries on remote machines. can use wbemtest verify. windows+r (run command) type wbemtest you have connect managementscope , check it's validity scope.isconnected . snippet of code, might have provide structure it. connectionoptions coption = new connectionoptions(); managementscope scope = new managementscope("\\\\" + machine + "\\" + namespaceroot + "\\" + managementscope, coption); scope.options.username = username; scope.options.password = passwor...

javascript - Angular.js track by ng-options on key of object -

consider following object: var orderedflights = { "airline 1": {}, "airline 2": {}, "airline 3": {} } using ng-options possible track by on keys of object? <select class="form-control" ng-change="flightnumber = airline[0]" name="airline" id="airline" ng-model="airline" ng-options="airline (airline, flights) in orderedflights track airline"> </select> try ng-options="airline airline (airline, flights) in orderedflights track airline">

upload - PHP downloading files has been corrupted(While downloading from ftp server) -

i have problem in downloading file(php)from particular folder. when download , open file says file corrupted. when check size of uploaded file , downloaded file same , zip file size differs. no files opening. can 1 wrong??? if (isset($_get['file']) && basename($_get['file']) == $_get['file']) { $filename = $_get['file']; } else { $filename = null; } $err = 'sorry, file requesting unavailable.'; if (!$filename) { // if variable $filename null or false display message echo $err; } else { // define path download folder plus assign file name $path = '/public_html/wp-content/uploads/'.$filename; // check file exists , readable if (file_exists($path) && is_readable($path)) { // file size , send http headers $size = filesize($path); header ("cache-control: must-revalidate, post-check=0, pre-check=0"); header('content-type: application/octet-stream'); header('c...

notifications - Appcelerator Push from web -

from last thursday i'm experiencing problem in sending push notifications appcelerator web page. page hangs , browser console gives me error. possible solve issue or solution work in progress? thanks lot i'm having same issue. push notification form won't load. javascript error on page: afterrender — controller.js:34:310593typeerror: undefined not constructor (evaluating 'new u[this.options.view](this.options)')

proxy - HAProxy: Take the middle IP from X-Forwarded-For into a new header -

in haproxy.cfg i'm trying extract proper ip address x-forwarded-for header new custom header. my input request header like x-forwarded-for: 1.2.3.4, 2.3.4.5, 3.4.5.6 and expected new header like: x-custom-ip: 2.3.4.5 thanks original answer: you can use field sample-fetcher transformation keyword: https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#7.3.1-field since there's no way count fields in current haproxy, i'd write several simple acls regexp on x-forwarded-for header detect 0, 1, 2, 3, 4, 5 different ips (or actually, comma separator) , based on that, select proper field put in x-custom-ip. e.g. (not tested) acl x_forwarded_for_1_ips hdr(x-forwarded-for) -i (?:[0-9]{1,3}\.){3}[0-9]{1,3} acl x_forwarded_for_2_ips hdr(x-forwarded-for) -i ((?:[0-9]{1,3}\.){3}[0-9]{1,3},){1}(?:[0-9]{1,3}\.){3}[0-9]{1,3} acl x_forwarded_for_3_ips hdr(x-forwarded-for) -i ((?:[0-9]{1,3}\.){3}[0-9]{1,3},){2}(?:[0-9]{1,3}\.){3}[0-9]{1,3} acl x_forward...

android - BottomSheet touch area taking all the screen -

i've added bottom sheet , view , works touch area can drag sheet taking screen. view code looking this <android.support.design.widget.appbarlayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:transitionname="@string/transition_image"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" app:contentscrim="@color/color_primary" app:expandedtitlemarginend="64dp" app:expandedtitlemarginstart="48dp"> <com.oxzimo.fabric.ui.detailsimageview android:id="@+id/backdrop" android:layout_width=...

ios - How to store and access previous sites accessed in WebView -

i have simple app few navigation buttons load pre-defined websites within webview container. if possible user last url visited after click different button. e.g. user clicks button 1 , goes google.com, carry's out search. user clicks button 2 , reads posts on stackoverflow, decide go button 1 (google). in ideal world user see search results carried out on button 1, , not directed google.com would able use geturl store last visited url, , reload url once user goes button? if how go storing url? quite new titanium. i have version of app uses tab group , loads different webviews each tab, solves problem of loading last url makes app memory heavy uses lot of webviews. try @ this ti webview 'load' event listener . you can use load event know url being shown in webview. in order have navigation system, save urls in array. to perform , forth operations, use variables keep track whether user has pressed button or forward button. try above steps , till ...

c# - z-index is not working with pdf in iframe -

Image
i opening pdf file in page under iframe.it's working fine in other browsers except internet explorer.in internet explorer top menu of page going behid iframe.i tried z-index doesn't work me.can 1 please me? here master page code : <body> <form id="form1" runat="server"> <div id="wrapper" class="mywrapper"> <!-- navigation --> <!-- fixed navbar --> <nav class="navbar navbar-default navbar-fixed-top" style="position:relative;z-index:2;"> ...... </nav> <div class="row"> <div class="col-md-3"> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav"> ................... ...

sql - update column of table with other column -

i hava table a col1 col2 ------------- 1 2 hhhh 3 erer 4 sdfsdfds 5 alimd table has relationshib other tables. and other table name b col1 col2 ---------------- 1 hhjgjh 2 jkkjerwe 3 jjjjj tables , b have milions of records question : want update col2 of table col2 of table b the best , speed of query update thanks update set a.col2 = b.col2 tablea inner join tableb b on a.col1 = b.col1 demo

file io - Handling write and read at the same time in java -

i have thread continuously logging file. have function getlines() when called return last 100 lines of log file. my question whether implementing simple bufferedreader inside getlines() enough ? i'm concerned whether reading valid when write going on. don't mind missing few lines of code written during process of read though. thanks since java fileoutputstream / fileinputstream open files in shared mode reading not interfere writing. though in view better , more efficient implement logger holds last 100 written lines , returns them on demand.

MySQL-Trigger Creation -

am trying create 1 update trigger.here code.. delimiter $$ create trigger before_user_update before update on user each row begin insert user_index set action = 'update', firstname = old.firstname, email = old.email, changedat = now() end $$ delimiter ; for code got error this.. error code: 1064. have error in sql syntax; check manual corresponds mysql server version right syntax use near 'end' @ line 10 how can solve this.. please me..

JavaScript forEach loop works in all webbrowser but Internet Explorer -

i've managed loop working in browsers apart internet explorer (which doesn't seem support foreach). the javascript cpde: function validate() { var msg = ''; var = 0; arr.foreach( function validateinfo(){ if (getrbtnname('yesno_' + + '_0' == "" && 'yesno_' + + '_0') == "") { msg = 'please select yes/no users' } if (msg == '') { return true; } is++; } ) if (msg == '') { reloadpage(); } if (msg != '') { alert(msg); return false; } } function reloadpage(){ window.location.reload() } the array being set in php file rather passed in. it's being set using: <script type="text/javascript"> var arr = <?php echo json_encode($arr) ?>; </script> just place shim mdn ...

php - Laravel Eloquent create method causing integrity constraint violation -

i've got following eloquent models , relations set up: applicant class applicant { public function application() { return $this->hasone(application::class); } } application class application { public function applicant() { return $this->belongsto(applicant::class); } protected $fillable = [ // ... other fields 'applicant_id', ]; } and migrations: applicants table public function up() { schema::create('applicants', function (blueprint $table) { $table->increments('id'); // other fields ... }); } applications table public function up() { schema::create('applications', function (blueprint $table) { $table->increments('id'); // other fields ... $table->integer('applicant_id')->unsigned(); // other relations ... $table->foreign('applicant_id')->refe...

javascript - Phonegap In App Browser and Local Storage -

i going create android application using html5/jquery , phonegap in app browser. display web page inside in app browser, i want implement functionality user enters name when first time access application. i can save value using phonegap's local storage can't find how access value inside in app browser. any appreciated. thanks. check following documentation more information is local storage phonegap app on android device separate built in browser?

sql server - SQL - Return Output To Stored Procedure -

i have stored procedure have created can enter lines table , subsequently return inserted.id can return id sql command sent input id table. i have used output instead.id before , works fine when insert statement how same result stored procedure. i have done following can't seem output correctly. create procedure sp_xstream_send -- add parameters stored procedure here @dept varchar(30), @process varchar, @requestdt datetime, @requesttype varchar, @requestbranch int, @requestpolref varchar, @requestxml varchar, @returnid int output begin -- set nocount on added prevent result sets -- interfering select statements. set nocount on; declare @outputtbl table (id int) insert dbo.xstream_log ( department , process , requestdt , requesttype , requestbranch , requestpolicyref , requestxml ) output inserted.id @outputtbl(id) values ( @dept, @process, @requestdt, @requesttype, @requestbranch, @request...

java - How to insert values in descending order into a LinkedList in O(n log n) complexity? -

i have implement custom properyqueue , decided use linkedlist container values. order in inserted high value - low priority. therefore queue has values in descending order , priority ascending element' values smaller. how implement insertion method use complexity of o(n log n) ? this priority queue : public class priorityqueue<e extends comparable<? super e>> implements comparable { private linkedlist<e> queue; private int size; public priorityqueue(int size) { this.size = size; queue = new linkedlist<>(); } public priorityqueue() { this(50000); } public void insert(e value) { if (queue.size() == size) { try { throw new sizelimitexceededexception(); } catch (sizelimitexceededexception e) { e.printstacktrace(); } } if (value == null) { throw new nullpointerexception(); } else { ...

How can I verify a LinkedIn access token? -

how can verify linkedin access token? i need check if access token valid or not? ex: in facebook https://graph.facebook.com/me?access_token=access_token is there similar way in linkedin? i found can done this: https://api.linkedin.com/v1/people/~?oauth2_access_token=your-access-token and that's :).

c# - Unit Tests from multiple test classes appear to be interleaved -

Image
i have tests in 2 separate classes within mstest project, each class (i think) set , each class runs fine when run whole project's tests, fail. my 2 classes both involve setting external data each class designed make sure in known state before starting (and wipe after finishing). have though mstest might run methods in test class in parallel(?), run each class in sequence... incorrect assumption? edit: came across question ( how mstest determine order in run test methods? ) seems suggest vs may interleave tests multiple classes in (seemingly not actually) random order i.e. not run tests in classa before starting in classb. problematic in case because if order tests within class, mstest might still run methods multiple classes conflict? important note mstest doesn't guarantee order of execution , order can different between runs. if need rely on order you'll need created ordered test , vs premium/enterprise feature unless you're on visual studio 2015 ...

email - Need Clarification in sending mail to the particular mail address in PHP -

i doing 1 project. in project want send mail customers in php. presently using sendmailer.php package sent mail. using package sending mail through gmail account(i.e, smtp protocol).it takes 20 sec-1 min. here doubt is... possible send mails customers out using smtp protocol.. i know there function called mail().. doubt is..!! send mail customers..? please clarify doubt.. stuck here..!! no, it's not possible without smtp. you have define own smtp server settings host provides, in php ini file example, when use normal mail() function. you can change settings this: ini_set("smtp","smtp.example.com" ); ini_set('sendmail_from', 'user@example.com');

html - How to insert a svg into a hml table which spans over multiple rows -

Image
i want insert svg-image in html-table should span on multiple rows of table. how do that? here's have now: but want produce this: my svg-rects should span per 1 table-column on multiple rows: here code: <!doctype html> <html> <head> <style> body { position: absolute; } svg { stroke:rgb(0,0,0); stroke-width:2; border:1px solid black; position:abolsute; z-index:10; } svg > rect.firstrect { fill: rgb(234,145,234); stroke:#006600; } svg > rect.secondrect { fill: rgb(123,11,234); stroke:#006600; } svg > rect.thirdrect { fill: rgb(11,234,98); stroke:#006600; } table { border:1px solid black; border-collapse:collapse; width:55%; height:55%; margin-top:10px; z-index:20; } td,th { border:1px solid black; padding:2px; width:250px; height:25px; font-weight:bold; text-align:center; } td.withsvg{ position: relative; } </style> <...

Laravel ServerException in RequestException.php when receiving simple JSON request -

i'm using laravel 5 framework communicate manufacturer, , i'm struggling in receiving callback: here routes (set them both, test): route::post('/callback', 'printcontroller@callback'); route::get('/callback', 'printcontroller@callback'); and simple method in controller: public function callback(request $request) { var_dump( $request ); //storage::put('request.txt', $request); } it works fine, if open site manually ( meaning, dump request , later create request file ) , when call like this: /** * test callback option */ public function testcallback() { $callback_url = 'http://project.dev/callback'; // prepare response $response = array( 'time' => -microtime(true), ); $data = [ "id" => 907, "current_state" => "shipped", "merchant_sku" => "bst123", "ordered_on_date" =...

How can I send a C++ map<> to Python using Boost Python object? -

i want pass map<string, string> c++ code python code while i'm using boost::python::object . want use input parameters. i define dictionary in python this: script_parameters = {} and pass map<string, string> in c++ this: typedef map<string, string> commandparametersmap; if ( !command_parameters.empty() ) { commandparametersmap::iterator begin = command_parameters.begin(); commandparametersmap::iterator end = command_parameters.end(); boost::python::dict command_parameters_dict; (commandparametersmap::iterator = begin; != end; it++) { command_parameters_dict[it->first] = it->second; } m_script_global["script_parameters"] = command_parameters_dict; } and run python file: object o_result = exec(m_filescript->c_str(), m_script_global, m_script_global); but here problem: script_parameters in python code empty. doing wrong in here? i have mention other parts of code, such executing script...

typescript - Angular 2 Error while routing to another component -

Image
i using angular 2 beta 17 error occurs.when trying route component. kindly guide me. thankful you. import {component} 'angular2/core'; import {http, http_providers} 'angular2/http'; import {mvccomponent} "./components/mvc.component"; import {location} 'angular2/platform/common'; import {router, routedefinition, routeconfig, router_directives} "angular2/router"; @component({ selector: 'my-app', templateurl: './appscripts/layout/sidebar.html', directives: [router_directives] }) @routeconfig([ { path: '/index', name: 'index', component: mvccomponent, useasdefault: true } ]) export class appcomponent { profileimageurl: string = './images/flat-avatar.png'; public routes: routedefinition[] = null; constructor(private router: router, private location: location) { } getlinkstyle(route: routedefinition) { return...

jquery - Need to clear dropdown3 on every select -

my script working fine problem append adding options in dropdown3 on every select. need clear dropdown3 every time user select option in dropdown2 tryed html insted of append html calling 1st option dropdown3 edit: have 1 more question how empty options not 1st 1 since disabled default? <script> $(document).ready(function() { var kategorije; $.ajax({ url : "kategorije.txt", datatype: "text", success : function (data) { popunikategorije(data); } }); function popunikategorije(kategorije){ $.each(kategorije.split("\n").slice(0,-1), function(k, v){ $('#dropdown2').append($('<option></option>').attr('value', k).text(v)); }); } </script> ...

c# - Converting XML to objects with nested embeded objects -

i have following xml has nested objects , when want deserialize xml steps class embedded list of step objects, have error. [xmlroot(elementname="comp")] public class comp { [xmlattribute(attributename="ref")] public string ref { get; set; } [xmlattribute(attributename="dir")] public string dir { get; set; } } [xmlroot(elementname="step")] public class step { [xmlelement(elementname="comp")] public comp comp { get; set; } [xmlattribute(attributename="name")] public string name { get; set; } [xmlelement(elementname="step")] public step step { get; set; } } [xmlroot(elementname="steps")] public class steps { [xmlelement(elementname="step")] public step step { get; set; } } my xml : <steps> <step name="2.3 upper"> <step name="2.3.1 upper"> <comp ref="15.txt" dir="d:\test...

javascript - AngularJS Select List doesnt match selected Item -

i have global controller in angularjs application provides me array containing attendee objects. want want modify courseregistration model contains 1 specific attendee object. in edit window d dropdown possible attendees whereas there should current attendee selected. i have following code in html: <select ng-model="courseregistration.attendee" ng-options="attendeeselectitem.name attendeeselectitem in attendeeselectitems"></select> if print out courseregistration.attendee json.stringify , same corresponding option print out same object (same id, same name etc.). if ( courseregistration.attendee == attendeeselectitem ) 2 identical objects, false. so question how can make sure selected item (stored in courseregistration.attendee) gets matched corresponding object in list (which used options) ? thanks lot in advance. jsfiddle: http://jsfiddle.net/2ddcy/ greets marc essentially when use array of objects populate select, se...

php - Print Array Key Multidimensional within a Foreach -

i have array (getting data excel file) have been trying "merge" data dependent on id. have managed create array (grouping products id), results in following. array ( [order10] => array ( [mr name] => array ( [45 street] => array ( [area] => array ( [product1] => 1 [product2] => 3 ) ) ) ) ) i trying to data extracted (order, name, street etc.), managing extract id (order10) using key(var). here basic layout of code like. //gets data excel file foreach ($bulk $prod) { $apiorder[] = array('order' => $prod['order'], 'prod' => $prod['prod'], 'quantity' => $prod['qty'], 'recipient_name' => $prod['recipient_name']); } $newoptions = array(); foreach ($apiorder $option) { $order = $option['order']; $prod = $option['prod']; $qty = $option['quantity']; //added $recipie...

javascript - Node.js app - different NODE_ENV when launched by NPM -

i have node.js app. runs in "production" mode when launched npm start , in 'development' mode when launched node start.js . don't understand difference. how can set 'development' mode according system variable 'npm start'? inside script log value of node_env way: console.log(process.env.node_env) my system variable: d:\>echo %node_env% development my npn content: ... "private": true, "main": "start.js", "scripts": { "start": "node --use_strict start.js", ... the problem: when run node --use_strict start.js - returns: "development" (right) when run npm start - returns production (wrong) (win: 7, npm: 3.8.3, node: v5.10.1) the solution: npm config set production=false the npm provides own config register. hre info: https://docs.npmjs.com/cli/config

javascript - Search and highlight the result in all the page -

i know if it's possible highlight word contained in form ? i have form long text written input , want find word in form , in form. i started code doesn't search form. <div id="search_input"> <form action="" id="form_search"> <input style="width: 300px" type="text" placeholder="entrez un mot-clef" id="search"> <button type="button" id="submit_form" onclick="checksearch()" value="submit">rechercher</button> </form> </div> <script type="text/javascript"> function checksearch() { var query1 = document.getelementbyid('search').value; window.find(query1); return true; } </script> i tried solution posted in commentary getting error : edit : <div id="search_input"> <form action="" id="form_search...

json - Add an anchor tag inside a php definition -

i trying add link inside success message shown after contact form filled in , sent. output get: {"submit_message":"bedankt voor uw vertrouwen in ons. klik hier<\/a> voor meer informatie.","isvalid":true} and code use (config.php): define('_msg_send_ok', 'bedankt voor uw vertrouwen in ons. klik <a href="informatie.php">hier</a> voor meer informatie.'); in mail script itself: if($isvalid == true) { $result["submit_message"] = _msg_send_ok; } else { $result["submit_message"] = _msg_send_error; } $result['isvalid'] = $isvalid; echo json_encode($result); how can add anchor tag works? , how can decode json string more normal looking text? tried json_decode, didn't work me, maybe did wrong.

java - How to fix sealing violation from a library? sealing violation: package org.lwjgl.opengl is sealed -

while setting project template slick2d based projects following instructions here: slick2d wiki using provided code testing setup here @ run-time keep getting giant block of sealing errors. thought problem stems version of ljgwl.jar in both libraries, slick requires both in order function properly. how can resolve this? package sealing java feature implemented in part in jar file format. discussed in several places, including in oracle's java tutorial , bottom line when package sealing enabled in jar's manifest, no classes belonging package can appear in other jar file. my thought problem stems version of ljgwl.jar in both libraries, slick requires both in order function properly. i'm not sure mean "library", not java concept. suspect, however, you're trying somehow have ljgwl.jar files 2 separate sources, , you've put both project classpath. indeed problem, , more package sealing. can, in fact, thankful sealing errors, may have...

android - fail to install app on my device receiving INSTAL_FAILED_CONFLICTING_PROVIDER -

Image
when trying build app using android studio, have faced following error : after clicking ok, can not unistall app because unistalled it. following error : $ adb shell pm uninstall com.siritime delete_failed_internal_error error while installing apk i able run app on device before, few days ago have added push notification ability using gcm , not sure if problem related (i add gcm codes project , customized it) . app run on similature or other devices not on device, could u please guide me wrong on phone ? have test other solution in different pages did not worked me>> this one... i did not used provider, should implement 1 ? the part of manifest added gcm push notification sample code :` /> <service android:name=".peyv.gcm.myinstanceidlistenerservice" android:exported="false"> <intent-filter> <action android...

css - How to change <li> position after animation using jquery? -

i have jquery image slider set move images -100% left. when image gets left:-100%; there way have move beginning of cycle? <div id="homeslider" class="firefly_slider_wrapper"> <div class="firefly_slider"> <ul id="ffslider"> <li class="slide"> <div class="slideplacment"> <img src="" name="0" /> </div> </li> <li class="slide"> <div class="slideplacment"> <img src="" name="1" /> </div> </li> </ul> </div> </div> the script looks this: jquery(window).load(function(){ var tl2 = new timelinemax({oncomplete: updateposition}); var imgarray = []; var imglength = 0; var photocontwidth = 0; var imgwi...

VBA in MS Word affects whole document, not just selection -

i want have vba script perform find / replace in selection , assign macro button on quick access toolbar, save having click through usual find/replace procedure. i recorded macro while doing , get: sub findreplace() ' ' findreplace macro ' ' selection.find.clearformatting selection.find.replacement.clearformatting selection.find .text = "^p" .replacement.text = " " .forward = true .wrap = wdfindask .format = false .matchcase = false .matchwholeword = false .matchwildcards = false .matchsoundslike = false .matchallwordforms = false end selection.find.execute replace:=wdreplaceall end sub but when run macro on selection change paragraph marks spaces continues on change whole document, not selection. i'm no stranger vba can't see how fix stops when selection done. you going need use ...

gtk - Drawing area using cairo -

i developing simple interface simulates led using gtk3 , c. when receive command "led" turn on or turn off according command. using cairo in drawing area draw circle representing led , using gtk_widget_queue_draw_area update screen in timeout function. after while cpu usage increase 100% in application. when receive command call function below void update_status_led(int led, int status_led) { g_signal_connect(g_object(darea[led]), "draw", g_callback(on_draw_event_leds), gint_to_pointer(status_led)); } so callback function "on_draw_event_leds" called gboolean on_draw_event_leds(gtkwidget *widget, cairo_t *cr, gpointer user_data) { set_status_led(cr, gpointer_to_int(user_data)); return false; } so calls function "set_status_led" void set_status_led(cairo_t *cr, int status) { printf("update status led: %d\n", countref++); cairo_reference(cr); cairo_set_line_width(cr, 2); cairo_set_source_rg...

How to achieve nested restangular call in angularjs -

how achieve nested restangular call in angularjs. first restangular call, i'm retrieving id. want make call retrieve details of id within first call. since restangular returns promise you can follows: firstrestangularcall() .then(function(r) { return secondmethod(r); }, handleerr) .then(function(r) { return thirdmethod(r); }, handleerr); hope helps..

jquery - How to show a hint while multiple ajax calls are running? -

i working on b2b version of magento shop. customers see list of products , input-fields. on change of input field, ajax-call ist set update cart. now want show hint in cart sidebar cart updated long ajax calls running. this ajax call: $.ajax ({ url: url, type: 'post', data: qty, success: function(response) { $('.block-cart').replacewith($('.block-cart', response)); } }); and in cart sidebar i've got div set display: block while ajax call running. i following code: $(document).ajaxstart(function() { $('.hint').css({'display':'block'}); }); $(document).ajaxstop(function() { $('.hint').css({'display':'none'}); }); but not work reliable. div shown not... i hope understand problem , make myself clear ;) thanks smo update: i've got start behavior work. i've got missing div in other if statement. works. ajaxstop fired early. when of posts r...

osx - Left indentation of the NSTextView -

i wrote following code: nsmutableparagraphstyle *paragraphstyle; double indent = 100 * mm2pt / 10.0; if ( !m_textview ) return; if ( start == -1 && end == -1 ) { if( style.hasleftindent() ) { paragraphstyle = [[nsmutableparagraphstyle alloc] init]; [paragraphstyle setheadindent: indent]; [paragraphstyle setfirstlineheadindent: indent]; [m_textview setdefaultparagraphstyle:paragraphstyle]; [paragraphstyle release]; } } else // set attributes range. { nsrange range = nsmakerange(start, end-start); nstextstorage* storage = [m_textview textstorage]; if( style.hasleftindent() ) { paragraphstyle = [[nsmutableparagraphstyle alloc] init]; [paragraphstyle setfirstlineheadindent: indent]; [paragraphstyle setheadindent: indent]; [storage addattribute: nsparagraphstyleattributename value: paragraphstyle range: range]; [paragraphstyle release]; ...