Posts

Showing posts from January, 2015

c# - How do I return an image from a ServiceStack query? -

i've got solution works, although suspect there more efficient way this... end result photo of subject displayed on web page. that, have servicestack service returns byte array, feed httphandler takes byte array , turns image. way can set src of image http://www.mydomain.com/httphandler.ascx?id , image of specific person displayed. hoping bypass httphandler , use servicestack return image web page. can't find examples of this, believe read possible servicestack. possible? the docs on service return types shows how return image responses, techniques used in servicestack's imgur.servicestack.net demo. an alternative solution industrial strength webserver nginx serve static file instead, avoiding servicestack, asp.net or managed .net code, can writing static file , redirecting it. this how can configure nginx serve static files in /img/ , add cache headers static files have common web formats file extensions (ico|pdf|flv|swf|exe|txt|css): server {

xcode - Reading a file in C++ in one block, can't output the contents -

i wrote simple program read contents of text file in 1 block , save buffer display contents of buffer size of buffer, although compiled exact code in windows 7 working fine whenever compile on mac there no buffer output @ size of buffer returning -1, iam not getting error during compilation myfile.txt content hello world !!! a b c d e f g h ... z a b c d e f g h ... z my code #include <iostream> #include <fstream> #include <string> using namespace std; int main () { fstream myfile; myfile.open("mytext.txt"); myfile.seekg(0,ios::end); long int size = myfile.tellg(); myfile.clear(); myfile.seekg(0,ios::beg); char* buffer = new (nothrow) char[size]; myfile.read(buffer,size); myfile.close(); (int = 1; < size;i++ ) if ((buffer[i]>= 65 && buffer[i] <=90) || (buffer[i] >= 97 && buffer[i] <= 122) || buffer[i] == ' ' || buffer[i]== '\n')

youtube - IE9 wmode transparent is showing background color in the flash player -

i'm having little problem ie9 , wmode transparent. works in chrome , firefox. i using windows 7 (64-bit). flash played version 11.7.700.224 i made change embed video in order dropdown list display correctly correction introduced else. i can hear audio no problem video white (since background white) , if put black background color show okay. you can test here or see below code. http://jsfiddle.net/xb43z/2/ this how use it. <object> <param name="movie" value="http://www.youtube.com/v/r2z93vumn6m?version=3&amp;hl=en_us&amp;wmode=transparent&amp;rel=0"></param> <param name="allowfullscreen" value="false"></param> <param name="allowscriptaccess" value="always"></param> <param name="width" value="420"> <param name="height" value="240"> <param name="wmode" value="tra

Timing a process with windows batch script -

hi , in advance, i newbie @ developing batch files trying write bat file right create , write ldif file. starting off simple 1st. need time process may more complicated , may need software comparisons later (such bat vs. java later). right got this: @ echo "ldif generator" @ echo off :: *** enter file here "within double quotes" set filename="test.ldif" :: *** if file exists, erase previous content ::if exist %filename% echo erase file >%filename% echo hello>%filename% echo created ldif file %filename% set /a sum = 0 /l %%a in (1,1,5) ( echo %%a>>%filename% set a/ sum = "%sum% + %%a" ) echo sum %sum% pause i trying figure out how add numbers , time process. it gives me output far: hello 1 set a/ sum = 0 + 1 2 set a/ sum = 0 + 2 3 set a/ sum = 0 + 3 4 set a/ sum = 0 + 4 5 set a/ sum = 0 + 5 and on cmd sum "0" i trying show current iterate sum , echo sum @ end , time takes that.

vb.net - geometries for ESRI UNION REST call -

the union json structure example shows 2 geoms, 1 x , other y points. real? the doc says geoms other rest calls. what trying merge 2 (or more) polygons (adjacent parcels) using geometryserver union. think passing 2 geoms in correctly 1 of polygons returned. my overarching goal draw 1000' buffer around multiple parcels. can draw buffer around single parcel need buffer both (or more) together. perhaps need union buffers? am using wrong service? i not using java libraries making httprequest rest calls vb.net. ideas? i did union on first 2 parcels used for..loop union result each remaining parcel. here portion of code performs union: dim sgeom string = "" dim url string = "http://servername/arcgis/rest/services/utilities/geometry/geometryserver/union" dim sdata string = "?sr=4251&geometries={|geometrytype|:|esrigeometrypolygon|,|geometries|:[geom1,geom2]}&f=json".replace("|", """&qu

ios - error with adding google analytics -

i have been trying add google analytics app in development following online text tutorial ok @ first right @ end error on code... (specifically code in .m file) two things: when go on google analytics, dont register information , line of code right below registers error when try compile , run another thing in code there section im supposed put tracker id google analytics? p.s ok include link tot tutorial following guys know im talking about? dont wanna banned thought ask first... - (ibaction)tappedbuttonone:(id)sender { id<gaitracker> tracker = [[gai sharedinstance] defaulttracker]; [tracker sendeventwithcategory:@"myfirstscreen" withaction:@"buttonpress" withlabel:@"buttonone" withvalue:nil]; } here code have in .h #import <uikit/uikit.h> #import <iad/iad.h> #import "gaitrackedviewcontroller.h" @interface viewcontroller : gaitrackedviewco

loops - creating multiple matrices in matlab through looping -

i have turn list of numbers (ex. 4 1 3 2) list of same numbers multiple copies of each number (and have in specific order) (ex. 4 4 4 4 1 1 1 1 3 3 3 3 2 2 2 2) right plan make 4x1 matrix of each 1 ( = [ 4 4 4 4]) i'm having trouble making run every number in list. made function takes in value (4) , makes matrix of contains 4 copies of in 4x1 through loop. can make loop runs copy each number in list? aftewrads think can use vertcat combine matrices list i'm looking for. thanks! no need loop in case. with constant length each entry in val = [4 1 3 2] , repmat() , reshape() : len = 4; reshape(repmat(val,len,1),1,[]) or variable lengths , decode fex: rude() len = [1 2 3 4]; rude(len,val)

iphone - urban airship , device token is null -

i have implemented push notification using urban airship (development) in iphone. it works fine. want test in new device . installed same project in new device new mac pc added certificate in keychain , run , log shows device token null , no new device token in urban dashboard . what reason of null device token ? there missing? shall .p12 file ? i have in didfinishlaunchingwithoptions: // results out open or close notification bool storedresult = [defaults boolforkey:airshipkey]; if(storedresult){ [uapush shared].pushenabled=yes; }else{ [uapush shared].pushenabled=no; } // override point customization after application launch. //create airship options directory , add required uiapplication launchoptions nsmutabledictionary *takeoffoptions = [nsmutabledictionary dictionary]; [takeoffoptions setvalue:launchoptions forkey:uairshiptakeoffoptionslaunchoptionskey]; // call takeoff (which creates uairship singleton), passing

c++ - Linking error with CGAL -

i have cgal installed on mac os x (10.8.4). have incorporated aspects of cgal previous c++ programs compute convex hull of 3d point cloud. however, trying include other parts of cgal computing surface meshes, converting them polyhedra, , on. when that, program compiles fine, receive linking errors don't understand. here linking command following compilation: c++ -o2 -i/usr/local/include -i/usr/include -i/opt/local/include -o /users/bullard/shapemetrology/particle/bin/diffgeom diffgeom.a -l/usr/local/lib -l/usr/lib -l/opt/local/lib -lboost_math_c99 -lm -lcgal -lcgal_core -lcgal_imageio -lgmp and here (rather verbose) linking errors receiving: undefined symbols architecture x86_64: "boost::detail::get_tss_data(void const*)", referenced from: cgal::lazy, cgal::gmpq, cgal::lazy_exact_nt, cgal::to_interval >::zero() in diffgeom.a(particle.o) boost::thread_specific_ptr, cgal::gmpq, cgal::lazy_exact_nt, cgal::to_interval > >::

php - sqs order by value asc -

i have mysql query in php file. want order results ascending values column in 1 of tables using 'order value asc'. however, results being produced current query not ordering value, value in table. presume because have syntax wrong cant work out how. have been trying work out few weeks no joy, can help? thanks in advance replies. query: $find_query3 = mysql_query("select patients.*, addobs.*, date_format(addobs.datetime, '%d/%m/%y %h:%i:%s') dti1, (select date_format(min(addobs.datetime), '%m/%d/%y %h:%i:%s') addobs addobs.mrn = patients.mrn , addobs.datetime >= lastokpar.lastdatetime , addobs.par >= $par , addobs.hidden != 'yes') dti2 addobs inner join patients on addobs.mrn = patients.mrn left join ( select addobs.mrn , max(addobs.datetime) lastdatetime addobs addobs.par < $par , addobs.hidden != 'yes' group addobs.mrn ) lastokpar on lastokpar.mrn = addobs.mrn addobs.datetime = (select max(olast.datetime) addobs

Return POST data in CodeIgniter model? -

i'm trying data form , send model below input data database table users. i have controller (class login) following code: class login extends ci_controller { function __construct() { parent::__construct(); $this->load->model('login_model'); } public function index() { $data = array( 'gid' => $this->input->post('gid'), 'name' => $this->input->post('name'), 'pic' => $this->input->post('pic'), 'link' => $this->input->post('link') ); var_dump($data); $this->login_model->insert_entry($data); } } in model have following: class login_model extends ci_model { public function __construct() { parent::__construct(); $this->load->database(); } function insert_entry($data) { $this->db->insert('users', $data); } } the issue have @ moment don't think

Attaching a Textbox to a point or line on a chart in Excel/VBA -

Image
i wondering how attach textbox point or line in excel chart macro working on. have been using .addtextbox method such .shapes.addtextbox(msotextorientationhorizontal, 150, 250, 100, 15) _ .textframe.characters.text = "temperature" but have manually drag textbox on line on chart representing orientation of chart not line. there way convert line/point chart orientation use variable? or way? possibly using datalabel function, though want able customize 1 of axis locations. thanks to solve question need left & top position of 2 objects: chart itself, position set in relation top-left corner of sheet range area point in series position set in relation top-left corner of chart combination of both result following code (fixed parameters-required changes situation, more dynamic loop) sub add_text_to_point() dim tmpchr chartobject set tmpchr = sheet1.chartobjects(1) 'put index of chartobject here 'for first serie, point 2nd he

exception notifier - Rate limiting Airbrake Javascript logs -

i have followed instructions available @ https://github.com/airbrake/airbrake-js allow js exceptions farmed out airbrake. what wondering - there way intercept these exceptions before sent airbrake? want limit messages sent on wire airbrake it's not looking in console when start getting many 503 responses old message of "you've performed many requests" we're re-writing our javascript notifier. 1 of features of updated notifier. watch space. ben

C# - Reading specific elements of an XML file into a dataGridView and display rest in textbox -

hi i'm faced problem i'd with. firstly have xml file here <data> <row> <id>1</id> <description>description 1</description> <thedate>2013-06-12t00:00:00</thedate> <somenotes>some notes1asdsadsadsad</somenotes> </row> <row> <id>2</id> <description>description 2</description> <thedate>2013-06-15t00:00:00</thedate> <somenotes> </somenotes> </row> <row> <id>3</id> <description>description 3</description> <thedate>2013-06-21t00:00:00</thedate> <somenotes>bobobobojkfjh</somenotes> </row> <row> <id>4</id> <description>description 4</description> <thedate>2013-06-17t00:00:00</thedate> <somenotes>adaad</somenotes> </row> <row> <id>5</id> <description>description 5</descripti

ios - UITableView with fixed section headers -

greets, i'm reading default behaviour of uitableview pin section header rows top of table scroll through sections until next section pushes previos section row out of view. i have uitableview inside uiviewcontroller , not seem case. is defualt behaviour uitableviewcontroller ? here's simplified code based on have. i'll show uicontroller interface , each table view method i've implemented create table view. have helper data source class helps me index objects use table. @interface myuiviewcontroller ()<uitableviewdelegate, uitableviewdatasource> @property (nonatomic, readonly) uitableview *mytableview; @property (nonatomic, readonly) mycustomhelperdatasource *helperdatasource; @end //when section data set, details each section , reload table on success - (void)setsectiondata:(nsarray *)sections { super.sectiondata = sections; //this array drives sections //get additional data section details

node.js - NodeJS: Use environment variables in front end scripts -

i'm writing socket.io app, , i'm getting annoyed @ having chance line in frontend scripts.js file every time push heroku, from var socket = io.connect('http://localhost'); to var socket = io.connect('http://ersatz-elephant-1337.herokuapp.com/'); i know can use process.env.var access variables on backend, i'm wondering if there's way programmatically determine use in frontend scripts? i'd rather leave scripts static aside this, maybe that's not possible? edit: i'm not looking solution on backend... i'm looking way /public/scripts.js file can connect right thing. guess maybe way specifying special in server.js frontend script file, rather serving statically, if so, that's instruction i'm looking for, not how access env vars on server. sorry confusion! it's possible. either use foreman or use configuration script one: var url = require('url'); var config = {}; var dburl; if (typeof(process.en

sendmail on OpenShift / PHP / CodeIgniter -

i'm looking openshift configuration information sendmail functionality. it's not totally clear me preferred way of doing is. some articles 1 must have pear/mail.php modules installed, others when using relay. others openshift supports outgoing mail default, although issues. then i've looked cartridges may available, if approach, no luck there, although there sendgrid quickstart. all i'm trying really, send couple of emails application. no large quantities, or mass marketing mailings. can please give me short , sweet how-to? thanks in advance. openshift online hosted on amazon's ec2 service. email servers configured detect , blacklist emails originating ec2 when detects spam. although may work initially, there chance emails start silently fail after time due being blacklisted. it recommended relay through 3rd party smtp server/service: https://www.openshift.com/blogs/email-in-the-cloud-with-mailgun https://www.openshift.com/blogs/enabl

java - Trouble using @Resource and JNDI lookup -

i'm having trouble applying concept of injection , jndi ejbs , i'd help. learning , want understand , apply techniques of @resource and/or jndi lookups xml configuration. can't seem find of initial parameters in jndi lookups. now, before continue, if manually enter jndi name of datasource, works great. i'm trying (again exercise) use @resource or jndi jndi datasource name , jndi lookup on datasource. know can directly inject datasource object if can't inject string, gotta start this. first, here's important part of ejb-jar.xml: <env-entry> <description>datasource jndi lookup name</description> <env-entry-name>datasourcename</env-entry-name> <env-entry-type>java.lang.string</env-entry-type> <env-entry-value>mydatasource</env-entry-value> </env-entry> in terms of injection using @resource i've tried i've tried following field in ejb @resource(name = "datasourcename

XSLT select part of XML message -

i'm strugling find solution xml message extract problem. have similar below xml message: <orders xmlns="http://au.inputorders"> <order> <orderref>d04004451</orderref> <orderqty>5</orderqty> </order> <order> <orderref>d04004451</orderref> <orderqty>1</orderqty> </order> <order> <orderref>d04004452</orderref> <orderqty>1</orderqty> </order> <order> <orderref>d04004452</orderref> <orderqty>4</orderqty> </order> <order> <orderref>d04004452</orderref> <orderqty>2</orderqty> </order> </orders> i need xslt bit only: <orders xmlns="http://au.inputorders"> <order> <orderref>d04004451</orderref> <orderqty>5</orderqty> </order> <order> <orderref>d04004451</orderref> <orderqty>1</orderqty> </order>

android - how to remove button space alocated for text drawableTop -

Image
<button android:id="@+id/profile" style="@style/dashboardbutton" android:drawabletop="@drawable/abarprofile"/> <style name="dashboardbutton"> <item name="android:layout_gravity">center_vertical</item> <item name="android:gravity">center_horizontal</item> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:paddingleft">10dp</item> <item name="android:paddingright">10dp</item> <item name="android:background">@null</item> </style> is there way make icon wrap content?to take out space below text disregard space on left , right need space icon space between each other don't need space below , above image how

how do I loop a php variable within a javascript script -

i created form text field has spry validation (ie javascript). user can select number of rows in form 1 10. need code below expand i'm not familiar enough javascript make work. $divkey variable controls how many rows in form. original <script type="text/javascript"> var sprytextfield1 = new spry.widget.validationtextfield("sprytextfield1", "none", {validateon:["change"], maxchars:20}); var sprytooltip1 = new spry.widget.tooltip("sprytooltip1", "#sprytrigger1"); </script> so need line 'var sprytextfield1...' repeat based on $divkey next line being 'var sprytextfield2...' , on. can please rewrite work? trying use php <script type="text/javascript"> <?php ($i = 0; $i < $divkey; $i++) { $num=$i+1; ?> var sprytextfield<?php echo $num;?> = new spry.widget.validationtextfield("sprytextfield<?php echo $num;?>", "none", {vali

networking - FreeBSD TCP/IP stack OR Linux TCP/IP stack -

i checking out uip (micro ip) ip stack, figure out porting tcp/ip stack means. i wondering if there way can cleanly remove tcp/ip stack freebsd codebase , linux codebase. is there documentation ? simple removing couple of files , respective makefile components , building or copying code personal project ? any pointers useful ! thanks ! in many modern oses tcp/ip stack very tightly integrated os, or uses many core os primitives (like memory allocation, synchronization, etc.) impossible "pull out" own project (assuming embedded). uip , lwip written purpose - using in own custom environment without many ties existing os services.

styles - Outlook Html mailer bad rendering -

i wrote mailer campaign.on mail clients looked design, on outlook looked nasty.i got elements wrapped tag didn't put class .msonormal, want rebuild mailer in way don't such bad result microsoft outlook. you find rendering differences on email clients when using html. hard tell happening on campaign if don't post code or specific issue. what suggest is use http://htmlemailboilerplate.com have @ campaign monitor email css guide http://www.campaignmonitor.com/css/ try make things simpler we can if post specific code problem you're having.

haskell - Composing function composition: How does (.).(.) work? -

(.) takes 2 functions take one value , return value: (.) :: (b -> c) -> (a -> b) -> -> c since (.) takes two arguments, feel (.).(.) should invalid, it's fine: (.).(.) :: (b -> c) -> (a -> a1 -> b) -> -> a1 -> c what going on here? realize question badly worded...all functions take 1 argument currying. maybe better way types don't match up. let's first play typechecker mechanical proof. i'll describe intuitive way of thinking afterward. i want apply (.) (.) , i'll apply (.) result. first application helps define equivalences of variables. ((.) :: (b -> c) -> (a -> b) -> -> c) ((.) :: (b' -> c') -> (a' -> b') -> a' -> c') ((.) :: (b'' -> c'') -> (a'' -> b'') -> a'' -> c'') let b = (b' -> c') c = (a' -> b') -> a' -> c' ((.) (.) :

sencha touch 2 - local storage data not in view -

i'm making webapp sencha touch 2 (with architet) , have problem local storage: data isn't in view. if check how "rows" has storage return 4 (correct!), on view records not displayed. can me? (settings not interact products, therefore, ignore it!) app.js: ext.application({ models: [ 'products', 'settings' ], stores: [ 'settings', 'products' ], views: [ 'settings', 'homepage', 'productslist' ], controllers: [ 'main' ], name: 'youpazzle', launch: function() { ext.create('youpazzle.view.settings', {fullscreen: true}); }}); controller: ext.define('youpazzle.controller.main', { extend: 'ext.app.controller', config: { }, launch: function() { var settings = ext.getstore('settings'); if(settings.data.all.length === 0){ console.log('settagglio non eseguito'); }else{ console.log('

c# - Trying to optimize I/O for MongoDB -

i have updater script runs every few hours various regions on gaming server. looking run script more , add more regions. ideally love spread load of cpu , i/o evenly possible. used run script using mysql, website uses mongodb everything, kinda made sense move updater scripts mongodb too. having high i/o spikes when mongodb flushes of updates database. the script written in c# , although don't think that's relative. more importantly doing 500k 1.2 million updates each time 1 of these scripts runs. have done small optimizations in code , indexes, @ point stuck @ how optimize actual mongodb settings. some other important information this update({'someidentifier':1}, $newdocument) instead of this: $set : { internalname : 'newname' } not sure if lot worse in performance doing $set or not. what can try , spread load out? can assign more memory vm if well. i happy provide more information. here thoughts: 1) explain performance co

javascript - Amazon S3 direct file upload from client browser - private key disclosure -

i'm implementing direct file upload client machine amazon s3 via rest api using javascript, without server-side code. works fine 1 thing worrying me... when send request amazon s3 rest api, need sign request , put signature authentication header. create signature, must use secret key. things happens on client side, so, secret key can revealed page source (even if obfuscate/encrypt sources). how can handle this? , problem @ all? maybe can limit specific private key usage rest api calls specific cors origin , put , post methods or maybe link key s3 , specific bucket? may there authentication methods? "serverless" solution ideal, can consider involving serverside processing, excluding uploading file server , send in s3. i think want browser-based uploads using post. basically, need server-side code, generate signed policies. once client-side code has signed policy, can upload using post directly s3 without data going through server. here's offici

dictionary - Python: list of dictionaries, how to get values of a specific key for multiple items of the list? -

i have list of dictionaries like: dict_list = [{'key1': 'dict1_value1', 'key2': 'dict1_value2', 'key3': 'dict1_value3'}, {'key1': 'dict2_value1', 'key2': 'dict2_value2', 'key3': 'dict2_value3'}, {'key1': 'dict3_value1', 'key2': 'dict3_value2', 'key3': 'dict3_value3'}, {'key1': 'dict4_value1', 'key2': 'dict4_value2', 'key3': 'dict4_value3'}, {'key1': 'dict5_value1', 'key2': 'dict5_value2', 'key3': 'dict5_value3'}] getting value 'key3' second list item like: dict_list[1]['key3'] dict2_value3 and code below returns items 2:4 list: dict_list[1:3] what if want values 'key3' multiple items list. like dict_list[1:3]['key3'] something similar in matlab. >>> [x.get('key3') x in dict

c# - System.Web.UI.DataVisualization.Charting charts are not displaying on IE8 -

i created chart using system.web.ui.datavisualization.charting. charts displayed on google chrome , safari. not visible on windows xp ie8. don't know how fix this. here's code snippet on creation of charts. <img src="/convertfiles/createactualsvsforecastchart/?actuals=@(thismonth)&forecast=@(prevmonth)" /> public fileresult createactualsvsforecastchart(string actuals, string forecast, string chartname) { //ilist<resultmodel> peoples = _resultservice.getresults(); if (actuals.equals("")) actuals = "0"; if (forecast.equals("")) forecast = "0"; chart chart = new chart(); chart.width = 350; chart.height = 400; chart.backcolor = color.fromargb(211, 223, 240); chart.borderlinedashstyle = chartdashstyle.solid; chart.backgradientstyle = gradientstyle.topbottom; chart.borderlinewidth = 1; chart.pale

ios - How to convert mail server date string to nsdate -

i getting date string form mail server this. thu, 31 dec 2009 14:32:15 +0580. want convert date string date. here's code: - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. nsstring *inputstring=@"mon, 3 sep 2012 08:32:39 +0580"; nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"eee, dd mmm yyyy hh:mm:ss zzz"]; [dateformatter setlenient:yes]; nslocale *enus = [[nslocale alloc]initwithlocaleidentifier:@"en_us"]; [dateformatter setlocale:enus]; nsdate *result = [dateformatter datefromstring:inputstring]; nslog(@"test==%@",result); } i getting output null. excepted output : 2012-09-03 03:02:39 +0000 first problem: not trying read "tue" on string. (add "eee, " front of format) second , bigger problem: +0580 not valid time zone. there php bug few years ago mistakenly return

AngularJS- Prompting the user before routing to other controller to save changes -

i have form in controller. if there unsaved change want warn user loosing them when leaving. first tried: $scope.$on('$locationchangestart', function (event, next, current) { if ($scope.settingsform.$dirty) { event.preventdefault(); $scope.theuserwantstoleave(function (result) { if (result === "leave") { $location.path($location.url(next).hash()); $scope.$apply(); } }); } the code above throws error in line $scope.$apply(); : error: $digest in progress removing line don't execute redirect. what right way it? === edit: other option tried handling reacting when need cancel redirection: $scope.$on('$locationchangestart', function (event, next, current) { if ($scope.settingsform.$dirty) { $scope.theuserwantstoleave(function (result) { if (result === "stay_here") { event.preventdefault(); }

breeze - How to implement multilingualism in SPA -

i'm struggling problem of multilingualism in spa. i've come several solutions, building wrapper resources resx files, or saving labels in database, wondering if of have found solution automates these steps. are there practices specific problem? for reasonable amount of literals, suggest save resources in db or in .resx file in server. when user logs in or detect language used, literals requested application , saved either in collection of translation module or in localstorage of browser (this approach large data). module have methods retrieve messages, passing key. using solution inject module in viewmodels need show translated literals , acces them through view: <p data-bind="text: resourcemanager.get('m01')"></a> for large applications require huge localization data transfered, maybe kind of modularity applied , load resources needed each module/section. i don't think making recurrent requests server translated liter

wso2 - Signing and Encrypting a SOAP message using Apache Rampart -

i want encrypt soap message public key of server , sign same message private key of client. ideally keys signing , encryption different. was referring apache rampart examples wso2 team. 1 such sample rampart configuration given is: rampartconfig rampartconfig = new rampartconfig(); properties merlinprop = new properties(); merlinprop.put("org.apache.ws.security.crypto.merlin.keystore.type", "jks"); merlinprop.put("org.apache.ws.security.crypto.merlin.file","c:/documents , settings/abdul.mujeeb/workspace/axis2clients/src/certs/oasis.jks"); merlinprop.put("org.apache.ws.security.crypto.merlin.keystore.password", "password"); cryptoconfig sigcryptoconfig = new cryptoconfig(); sigcryptoconfig.setprovider("org.apache.ws.security.components.crypto.merlin"); sigcryptoconfig.setprop(merlinprop); cryptoconfig encrcryptoconfig = new cryptoconfig();

c# - Build fails in teamcity for Nuget packages -

i added solution via nuget autoumapper , nunit packages , work great , project compiles in computer. when declared build server build solution got messages: [msbuild] automapper\automapperspike.csproj: build default targets (1s) [10:35:50][automapper\automapperspike.csproj] resolveassemblyreferences [10:35:50][resolveassemblyreferences] resolveassemblyreference [10:35:50][resolveassemblyreference] primary reference "automapper". [10:35:50][resolveassemblyreference] c:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets(1360, 9): warning msb3245: not resolve reference. not locate assembly "automapper". check make sure assembly exists on disk. if reference required code, may compilation errors. [10:35:50][resolveassemblyreference] searchpath "{hintpathfromitem}". [10:35:50][resolveassemblyreference] considered "..\packages\automapper.2.2.1\lib\net40\automapper.dll", didn't exist. does know how solve pro

javascript - How to add custom CSS span into a text input box ( like )?

i make same feature of stack overflow's tags selector ( 1 below ). have read chosen , stack overflow heavily inspired from . main difference of chosen , stack overflow's 1 stack overflow allows users type , auto-complete tag, while chosen can select list. how change code of chosen's multiple select demo make similar thing stack overflow's tags selector ? here code chosen's multiple select demo: <div> <em>into this</em> <select data-placeholder="choose country..." class="chzn-select" multiple style="width:350px;" tabindex="4"> <option value=""></option> <option value="united states">united states</option> <option value="united kingdom">united kingdom</option> </select> </div>

python - How to detect the event when smart card scanned -

i working on smartcard based application smartcard reader, here whenever flash card should card uid, based on need retrieve details database. for need how start, whether need create service on windows run background or there way detect event on os or scheduler program. i able uid , related need run program externally. please suggest me on issue, in advance. if using usb or serial connection connect card reader pc, .you can use datareceived event of serial port class.

How do I make doxygen hide enum values in documenting each member? -

for example, have source code enum colormodel { color_model_rgb = 0, color_model_rgba = 1, color_model_grayscale = 2, color_model_grayscalealpha = 3, color_model_cmyk = 4, }; and after generation, in enumerations section get: enum ecolormodel { color_model_rgb = 0, color_model_rgba = 1, color_model_grayscale = 2, color_model_grayscalealpha = 3, color_model_cmyk = 4 } how can hide values just enum ecolormodel { color_model_rgb, color_model_rgba, color_model_grayscale, color_model_grayscalealpha, color_model_cmyk, } set following in doxygen's configuration file: max_initializer_lines = 0

ruby on rails - column spree_preferences.key does not exist -

when run rake db:migrate i following error message. pg::error: error: column spree_preferences.key not exist` anyone can please tell me how fix error. as quick solution can remove references spree_preferences in specific migration. careful though, because has potential break things.

java - Understanding of the classpath and the classloader -

the root of misunderstanding concerns classpath or classloader me i'll depict in context first steps openejb. i playing openejb embedded , faced strange issues. using maven pull dependencies , 1 of jar containing ejbs. my application creates ejb container , try lookup 1 of @singleton contained in dependencies. case 1) when i'm launching main netbeans, relies on maven ( exec-maven-plugin ) working fine, can lookup bean. uses command line : mvn -e "-dexec.args=-classpath %classpath com.app.main" -dexec.executable=/usr/lib/jvm/java-7-openjdk/bin/java org.codehaus.mojo:exec-maven-plugin:1.2.1:exec case 2) if try package application jar dependencies in specific folder lib ejbs not found. here part of pom.xml create manifest.mf , put dependencies in lib folder. <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.4</version> <configurat

MPI - Will it cause any problems if a message sent by MPI_Bcast() is not received in one of the nodes (doesn't call MPI_Bcast) -

i have master node broadcasts message every using mpi_bcast. problem is, have 1 specific node needs run bit slower others, , say, participate in bcast half of time. like: // -- iteration 1 master: mpi_bcast(msg1) node1: mpi_bcast(msg1) node2: mpi_bcast(msg1) node0: mpi_bcast(msg1) // -- iteration 2 master: mpi_bcast(msg2) node1: mpi_bcast(msg2) node2: mpi_bcast(msg2) node0: dosomethingimportantanddontparticipateinbcast() // -- iteration 3 master: mpi_bcast(msg3) node1: mpi_bcast(msg3) node2: mpi_bcast(msg3) node0: mpi_bcast(msg3) is possible? note in last iteration, want node0 receive msg3 , not msg2 (which ignored). your suggested pattern won't work, processes in communicator participate in each broadcast. if implement plan stands find node0 matches mpi_bcast(msg3) broadcast other processes see mpi_bcast(msg2) . there no mechanism identifying broadcasts separately. it's long time since wrote mpi program mis-matched broadcasts can't recall happens,

sql - Convert time into datetime which returns today's date and time from database -

how can convert time datetime returns today's date , time database? let's have time in database. 12:30 pm , when use: convert(datetime, a.start time) it returns 1900-01-01 12:30:00.000 . there way can today's date? like : 2013-07-11 12:30:00:000 select convert(varchar(19), (cast(getdate() date) + cast(tm datetime)), 120) yourtable output: 2013-07-11 12:30:00 check see if matches requirement chek see sql feedle demo

c# - Access foreign key data linq -

i have simple requirement if done via sql query. have table category id,name table b categoryitems has foreign key of categoryid,name. using linqdatasource simple select statements show data table a. select * (simple) i have requirement want "not show" categories in first place not have items associated them i. e (select count(*) b categoryid="")>0 very easy modifying sql statement, wondering if can done possible accessing foreign key relationship data using out of box linq functionality , applying validation. just keen on it!.. thanks ton! you want use any() method on category.categoryitems any() returns true if count > 0 , false if count == 0 // select categories have @ least 1 categoryitem. ienumerable<category> categorieswithitems = context.categories.select(x => x.categoryitems.any()); for linqdatasource want use selecting event handler . msdn . the aspx:- <asp:linqdatasource id="linqdatasource1&quo

java - How to invoke JTable action from outside JButton? -

i have jtable transferhandler allows copy-cut-paste actions via hotkeys or dnd . have 3 jbuttons ( copy-cut-paste ) outside of jtable , should invoke similar actions on jtable's transferhandler (such canimport() etc). how can that? basically similar approach in recent question/answer : find table's copy action in actionmap, wrap custom action delegates original , use custom action in button: table.setdragenabled(true); final action copy = table.getactionmap().get("copy"); action copywithbutton = new abstractaction("copy") { @override public void actionperformed(actionevent e) { copy.actionperformed( new actionevent(table, e.getid(), e.getactioncommand())); } }; frame.add(new jscrollpane(table)); frame.add(new jbutton(copywithbutton), borderlayout.north); frame.add(new jscrollpane(new jtextarea(5, 20)), borderlayout.south);

javascript - getElementsByTagName inside GetElementById (object xraywrapper)? -

i trying div inside div , since id of second div variable, use var wrappingdiv = document.getelementbyid('divid') to wrapping div then var insidediv = wrappingdiv.getelementsbytagname('div') but getelementsbytagname not function error, guess syntax wrong, guys put me in right direction? thanks in advance. edit : correct myself, trying body of gmail email, : var element = content.document.getelementsbyclassname("ii gt m13fbe3a51e95e196 adp ado"); it returns object xraywrapper[object htmlcollection] edit 2 : i using mozilla firefox, , developing own extension, access source code of google mail use simple javascript (content.document...) in var element = content.document.getelementsbyclassname( "ii gt m13fbe3a51e95e196 adp ado"); getelements <- s means returns multiple elements (in list-like collection), not 1 element. you might want pick out first 1 found. var element = content.document.getelements

iphone - Receive same JSON response as coming from server -

Image
this question has answer here: how sort json 1 answer how sort json. json below output in browser. { event: { july: [ { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", } ], aug: [ { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", } ], sept: [ ], oct: [ ], nov: [ ], dec: [ { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", stamp: "1386019800" }, { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", stamp: "1387921620" } ], jan: [ ], feb: [ ], mar: [ ], apr: [ ], may: [ ], june: [ ] } } below in console when fetched. apr = ( ); aug = ( { createdseatmap: "yes",