Posts

Is there a way to tell meteor a collection is static (will never change)? -

on meteor project users can post events , have choose (via autocomplete) in city take place. have full list of french cities , never updated. i want use collection , publish-subscribes based on input of autocomplete because don't want client download full database (5mb). there way, performance, tell meteor collection "static"? or make no difference? could suggest different approach? when "want tell server collection static", aware of 2 potential optimizations: don't observe database using live query because data never change don't store results of query in merge box because doesn't need tracked , compared other data (saving memory , cpu) (1) can rather constructing own publish cursor. however, if client observing same query, believe meteor (at least in future) optimize it's still 1 live query number of clients. (2), not aware of straightforward way because potentially mess data merging on multiple publications , subscript...

PayPal Integration and Sandbox Test Account Android -

Image
i developing android app in have integrate paypal.i have followed mpl paypal tutorial integrate palpal in app.i understood clearly.but problem i unable make personal , business test account because when make account ask me account details. i living in non-usa country. i follow sandbox testaccount make account. problem nob 1. says when go paypal.com make test account then problem nob 2. my country not in list of " your country or region " problem nob 3. when go make individual test account ask me credit card information if ignore credit card information @ point @ next step have add it. from start go https://developer.paypal.com/ create new developer account , log in there can create sandbox account have 2 options personal or bussiness account. when create personal account automatic credit card added paypal login. by using login details can test application.

compiler construction - Why it is important to first convert code in assembly? -

while learning reverse engineering, got know assembly best way see , attack closed source software. why languages c/c++ needs convert code assembly, why doesn't directly convert machine language. secondly why necessary map code sections (like .stack,.bss) @ same location (virtual) every time? some compilers, in time compilers example, output machine code. in general easier debug compiler human examining assembly language rather machine code. extent "unix way" adding layer existing tools, etc. in case assembler , linker need exist target platform, understood argument. can generate assembly language , debug visually, , use existing assembler , linker turn usable machine code.

How can I write into a particular line of a file in a bash script? -

i want write data taken file last line (not in new line) of file. using following script. #!/bin/bash echo "write start , end file number:" read sta end echo "$sta" "$end" (( c="$sta"; c<="$end"; c++ )) cp analyzeclusterparameterfile analyzeclusterparameterfile$c awk '{if (nr== '$c' -10){print $1 " " $2 " " $3}}' center.dat >> analyzeclusterparameterfile$c done but (analyzeclusterparameterfile$c file) going new line this rinner = 0.1 ! in mpc router = 5 ! in mpc numberofpoints = 50 ! default 16 virialdensity = 200 ! default 200 centerlistname = 5.044627347e-01 5.008533222e-01 5.043365095e-01 what want(analyzeclusterparameterfile$c file) rinner = 0.1 ! in mpc router = 5 ! in mpc numberofpoints = 50 ! default 16 virialdensity = 200 ! default 200 ...

singleton - how to initialize static class at service level in wcf -

i have singleton log framework, can suggest how initialize @ service level. have attach event handlers part of initialization. when had initialized in service class getting executed(handlers added) each client call , therefore log table getting updated multiple times same records. thanks.. if want control how service instance gets initialized, you'll need implement custom service host. msdn article should give start. idea put log framework initialization in service host occurs once , have injected each service instance.

javascript - Removing Cookie value from browser -

i know has been asked many times, , ive tried using accepted answers. sadly none of seems work me in browser(mozilla v18.0.2). i using backbone website , im using cookies handle user login sessions. the following unsuccessful ones : code 1 var cookie_date = new date ( ); // cookie_date.settime ( cookie_date.gettime() - 1 ); // 1 second before now. // empty cookie's value , set expiry date time in past. document.cookie = "uid=;expires=" + cookie_date.togmtstring(); document.cookie = "username=;expires=" + cookie_date.togmtstring(); code 2 var nameeq = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charat(0)==' ') c = c.substring(1,c.length); if (c.indexof(nameeq) == 0){ uid = c.substring(nameeq.length,c.length); return uid; } }; any working solution removing browser cookies?? thanks roy ...

mysql - Query on large i18n table slow in CakePHP -

the query below, using cakephp's i18n table, takes around 1000ms run. i18n table large - has around 600,000 rows. have default indexes on table, per cake schema. how can speed queries up? caching them possible when cache needs cleared these queries run, , slow down performance quite noticeably. select `category`.`id`, `category`.`slug`, `category`.`name`, `category`.`description`, `category`.`head_title`, `category`.`display_title`, `category`.`category_count`, `category`.`product_count`, `category`.`parent_id`, `category`.`lft`, `category`.`rght`, `category`.`sort_order`, `category`.`created`, `category`.`modified`, `category`.`image_processed`, ((rght - lft) = 1) `category__is_child`, (`i18n__name`.`content`) `category__i18n_name`, (`i18n__description`.`content`) `category__i18n_description`, (`i18n__slug`.`content`) `category__i18n_slug`, (`i18n__head_title`.`content`) `category__i18n_head_title`, (`i18n__meta_description`.`content`) `category__i18n_meta_description`,...