Posts

Showing posts from August, 2011

How to get steam items names? -

i trying find name of item on steam. this json array [appid] => 730 [contextid] => 2 [assetid] => 4981322842 [classid] => 311848115 [instanceid] => 188530139 how can "convert" item name or market hash name ? if add get_descriptions=1 request item description names inside json array . looks http://paste.ofcode.org/wxs7ra35zjzk9wtuh7t3eh now not sure how prices here. i think 1 same next question. with code, get, instanceid, classid, assetid, amount, market_hash_name, market_name, name, etc. can learn edit response result. { "items_to_give": [ { "instanceid": "480085569", "classid": "1440311074", "assetid": "5003822520", "amount": "1", "market_hash_name": "awp | asiimov (field-tested)", "market_name": "awp | asiimov (field-tested)&q

Cassandra Replication With in cluster Without partitioning Data -

i have 3 nodes in cluster node1 = 127.0.0.1:9160 node2 = 127.0.0.2:9161 node3 = 127.0.0.3:9162         i want use 1 node(node1) insertion. other 2 nodes should used fault tolerance on writing millions of records. i.e. when node1 down either node2 or node3 should take care of writing.for formed cluster replication factor of 2 , added seed nodes in cassandra.yalm file. working fine. due partition whenever write data node 1, rows getting scattered across node in cluster. there way use nodes only replication in cluster?...or there way disable partitioning ?... thanks in advance.. no. cassandra distributed system.

Perl one-liner: how to skip to the next file in @ARGV -

i thinking how "short circuit" reading file within perl -ne loop. if hit condition, want abandon current file , proceed next 1 in @argv. similar gnu awk's handy nextfile command. something this: perl -ne 'do_something(); next_file if some_condition()' files ... playing around, found close argv achieves "go next file" goal. are there other, less magical, ways accomplish this? nope, close argv right way this. as noted glenn jackman, has side effect of resetting $. line counter (which continues incrementing across several files when using argv), may want save , restore it: my $line = $.; close argv; $. = $line;

Clang Cross Compiling with Yocto SDK -

is possible use toolchain , sysroot yocto sdk cross compile clang/llvm arm? the environment-setup script within yocto sdk has following compiler options: export cc="arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=$sdktargetsysroot" i cross compile simple userspace application testapp.c: #include <stdio.h> int main() { printf("hello world\n"); return(0); } following guide http://clang.llvm.org/docs/crosscompilation.html , trying cross compile app $ gccflags="-mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard" $ gccinclude="/opt/poky/2.0.1/sysroots/cortexa7hf-vfp-neon-poky-linux-gnueabi/usr/include/c++/5.2.0/arm-poky-linux-gnueabi/ $ /usr/bin/clang -target arm-poky-linux-gnueabi $gccflags -i$gccinclude -ccc-gcc-name arm-poky-linux-gnueabi-gcc testapp.c -o testapp -v however, fails with ubuntu clang version 3.4.2-3ubuntu2~xedgers (tags/release_34/dot2-final) (based on llv

trying to understand the concept of being unable to mutate strings/numbers in javascript -

in javascript, can reassign variable like: var x = 10; x+=10; console.log(x); //prints 20 console but if take example of seemingly similar activity unexpected result: var originalvar = 1; changemyvar(originalvar); function changemyvar(myvar) { myvar += 1000; return myvar; } console.log(originalvar); //prints 1 console i see 1 in same. passing variable argument function. i'm reassigning value within function. , i'm returning , printing variable. mutation? primitives function parameters passed value in javascript. therefore myvar in changemyvar function not reference originalvar new variable value of originalvar .

In SSIS, Hoew to assign a value to the variable? -

Image
i have sql query in have mentioned @result . want assign value of @result declared variable in execute sql task of dft. please assist me? here query: declare @result smallint declare @value smallint begin set @value = (select value dbo.ldmstockintegritycheck interfacename = 'i0180' , filename = 'piz.ed.nbfs001.picsht.data.ldm') set @result = 0; if (@value = 1) begin select @result = count(*) dbo.ldmintegrityerrorlog interfacename = 'i0180' , filename = 'piz.ed.nbfs001.picsht.data.ldm' , convert(varchar(10), datetime, 120) = convert(varchar(10), getdate(), 120); end end if want output value of count query count(*) dbo.ldmintegrityerrorlog don't see importance of variable @result declare @value smallint begin set @value = (select value dbo.ldmstockintegritycheck interfacename = 'i0180' , filename = 'piz.ed.nbfs001.

postgresql - Does Postgres allow json[] or jsonb[]? -

so l have been trying find answer on internet 0 luck. does postgres support having arrays of objects in single field, e.g. [ { key: value, another: value }, { key: value, value: key } ] and saving single field? also how perform single insert or update would be: update db set value='[{ key: val }, { key: val }]' ?? postgres supports valid json values, including json arrays. going use single json (jsonb) column, not postgres array: create table example (id int, val jsonb); insert example values (1, '[{ "name": "aga" }, { "gender": "female" }]'); select * example; id | val ----+----------------------------------------- 1 | [{"name": "aga"}, {"gender": "female"}] (1 row)

java - Apache Ant Configuration Not Working -

i new apache ant , have downloaded , want automate task i have configured ant_home in system environment. when running ant in prompt shows me following error: c:\>ant buildfile: build.xml not exist! build failed c:\> ant wants (by default) build.xml file specifies tasks accomplish. use c:\> ant -help to know syntax of ant command appropriate case ... , figure out build.xml appropriate project. installation seems work :) ... message ant.

python - Can't install scikit-learn -

i have ubuntu linux. command pip install -u scikit-learn gives unicodedecodeerror: 'ascii' codec can't decode byte 0xe2 in position 52: ordinal not in range(128) do have advices solve problem? i faced same problem. worked me running following commands: sudo pip install --upgrade setuptools sudo pip install -u scikit-learn

java - Google Play Games not authenticating in Android -

in debug mode, google play games shows it's loading screen , can log in. however, afterwards receiving error in clean message box: the application incorrectly configured. check package name , signing certificate match client id created in developer console. also, if application not yet published, check account trying sign in listed tester account. see logs more information. in release mode, game crashes , receiving error in android studio: access not configured. api (google play game services api) not enabled project. please use google developers console update configuration. in google play developer console, marks ticked. don't understand why not working. should sha key or client id? i did not publish settings yet, says the google play game services settings ready test. use developer account test account on same device testing on. i using wrong sha1 keys. had create new gpgs game , perform step 3c on page: https://developers.google.com/games/services/co

Vector.size() in Java -

how vector.size() work exactly, returning aleready known array.length or makes calculations every time? my point is.. better have variable store vector's size when need use in loop example : int vectorlength = myvector.size(); (int = 0; < vectorlength; i++) { //... } or can use directly vector.size() ? better in terms of memory , cpu time used? you can @ actual codes how implements it: 308 * @return number of components in vector 309 */ 310 public synchronized int size() { 311 return elementcount; 312 } the link here: http://www.docjar.com/html/api/java/util/vector.java.html it int value getter.

java - How to Integrate Facebook sdk for android development on Eclipse -

i relatively new eclipse ide , want build facebook login option in android app. looked developers.facebook documentation can't find 1 eclipse ide (they have android studio ). want know if possible? (if yes how done?)

regex: how to stop on no alpha or end of line char? -

my goal match both: 25 place de la paix 24 place de la guerre. not continue after . 26 place de la foi !do not continue after ! should give 3 results: 25 place de la paix 24 place de la guerre 26 place de la foi i use: /\d+\splace.*[^a-z\s]/iu which works fine 24 place de la guerre. since stopps @ none alpha numeric char "." i stop regex on no alpha or @ end of line char: idea ? i tried /\d+\splace.*[^a-z\s\n]/iu /\d+\splace.*[^a-z\s\r]/iu you don't need use .* after place . can use [a-z\s]* match want: /\b\d+\s+place[a-z\s]*/i regex demo or else use negative lookahead stop when encounter first non-letter, non-space character: /\b\d+\s+place.*?(?=[^a-z\s]|$)/mi

C++ vector do not keep value received from loop -

i'm writing program takes value file. value require modified @ further moment, store them in vector. basically program is: read whole file while loop. if line contain required parameter array, store every value array in vector using loop. problem is: as loop exited, vector lost everything. declared vector outside while loop read file, should not happen. 1 know going on? example file: <polylist count="34"> <input semantic="vertex" source="#cylinder-mesh-vertices" offset="0"/> <input semantic="normal" source="#cylinder-mesh-normals" offset="1"/> <vcount>4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 32 4 4 32 </vcount> <p>0 0 1 0 3 0 2 0 2 1 3 1 5 1 4 1 4 2 5 2 7 2 6 2 6 3 7 3 9 3 8 3 8 4 9 4 11 4 10 4 10 5 11 5 13 5 12 5 12 6 13 6 15 6 14 6 14 7 15 7 17 7 16 7 16 8 17 8 19 8 18 8 18 9 19 9 21 9 20 9 20 10 21 10 23 10 22 10 22 11 23

Update Table View in iOS (Swift) -

i making cocktail ios application. i adding strings tableview (an ingredient "cabinet"). user enters ingredient , presses button add. adds core data not appear right away. doing wrong? below code, thanks! viewcontroller: import uikit import coredata class cabinetviewcontroller: uiviewcontroller, uitextfielddelegate, uitableviewdatasource, uitableviewdelegate { var ingredientarray = [string]() var display = [string]() var dbingredients = [string]() let ingredientfetch = nsfetchrequest(entityname: "cabinet") var fetchedingredient = [cabinet]() @iboutlet weak var textui: uitextfield! @iboutlet weak var button: uibutton! @iboutlet weak var tableview: uitableview! let moc = datacontroller().managedobjectcontext override func viewdidload() { super.viewdidload() textui.delegate = self textui.addtarget(self, action: "textfielddidchange:", forcontrolevents: uicontrolevents.editingcha

html - How to have title columns for each PHP column result -

i individual column titles display each table data column echo'd? <form> <?php $numerooption= $_post['numero']; $roomtype= $_post['roomtype']; $selectoption = $_post['parkname']; $query = "select * `rooms` `capacity` < '$numerooption' , `park` '$selectoption%' , `dataprojector` '$proj_check%' , `whiteboard` '$white_check%' , `ohp` '$ohp_check%' , `wheelchairaccess` '$wheel_check%' , `lecturecapture` '$cap_check%' , `style` '$roomtype%'"; $result = mysql_query($query); if ($result == false) die ("could not execute statement $query<br />"); echo "<form action='' method='post'>"; echo "<table>"; while($row = mysql_fetch_array($result)){ echo "<tr><td>" . $row['roomcode'] . "</td>"; echo "<td>" . $row['st

iphone - Status bar tap should scroll table view to the top -

this question has answer here: how detect touches in status bar 10 answers can please tell me how implement tap on status bar , table view should scroll top. have scroll view in view controller different purpose. thanks in advance if having more 1 scrollview inside viewcontroller, set setscrollstotop property yes scrollview want scroll when user taps status bar. , set property no other scrollviews. if there 1 scrollview/tableview, don't need this. set automatically. [myscrollview setscrollstotop:yes]; [otherscrollview setscrollstotop:no];

Type check for nested generic classes in swift -

i have problem solving following use case in swift, , not sure if possible. let's have data structure class using generics - let's call container<t> now have list of many container can of different types t, e.g. container<a>, container<b>, container<a>, container<c>, container<c>, ... i go through list, , each container find out "inner type" is. , cast it, if possible. the possible types t not finite, cannot have big switch case testing each of them. what try similar to: if value container<???> { <- 1. should match container type (??? stands here type) let value = value as! container<???> <- 2. cast specific container ... } what ways possible solve 1. , 2.? you can switch on value , conditionally cast known possible types (if case falls through: type conversion successful). example: class myclass : customstringconvertible { var foo : int = 1 var description: s

Is there a rough timeline for Breeze server to support asp.net 5 / ef7? -

do have sort of timeline, rough may be, when can expect breeze server support asp.net 5 , ef7? thank you asp.net 5 being renamed asp.net core 1 , entity framework 7 being renamed entity framework core 1 , latest version rc1. @ date/time proccess ongoing. hope breeze team communicate , @ rendez-vous.

Windows 8 Bluetooth Low Energy - Custom driver required -

i'm trying connect glucose , heartrate monitor le devices using windows 8. being detected fine , default le used device. i'm trying use sample ble http://code.msdn.microsoft.com/windowsapps/bluetooth-le-metro-sample-a2ba1b5b getting 80070057 error. i have read post custom driver required. run using sample in mac , works fine. sample application able use device without issues. there way access , use device without creating custom driver? thanks! the sample facade user. driver needed in order communicate hardware. standard devices os might include default driver (e.g., standard web cam) predefined set of functionality rest vendor-supplied driver required.

javascript - Grunt read .json file to concat list of html files -

i’m trying grunt concat .css files 2 different directories single css file i got working ok , trying write similar piece of code concat html files in order specify in simple external .json file rather editing grunfile.js directly each time keeps throwing errors the file locations , permissions ok, can php or concat css files ok, i’m not great on js syntax os using functions. learned use grunt in last few days pretty sure have not called file correct code?? any advice kindly appreciated! this gruntfile.js exactly module.exports = function(grunt) { // 1. configuration goes here grunt.initconfig({ pkg: grunt.file.readjson('package.json'), concat: { // 2. configuration concatinating files goes here file.readjson(‘html-files.json’); }, watch: { files: ['../../pages/**/*.html’], tasks: ['concat'], options : { nospawn : true } } }); // 3. tell grunt plan use plu

ubuntu - bz2 not available (/usr/bin/python older version, so am using /home/name/somedir for python -

my server has python older version(2.6~), have created separate dir installing latest python. have installed binary . now, got error 'bz2 module not available' got problem when installing django-celery. it working system level python this: /usr/bin/python: python shell opens...... then, import bz2; works !!! python (means, locally installed python, after source /venv/bin/activate) in python shell, import bz2; says not available. can please make work local version( not global one). resources found , tried : importerror: no module named bz2 python 2.7.2 python's bz2 module not compiled default a very similar question describes same problem zlib. in short, you'll need libbz2.so , headers in location python can find them. might need download bzip2 source code , compile/install in homedir well.

r - Geom_line not plotting colors correctly for characters but fine for numerics -

Image
i'm confused. have following data: require("ggplot2") treatment=c(rep("no", 10), rep("yes", 30), c(rep("no", 10)), rep("yes", 10), rep("no", 30), c(rep("yes", 10))) dat=data.frame(time=rep(1:50, 2), group=rep(c("group 1", "group 2"), each=50), treatment=treatment) why not work: ggplot(dat, aes(x=time, y=group, color=treatment))+ geom_line() but works (group 2's colors change correctly)? ggplot(dat, aes(x=time, y=group, color=as.numeric(as.factor(treatment))))+ geom_line() you need add group=group clause aes function want, othewise doesn't handle factors correctly: require("ggplot2") treatment=c(rep("no", 10), rep("yes", 30), c(rep("no", 10)), rep("yes", 10), rep("no", 30), c(rep("yes", 10))) dat=data.frame(time=rep(1:50, 2), group=rep(c("group 1&

c++ - How to dynamically linking sapi.dll and making it work? -

i dynamically bind windows sapi.dll , call code needed 'speak' text on windows - code below (this snippet copied gamedev.net article desmond lang) have no experience in using dll's especialy com. tell me how code should work my? tnx // voice interface pointer ispvoice* voice = null; // initialize com coinitialize ( null ); // create voice instance cocreateinstance ( clsid_spvoice, null, clsctx_all, iid_ispvoice, (void**)&voice ); // our text spoken wchar* textbuffer = "hello world"; // use our voice interface speak contents of buffer voice -> speak ( textbuffer, spf_default, null );

php - Laravel simplify nested relation output -

i items owned authenticated user. $items=auth::user()->with('items')->get(); in view can access items collection, instead of title_id want retrieve item_title value. i'm able item_title value using code below: $item->title->title is possible simplify retrieve title this: $item->title ? here models , relations: users id username item id user_id title_id item_titles id title user model: public function items() { return $this->hasmany('item', 'user_id', 'id'); } item model: public function user(){ return $this->belongsto('user', 'user_id', 'id'); } public function title() { return $this->belongsto('itemtitle','title_id','id'); } itemtitle model: public function item() { return $this->hasmany('item', 'title_id', 'id'); } update excuse me wasn't clear. precise - want find e

javacard - Generate random number bounded between two numbers in Java Card -

how generate random number bounded between 2 number in java card? example number should generated between 0 , 50. being intrigued question decided again make code contributions through stackoverflow. note have tested distribution of random numbers using securerandom within java se. i'm reasonably sure code correct though. so without further ado, code. package nl.owlstead.jcsecurerandom; import javacard.framework.jcsystem; import javacard.framework.util; import javacard.security.randomdata; /** * generates numbers within range. class uses modulo arithmetic * minimize number of calls random number generator without expensive * calculations. class similar in operation * {@code securerandom.nextint(int)} method defined in java se. * * @author owlstead */ public final class jcsecurerandom { private static final short short_size_bytes = 2; private static final short start = 0; private final randomdata rnd; private final byte[] buf; /**

php - WHERE NOT Query in Wordpress -

i querying database using following code , working fine <?php query_posts( 'post_type=gallery&posts_per_page='.$gnum.'&paged='.$paged.'&orderby=title&order=asc' ); ?> could please tell me how add not above query. ( where id != '400' , id!='401' ) in wordpress query post add argument post__not_in . 'post__not_in' => array(400, 401) $args = array( 'post_type' => 'gallery', 'posts_per_page' => $gnum, 'post__not_in' => array(400, 401), 'paged' => $paged, 'orderby' => 'title', 'order' => 'asc' ); so query post like, query_posts($args);

javascript - Display selected value in dropdown menu -

i have drop down list this: <select id="ddllanguage" name="culture"> <option value="null" >language:</option> <option value="ar-jo">arabic</option> <option value="en-us">english</option> <option value="fr-fr">french</option> <option value="es-cl">spanish</option> </select> if select "arabic",the drop down list should display "arabic". getting "language". edit i got answer using viewbag script:- <script type="text/javascript"> $(function () { $('#ddllanguage').val("@viewbag.msg"); $('#ddllanguage').change(function () { $('#currentculture').val($(this).val()); $(this).parents("form").submit(); }); }); </script> in controller have

html - padding-right not working -

Image
i having code this <div style="background-color: greenyellow; color: black"> <span style="padding-left:20%">t1</span> <span style="padding-right:10%">2</span> </div> currently showing this. here padding right not working. should such 2 should having 10% padded right of div. there other style tag can give such padding right. by default, inline elements rendered left right aligned, unless specify float property them. that means, in given horizontal line, first span t1 rendered adjacent left border of parent , span 2 rendered adjacent span t1 . so, padding-right never being utilized, last span far away right border, unless make move right either float:right or giving margin try this: <div style="background-color: greenyellow; color: black"> <span style="padding-left:20%">t1</span> <span style=" float:rig

java - GOOGLE PLAY SERVICES EXCEPTION: com.google.android.gms.common.GooglePlayServicesUtil -

i trying integrate google play games app. working in debug mode. however, not seem work in release mode. getting errors. tried clean , rebuild. java.lang.runtimeexception: unable provider com.google.android.gms.measurement.appmeasurementcontentprovider: java.lang.classnotfoundexception and one: google play services exception: com.google.android.gms.common.googleplayservicesutil followed one: there problem google play services library, required android advertising id support. google play services library should integrated in app shipping in play store uses analytics or advertising. what wrong? tried experimenting gradle, no luck yet. if disable proguard, works! seems known issue, not resolved yet. ideas? the problem in gradle using classpath 'com.google.gms:google-services:1.5.0-beta2' now using classpath 'com.google.gms:google-services:1.5.0'

sql - change timezone mysql without root -

i have mysql database in free hosting web (because of can't set timezone). when make 'now()' sentence, shows me hour gmt+8, , need gmt+1. are there way change or modify result without root access?? thank in advance , sorry english ;) there 1 command set timezone in mysql set time_zone = '+05:30';

java - Text processing to identify parts of speech -

i've write program (in java) identify several parts of speech nouns, adjectives, verbs etc. program should identify number (in numeric e.g. 10) , numbers written in plain english (ten, hundred etc) , more. i'm not sure way forward. there library available can help? can done regex? or need learn nlp? please suggest way forward. (1) opennlp (2) lingpipe (3) stanford nlp all 3 of above (java based) out, out of box in identifying pos. for numbers use regular expressions.

regex - Oracle regular expression replacement for negative lookahead/lookbehind that doesn't consume a character -

i'm looking better answer similar problem post "oracle regular expression replacement negative lookahead/lookbehind" my problem find numbers of 8 digit coming after keyword. must match: ref12345678 ref:12345678 ref text or short 23 num 12345678 not match: ref 123456789 ref 123456789 '(ref)(.*?)(\d{8})(\w|$)'; # matches 9 digits: ref 123456789 '(ref)(.*?)\d(\d{8})(\w|$)'; # won't match ref12345678 \d suggested solution in existing post way avoid .*? matching 1st digit of 9, if there no non-digits left won't work. (in ref12345678 f in ref used already). '(ref)(.*?)(?<!\d)(\d{8})(\w|$)' works wonderfully in perl, not oracle, doesn't support negative lookbehind. how can zero-width assertion either non-digit comes before number, or .* did not end digit? (using \d? won't work.) any suggestions please? i think you're looking for: (ref)(.*?\d)?(\d{8})(\w|$) this says, if there c

converting svg files with google fonts into png - PHP -

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="overflow: hidden; position: relative;" width="100%" version="1.1" height="100%"><defs><style> @import url(http://fonts.googleapis.com/css?family=faster+one);</style></defs><text transform="matrix(1,0,0,1,0,0)" style="text-anchor: middle; ; font-size: 100px;" x="10%" y="32.36134453781513%" text-anchor="middle" font="" stroke="none" fill="#000000" font-family=" faster 1 , cursive" font-size="78%" id="text2"><tspan dy="nan">hii</tspan></text></svg> when tried convert svg png using php imagick , renders text in default font (arial). is there way use same google font render text, when converting png ? any appreceated. in advance. phantomjs ca

Hadoop new method in older versions -

there method in new version of hadoop. http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/filesystem.html#concat%28org.apache.hadoop.fs.path,%20org.apache.hadoop.fs.path[]%29 this method not available in hadoop 1.0.4 can use it? new in hadoop , java yes concat function not availalbe in hdfs 1.0.4 shows in folloing hdfs doc: http://hadoop.apache.org/docs/r1.0.4/api/org/apache/hadoop/fs/filesystem.html if function not available in hdfs 1.0.4 can't have unless need write libraries support yourself. suggest looking this thread see how discussion went on support feature , new code exist see changes if wish add functionality yourself.

swift - Reload TableView after clicking on a custom cell's UITextField -

i have tableview custom cells. each custom cell has textfield. when user clicks on textfield, want new cells appear on screen. this i'm trying: func textfieldshouldbeginediting(textfield: uitextfield) -> bool { /* ...code determine new cells should added in data structure */ self.tableview.reloaddata() return true } however, every time reloaddata called, think delegate calls textfieldshouldbeginediting again, stuck in infinite loop , method never returns. any ideas on how can avoid problem? i think looking insertrowsatindexpaths call instead of reloading whole table. func insertrowsatindexpaths(_ indexpaths: [nsindexpath], withrowanimation animation: uitableviewrowanimation) another stack overflow post should at here's link apple docs keep in mind when doing need keep datasource date well. update datasource before calling insertrowsatindexpath

list - For loop python invalid syntax -

i'm trying run loop in program calculate average of h need calculate value's of 2 arrays each element of arrays , add them up. htot = 0 in range (0, len(redshift)): h = ((300000*redshift[i])/(np.power(10, (appmag[i]-19.0+5)/5)) htot = htot + h hgem = htot/len(redshift) print htot but invalid syntax error @ htot = htot + h you forgot close parenthesis on previous line. there many anyway, these enough: h = 300000 * redshift[i] / np.power(10, (appmag[i] - 19.0 + 5) / 5)

Implementing untrusted plugins in .NET web application -

i'd develop application accepts plugins user community, similar how chrome or firefox does. web application, each "instance" of application individual users run different plugins (plugins loaded singleton instances, "active" users). i'm planning on implementing application in .net, , trying come architecture plugin model. here desired attributes: plugins built entirely outside of core application, separate assemblies. plugins run in own "locked down", low-trust environment. separate appdomain. plugins can act through api provide. e.g. pass them sort of facade interface, , can call that, not call other assemblies. can't have plugins can arbitrarily take actions on web server, e.g. affect file system. a fatal crash in addin cannot affect stability of core application. it seems system.addin best bet, unclear on how can force loaded addins work through api provide, , not load other assemblies. system.addin provide functionalit

javascript - How to use Websocket for Firefox Android Addon -

i trying write simple firefox mobile addon talks server side code using websocket. i have code working desktop firefox addon having difficulty 1 firefox mobile. function connecttoserver(awindow) { var ws = new mozwebsocket("ws://ipaddress:8887"); // line 20 // var ws = new websocket("ws://ipaddress:8887"); ws.onopen = function() { showtoastmsg(awindow, 'sending'); ws.send('data'); } ws.onmessage = function (evt) { showtoastmsg(awindow, 'display') }; ws.onclose = function() { }; i have tried both mozwebsocket , websocket, both of them gives me error similar following : e/geckoconsole(15569): [javascript error: "referenceerror: mozwebsocket not defined" {file: "resource://gre/modules/xpiprovider.jsm -> jar:file:///data/data/org.mozilla.firefox/files/mozilla/sq4c77hi.default/extensions/view-source@mydomain.org.xpi!/bootstrap.js" line: 20}] anyone know need import or able reference w

Is Ruby pass by reference or by value? -

@user.update_languages(params[:language][:language1], params[:language][:language2], params[:language][:language3]) lang_errors = @user.errors logger.debug "--------------------lang_errors----------101-------------" + lang_errors.full_messages.inspect if params[:user] @user.state = params[:user][:state] success = success & @user.save end logger.debug "--------------------lang_errors-------------102----------" + lang_errors.full_messages.inspect if lang_errors.full_messages.empty? @user object adds errors lang_errors variable in update_lanugages method. when perform save on @user object lose errors stored in lang_errors variable. though attempting more of hack (which not seem working). understand why variable values washed out. understand pass reference know how value can held in variable without being washed out. in traditional terminology, ruby strictly

java - How many String objects will be created here? -

string x = new string("xyz"); string y = "abc"; x = x + y; how many string objects created in code? there @ least 4 objects: the interned string "xyz" the copy of interned "xyz" string the interned string "abc" the result of concatenating 2 strings.

mapreduce - Using Hadoop for Parallel Processing rather than Big Data -

i manage small team of developers , @ given time have several on going (one-off) data projects considered " embarrassingly parallel " - these involve running single script on single computer several days, classic example processing several thousand pdf files extract key text , place csv file later insertion database. we doing enough of these type of tasks started investigate developing simple job queue system using rabbitmq few spare servers (with eye use amazon sqs/s3/ec2 projects needed larger scaling) in searching examples of others doing keep coming across classic hadoop new york times example: the new york times used 100 amazon ec2 instances , hadoop application process 4 tb of raw image tiff data (stored in s3) 11 million finished pdfs in space of 24 hours @ computation cost of $240 (not including bandwidth) which sounds perfect? researched hadoop , map/reduce. but can't work out how did it? or why did it? converting tiff's in pdf's not m

c# - ServiceStack: Serving Static files from a directory when present? -

i in process of converting stand-alone home grown web server use servicestack serving pages , resources. i see question serving static file servicestack that easy serve single static file service stack. in home grown implementation, after checking see if url matches particular handler (equivalent servicestack routes), default handler checks static file in httpdata directory serve matching url. if file not exist, generates 404 error. what best pattern use servicestack serve files file system if no other service matched? note using in standalone mode without iis. these files can html, png, js, , small handful of other content types. note: see servicestack.razor package may assist requiredments, cannot find documentation on it. put in separate question that. edit : found reference in question create route root path, '/', servicestack indicating register iapphost.catchallhandlers - gets called un-matched requests. so far, have not found docum

xml - How to sort SimpleXMLElement on PHP -

i want know how can sort simple xml elements php. yes, found threads address same subject — couldn't solve problem. the xml want sort is: <?xml version="1.0" encoding="utf-8"?> <cursos> <curso> <id>drw</id> <nome>design responsivo</nome> <categoria>web</categoria> <inicio>30/02/2013</inicio> <periodo>sábados de manhã</periodo> <cargahoraria>40h</cargahoraria> <objetivos></objetivos> </curso> <curso> <id>msq</id> <nome>mysql</nome> <categoria>banco de dados</categoria> <inicio>30/03/2013</inicio> <periodo>sábados de manhã</periodo> <cargahoraria>20h</cargahoraria> <objetivos></objetivos> </curso> <curso> <id>mby</id> <nome>iniciação à informática</nome>

php - Value in array getting un rounded -

here code within method of class: $this->p($result);//die(); $this->spreadsheet($result); //die(); $this->p($result);die(); result of first print call(this->p) array ( [0] => array ( [block_id] => 537-14547 [sawnon] => gang saw [orig_volume_brut] => 179.67 [orig_volume_net] => 103.38 [couts_totaux] => 2413.92 [couts_transport] => 0 [slabcount] => 20 [totalslabvolume] => 117.48 [totalsurfacearea] => 1127.78 [totalvalue] => 9563.56 [reception_date] => 03/22/2013 [1st quality] => 100 [second quality] => 0 [standard slab] => 0 ) [1] => array

Is it possible to somehow modify value system maintained field in MS CRM 2011 -

i'm trying accomplish rather strange task. i'm required change value of isdefault attribute on team entity , after manipulation return back. i tried updating value using c# plugin, custom workflow step , web-interface, seems not permitted in case, no matter user privileges i'm using perform operation. system shows no exceptions, happily ends no error message. changing field value directly in ms sql work, may not have direct access it, , it's dangerous approach since not technically supported. is there workaround situation? way can update system maintained field in ms crm 2011? when create business unit automatically crm create default team same name , property isdefault set true. it's design, in way there team holds users business unit. there isn't supported way change value.

android - Behind Offset Sliding Menu -

i'm using jfeinstein10's sliding menu. have following xml code: <com.slidingmenu.lib.slidingmenu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sliding="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_in" android:layout_width="match_parent" android:layout_height="match_parent" sliding:viewbehind="@layout/activity_main" sliding:viewabove= "@layout/slidingcontent" sliding:touchmodeabove="fullscreen" sliding:selectorenabled="true" sliding:behindoffset="@dimen/slidingmenu" /> @dimen made new dimension value of 100px: <dimen name = "slidingmenu">100px</dimen> however when run project sliding menu covers entire screen. works if put following line in oncreate: getslidingmenu().setbehindoffset(100) how can specify entire layout in xml? let's have xml file named "dimens" stored in &