Friday 15 July 2011

google api - Start a hangout chat from web -



google api - Start a hangout chat from web -

i trying create hangouts button on user page profile when clicked take user hangouts app , start hangouts chat person specified.

just create things clear trying create chat start not video phone call or hangouts on air.

current code:

<script src="https://apis.google.com/js/platform.js"></script> <div id="placeholder-rr"></div> <script> $( document ).ready(function() { gapi.hangout.render('placeholder-rr', { 'render': 'createhangout', 'hangout_type': 'normal', 'invites' : [{'id': '109883513693796164843','invite_type': 'profile'}], 'widget_size': 175 }); }); </script>

but reason no matter tinker allways starts hangouts on air.

if can help me apreciate it.

the hangouts api supports video hangouts. if integration text chats search or create feature requests.

google-api google-plus hangout

wordpress - Use value inside another PHP function -



wordpress - Use value inside another PHP function -

in wordpress i'm using function plugin <?php the_field('event_boat'); ?> output post id selected field, happens 5755 in example.

as plugin allows me output post id possible incorporate value function within <?php echo get_permalink(); ?> permalink based on post id?

you can pass id parameter in get_permalink function, either storing id value in new variable, or passing in acf-function straight parameter.

$post_id = get_field('event_boat'); echo get_permalink($post_id) // echoes out link id 5755

i'm using get_field() instead of the_field() because the_field() echo out value, want pass along. might aswell do:

echo get_permalink(get_field('event_boat'));

php wordpress

android - How to upload files to HTML5 Web App from Google Drive or Onedrive? -



android - How to upload files to HTML5 Web App from Google Drive or Onedrive? -

i designing web application allow applying jobs post in our career page. application utilize responsive design , should create easy mobile users (ios , android initially) upload resumes. read uploading files google drive or ms onedrive using corresponding apis. however, trying opposite; browse files, select resume, perhaps download locally, , upload web application.

do know if possible? if so, recommendation?

thanks in advance!

first can inquire user authorize utilize google drive info using oauth2.0. below 2 reference links google drive api useful 1.get list of filenames using filelist alternative in api , fetch filename list https://developers.google.com/drive/v2/reference/files 2. download file straight server using downloads feature of api https://developers.google.com/drive/web/manage-downloads

i hope gives plenty direction proceed further.

android ios html5 google-drive-sdk onedrive-api

javascript - Select box placeholder in HTML Template -



javascript - Select box placeholder in HTML Template -

code in controller:

$scope.infooptions = [ { name: 'select option', value: '0' }, { name: 'some option', value: '1' } ];

html:

<select data-ng-model="nothing" data-ng-options="info.name info in infooptions "> </select>

angular puts damn empty alternative @ top/selected default. i've seen answers question suggest selecting default alternative in $scope form, select box in template in dynamic form (ie. can number of select boxes). demonstration purposes - there anyway can rid of empty alternative in template?

javascript angularjs

floating point - Enforcing rational-based conversions between custom-unit-based quantities in Boost.Units -



floating point - Enforcing rational-based conversions between custom-unit-based quantities in Boost.Units -

i have custom unit scheme defined, derives boost::units::si::time. kid units defined using boost::units::make_scaled_unit, hence conversion factors specified using boost::units::scale , boost::units::static_rational, e.g. boost::units::scale<1020, boost::units::static_rational<1> >.

in general not complain, if wasn't boost::units::scale::value_type beingness 'double'. result runtime conversions between quantities involve floating point arithmetics, whereas ratios between custom units integers, e.g. 1 apple equals 18 oranges, , conversions using rational-based factors suffice.

is there way override floating point arithmetics used units convesion else? thanks.

edit: 1. quantities defined using integer types.

floating-point data-conversion rational-numbers boost-units

asp.net mvc - Disable form field when another is unchecked -



asp.net mvc - Disable form field when another is unchecked -

i have asp.net mvc website , form.

for form, utilize :

@html.labelfor(m => m.field) @html.editorfor(x => x.field)

but have boolean fields linked one. disable these fields when other 1 unchecked.

i utilize jquery mobile it's generating these kind of checkboxes

so don't have id of generated checkbox...

is there way need using these html helpers or have creates fields manually ?

asp.net-mvc forms html-helper

c++ - Conversion of pointer-to-pointer between derived and base classes? -



c++ - Conversion of pointer-to-pointer between derived and base classes? -

regarding next c++ program:

class base of operations { }; class kid : public base of operations { }; int main() { // normal: using kid base of operations allowed kid *c = new child(); base of operations *b = c; // double pointers: apparently can't utilize child** base** kid **cc = &c; base of operations **bb = cc; homecoming 0; }

gcc produces next error on lastly assignment statement:

error: invalid conversion ‘child**’ ‘base**’

my question in 2 parts:

why there no implicit conversion child** base**? i can create illustration work c-style cast or reinterpret_cast. using these casts means throwing away type safety. there can add together class definitions create these pointers cast implicitly, or @ to the lowest degree phrase conversion in way allows me utilize static_cast instead?

if allowed, write this:

*bb = new base;

and c end pointing instance of base. bad.

c++ inheritance pointers subtyping

objective c - UIAlertController showing with delay -



objective c - UIAlertController showing with delay -

i'm experiencing problem uialertcontroller on app migrated ios8 date picker inside.

below code.

uialertcontroller *alertview = [uialertcontroller alertcontrollerwithtitle:title message:nil preferredstyle:uialertcontrollerstyleactionsheet]; uialertaction *ok = [uialertaction actionwithtitle:@"ok" style:uialertactionstyledefault handler:^(uialertaction *action) { [alertview dismissviewcontrolleranimated:yes completion:nil]; }]; uialertaction *set = [uialertaction actionwithtitle:nslocalizedstring(@"set today", nil) style:uialertactionstyledefault handler:^(uialertaction *action) { [self set_to_today:nil]; [alertview dismissviewcontrolleranimated:yes completion:nil]; [self.tableview reloaddata]; }]; uialertaction *cancel = [uialertaction actionwithtitle:@"cancel" style:uialertactionstyledefault handler:^(uialertaction *action) { [alertview dismissviewcontrolleranimated:yes completion:nil]; }]; uidatepicker *datepicker = [[[uidatepicker alloc] init] autorelease]; datepicker.datepickermode = uidatepickermodedate; [datepicker setdate:data_appo]; [datepicker addtarget:self action:@selector(datepickervaluechanged:) forcontrolevents:uicontroleventvaluechanged]; [alertview.view addsubview:datepicker]; [alertview addaction:ok]; [alertview addaction:set]; [alertview addaction:cancel]; [self.view bringsubviewtofront:datepicker]; [self presentviewcontroller:alertview animated:yes completion:nil];

uialertcontroller , date picker shown when user select row uitableviewcontroller.

the problem following: first time users select row works fine...but if user select "cancel" , select de tate 1 time again uialertcontroller takes 2-3 seconds show up...this happens in simulator...

i'm getting crazy....this makes app have bad user experience.

any help appreciated thanks

alex

i having same issue uialertcontroller presented selecting row uitableview. first time worked fine, , when user triggered alert 1 time again there few seconds delay before alert presented.

as workaround used gcd:

dispatch_async(dispatch_get_main_queue(), ^{ [self presentviewcontroller:alertview animated:yes completion:nil]; });

it bug since -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath executed on main thread.

i submitted bug study apple: rdar://19285091

objective-c xcode swift uialertview uialertcontroller

How to change Tabs using JavaFX by outside event handler? -



How to change Tabs using JavaFX by outside event handler? -

building application in phone interacts pc application. application (which has gui on pc side) appears javafx tabbed pane. going "listen" event "a" comes phone. when event "a" occurs, alter tabs on tabbed pane (pc side). there way can implement listener overload existing clickable tabs, event "a" can alter between tabs?

i hope not overly confusing. want application to alter panes separate event. don't know start since details of tabbed pane hidden in api. in advance.

karl

if understood question, try

public void myeventahandler() { tabpane.getselectionmodel().select(desired_tab_index); }

events tabs javafx actionlistener

algorithm - An interview puzzle: A Broken Calculator -



algorithm - An interview puzzle: A Broken Calculator -

time limit : 2sec / stack limit : 256mb / memory limit : 256mb

problem dave's calculator broken. halts when presented more k different digits.

dave wants input integer a, if inputs number correctly calculator might halt. instead, inputs closest integer won't halt calculator.

output difference between dave's input , integer a.

input

the input given in next format standard input.

a k on first line, given integer a(1≦a≦10^15), integer dave wants input, followed space , k(1≦k≦10), number of different digits calculator can recognize.

output

output minimum difference between dave's input , integer in 1 line. create sure insert line break @ end of output.

input illustration 1

1234 2

output illustration 1

12

in case dave can utilize 2 different digits. input closest integer 1222, difference 12.

input illustration 2

7328495 10

output illustration 2

0

in case dave's calculator not broken @ all. can input given integer is.

input illustration 3

800000 1

output illustration 3

22223

dave can utilize 1 digit, 777777 closest integer.

input illustration 4

262004 2

output illustration 4

218

the closest integer 262222.

i have solved problem brute forcefulness solution...

i seek possible situation in 1<= < or < <= 10^15.

i'll 2 solutions composed k different digits, , find min difference between , solutions.

it's straightforward solution.

when larger, execution exceed threshold of 2 sec.

is there smart , efficient way solve it?

the first part is: take k digits (out of 10 possible) used in result bit math (binomial coefficient) it´s easy calculate number of different digit combinations possible given k. there 252 possibilities take (252 if k=5, else not many).

if not clear i´m saying: k=2, there 01,02,03,...09,12,13,...,19,23,24,...,89 no eg. 11 because it´s 1 k=2 allows 2 different digits. , no eg. 90 because it´s same 09, 91=19 etc. count of these possible combinations 252 k=5, , won´t larger.

finding of (up to) 252 possibilities current k , iterating on them in loop shouldn´t hard.

for each of possibilities following: {

within loop, have a, k, , current choosen valid digits solution (latter differs in each iteration of loop, of course) lets take a=12899, k=3, digits 123 example. search first digit of (from left right) not allowed. in example, 12899, because 1 , 2 left of allowed.

replace (8) next-lower allowed digit (2) if there one , replace right of highest possible digit (3 too). 12899=>12399=>12333 save result 12333 somewhere in array etc. if there no next-lower possible digit, nil (nothing goes array)

(a proper add-on carry introduce new digit left of changed one, ie. invalid. solution new digit found when loop comes digit)

then same thing 1 time again in other direction: replace found digit next-higher possible one , right lowest. goes in array too, of course of study if there next-higher possible digit. in case of 12899, higher replacement 8 9, 9 not possible (only 123).

}

after whole loop has finished (and every iteration has produced 2 new array entries), have 502 possible solutions problem. thing left check soltion best (ie. calculate difference every entry , take solution minimal difference)

algorithm

javascript - Passing the page name by clicking on the page -



javascript - Passing the page name by clicking on the page -

i create web mobile app jquery mobile in static html, need take things(title, texts, images, etc) original wordpress site, when update wordpress, mobile app update too.

i'm using json api plugin. plugins transform pages json.

now, need create function pull json's ajax request, , part of logic this.

i started now, , created function in web app called getpages

function getpages(pagename) { var url = 'http://mywebsite.com/' + pagename + '/?json=1'; $.ajax({ url: url; etc etc etc }) }

i have several pages in mobile web (same wordpress), about, contact, partners, etc..

i need pass name of page function, function pull info page want.

for example:

i click on page in mobile app, var url this:

var url = 'http://mywebsite.com/' + pagename + '/?json=1'; var url = 'http://mywebsite.com/about/?json=1';

this how construction page looks in jquery mobile:

<div data-role="page" id="main" data-url="main" class="page"> <div data-role="header" data-theme="b" data-fullscreen="true"> </div> <div data-role="content" class="content"> </div> <div data-role="footer" class="footer" data-position="fixed" data-theme="b"> </div> </div> <!-- end page 1 -->

if observe, there data-url attr, attr define url. taking advantage of guys, there improve way create code above?

i have 1 code similar of pages, 1 main, 1 about, 1 contact, etc.. think not dry. right?

update

the question is:

is there way pass name of page clicked on web app (the same name of wordpress page) variable called pagename, in function?

when click here:

<li><a href="#about" data-rel="close">about?</a></li>

will load part:

<div data-role="page" id="about" data-url="about" class="page"> </div> <div data-role="header" data-theme="b" data-fullscreen="true"> </div> <div data-role="content" class="content"> <h2>about us</h2> <div class="video-container"> </div> </div> <div data-role="footer" class="footer" data-position="fixed" data-theme="b"> </div> </div> <!-- end page 2 -->

i need pull info of wordpress site using ajax, have:

function getpages() { var pagename = ""; var url = 'http://mywebsite.com/' + pagename + '/?json=1'; <- query json api create. $.ajax({ url: url; datatype: 'jsonp', }) }

so, when click in page, function create ajax request url in wordpress site, display content of wordpress page in mobile web app (i create part after solve problem)..

javascript php jquery json wordpress

node.js - Callback on success: Should err be null or undefined -



node.js - Callback on success: Should err be null or undefined -

function myasyncfn( params, callback ) { var result; /* something... ...with success! */ callback( null, result ); // this? // callback( undefined, result ); or this? }

i wonderíng expected value of err in callback on success. null or undefined?

node.js

mysql - Select records between two columns with date and ignoring Year from date column -



mysql - Select records between two columns with date and ignoring Year from date column -

mytable events looks this:

id | from_date | to_date 1 | 2014-10-01 | 2015-02-20 2 | 2014-08-25 | 2015-04-01

from_date , to_date date columns year isn't of import becouse events every year same time. illustration between 10-01 02-20 every year.

i want select events in today 10-22

i trying using dayofyear without success.

select * mytable dayofyear('2014-10-22') between dayofyear(`from_date`) , dayofyear(`to_date`)

between date_format(from_date,'%m%d') doesn't work

any help great!

you need reverse status when to_date in next year after from_date.

select * mytable (year(from_date) = year(to_date) , dayofyear('2014-10-22') between dayofyear(from_date) , dayofyear(to_date)) or (year(from_date) != year(to_date) , dayofyear('2014-10-22') not between dayofyear(to_date) , dayofyear(from_date))

demo

mysql date datetime datediff

freeing memory in C doesn't work -



freeing memory in C doesn't work -

i have problem when seek free allocated memory in c.

int i,j,**redmatrix, **bluematrix, **greenmatrix; double **weigthmatrix,fsom; weigthmatrix = (double**) calloc(radius*2+1,sizeof(double*)); redmatrix = (int**) calloc(radius*2+1,sizeof(int*)); bluematrix = (int**) calloc(radius*2+1,sizeof(int*)); greenmatrix = (int**) calloc(radius*2+1,sizeof(int*)); if(weigthmatrix==null || redmatrix==null || bluematrix==null || greenmatrix==null){ printf("%s\n", "error: probleem met geheugenallocatie"); exit(1); } for(i=0;i<radius*2+2;i++){ weigthmatrix[i] = (double*) calloc(radius*2+1,sizeof(double)); redmatrix[i] = (int*) calloc(radius*2+1,sizeof(int)); bluematrix[i] = (int*) calloc(radius*2+1,sizeof(int)); greenmatrix[i] = (int*) calloc(radius*2+1,sizeof(int)); if(weigthmatrix[i]==null || redmatrix[i]==null || bluematrix[i]==null || greenmatrix[i]==null){ printf("%s\n", "error: probleem met geheugenallocatie"); exit(1); } } for(i=0;i<radius*2+1;i++){ free(weigthmatrix[i]); free(redmatrix[i]); free(bluematrix[i]); free(greenmatrix[i]); } free(redmatrix); //my programme crashes here free(bluematrix); free(greenmatrix); free(weigthmatrix); free_image(&copyimage);

my programme crashes when seek free top level of array. don't know doing wrong. think allocated right?

you reserve space radius*2+1 elements

redmatrix = (int**) calloc(radius*2+1,sizeof(int*));

but fill , free arrays radius*2+2 elements

for(i=0;i<radius*2+2;i++){ redmatrix[i] = (int*) calloc(radius*2+1,sizeof(int)); for(i=0;i<radius*2+2;i++){ free(redmatrix[i]); ...

change to

for(i=0;i<radius*2+1;i++){ redmatrix[i] = (int*) calloc(radius*2+1,sizeof(int)); ... for(i=0;i<radius*2+1;i++){ free(redmatrix[i]); ...

and please, don't cast malloc

c memory malloc calloc

ios - Share Core Data database between app and today extension in Swift -



ios - Share Core Data database between app and today extension in Swift -

i have database widget has read data. i've set membership targets related files both app , widget. there problem though.

i have helper class in main app gets appdelegate context whenever operations on database. code looks follows:

class func getentityandcontext(name:string) -> (entity:nsentitydescription, context: nsmanagedobjectcontext){ var appdel:appdelegate = uiapplication.sharedapplication().delegate appdelegate allow context:nsmanagedobjectcontext = appdel.managedobjectcontext! allow entity:nsentitydescription = nsentitydescription.entityforname(name, inmanagedobjectcontext: context)! homecoming (entity, context) }

this method helps me in cases these:

class func getall() -> array<city>{ allow (_, context) = nsmanagedobjectwrapper.getentityandcontext("city") allow req = nsfetchrequest(entityname: "city") req.sortdescriptors = [nssortdescriptor(key: "order", ascending: true)] allow citieslist:array<city> = context.executefetchrequest(req, error: nil)! array<city> homecoming citieslist }

after added target membership widget, error: use of undeclared type 'appdelegate'. makes sense, have no thought how prepare it. can please help me?

ps: noticed error too: use of unresolved identifier 'nsfetchrequest'. doing wrong? certainly can't way it...

i found reply here: https://github.com/pjchavarria/swift-widget

this git project shows how utilize core info in widget.

ios widget

How to evaluate a mathematical expression using strings and arrays in C -



How to evaluate a mathematical expression using strings and arrays in C -

i want evaluate mathematical look stored string, eg. "1+3/4*3".

my thought accomplish this:

read in string store in array, extract operators temporary array , sort according mathematical order of operations. extract values temporary array, in turn evaluates look using right operation.

does logic sound right? if so, can please show me illustration of basic version of 3+1-3.

look shunting yard algorithm , convert string reverse polish notation.

it help if separate out number detection symbol detection reading string 1 character @ time instead of jumping operators.

after that, rather easy perform computation, inputs ordered in manner makes stack based calculator easy implement.

yes, total fledged recursive descent parser; but, relatively simple matter of algebraic expressions, overkill.

--- edited because see there's controversy on tools vs techniques ---

i see lot of people mentioning lexx , yacc. great tools, overkill need. it's saying open carpentry shop when want replace board on fence. don't need larn language handle math language, , lexx , yacc require larn domain specific configuration language build parser domain specific language. that's lot of languages simple, solved problem.

lexx , yacc great if want build mathematical tree of data; however, rpn mathematical tree of info stored in list of 2 fundamental node types (data) , (operation).

(a)(b)(c) // 3 "data nodes" (a)(b)(+) // 2 "data nodes" , 1 operation node.

this allows 1 utilize stack based machine (very easy implement). machine has "instruction set" of

if (x data) { force x onto top of stack } if (x operation) { pop operation's required parameters. pass them operation. force result on stack }

so assuming had '+' operator, look 3 + 5 + 6 convert rpn 3 5 + 6 + , stack (during processing)

<empty> (3) (3)(5) (8) (8)(6) (14)

the primary reason convert rpn not because it's necessary, it's because makes rest of programme much easier implement. imagine 3 + 5 * 7 converted rpn, have 3 5 7 * + means don't have special evaluation "machine" language. note (3 + 5) * 7 converts rpn 3 5 + 7 *. in short, cut down complexity of evaluation engine massaging input info less ambiguous.

lexx , yacc provide lot of "configurability" allow accomplish same thing; however, not going configuring lexx , yacc special here, configurable interface doesn't purchase much. it's having multiple selection knob when need on-off switch.

now, if want build any kind of parser, not aware of any kind of future rules might added; definately take lexx , yacc. simple algebraic look parser far "solved" problem bring in big guns. utilize shunting algorthim , break problem downwards into

simple scanner identify main types of "tokens", number, +, -, /, *, (, , ) shunting algorithim convert "list" of tokens rpn list stack hold "memory" of evaluation "machine" "machine" pull / force / evaluate loop

this has added benefits of beingness able develop pieces independently, can verify each step without entire framework beingness in place. lexx , yacc promote adding code framework, unless take steps otherwise, might have debug entire thing 1 big piece.

c arrays string evaluation

javascript - How to display file content in Ace Editor -



javascript - How to display file content in Ace Editor -

i testing out ace-editor display big text files server. since boasts beingness able handle files 4 millions lines , has text highlighting, makes candidate.

i've been struggling understand document , editsession ace editor. understanding, possible tell ace editor read file , display it.

i using createeditsessiont() create session , specify document. api documentation:

createeditsession(document | string text, textmode mode)

document: required. if text document, associates editsession it. otherwise, new document created, initial text

here code:

<script src="../src/ace.js"></script> <script> var docsession = new ace.createeditsession("../files/myfile.log", "ace/mode/plain_text"); var editor = ace.edit("editor"); editor.setsession(docsession); editor.settheme("ace/theme/dawn"); </script>

unfortunatly, appears on page "../files/myfile.log". guess creating file text instead of reading document. how tell display contents of myfile.log?

ace doesn't handle files in way, front-end component of editor. document in createeditsessions definition instance of aces document object, not file. load file ace need contents server ajax call. https://github.com/ajaxorg/ace/blob/v1.1.7/demo/kitchen-sink/doclist.js#l164

javascript html5 ace-editor

java - Fast search of proper XML file in folder -



java - Fast search of proper XML file in folder -

if have 100 short xml files in folder , i'd know of them contains text aaabbbccc (for later accurate parsing). thought read them strings 1 after other , seek utilize contains function determine files not contains text?

as know contains function very fast.

java

ruby on rails - Paperclip - how to access saved file -



ruby on rails - Paperclip - how to access saved file -

every one! using paperclip upload files

class model include mongoid::document include mongoid::paperclip has_many :myfiles end class myfile include mongoid::document include mongoid::paperclip belongs_to :model has_mongoid_attached_file :file, :path => ":rails_root/public/uploads/:class/:id/:basename.:extension", end

my question how access uploaded file after saved? tried:

@model.myfiles.first.path @model.myfiles.first.url

it gives error:

nomethoderror: undefined method `path' #<myfile:0x007fd22b336f80>

thank much help!

try :)

@model.myfiles.first.file.path @model.myfiles.first.file.url

you can delegate fields if want

class myfile include mongoid::document include mongoid::paperclip belongs_to :model has_mongoid_attached_file :file, :path => ":rails_root/public/uploads/:class/:id/:basename.:extension" delegate :url, :path, to: :file, allow_nil: true, prefix: false end

then can use

@model.myfiles.first.path @model.myfiles.first.url

ruby-on-rails paperclip

Why string inputs after integer input gets skipped in Java? -



Why string inputs after integer input gets skipped in Java? -

this question has reply here:

scanner issue when using nextline after nextxxx [duplicate]

i trying input values of string , integer variables in java. if taking input of string after integer, in console string input skipped , moves next input.

here code

string name1; int id1,age1; scanner in = new scanner(system.in); //i can input name if input before integers system.out.println("enter id"); id1 = in.nextint(); system.out.println("enter name"); //problem here, name input gets skipped name1 = in.nextline(); system.out.println("enter age"); age1 = in.nextint();

this mutual problem, , happens because nextint method doesn't read newline character of input, when issue command nextline, scanner finds newline character , gives line.

a workaround one:

system.out.println("enter id"); id1 = in.nextint(); in.nextline(); // skip newline character system.out.println("enter name"); name1 = in.nextline();

another way utilize nextline wrapped integer.parseint:

int id1; seek { system.out.println("enter id"); id1 = integer.parseint(input.nextline()); } grab (numberformatexception e) { e.printstacktrace(); } system.out.println("enter name"); name1 = in.nextline(); why not scanner.next() ?

i not utilize scanner.next() because read next token , not total line. illustration next code:

system.out("enter name: "); string name = in.next(); system.out(name);

will produce:

enter name: mad scientist mad

it not process scientist because mad completed token per se. maybe expected behavior application, has different semantic code posted in question.

java

SQL statement at Birt Report for parameters -



SQL statement at Birt Report for parameters -

currently i'm using birt study generate study system. i'm using input parameter send parameter scheme birt report. problem when i'm trying send multiple parameter system.

sql statement @ birt study 1 parameter

select actualdate table1 storeloc = ?;

when utilize query 1 parameter, work.

i tried sql this

select actualdate table1 storeloc = params["storeloc"].value;

i created parameter @ info set , study parameter it's still can't gets work

and birt dont show me options in edit dataset query , linked study parameters in parameters

so should do?

create parameter storeloc in study params section of info source. write query in dataset open:

select actualdate table1 storeloc='"+params["storeloc"]+"';

fetch actualdate value in info source fetch , run report.

birt

javascript - Get Attributes Value for multiple class -



javascript - Get Attributes Value for multiple class -

im javascript beginner. want attribute value on multiple class elements. tried ids, it's not revelent since ids supposed unique.

my html looks :

<a href="#" class="test" onclick="myjavascriptfunc()" data="foobar_1"> <a href="#" class="test" onclick="myjavascriptfunc()" data="foobar_2"> <a href="#" class="test" onclick="myjavascriptfunc()" data="foobar_3">

any help appreciated.

thanks

first close anchor tags

<a href="#" class="test" onclick="return myjavascriptfunc(this);" data="foobar_1">test1</a> <a href="#" class="test" onclick="return myjavascriptfunc(this)" data="foobar_2">test2</a> <a href="#" class="test" onclick="return myjavascriptfunc(this)" data="foobar_3">test3</a>

then utilize javascript function

function myjavascriptfunc(item) { alert(item.getattribute("data")); homecoming false }

and allow me know if works

javascript html class

How to select new element in jquery? -



How to select new element in jquery? -

why alert not work?

$('.checkprice').click(function(el){ $(this).addclass('checkcheck'); }); $( '.checkcheck' ).on( "click", function() { alert('yes'); });

may .checkcheck creates more longer, .on() start?

waht must do?

jquery setup event handlers on matched elements. instance, next code apply element has .checkcheck class @ time code ran, , not @ future time:

$( ".checkcheck" ).on( "click", handlecheck );

if class added element @ future time, handler will not handle click events it, since didn't have class @ time $.fn.on called originally.

the popular way around issue leverage event delegation, utilizes bubbling-nature of javascript events. rather placing handler straight on .checkcheck elements, can place 1 farther dom tree:

$( document ).on( "click", ".checkcheck", handlecheck );

now don't care if element has .checkcheck class when script ran, care if has class when event bubbles document. means can add together brand new elements dom, given them .checkcheck class, , trigger handlecheck when clicked.

jquery

asp.net mvc - Grid.Mvc Filtering -



asp.net mvc - Grid.Mvc Filtering -

i using grid.mvc grid. want utilize filtering feature of same. set filterable(true) column need filter. filter icon appears. when click on it, nil happens. mean pop-up never comes on.

more info of grid: grid on partial view. model list<>. have paging , sorting work on same grid.

i figured out. in fact, ajax phone call on filling partial view grid.mvc. so, in case, need refresh grid, 1 time placed in div.

$(".grid-mvc").gridmvc();

asp.net-mvc mvcgrid

How do I illustrate both sides of a transaction in BPMN? -



How do I illustrate both sides of a transaction in BPMN? -

we have number of processes rely on interactions between 2 people/groups. trying figure out best way illustrate in bpmn.

consider: using illustration of pizza order, phone call pizzeria order, order-taker answers phone , discuss order. trying accurately capture "we discuss order" portion of process. here how envision diagram playing out. call, answer, there's branching simultaneous exchange, converges @ end of phone call , order finished. illustrated correctly? or there improve ways show 2 different entities communicating each other @ same time accomplish task?

the moment want show interaction in greater detail high level bird view, typically run troubles when remaining within paradigm of using "one pool several lanes". in such case need draw called "collaboration diagram", means create utilize of several pools , hence several process definitions interacting each other means of message exchange. give illustration here:

you may utilize envelope symbols attached message flows, don't need to.

the big advantage of approach can show processes dependent on each other, yes, each participant wants remain in drivers seat of his/her own process, e.g. deciding if other side doesn't provide desired answer, doesn't within reasonable time , on. furthermore can @ diagram both perspectives , people see "their own process" - , not mixed concerns of others involved.

for same reason bpmn offers concept of "collapsed pools" able @ communication 1 side , treat internal details of other side kind of "black box":

bpmn

python - Appending in an empty list all the values of a dict key -



python - Appending in an empty list all the values of a dict key -

i'm working graphs (with python module networkx) , task create 2 different sets 1 longitude values of nodes , 1 latitude values. when read through info of each node coordinates comes in dict form, {lat: 1234, lon: 5678}.

this code, if print node_id nodes, if print node_data dictionary values of coordinates:

all_nodes = g.node node in all_nodes: node_id = node node_data = g.node[node_id]

re-edit: wasn't clear, @ bottom of above code there 2 print statement:

all_nodes = g.node node in all_nodes: node_id = node node_data = g.node[node_id] print: "node id :", node_id print: "coordinates:", node_data

this gives me output nodes id , coordinates. asked know how in 2 different sets lat , long.

if understand correctly, should trick:

lat = [node['lat'] node in nodes]

python dictionary coordinates networkx

basic function in javascript not working -



basic function in javascript not working -

hi first time here , i'm struggling since i'm first timer learning code. presume when seek pass arguments parameters, gets confused, or maybe i'm missing simple. missing or failing here? doesn't work...

function adultcheck(age,name) { if (age <= 17) { alert("sorry " + name ", not allowed see this, young."); } else { alert("welcome " + name ", " + age " visit our lounge!"); } } adultcheck(15,tami);

you forgot add together additional + after variables: "" + name + ""

javascript function jscript

c# - Structural or Messenger in .net 4.5 -



c# - Structural or Messenger in .net 4.5 -

i want inquire best practice in case :

suppose have kind of code

class baseclass { protected bool checkresponse(string response) { if (response == somecondition) { runerrormessages(); homecoming true; } homecoming false; } } class derivedclassa { connectorclass myconnector = new connectorclass(); private void mycommand(string req) { string resp = await myconnector.senddatatoserver(req); if (!checkresponse(resp)) dosomething1(); } } class connectorclass { public async task<string> senddatatoserver(string req) { string resp = await server.waitforresponse(req); homecoming resp; } }

it improve or 1 below?

abstract class baseclass { public baseclass() { messenger.default.register<string>(checkresponse); } public abstract callwhateverderivewant(); private void checkresponse(string response) { if (response == somecondition) { runerrormessages(); } else callwhateverderivewant(); } } class derivedclassa { connectorclass myconnector = new connectorclass(); private void mycommand(string req) { await myconnector.senddatatoserver(req); } public abstract callwhateverderivewant() { callsomething(); } } class connectorclass { public async task senddatatoserver(string req) { string resp = await server.waitforresponse(req); messenger.default.send(resp); } }

for information, there lot of derive class derived baseclass, , it's behaviour similar derivedclassa.

please help me find out best way solve case.

thanks before.

in situation, reply question depends on intent of program. these 2 cases not @ logically equivalent.

in first example, checking response condition. presumably complicated procedure belongs in own method. way code written, checkresponse takes place in base of operations class, while derived classes contain conditional logic statements process boolean result. use-case when checkresponse method same across classes, result differs.

in sec example, checkresponse method , conditional logic uses exist in base of operations class, uses of both same across instances; calling method on derived classes 1 time conditional logic has been executed. derived class has no thought result of checkresponse was.

so, objective trying achieve?

c# .net-4.5 mvvm-light

VHDL - Add operation between Signed -



VHDL - Add operation between Signed -

i'm new @ vhdl. i'm trying realize block diagram in next picture: code realize z^1 block (which delay) following:

library ieee; utilize ieee.std_logic_1164.all; utilize ieee.numeric_std.all; entity dff generic (n : integer:=16); port( d : in signed(n-1 downto 0); -- info input clk : in std_logic; -- clock input reset : in std_logic; -- reset input q : out signed(n-1 downto 0)); -- info output end dff; architecture behavioral of dff begin dff:process(clk) begin if (clk'event , clk='1') in 0 n-1 loop q(i) <= reset , d(i); end loop; end if; end process dff; end behavioral;

the code realize entire block diagram following:

library ieee; utilize ieee.std_logic_1164.all; utilize ieee.numeric_std.all; entity fir generic (n : integer:=16); port( clk : in std_logic; --clock signal reset : in std_logic; xin : in signed(n-1 downto 0); --input signal yout : out signed(n-1 downto 0) --filter output ); end fir; architecture fir_struct of fir component dff generic (n : integer:=16); port( d : in signed(n-1 downto 0); clk : in std_logic; reset : in std_logic; q : out signed(n-1 downto 0)); end component; signal y_delayed, add2_in1, add2_in2, y_temp : signed(n-1 downto 0) := (others => '0'); -- add2_in1 first input of adder (the input of block diagram) -- add2_in2 delayed output of adder -- y_temp output of adder -- y_delayed output of delay operation begin add2_in1 <= xin; y_temp <= add2_in1 + add2_in2; -- line giving me troubles delay1: dff port map(y_temp, clk, reset, y_delayed); yout <= y_temp; add2_in2 <= y_delayed; end fir_struct;

i highlighted line gives me troubles. tried remove , set first parameter of delay1 input xin (just seek if works or problem in line) , works (of course of study doesn't want, waveform behave expeted). testbench following:

library ieee; utilize ieee.std_logic_1164.all; utilize ieee.numeric_std.all; utilize ieee.std_logic_unsigned.all; entity iir_wav_tb end iir_wav_tb; architecture behavior of iir_wav_tb signal clk : std_logic := '0'; signal reset : std_logic := '1'; signal xin : signed(15 downto 0) := (others => '0'); signal yout : signed(15 downto 0) := (others => '0'); constant clk_period : time := 10 ns; begin -- instantiate unit under test (uut) uut: entity work.fir port map ( clk => clk, reset => reset, xin => xin, yout => yout); -- clock process definitions clk_process :process begin clk <= '0'; wait clk_period/2; clk <= '1'; wait clk_period/2; end process; -- stimulus process stim_proc: process begin xin <= to_signed(1,16); wait clk_period*1; xin <= to_signed(23,16); wait clk_period*1; end process; end

the waveform obtain following:

the problem when add together operation occurs, value of y_temp become '?' (the components of 16bits signal 'x'). think problem of inizialization, passing xin straight without adding won't rising problem. help me?

before start code, need remember vhdl create hardware , it's not software language. so, every process executed in parallel simulator. variables executed immediately.

second thing, don't initialize signals don't need initialization.

so, propose changes:

library ieee; utilize ieee.std_logic_1164.all; utilize ieee.numeric_std.all; entity dff generic (n : integer:=16); port( d : in signed(n-1 downto 0); -- info input clk : in std_logic; -- clock input reset : in std_logic; -- reset input q : out signed(n-1 downto 0)) -- info output end dff; architecture behavioral of dff begin dff:process(clk,reset) begin if (reset = '0') q <= (others => '0'); elsif (clk'event , clk='1') q <= d; end if; end process dff; end behavioral;

doing so, initialize add2_in2 within flip-flop (it's necessary reset @ begin going 0 1). don't need loop assign every bit.

library ieee; utilize ieee.std_logic_1164.all; utilize ieee.numeric_std.all; entity fir generic (n : integer:=16); port( clk : in std_logic; --clock signal reset : in std_logic; xin : in signed(n-1 downto 0); --input signal yout : out signed(n-1 downto 0) --filter output ); end fir; architecture fir_struct of fir component dff generic (n : integer:=16); port( d : in signed(n-1 downto 0); clk : in std_logic; reset : in std_logic; q : out signed(n-1 downto 0)); end component; signal y_delayed, y_temp : signed(n-1 downto 0); -- add2_in1 first input of adder (the input of block diagram) -- add2_in2 delayed output of adder -- y_temp output of adder -- y_delayed output of delay operation begin y_temp <= xin + y_delayed; delay1: dff port map(y_temp, clk, reset, y_delayed); yout <= y_temp; end fir_struct;

i think adder work. need update test-bench:

signal reset : std_logic; process begin reset <= '0'; wait 5 ns; reset <= '1'; wait; end process;

if forgot something, please inquire me.

add vhdl

java - Why does it skip the "control" segment? -



java - Why does it skip the "control" segment? -

this question has reply here:

how compare strings in java? 23 answers

so i'm trying inquire user input value command right after sop done. skips reason.

public static void main(string [] args) { scanner keyboard = new scanner(system.in); system.out.println("what's balance?"); double initialbalance = keyboard.nextdouble(); business relationship chase = new account(initialbalance); system.out.println(chase + "; deposit or withdraw?"); string command = keyboard.nextline(); if(control == "deposit") { double deposit = keyboard.nextdouble(); system.out.println("how much deposit? " + deposit); chase.deposit(deposit); system.out.println(chase); } }

here snippet of code changes required.

scanner keyboard = new scanner(system.in); system.out.println("what's balance?"); double initialbalance = keyboard.nextdouble(); keyboard.nextline(); business relationship chase = new account(initialbalance); system.out.println("; deposit or withdraw?"); string command = keyboard.nextline(); if (control .equals("deposit") ){ system.out.println("how much deposit? " ); double deposit = keyboard.nextdouble(); keyboard.nextline();

the comments clear. need see 2 post pointed to. briefly there line separator comes in , importance of equals method , significance.

java

python - Priority of operators: > and == -



python - Priority of operators: > and == -

this question has reply here:

why look 0 < 0 == 0 homecoming false in python? 9 answers

i'm trying guess operator has priority: > (greater than) or == (equal). experiment:

>>> 5 > 4 == 1 false

as far know, has 2 possible solutions.

>>> (5 > 4) == 1 true >>> 5 > (4 == 1) true

neither 1 returns false, how first code resolved python?

this has operator chaining. unlike c/c++ , other languages, python allows chain comparing operators in normal mathematics. documentation:

comparisons can chained arbitrarily, e.g., x < y <= z equivalent x < y , y <= z, except y evaluated 1 time (but in both cases z not evaluated @ when x < y found false).

so, expression:

5 > 4 == 1

is interpreted as:

5 > 4 , 4 == 1 # except 4 evaluated once.

which becomes:

true , false

which false.

using parenthesis changes how python interprets comparison. this:

(5 > 4) == 1

becomes:

true == 1

which true (see below why). same goes for:

5 > (4 == 1)

which becomes:

5 > false

which true.

because of pep 0285, bool made subclass of int , true == 1 while false == 0:

>>> issubclass(bool, int) true >>> true == 1 true >>> false == 0 true >>>

python boolean operators operator-precedence

html - Center type accurately within my headline div -



html - Center type accurately within my headline div -

i'm having issues trying find way center h2 within div class called headline-services.

i have text-align:center; applied h2 (only) allowing text center within (text) , it's not centering text within div box. accomplish have white text in center of greenish box.

// note //

the text may centered it's not accurate... i've applied padding-top h2 class allowing move downwards towards center of box mentioned before not accurate way go centering h2 within div.

http://kapena.github.io/pp_web/

.plumbing-repairs{ font-family: avenir; padding-left: 20px; padding-right: 20px; font-size: 50pt; color: white; margin: 0px; text-align: center; padding-top: 55px; }

you can add together next lines of css element want center vertically;

position: relative; top: 50%; transform: translatey(-50%);

reference

also, clarity, text-align:center; applies horizontal centering.

html css zurb-foundation

c# - Unable to load modules using Unity Framework -



c# - Unable to load modules using Unity Framework -

i trying configure unity framework in app.config, can please give illustration of how set please when trying using below app.config file getting below error:

the given assembly name or codebase invalid. (exception hresult: 0x80131047)

my app.config file below:

<?xml version="1.0" encoding="utf-8" ?> <configuration> <configsections> <section name="unity" type="microsoft.practices.unity.configuration.unityconfigurationsection, microsoft.practices.unity.configuration"/> </configsections> <unity> <containers> <container> <register type="interfaces.icalculator, interfaces" mapto="calculatorlibrary.calculator,calculatorlibrary"/> <register type="interfaces.icalcreploop, interfaces" mapto="calculatorlibrary.calcreploop,calculatorlibrary"/> <register type="interfaces.iconsoleinputservice, interfaces" mapto="inputoutput.consoleinputservice,inputoutput"/> <register type="interfaces.iconsoleoutputservice, interfaces" mapto="inputoutput.consoleoutputservice,inputoutput"/> <register type="interfaces.iinputparserservice, interfaces" mapto="calculatorcommandlibrary.inputparserservice,calculatorcommandlibrary"/> </container> </containers> </unity> </configuration>

i using dll prisim 4.0

c# unity-container prism

php - How do I parse this large xml file with XMLreader? -



php - How do I parse this large xml file with XMLreader? -

i have xml file 200 mb in size have decided utilize xmlreader extract info need.

here snippet of xml in file:

<product> <manufacturer>blue widgets</manufacturer> <price>6.79</price> <condition>new</condition> </product> <product> <manufacturer>green widgets</manufacturer> <price>9.99</price> <condition>new</condition> </product> <product> <manufacturer>black widgets</manufacturer> <price>3.29</price> <condition>new</condition> </product> <product> <manufacturer>blue widgets</manufacturer> <price>14.99</price> <condition>new</condition> </product>

of thousands of records in big file, need info manufacturer "blue widgets", having problem figuring out how isolate manufacturer:

$reader = new xmlreader(); $reader->open('test.xml'); $products = array(); while($reader->read()){ if($reader->nodetype == xmlreader::element && $reader->localname == 'manufacturer'){ $reader->read(); if($reader->value == 'blue widgets'){ //now know manufacturer right, how advance next cost node within product element? if($reader->nodetype == xmlreader::element && $reader->localname == 'price'){ $reader->read(); $products['price'] = $reader->value } } } }

you can utilize xmlreader::next method. using example:

... $reader->read(); if ($reader->value == 'blue widgets') { $reader->next('price'); // advances cursor cost node } ...

documentation: http://php.net/manual/en/xmlreader.next.php

php xml xmlreader

javascript - How do I make {{#each}} work with these templates? -



javascript - How do I make {{#each}} work with these templates? -

i have been reading these tutorials on spacebars.

understanding spacebars david burles

meteor's spacebars readme on github

discover meteor's spacebars secrets

i think can understand pretty good, having problem

i have main.html template this

<template name="main"> <div class="container"> <section id="bl-work-section"> <div class="bl-box"> <h4 class="sin">próximo</h4> <h2 id="titulo1" class="sin"></h2> <h4 class="sin" id="sub1"></h4> </div> <div class="bl-content"> <h2>lunes 25 de noviembre del 2014</h2> {{#each mostrarlunes}} {{> lunes}} {{/each}} <a></a> </div> <span class="bl-icon bl-icon-close"></span> </section> <!-- panel items works --> <div class="bl-panel-items" id="bl-panel-work-items"> {{#each mostrarlunes}} {{showpromos}} {{/each}} </div> </div> </div><!-- /container --> </template>

so guys see im calling 2 templates within main template , 2 templates this

lunes.html template

<template name="lunes"> <ul id="bl-work-items"> <li data-panel="panel"> <div class="oferta"> <a href="#"> <h3>promocion: {{metadata.nombrepromo}} </h3><br><small>descripcion:{{metadata.descripcionpromo}}</small></a> </div></li><br><br> </ul> </template>

showpromos.html template

<template name="showpromos"> <div data-panel="panel"> <div> <h1>estoy viendo esto en la segunda pagina </h1> <h3>nombre promo {{metadata.nombrepromo}}</h3> <p>descripcion promo.{{metadata.descripcionpromo}}</p> </div> </div> <nav> <span class="bl-icon bl-icon-close"></span> </nav> </template>

so problem? if @ template lunes , showpromos, have data-panel="panel", seems info panel don't work when wrap value on {{each}} tags, because if use, {{each}} tags outside data-panel selector works, seems not working seems don't have connection.

so im asking if there way connect value? seek helper attributes 3rd link says, , don't work, attributes helpers this

template.main.helpers({ attributes: function () { homecoming { datapanel: "prueba", } } });

helper mostrarlunes

template.main.helpers({ 'mostrarlunes' : function(){ homecoming promociones.find({'metadata.diaoferta' : { $in: ['lunes'] } }); } });

looks info context isn't set. seek creating template helper other templates info (i don't understand spanish i'm assuming mongodb cursor need...

templates.lunes.helpers({ data: function() { homecoming promociones.find({'metadata.diaoferta' : { $in: ['lunes'] } }); } }); templates.showpromos.helpers({ data: function() { homecoming promociones.find({'metadata.diaoferta' : { $in: ['lunes'] } }); } });

javascript css3 templates meteor spacebars

c++ - how to convert each character in string to ascii value -



c++ - how to convert each character in string to ascii value -

i convert each character ascii separated x have 65x122x97x45......

#include <iostream> #include <string> int main(){ std::string text = "this text 123..."; homecoming 0; }

here solution using stringstreams

#include <iostream> #include <string> #include <sstream> int main(){ std::string text = "this text 123..."; std::istringstream sin(text); std::ostringstream sout; char temp; while(sin>>temp){ sout<<"x"<<std::hex<<(int)temp; } std::string output = sout.str(); std::cout<<output<<std::endl; homecoming 0; }

and output is:

x54x68x69x73x69x73x73x6fx6dx65x74x65x78x74x31x32x33x2ex2ex2e

c++

html - Why is computed style in mobile safari differing from ruled style? -



html - Why is computed style in mobile safari differing from ruled style? -

i have iframe within popup reason in mobile safari 1 time iframe loads it's changing size of iframe go beyond screen dimensions , no matter in inspector computed style won't update.

the style inspector shows taking effect (and works everywhere else including android):

.gc-lightbox > iframe { background-color: #fff; height: 645px; width: 900px; position: relative; border: 4px solid rgba(255, 255, 255, 0.5); max-height: 90%; max-width: 90%; overflow: hidden; border: none; }

however, in mobile safari "computed height" , "computed width" way off (depending on popup initiate) they're high 3000px tall , 700px wide. inspector not have height: 900px or max-height: 90% crossed out , if set style="width: 300px !important; height: 300px !important" straight on iframe tag computed values still going past these values no indication why.

any clues?

click on of campus tour links (as said, works expected everywhere mobile safari - android) http://www.georgiancollege.ca/new-campus-tours/

in 1 of projects, safari computed rules not matching styles rules. , like, adding !important straight inline style did not help.

the culprit turned out many transition effects on page. transitions on inputs , textareas (which manipulated lot js). changing helped me out.

transition: none;

html ios css html5 css3

ios - when Device Time Setting is in 24h Formate Get time is null -



ios - when Device Time Setting is in 24h Formate Get time is null -

i having problem displaying proper date in app. when user sets 24 hr format 'off' in date time preferences..my app shows right time. when 24 hr format set 'on' shows nothing.

nsstring *firedate_str = [nsstring stringwithformat:@"%@:%@:00 %@",hour_str,minute_str,[[am_pm_btn titlelabel].text lowercasestring]]; nslog(@"firedate_str: %@ ", firedate_str); // firedate_str formate: 02:02:00 nsdateformatter* df = [[nsdateformatter alloc]init]; [df setdateformat:@"hh:mm:ss a"]; nsdate *waketime = [df datefromstring:firedate_str];

but got waketime (null) when device time setting in 24h on.

try:

[df setdateformat:@"hh:mm:ss a"];

see the unicode date formatting reference , apple's date formatting guide.

ios objective-c nsdateformatter

html - JavaScript - Looping image gallery does loop correctly -



html - JavaScript - Looping image gallery does loop correctly -

i trying create image gallery in html, css. , utilize javascript animate transition. i've managed working, decided wanted loop within when reached lastly image (4th) loop - transition first, , carry on sequence until got end again.

download @ site thought of problem - https://drive.google.com/folderview?id=0b8hdvq3ozfi6mg5gltbfwgnmzku&usp=sharing

i've tried many ways of doing this, i've got loop fine. entire code:

var imagenum = 0; var currentimg = 1; var maxwidth = 0; $(document).ready(function() { var div1 = $("#ip").offset().top; var div3 = $("#flash").offset().top; $(window).scroll(function() { if($(window).scrolltop() < div3) { $("#ip").fadein(400); } else if($(window).scrolltop() > div3) { $("#ip").fadeout(400); }}); }); $(document).ready(function() { $( '.g-li' ).each(function() { imagenum++; maxwidth += 830; }); $( '.g-ul' ).css('width' , maxwidth + 'px'); $( '.rightbtn-inner' ).click(function(){ moveleft(); }); $( '.leftbtn-inner' ).click(function(){ moveright(); }); timer(); loop(); }); function moveleft() { if( currentimg < imagenum ) { $( '.g-ul' ).animate( {'marginleft' : '-=820px' } , 1000 , 'swing' ); currentimg = currentimg + 1; } } function moveright() { if( currentimg > 1 ) { $( '.g-ul' ).animate( {'marginleft' : '+=820px' } , 1000 , 'swing' ); currentimg = currentimg - 1; } } function timer() { setinterval(moveleft, 10000); } function loop() { if( currentimg = imagenum ) { setinterval(loopbk, 10000); currentimg = 1; // did reset here } function loopbk() { $( '.g-ul' ).animate( {'marginleft' : '+=2460px' } , 1000 , 'swing' ); /* currentimg = 1; // , tried reset here */ } }

to create carry on sequence normal have reset variable currentimg 1 work. if currenting = 1 in function loop() goes lastly image , carries on until looping back.

or if place reset in function loopbk(), loops until 2nd image , proceeds loop resulting in going left far.

can play around , help me eyes should work, doesn't - , i've been trying solve long time.

thank can help.

andy.

javascript html css image-gallery

java - How can I change what printStacktrace() does for Exception? -



java - How can I change what printStacktrace() does for Exception? -

i have tried making new class extending exception , overriding printstacktrace. problem is, when seek thr following, error "unreachable grab block loggerexception. exception never thrown seek statement body"

public class loggerexception extends throwable {

private static final long serialversionuid = 1l; @override public void printstacktrace() { // todo auto-generated method stub super.printstacktrace(); logger logger = logger.getlogger("custom app exception"); logger.log(level.warning,getmessage(),this); } } seek { //do throw anything. incase there null pointer or } grab (loggerexception e) { // error: unreachable grab block loggerexception. exception never thrown seek statement body e.printstacktrace(); }

you should extend runtimeexception class

java google-app-engine exception

mongodb - Sharding on single machine -



mongodb - Sharding on single machine -

i want run shard on local server. please help me step step. want create multi instance of mongod on cpu(16 core). way, i'm collection consist of 7 1000000 documents, whether went missing when run shard?

i utilize script creating 3 shard on 1 replicaset:

# clean echo "killing mongod , mongos" killall mongod killall mongos echo "removing info files" rm -rf /media/mongo/data/config rm -rf /media/mongo/data/shard* rm -rf /data/config rm -rf /data/shard* # mac create sure rlimits high plenty open necessary connections ulimit -n 2048 # start replica set , tell it shard0 mkdir -p /media/mongo/data/shard0/rs0 mongod --replset s0 --logpath "/var/log/mongodb/s0-r0.log" --dbpath /media/mongo/data/shard0/rs0 --port 37017 --fork --shardsvr --smallfiles sleep 5 # connect 1 server , initiate set mongo --port 37017 << 'eof' config = { _id: "s0", members:[ { _id : 0, host : "localhost:37017" }, ]}; rs.initiate(config) eof # start replicate set , tell it shard1 mkdir -p /media/mongo/data/shard1/rs0 mongod --replset s1 --logpath "/var/log/mongodb/s1-r0.log" --dbpath /media/mongo/data/shard1/rs0 --port 47017 --fork --shardsvr --smallfiles sleep 5 mongo --port 47017 << 'eof' config = { _id: "s1", members:[ { _id : 0, host : "localhost:47017" }, ]}; rs.initiate(config) eof # start replicate set , tell it shard2 mkdir -p /media/mongo/data/shard2/rs0 mongod --replset s2 --logpath "/var/log/mongodb/s2-r0.log" --dbpath /media/mongo/data/shard2/rs0 --port 57017 --fork --shardsvr --smallfiles sleep 5 mongo --port 57017 << 'eof' config = { _id: "s2", members:[ { _id : 0, host : "localhost:57017" }, ]}; rs.initiate(config) eof # start 3 config servers rm cfg-a.log cfg-b.log cfg-c.log mkdir -p /media/mongo/data/config/config-a /media/mongo/data/config/config-b /media/mongo/data/config/config-c mongod --logpath "/var/log/mongodb/cfg-a.log" --dbpath /media/mongo/data/config/config-a --port 57040 --fork --configsvr --smallfiles mongod --logpath "/var/log/mongodb/cfg-b.log" --dbpath /media/mongo/data/config/config-b --port 57041 --fork --configsvr --smallfiles mongod --logpath "/var/log/mongodb/cfg-c.log" --dbpath /media/mongo/data/config/config-c --port 57042 --fork --configsvr --smallfiles # start mongos on port 27018 rm mongos-1.log sleep 5 mongos --port 27018 --logpath "/var/log/mongodb/mongos-1.log" --configdb localhost:57040,localhost:57041,localhost:57042 --fork echo "waiting 60 seconds replica sets come online" sleep 60 echo "connnecting mongos , enabling sharding" # add together shards , enable sharding on test db mongo --port 27018 << 'eof' db.admincommand( { addshard : "s0/"+"localhost:37017" } ); db.admincommand( { addshard : "s1/"+"localhost:47017" } ); db.admincommand( { addshard : "s2/"+"localhost:57017" } ); db.admincommand({enablesharding: "ibsng"}); eof sleep 5 echo "done setting sharded environment on localhost"

but don't know how add together shard key on collection. speed write/read(i/o) important.

sharding not help improve query performance if done on single machine has huge number of documents(7 1000000 not small).

reason : mongodb uses memory mapped files means re-create of info , indexes stored in ram , whenever there query fetches ram itself. in current scenario queries slower because info + indexes size big not fit in ram , hence there lot of i/o activity info disk bottleneck.

what else can done improve query performance (incase sharding not option):

increase ram on machine use indexes redesign schema

note - if implement above points, there limit how much query performance can improved, sharding linear scaling of read/write throughput can expected.

mongodb query-optimization sharding

regex - perl negative lookahead for not matching a word -



regex - perl negative lookahead for not matching a word -

i found regex not match word question regular look match string not containing word? .

u(?!i) match word u not followed i. reply says checks if each character not followed hede. shouldn't regex /^(.(?!hede))*$/. works words containing hede not starting it. why utilize /^((?!hede).)*$/ . whats difference between position of dot. used re=debug couldn't still meaning

(?!hede) means look ahead see if there not: hede. create sense if there other character followed hede hence . after (?!hede) valid regex.

regex explanation of ^((?!hede).)*$

^ origin of string ( grouping , capture \1 (0 or more times): (?! ahead see if there not: hede 'hede' ) end of look-ahead . character except \n )* end of \1 $ before optional \n, , end of string

use (?<! look behind

pattern explanation of ^(.(?<!hede))*$

^ origin of string ( grouping , capture \1 (0 or more times): . character except \n (?<! behind see if there not: hede 'hede' ) end of look-behind )* end of \1 $ before optional \n, , end of string

it's improve explained under lookahead , lookbehind zero-length assertions

they not consume characters in string, assert whether match possible or not

regex perl

Eclipse Luna. Illegal position of bar with views -



Eclipse Luna. Illegal position of bar with views -

before used kepler version. screenshots of normal , minimized bar.

now decided alter kepler lastly version: luna sr1. normal state bar seems kepler. if seek minimize bar, attach right side of application.

but want enable working version kepler. how can todo?

move mouse cursor ---- marker on fast view bar mouse cursor changes hand symbol drag ever want. using eclipse version: luna release (4.4.0) not sr1(i on ubuntu 14.04).

eclipse

vmware - Round a number in PowerShell one-liner -



vmware - Round a number in PowerShell one-liner -

i'm using vmware's powercli run command output inventory of sorts vcenter.

get-vm | select-object name,memorygb,numcpu,usedspacegb,@{n="totalhdsizegb"; e={(get-harddisk -vm $_ |measure-object -sum capacitygb).sum}},@n="network"; e={(get-networkadapter -vm $_ |select -unique -expand networkname)}}sort-object network|export-csv -path vms.csv

i'd round usedspacegb , list of networkname values, not one. i've seen how utilize [math]::round() round numbers in scripts, haven't been able find illustration on command line , attempts have failed accomplish desired results. how do that?

try using next instead of usedspacegb:

@{ n="spaceusedgb"; e={[math]::round( $_.usedspacegb, 3 )}}

that'll round usedspacegb 3 decimal places , give field name spaceusedgb. round nearest whole number, either alter 3 0, or use:

@{ n="spaceusedgb"; e={[math]::round( $_.usedspacegb )}}

if don't want homecoming networknames array, sorted string, alter look like:

@{n="network"; e={(get-networkadapter -vm $_ | sort-object networkname | select -unique -expand networkname) -join ', '}}

because totalhdsizegb had bunch of decimal places in cases well, final version of command looks like:

get-vm | select-object name, memorygb, numcpu, @{ n="diskusedgb"; e={[math]::round( $_.usedspacegb )}}, @{ n="totalhdsizegb"; e={[math]::round((get-harddisk -vm $_ | measure-object -sum capacitygb).sum)}}, @{n="network"; e={(get-networkadapter -vm $_ | sort-object networkname | select -unique -expand networkname) -join ', '}} | export-csv -path vms.csv

powershell vmware rounding powercli vcenter

php - Laravel Ajax and Session issue? -



php - Laravel Ajax and Session issue? -

i have ajax phone call fires right when dom has finished loading, yet trying prevent situation when user hits refresh , fires ajax phone call 1 time again storing session variable. yet, there seems issue storing session entry via ajax request, consider next snippet:

<?php function postmyajax() { $already_fired = \session::get('ajax_fired'); // <-- returns null! if ( ! empty( $already_fired ) ) { homecoming response::json(array('already fired')); } # remember fired phone call \session::put('ajax_fired',1); // <-- fails set? homecoming response::json(array('ok')); }

any ideas?

for sake of answering question, has been bug since laravel 4.1 session handling becomes unstable on concurrent requests. experienced 1 request made @ time. , there seems no way pinpoint problem.. read here in github issues.

php ajax session laravel

facebook - Getting `Unsupported get request` error only on certain ID -



facebook - Getting `Unsupported get request` error only on certain ID -

i'll start example, easier understand. have script:

facebooksession::setdefaultapplication('536443039714362', '007d98b0f51f3ffecb206987fc3bc624'); $session = new facebooksession('access-token'); $session = facebooksession::newappsession(); $event = (new facebookrequest( $session, 'get', '/loftasvilnius'))->execute()->getgraphobject(graphuser::classname())->asarray();

as see gets info of page prefix 'loftasvilnius'. , works fine here.

hovewer if alter name of page 'opiumclub'. api throws error message:

fatal error: uncaught exception 'facebook\facebookauthorizationexception' message 'unsupported request. please read graph api documentation @ https://developers.facebook.com/docs/graph-api' in d:\xampp\htdocs\fb\src\facebook\facebookrequestexception.php:104 stack trace: #0 d:\xampp\htdocs\fb\src\facebook\facebookrequest.php(268): facebook\facebookrequestexception::create('{"error":{"mess...',

could explain that's wrong here ?

i tried through graph explorer in facebook dev page. , here worked ok.

facebook

wpf - TextSearch.TextPath timing on DataTemplate? -



wpf - TextSearch.TextPath timing on DataTemplate? -

i have info template:

<usercontrol.resources> <datatemplate x:key="imageitemtemplate"> <stackpanel orientation="horizontal"> <image height="44" source="{binding path}"/> <label content="{binding name}" verticalalignment="center"/> </stackpanel> </datatemplate> </usercontrol.resources>

its combobox.

<combobox itemtemplate="{staticresource imageitemtemplate}" textsearch.textpath="name"/>

this works intended. if on combobox, , nail "k" button on keyboard, seek content within combobox name starts "k".

moving on that, if nail "w" button on keyboard, not seek content within combobox name starts "w". seek content starts "kw".

however, if instead of hitting "w" button after "k" button, instead wait 2-3 seconds before hitting "w", when nail "w" button, seek content starting "w", if dropped search k after few seconds.

i wondering if there way eliminate wait time. want previous search text dropped imemdiately.

nope. looking @ source code textsearcher appears timeout not configurable programmatically. here how timeout value calculated:

/// <summary> /// time until search engine resets. /// </summary> private timespan timeout { { // note: ntuser next (file: windows/ntuser/kernel/sysmet.c) // gpsi->dtlbsearch = dttime * 4; // dtlbsearch = 4 * gdtdblclk // gpsi->dtscroll = gpsi->dtlbsearch / 5; // dtscroll = 4/5 * gdtdblclk // // 4 * doubleclickspeed seems slow search // we'll 2 * doubleclickspeed homecoming timespan.frommilliseconds(safenativemethods.getdoubleclicktime() * 2); } }

and cannot reset search algorithm either, because corresponding properties maintain current search prefix private textsearch class.

wpf combobox

javascript - Loading specific markers by checkbox? -



javascript - Loading specific markers by checkbox? -

i loading markers database display on google map below. working fine however, implement alternative of pressing particular button somewhere else on page, , map dynamically alter show markers pertaining clicked.

basically, filter 'type' column in database still maintain types loaing default. eg. page loads, map loads , displays types, user clicks on button causes map show markers have type1 value in db. kind of toggle check box.

any ideas of how go ahead this, don't think reloading markers db efficient way, can hide markers have property?

map = new google.maps.map(document.getelementbyid("google_map"), googlemapoptions); //load markers xml file, check (map_process.php) $.get("map_process.php", function (data) { $(data).find("marker").each(function () { var name = $(this).attr('name'); var address = '<p>'+ $(this).attr('address') +'</p>'; var type = $(this).attr('type'); var description ='<p>'+ $(this).attr('description') +'</p>'; var point = new google.maps.latlng(parsefloat($(this).attr('lat')),parsefloat($(this).attr('lng'))); var icon1 = customicons[type] || {}; create_marker(point, name, address, false, false, false, icon1.icon);//"http://sanwebe.com/assets/google-map-save-markers-db/icons/pin_blue.png"); }); });

you can't hide specific markers according tag or type, have hide/remove them first , add together need on map

here functions need:

var all_markers = []; var show_markers = []; function setmarkers(map) { (var = 0; < show_markers.length; i++) { show_markers[i].setmap(map); } } function showmarkers(type) { setmarkers(null); show_markers = [] (var = 0; < all_markers.length; i++) { if (all_markers[i].type == type){ show_markers.push(all_markers[i]) } } setmarkers(map); }

here idea: load markers all_markers, on first loading markers show_markers must equal all_markers. hitting button showing specific markers must trigger function showmarkers clear map , reload specific ones.

javascript jquery google-maps google-maps-api-3

c# - Elasticsearch NEST -



c# - Elasticsearch NEST -

currently started using elasticsearch wrapper c# "nest", , i'm facing troubles writing queries check partial similarities such in "book" , "books", when have document contains "books", if search "book" doesn't find it: here code :

var articles = client.search<productresult>(s => s .from(0) .size(1000) .matchall() .query(q => q.querystring(d => d .query(query) )));

try analyzing fields stemming analyzer snowball seek it's best cut down words root form. example, books , booking => book, jumps , jumping => jump. etc... algorithm behind isn't perfect , trip on irregular words/plural forms, part works (on european languages).

you can apply different analyzers when create index, or on existing index using update mapping api. either way, you'll have reindex our documents apply new analysis.

create index illustration using nest:

client.createindex("yourindex", c => c ... .addmapping<yourtype>(m => m .mapfromattributes() .properties(ps => ps .string(s => s.name("fieldname").analyzer("snowball")) ... ) ) );

update mapping example:

client.map<yourtype>(m => m .mapfromattributes() .index("yourindex") .properties(ps => ps .string(s => s.name("fieldname").analyzer("snowball")) ... ) );

here's great info on algorithmic stemmers in definitive guide.

c# elasticsearch nest

php - Customize/Edit svgEdit from Google on my Website -



php - Customize/Edit svgEdit from Google on my Website -

here problem,

i have build custom interface map-editing. these maps svg files, chose svgedit google. need customize it... utilize jquery 1.10.x , bootstrap3

i not need default functionnalities, , don't want maintain standard svgedit interface, need simplify it, need functionnalities, , have remove toolbars & on... create editor quite empty... buttons & functionnalities have externalized, on container page, have out of svgedit iframe... (is possible?)

for editor, need these functionnalities :

i have set default canvas (a map) on click on list (when take map, has appear on svgedit tool - have map, svg file, on server)

i have set main image fit canvas, no scroll x or y far away image... have scrollbars around "default empty canvas" allows me go far away image... , thus, should allow mouse wheel zoom in/out on map... (which seems disabled default...)

i have allow user possibility add together "layer" on map (i have "pseudo-form" input text , confirm button, on click on it, should add together empty layer on main map "current layer")... user should able add together many layers wants... , display ones wants...

i have allow user add together icons drag&drop or click on image click on canvas place anywhere on current layer (not on map, on layer), draw line, polygon, , add together text on current layer , save these objects on layer (then have allow possibility edit / delete these objects)

i need "save" button saves current layers on server.

well, don't know if i'm talking possible, i'm tryin' do. here is, example, short thought of page should (bootstrap inside...) :

<div class="panel panel-success" style="margin-top:30px;"> <div class="panel-heading"> <a class="btn btn-success" href="#" title="add map" style="float:right;">add new map</a> <h3>maps : </h3> </div> <div class="panel-body" style="text-align:center;"> <div class="col-lg-4" style="border-right:1px dotted grey;"> <fieldset class="bordershadone" style="margin-bottom:20px;"> <legend> select place : </legend> <div class="input-group"> <span class="input-group-addon"> map : </span> <select class="form-control" name="mapchoice" id="mapchoice"> </select> </div> </fieldset> <fieldset class="bordershadone" style="margin-bottom:20px;"> <legend> display layers : </legend> <label class='btn col-lg-6' style='text-align:left;'><input type='checkbox' style='width:10px;float:left;' class='displaylayer' name='displaylayer' value='1'/>&nbsp;&nbsp;&nbsp;layer 1 </label> <label class='btn col-lg-6' style='text-align:left;'><input type='checkbox' style='width:10px;float:left;' class='displaylayer' name='displaylayer' value='2'/>&nbsp;&nbsp;&nbsp;layer 2</label> </fieldset> <fieldset class="bordershadone" style="margin-bottom:20px;"> <legend> add together new layer : </legend> <div class="input-group"> <span class="input-group-addon"> layer name : </span> <input class="form-control" type="text" name="newlayername" id="newlayername" value=""/> </div> <br> <div style="text-align:right;"> <label class="btn btn-success" id="send_name_layer">confirm</label> </div> <br> </fieldset> <fieldset class="bordershadone" style="margin-bottom:20px;"> <legend> layer edit : </legend> <div class="input-group"> <span class="input-group-addon"> layer edit : </span> <select class="form-control" type="text" name="currentlayertoedit" id="currentlayertoedit"> <option value="0">none</option> <option value="1">layer 1</option> <option value="2">layer 2</option> </select> </div> <br> <fieldset style="margin-left:10px;"> <legend style="text-align:left;"> icons : </legend> <label style="height:32px;width:32px;float:left;margin-left:10px;"> <a href="#" class="thumbnail" style="float:left;padding:0;"><img class="icon" style="width:24px;height:24px;" src="./files/icons/icon1.jpg" alt="" title="icon1"/></a> </label> <label style="height:32px;width:32px;float:left;margin-left:10px;"> <a href="#" class="thumbnail" style="float:left;padding:0;"><img class="icon" style="width:24px;height:24px;" src="./files/icons/icon2.jpg" alt="" title=""/></a> </label> <br> <label class="info little italic"> drag & drop on "current layer" </label> </fieldset> <br> <fieldset style="margin-left:10px;"> <legend style="text-align:left;"> tools : </legend> <label class="btn btn-warning" id="toolline" style="float:left;margin-left:5px;margin-right:5px;"><i class="fa fa-pencil"></i>&nbsp;|&nbsp;draw line</label> <label class="btn btn-info" id="toolselector" style="float:left;margin-left:5px;margin-right:5px;"><i class="fa fa-location-arrow"></i>&nbsp;|&nbsp;select objects</label> <label class="btn btn-danger" id="tooltext" style="float:left;margin-left:5px;margin-right:5px;"><i class="fa fa-bold"></i>&nbsp;|&nbsp;add text</label> <label class="btn btn-default" id="toolpolygon" style="float:left;margin-left:5px;margin-right:5px;"><i class="fa fa-square"></i>&nbsp;|&nbsp;draw polygon</label> </fieldset> </fieldset> </div> <div class="col-lg-8"> <div class="row col-lg-12"> <b><i>display box : </i></b> </div> <div style="clear:both;"></div> <div class="mixsize" style="border:1px solid black;position:relative;margin:0 auto;max-width:1000px;width:100%;border-radius:8px;"> <iframe class="svgeditiframe" src='./js/svgedit26/svg-editor.html' width=100% height=100% ></iframe> </div> <br> <div> <div class="col-lg-6"> <fieldset> <legend> doing : </legend> <!-- should here display info doing, selected, give possibility save layer or delete selected items on --> </fieldset> </div> </div> </div> </div>

here css... (the main thing ":before" forcess svgedit container have height set width...)

<style> .mixsize:before{ content:""; display:block; padding-top:80%; } .svgeditiframe{ position:absolute; top:0; left:0; height:100%; width:100%; } </style>

thanks reading, help!

php jquery html css svg

css - Wordpress header not scaling corectly for mobile -



css - Wordpress header not scaling corectly for mobile -

i got request today help out friend of friend wordpress site. have never looked @ wordpress backend before today, agreed.

so, im stuck now. header image scaling totally wrong mobile sizing. i'm not used wordpress or experienced of coder help appreciated!

here! thanks!

so need alter line :

.header-image{ background-size : cover; }

with line :

.header-image{ background-size : 100% 100% !important; }

note: tested in mozilla browser , responsive.

css wordpress responsive-design

android - Problems when sending a continuous stream of data over BLE -



android - Problems when sending a continuous stream of data over BLE -

i'm wondering if can help me figure out causing info sending become corrupt.

my setup arduino pro mini hm-10 bluetooth module connected (i have tried hm-11 module too) , android application receive bluetooth data.

module setup: http://letsmakerobots.com/node/38009

if send info big plenty intervals info fine, if send info continuously see messages getting mixed , lost. test send "$0.1,0.2,0.3,0.4,0.5" android application arduino, stream of info appears send fine other times quite scrambled. please see below graphs demonstrate this:

good case:

bad case:

arduino code:

string inputstring = ""; //hold incoming data. boolean stringcomplete = false; //determines if string complete. boolean realtime = false; void setup() { serial.begin(9600); delay(500); serial.print("at+start"); delay(500); } void loop() { if(stringcomplete) { if(inputstring.equals("rstart")) { serial.println("$startack"); realtime = true; } else if(inputstring.equals("stop")) { serial.println("$stopack"); realtime = false; } else{ serial.print(inputstring); } inputstring = ""; stringcomplete = false; } if(realtime) { serial.println("$0.1,0.2,0.3,0.4,0.5,0.6"); delay(10); } } void serialevent() { while (serial.available()) { // new byte: char inchar = (char)serial.read(); if (inchar == '\n') { stringcomplete = true; } else { inputstring += inchar; } } }

the android side receives info , parses in intentservice:

@override protected void onhandleintent(intent intent) { //incoming command. string rawdata = intent.getstringextra(dataprocessingintentservice.request); //append our new info our info helper. log.i(this.getclass().getname(), "previous raw: (" + dataprocessinghelper.getinstance().getdata() + ")"); dataprocessinghelper.getinstance().appenddata(rawdata); log.i(this.getclass().getname(), "new raw: (" + dataprocessinghelper.getinstance().getdata() + ")"); commandstartindex = dataprocessinghelper.getinstance().getdata().indexof("$"); commandendindex = dataprocessinghelper.getinstance().getdata().indexof("\n"); //set info starting point. if(commandstartindex != -1){ dataprocessinghelper.getinstance().offsetdata(commandstartindex); } //ensure command has been found , end index after starting index. if(commandstartindex != -1 && commandendindex > commandstartindex){ //remove command construction command. command = dataprocessinghelper.getinstance().getdata().substring(commandstartindex+1, commandendindex-1); //remove \r\n end command. dataprocessinghelper.getinstance().offsetdata(commandendindex+1); if(command.length() > 1){ //split info out of comand. splitdata = command.split(","); log.i(this.getclass().getname(), "broadcasting processed data. (" + command + ")"); //broadcast data. intent broadcastintent = new intent(); broadcastintent.setaction(dataprocessingintentservice.response); broadcastintent.addcategory(intent.category_default); broadcastintent.putextra(dataprocessingintentservice.response, splitdata); sendbroadcast(broadcastintent); }else{ log.e(this.getclass().getname(), "command less 1 character long!"); } } }

thank help!

i have figured out causing problem. appears ble supports maximum of 20 bytes per transaction. time between these transactions different depending on using. i'm using notifications means can send 20 bytes every 7.5 milliseconds maximum. have opted 10 milliseconds safe. need breaking packets 20 bytes maximum ensure no info corruption.

android arduino bluetooth-lowenergy

c++ - Dynamic memory slow down on Intel Xeon Phi -



c++ - Dynamic memory slow down on Intel Xeon Phi -

i creating simple matrix multiplication procedure, operating on intel xeon phi architecture.the procedure looks (parameters a, b, c), , timing doesn't include initialization:

//start timing for(int = 0; < size; i++){ for(int k = 0; k < size; k++) { register type aik = a[i][k]; for(int j = 0; j < size; j++) { c[i][j] += aik * b[k][j]; } } } //end timing

i using restrict, aligned info , on. however, if matrices allocated using dynamic memory (posix_memalign), computation incurs in severe slow down, i.e. type=float , 512x512 matrices takes ~0.55s in dynamic case while in other case ~0.25. on different architecture (intel xeon e5), there slow down, barely noticeable (about 0.002 s).

any help apreciated!

what happens timing differences if create matrix different size? (e.g. 513x513)

the reason why inquire think might seeing effect due exceeding cache way associativity , evicting elements of c[i][] l2 loop on b in loop on k. if b , c aligned , sizes powers of 2, might cache super-alignment causing issue.

if b , c on stack or otherwise not aligned, don't see effect fewer addresses powerfulness of 2 aligned.

c++ performance matrix xeon-phi

android - @layout/layoutID Error on XML -



android - @layout/layoutID Error on XML -

im trying run sample code error when run application error on xmp preview , run time

10-23 22:04:02.518: e/androidruntime(1543): fatal exception: main 10-23 22:04:02.518: e/androidruntime(1543): process: net.micode.compass, pid: 1543 10-23 22:04:02.518: e/androidruntime(1543): java.lang.runtimeexception: unable start activity componentinfo{net.miui.compass/net.miui.compass.compassactivity}: android.view.inflateexception: must specifiy layout in include tag: <include layout="@layout/layoutid" /> 10-23 22:04:02.518: e/androidruntime(1543): @ android.app.activitythread.performlaunchactivity(activitythread.java:2184) 10-23 22:04:02.518: e/androidruntime(1543): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2233) 10-23 22:04:02.518: e/androidruntime(1543): @ android.app.activitythread.access$800(activitythread.java:135) 10-23 22:04:02.518: e/androidruntime(1543): @ android.app.activitythread$h.handlemessage(activitythread.java:1196)

and here xml file :

<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <framelayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background" > <linearlayout android:id="@+id/view_compass" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background_light" android:orientation="vertical" > <linearlayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:orientation="vertical" > <framelayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/prompt" > <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_margintop="70dip" android:orientation="horizontal" > <linearlayout android:id="@+id/layout_direction" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:orientation="horizontal" > </linearlayout> <imageview android:layout_width="20dip" android:layout_height="fill_parent" > </imageview> <linearlayout android:id="@+id/layout_angle" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="left" android:orientation="horizontal" > </linearlayout> </linearlayout> </framelayout> <linearlayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:orientation="vertical" > <framelayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" > <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/background_compass" /> <net.micode.compass.compassview android:id="@+id/compass_pointer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/compass" /> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/miui_cover" /> </framelayout> </linearlayout> </linearlayout> <framelayout android:id="@+id/location_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" > <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/background_bottom" android:orientation="vertical" > </linearlayout> <textview android:id="@+id/textview_location" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/getting_location" android:textappearance="?android:attr/textappearancemedium" android:textcolor="#7fffffff" /> </framelayout> </linearlayout> </framelayout> <include android:id="@+id/low_accuracy_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|center_horizontal" android:layout_marginbottom="35dip" android:visibility="gone" />

i know should add together layout ? xml preview not working . , total error : exception raised during rendering: must specifiy layout in include tag:

your illustration xml has <include> element missing layout attribute. layout attribute should specified layout resource. seem missing closing </framelayout> tag.

... <include layout="@layout/my_layout" ... /> </framelayout>

for layout xml file res/layout/my_layout.xml.

android xml