Posts

c# - ListPicker Data Binding and INotifyPropertyChanged -

so have 2 listpickers, device type , device name . if select tablet in device type , want device name listpicker show options ipad , dell venue 8 , etc. if select phone in device type , want device name listpicker show options iphone , samsung galaxy , etc , on. so how can go making data binding between these 2 listpickers , implement inotifypropertychanged changes in 1 listpicker dynamically reflected in other? you can following : in xaml : <toolkit:listpicker x:name="devicetype" itemsource="{binding devicetypelist}" selecteditem="{binding selecteddevicetype, mode=twoway}"/> <toolkit:listpicker x:name="devicename" itemsource="{binding devicenamelist}" /> in code : public class classname : notifychangements { private yourtype selecteddevicetype; public yourtype selecteddevicetype { { return selecteddevicetype; } set { selecteddevicetype = val...

shell - bash script to remove files matching those in another directory -

i'm trying create script retrieves files (including subfolders) cvs , stores them temporary directory /tmp/projectdir/ (ok), removes copies of files project directory /home/projectdir/ (not ok) without touching other files in project directory or folder structure itself. i've been attempting 2 methods, i'm running problems both. here's script far: #!/usr/bin/bash cd /tmp/ echo "removing /tmp/projectdir/" rm -rf /tmp/projectdir # cvs login goes here, code redacted # export files /tmp/projectdir/dir_1/file_1 etc cvs export -kv -r $1 projectdir # method 1 file in /tmp/projectdir/* # check zero-length string if [-n "$file"]; echo "removing $file" rm /home/projectdir/"$file" fi done # method 2 find /tmp/projectdir/ -exec rm -i /home/projectdir/{} \; neither method works intended, because need way of stripping /tmp/projectdir/ filename (to replaced /home/projectdir/) , prevent them executing rm /home/projectd...

asp.net - Server Error in '/' Application on web site Hosting on internet issue C# aspx -

i have website hosted on www/internet, when tried open abcxxx.com/webapplicationasp/login/login.aspx showing below error; server error in '/' application <%@ page language="c#" autoeventwireup="true" codebehind="login.aspx.cs" inherits="webapplicationasp.login.login" %> same web site hosted on local pc in iis showing no errors. working fine. i have googled , found need change codebehind codefile: got below error: parser error message: file '/webapplicationasp/login/login.aspx.cs' not exist. is means have add c# source files ? i published website in localpc using iis @ filesystem c:\inetpub\wwwroot\webapplicationasp same file structure have put on www hosting site? need more make work ? thanks, ashok

pdf - Remove font using iText -

i have problem pdfs. have default font, helvetica. font unused, need develop script automatically deletes font. after asking 2 questions: unset pdf font script xhtml2pdf doesn't embed helvetica i discover itext. i've been trying work library, , made few successful tests unembeding fonts ( example ). can't find deleting whole font de pdf. thanks lot

C++ template specialization for member function -

i'm trying implement basic vector3 ( vec3 ) class. i'm struggling special case : vec3<size_t> addition vec3<int> . how can make template specialization case? any appreciated. ben #include <array> #include <ostream> #include <vector> // #define vec3f std::array<float, 3> // #define vec3u std::array<size_t, 3> #define vec3f vec3<float> #define vec3u vec3<size_t> #define vec3i vec3<int> template <typename t> class vec3 { public: vec3(): _a() {} vec3(t x, t y, t z): _a({x, y, z}) {} vec3(const vec3<t> & a): _a({a[0], a[1], a[2]}) {} ~vec3() {} /// print vec3. friend std::ostream & operator<<(std::ostream & os, const vec3<t> & v) { os << "(" << v[0] << ", " << v[1] << ", " << v[2] << ")"; return os; ...

security - How to load PKCS7 (.p7b) file in java -

i have pkcs7 file, , want load , extract contents. i tried these 2 methods: byte[] bytes = files.readallbytes(paths.get("myfile.p7b")); fileinputstream fi = new fileinputstream(file); //creating pkcs7 object pkcs7 pkcs7signature = new pkcs7(bytes); or this fileinputstream fis = new fileinputstream(new file("myfile.p7b")); pkcs7 pkcs7signature = new pkcs7(fis); but got ioexception: sequence tag error so how can load .p7b file ? try this. works other pkcs module not sure 7. final string keystore_file = "file path"; final string keystore_instance = "pkcs7"; final string keystore_pwd = "password"; final string keystore_alias = "key1"; keystore ks = keystore.getinstance(keystore_instance); ks.load(new fileinputstream(keystore_file), keystore_pwd.tochararray()); key key = ks.getkey(keystore_alias, keystore_pwd.tochararray()); privatekey privkey = (privatekey) key;

javascript - Variable being overriden in for loop -

for each event, different location. when displayed on ui locations have been overridden last api call. how can stop happening? $scope.eventloc = ''; api.get({entity: 'organisation', entity_id: oid, property: 'campaign', property_id:cid, property2:'events'}, function(resp) { $scope.orgevents = resp.data; (i in resp.data) { ceid = resp.data[i].campaigneventid; lid = resp.data[i].locationid; api.get({entity: 'location', entity_id: lid}, function(resplocation){ $scope.eventloc = resplocation.data; }) } }); <li ng-repeat="event in orgevents track $index"> <h2>{{event.name}}</h2> {{eventloc.address1}} </li> simply change code this: //$scope.eventloc = ''; //this can removed api.get({entity: 'organisation', entity_id: oid, property: 'campaign', property_id:cid, property2:...