Sunday, 15 September 2013

jquery - pageSlide: $.pageslide.close(); reloads the website -



jquery - pageSlide: $.pageslide.close(); reloads the website -

fans,

i'm using pageslide plugin close button in menu.

$('.close-button').click(function() { $.pageslide.close(); });

everytime i'm using close-button, site reloads completely... ideas?

thanks!

try

event.preventdefault()

description: if method called, default action of event not triggered.

$('.close-button').click(function(e) { e.preventdefault(); //stop default behavior of anchor tag. $.pageslide.close(); });

problem

your element class close-button a anchor tag empty href on click reload page.

jquery

javascript - SAPui5 sap.viz.ui5.StackedColumn custom tooltip on data point -



javascript - SAPui5 sap.viz.ui5.StackedColumn custom tooltip on data point -

i trying implement custom tooltip in sap viz stacked column chart. little popup window appears when mouse hovers datapoint. problem how observe position of info point tooltip popup points it. points graph itself, not datapoint within graph. here's have:

graph = new sap.viz.ui5.stackedcolumn({ width: graphwidth, height : graphheight, //.. more properties here interaction: new sap.viz.ui5.types.controller.interaction({ decorations: [{name: "showdetail", fn: showdetailhandler}, {name: "hidedetail", fn:hidedetailhandler}] }),

and showdetailhandler this. supposed display popup pointing info point.

var showdetailhandler = function(oevent){ var info = oevent.data; var offset = '0 0'; var tp3 = new sap.ui.ux3.toolpopup({ content : [ new sap.ui.commons.button({ text : "button" }) ], }); offset = '0 0'; offset = oevent.position.x + " " + oevent.position.y; tp3.setposition( sap.ui.core.popup.dock.centerbottom, sap.ui.core.popup.dock.centertop, $(oevent.container), offset, "none"); if (tp3.isopen()) { tp3.close(); } else { tp3.open(sap.ui.core.popup.dock.centerbottom, sap.ui.core.popup.dock.centertop); } };

the docs around here: https://sapui5.hana.ondemand.com/sdk/#docs/api/symbols/sap.ui.core.popup.html#setposition https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.viz.ui5.types.controller.interaction.html#getdecorations

my understanding offset offset point calculated anchor point. problem is, offset ignored. popup appears @ top of graph.

however, normal tooltip appears in right place.

any idea/example?

thank in advance.

javascript sapui5

Which file formats can be previewed on CKAN Data Preview tool? -



Which file formats can be previewed on CKAN Data Preview tool? -

i working on ckan , know appropriate file formats can previewed on ckan. not find info on topic online, decided start topic , hope garner more responses on useful ckan developers in future. here's list of file formats have gathered after experimenting own ckan , looking through other ckan instances such uk , australia.

can previewed:

csv (comma separated values) xls (microsoft excel binary file format) html (hypertext markup language) json (javascript object notation) pdf (portable document format) rss (really simple syndication) txt (plain text) wms (web map service) xml (extensible markup language)

cannot previewed:

doc (microsoft word) rdf (resource description framework) html (hypertext markup language) kml (keyhole markup language) shp (shapefile) wfs (web feature service) xlsx (microsoft excel open xml document) zip (archive)

help add together on list , right me if of above wrong, update list above. thanks! ;)

for each ckan release, info viewer's functionality may differ.

refer dataviewer section in documents of ckan version using.

http://docs.ckan.org/en/latest/maintaining/data-viewer.html

preview file-format ckan

c++ - Send HBITMAP over socket -



c++ - Send HBITMAP over socket -

i need code in c++ gets hbitmap 1 side , sends through socket , on other side receive , create hbitmap again.

it has fast , effective

if more comfortable, utilize gdi+ bitmap

that's not going work!

what need go convert hbitmap bitmap using getobject function. serialize object on network. note: you'll need create sure serialize bmbits fellow member correctly.

on other side, 1 time you've deserialized bitmap can utilize createbitmapindirect hbitmap.

c++ sockets bitmap

sas - retrieve data with a proc print or a sql query or else -



sas - retrieve data with a proc print or a sql query or else -

i'm looking advice on one. context before.

i have next table on sas. there 711 observations , many more variables. below sample table.

date col1 col2 col3 jun14 0 0 0 may14 1 0 2 apr14 1 0 3

the table has no index, no primary key , nothing.

the results i'm aiming for, know specific date, values of column.

date col1 col2 col3 may14 1 0 2 apr14 1 0 3

example may 14, have

i'm running next sql query on it

proc sql; select * mytable date < (input('may14',monyy5.));

as can imagine, query heavy when have many variables , many observations. query started 50 minutes ago , still running.

i thought using proc print

proc print data=mytable; var date col1 col2 col3; date = (input('may14',monyy5.)); run;

so here question.

is there other way have results rather through query or proc print? need have datastep transpose , although if i'm doing transpose, things different (see below).

date jun14 may14 apr14 col1 0 1 1 col2 0 0 0 col3 0 2 3

thanks in advance insight.

aren't missing quit; after select statement end proc sql? can't believe take such time 771 records.

edit:

so problem in creating , displaying output straight in sas windows.

below log test proc printto direct output text file. takes less 10 seconds. size of file 100mb 1000 records , 10000 variables.

obviously, create more sense output info other formats. also, what's utilize of presenting thousands of values user?

114 info mytable ; 115 format date date9.; 116 array var {10000}; 117 i=1 10000; 118 var(i)=i; note: array var has same name sas-supplied or user-defined function. parentheses next name treated array references , not function references. 119 end; 120 i=1 1000; 121 date = i; 122 output; 123 end; 124 run; note: info set work.mytable has 1000 observations , 10002 variables. note: info statement used (total process time): real time 0.13 seconds cpu time 0.12 seconds 125 126 ods html close;* no html output; 127 ods listing; *text output rather; 128 129 proc printto print="e:\sasoutput.lst";run; note: procedure printto used (total process time): real time 0.00 seconds cpu time 0.00 seconds 129! * output file; 130 proc sql; 131 select * mytable date < '1may2014'd; 132 ; 133 quit; note: procedure sql used (total process time): real time 9.35 seconds cpu time 8.57 seconds 134 135 %put &sqlobs; 1000

sql sas

c# - How to sort records in grid view on click of header of a column -



c# - How to sort records in grid view on click of header of a column -

i wanted sort grid view column when user clicks on column header. here user can click column , grid view sorted based on column clicked. code:

<asp:gridview id="gvemployeestatus" runat="server" autogeneratecolumns="false" allowpaging="true" pagesize="10" allowsorting="true" onpageindexchanging="gvemployeestatus_pageindexchanging" onsorting="gvemployeestatus_sorting" > protected void gvemployeestatus_sorting(object sender, gridviewsorteventargs e) { loginname = (string)(session["loginname"]); dslogindetail = clsblogic.tbllogin(loginname); tblemployeeno = dslogindetail.tables[0].rows[0]["employeeno"].tostring(); binddatatogvemployeestatus(tblemployeeno); datatable datatable = gvemployeestatus.datasource datatable; if(datatable != null) { dataview dataview = new dataview(datatable); dataview.sort = e.sortexpression + " " + convertsortdirection(e.sortdirection); gvemployeestatus.datasource = dataview; gvemployeestatus.databind(); } } private string convertsortdirection(sortdirection sortdirection) { string newsortdirection = string.empty; switch (sortdirection) { case sortdirection.ascending: newsortdirection = "asc"; break; case sortdirection.descending: newsortdirection = "desc"; break; } homecoming newsortdirection; }

record in grid view comes info set. when run code, nil happens. had set break point on gvemployeestatus_sorting event check when fired. it not beingness fired. how can sort records!!

as u mentioned sorting not triggered, guess missing attribute sortexpression in <asp:templatefield> or <asp:boundfield>

for example,

<asp:templatefield headertext="your header 1" sortexpression="columname1">

or

<asp:boundfield datafield="your header 1" headertext="your header 1" sortexpression="columname1" />

c# asp.net dataset

java - Wicket replacing items in ListView -



java - Wicket replacing items in ListView -

i want alter info of listview on button click.

this currently:

final pageablelistview<users> listview = new pageablelistview<users>("rows", displaylist, 10) { //.... protected void populateitem(final listitem<users> item) { item.add(new label("username").setoutputmarkupid(true)); // .. other fields } } final indicatingajaxfallbacklink<mypanel> sublist = new indicatingajaxfallbacklink<mypanel>("sublist") { public void onclick(ajaxrequesttarget target) { displaylist = // new list listview.setlist(displaylist); target.addchildren(listview, label.class); } }; add(sublist);

this works if new list same size old list. in other case an

caused by: java.lang.indexoutofboundsexception: index: 1, size: 1

how can prepare problem?

since can't update listview via target.add(listview); added webmarkupcontainer this:

final webmarkupcontainer datacontainer = new webmarkupcontainer("data"); datacontainer.setoutputmarkupid(true); add(datacontainer);

and can update onclick method:

target.add(datacontainer);

this works fine - problem solved.

but why replacing children didn't work still unclear me

java listview wicket

c# - Does this nested locking cause deadlock? -



c# - Does this nested locking cause deadlock? -

method1 , method2 public methods. both methods required take in 2 locks in same order. sure acquiring locks in same order not end in deadlock. locks in common() unnecessary?

public void method1() { lock(lockobja) lock(lockobjb) { //dosomething common(); } } public void method2() { lock(lockobja) lock(lockobjb) { //dosomething else common(); } } private void common() { lock(lockobja) lock(lockobjb) { //dosomething else } }

i couldn't find improve reference on rush can remember operating scheme course of study resource locking professor stated acquiring resources in same order doesn't raise chances deadlocks happen.

always acquiring resources in same order

edit: found a stackoverflow question this still no article specific deadlock prevention mechanism...

since c# locks reentrant should not more harm when using code.

back qeustion

if methods private have little scope within class check lock conditions. on public api improve decorate methods changing mutable state locks. if means might reenter on same lock twice. in private api can decide wether appropriate.

edit: after qestion edit

if 3 methods have 1 have in scope, or 3 methods critical ones (modifying/accessing mutable state). , since can see nil more happen can break locking.

then reply yes! in method common locking not neccessary.

note: decorating methods

by decoration mean decoration in sense of decorator pattern. means execute code before , after piece of code. in case mean code within method. in java there exist synchronized key word allows utilize short hand decorate code within method conveniently synchronized block using enclosing instance object. this called synchronized method.

c# .net multithreading locking

single sign on - Delegated Authentication for Mobile Users in salesforce -



single sign on - Delegated Authentication for Mobile Users in salesforce -

why delegated authentication recommended sso configuration mobile users in salesforce?

the simplest reply because delauth only sso method sfdc has enabled mobile application...so don't have choice. expect sfdc move standards-based model eventually.

salesforce single-sign-on

objective c - Build app for Universal but keep iPhone mode -



objective c - Build app for Universal but keep iPhone mode -

i want create app universal want maintain app blowing app ipad mode messes everything.

i built app iphone only. need create universal can run iads on ipads, don't want rebuild interface fit ipad resolution. there way can maintain app running on iphone compatibility mode on ipads universal mode on?

no. either switch app universal in project settings , provide interface each form factor, or maintain set iphone in case user can "blow app" when run on ipad.

iphone objective-c ipad iad

How to run a Java Main method of a Class during Eclipse Start up in the background ? -



How to run a Java Main method of a Class during Eclipse Start up in the background ? -

is there alternative in eclipse can add together start hook, @ start of eclipse can execute main method class of java project ? doable ? or require create eclipse plugin ?

the "right" way of doing create plugin extension org.eclipse.ui.startup (org.eclipse.ui.startup documentation). have provide class implements interface org.eclipse.ui.istartup. it's in class should phone call main method of class.

another alternative create osgi bundle, install bundle in eclipse , configure start automatically, can provide activator runs task want in start(bundlecontext) method.

in either case, class/es must part of plugin's classpath or packaged plugin/osgi bundle marked dependency of startup bundle.

now, may inquire want achieve?

java eclipse eclipse-plugin eclipse-rcp

javascript - Jade - script not being recognized -



javascript - Jade - script not being recognized -

i have simple jade document , want import standard jquery script:

extends layout block content h1 #{title} ul#messages form#formadduser(name="adduser",method="post",action="") input#m(type="text", name="message") button#btnsubmit(type="submit") submit script(src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js")

which extension of

doctype html html head title= title link(rel='stylesheet', href='/stylesheets/style.css') body block content

the thing script not recognized! rather have 404 response, not that, nil happens @ all. doing wrong?

thanks much

p.s: i'm using express.js

controller code:

router.get("/chat",function(req,res){ res.render("chat",{title:"chat"}); });

update: added piece layout

doctype html html head title= title link(rel='stylesheet', href='/stylesheets/style.css') script(type="text/javascript") alert("hello!") body block content

that simple alert, , doesn't work either!

add dot literal parsing in jade. ie.

doctype html html head title= title link(rel='stylesheet', href='/stylesheets/style.css') script(type="text/javascript"). alert("hello!") console.log('notice dot after script tag.'); body block content

if add together dot, within block (so indented) not parsed. this:

ul li inlined text. li. 1 on its' own line, without beingness turned tag. li div div within li li. div not div, simple text within li. p added bonus, can utilize colon , next thing tag. p like, opposite of dot. p: a(href="#") clickme! p a(href="#") i'm not clickable :(

jade cool, isn't it?

edit: oops, noticed alert('hello') appendix orig question. allow me update answer.

edit 2: actually, can show rendered html (for first example) can see rendered , expect there?

javascript jquery node.js express jade

groovy - How to get the resource types from a webpage using JSoup? -



groovy - How to get the resource types from a webpage using JSoup? -

i trying create webcrawler in groovy. looking extract resource types webpage. need check if particular webpage has next resource types:

pdfs

jmp files

swf files

zip files

mp3 files

images

movie files

jsl files

i working crawler4j crawling , jsoup parsing. in general know approach getting resource type may need in future. tried next in basiccrawler.groovy. tells content type of page i.e. text/html or text/xml. need types of resource on page. please right me going wrong:

@override void visit(page page) { println "inside visit" int docid = page.getweburl().getdocid() url = page.getweburl().geturl() string domain = page.getweburl().getdomain() string path = page.getweburl().getpath() string subdomain = page.getweburl().getsubdomain() parenturl = page.getweburl().getparenturl() string anchor = page.getweburl().getanchor() println("docid: ${docid} ") println("url: ${url} ") document doc = jsoup.connect(url).get(); elements nextlinks = doc.body().select("[href]"); for( element link : nextlinks ) { string contenttype = new url(link.attr("href")).openconnection().getcontenttype(); println url + "***" + contenttype } if (page.getparsedata() instanceof htmlparsedata) { htmlparsedata htmlparsedata = (htmlparsedata) page.getparsedata() string text = htmlparsedata.gettext() string html = htmlparsedata.gethtml() list<weburl> links = htmlparsedata.getoutgoingurls() } println("finished crawling") def crawlobj = new resource(url : url) if (!crawlobj.save(flush: true, failonerror: true)) { crawlobj.errors.each { println } } }

after printing 2 doc ids, throws error: error crawler.webcrawler - exception while running visit method. message: 'unknown protocol: tel' @ java.net.url.<init>(url.java:592)

you check urls in document , inquire server content type. here quick+dirty example:

document doc = jsoup.connect("http://yourpage").get(); elements elements = doc.body().select("[href]"); (element element : elements) { string contenttype = new url(element.attr("href")).openconnection().getcontenttype(); }

for images, embedded elements , on should search src attribute.

types groovy resources jsoup crawler4j

php - Laravel - restrict query through relations? -



php - Laravel - restrict query through relations? -

i've been hitting head against wall this, need bit of help. i'm using laravel 4.2.4. have 2 models, event , eventdate.

class="lang-php prettyprint-override">// event has id, name class event extends eloquent { protected $table = 'events'; protected $guarded = ['id']; public $timestamps = false; public function eventdates() { homecoming $this->hasmany('\eventdate', 'event_id', 'id'); } } // eventdate has id, event_id, start_date, end_date class eventdate extends eloquent { protected $table = 'eventdates'; protected $guarded = ['id']; public $timestamps = false; }

now i'm trying events between start , end date. according docs, should able do:

class="lang-php prettyprint-override">\event::with('eventdates')->where('start_date', '>=', '2014-01-01')->where('end_date', '<=', '2014-02-01')->get();

but throw sqlstate[42s22]: column not found: 1054 unknown column 'eventdates.start_date' in 'where clause'.

i've tried using closures (if using repository pattern) such as:

class="lang-php prettyprint-override">return $this->model->with(['eventdates' => function($query) utilize ($startdate, $enddate) { $query->where('start_date', '<=', $enddate->format('y-m-d')); $query->where('end_date', '>=', $startdate->format('y-m-d')); }]);

this feels dumb error, can't figure out. ideas?

you may seek this:

$events = \event::with(array('eventdates' => function($query){ // querying in eventdates table $query->where('start_date', '>=', '2014-01-01') ->where('end_date', '<=', '2014-02-01'); }))->get();

it's because start_date , end_date fields available in eventdates table.

php laravel laravel-4

php - Adding delivery date with datepicker to a loop of products -



php - Adding delivery date with datepicker to a loop of products -

i'm trying loop of products have delivery date field , utilize datepicker field. i'm looking through docs on how increment id or unique id of sort datepicker work , maintain delivery date associated product. help appreciated. thanks!

php

<div class="row-fluid"> <?php foreach ($products $product) : ?> <!-- prod grid ============================================================ --> <!-- prod. item --> <div class="col-sm-6 container-cart"> <div class="thumbnail"> <!-- image container--> <?php if ($product->image_url): ?> <img src="<?=$product->image_url ?>" /> <?php endif // image_url ?> <!--end image container--> <!-- caption --> <div class="caption"> <div class="well"> <h3 class="product-title"><?= $product->title ?></h3> <p class="product-description"><?= $product->description ?></p> </div> <div class="row-fluid"> <div class="input-group input-group-sm scrow"> <p class="lead"> <span id="item-price">$<?= money_format('%i', $product->price) ?></span> <input type="hidden" class="price-integer form-control" value="<?= money_format('%i', $product->price) ?>"> </p> </div> <div class="input-group input-group-sm scrow"> <span class="input-group-addon">quantity</span> <input type="text" name="surgecart_products[<?=$product->id ?>]" id="quantity" class="quantity form-control" autocomplete="off" value="<?=$_post['surgecart_products['. $product->id . ']'] ?>"> </div> <div class="input-group input-group-sm scrow"> <span class="input-group-addon">delivery date</span> <input type="text" name="surgecart_products[<?=$product->id ?>]" id="datepicker" class="delivery-date form-control" autocomplete="off" value="<?=$_post['surgecart_products['. $product->id . ']'] ?>"> </div> <div class="input-group input-group-sm scrow"> <span class="input-group-addon">$</span> <input type="text" name="base-total" id="base-total" class="readonly base-total form-control" value="" readonly> <span class="input-group-addon">.00</span> </div> </div> </div> <!--end caption --> </div> <!-- end: thumbnail --> </div> <?php endforeach // products ?> <!-- prod. item --> </div>

and of course of study datepicker:

$(function() { $( "#datepicker" ).datepicker(); });

php wordpress datepicker

sbt - Why are no tests executed after migration from Play 2.2.2 to 2.3 with activator test? -



sbt - Why are no tests executed after migration from Play 2.2.2 to 2.3 with activator test? -

i upgraded application play 2.2.2 2.3. app running well.

sometimes activator test gives next output:

[info] loading project definition /users/myapp/project [info] set current project myapp (in build file:/users/myapp/) [info] compiling 23 scala sources , 180 java sources /users/myapp/target/scala-2.10/classes... [info] compiling 55 java sources /users/myapp/target/scala-2.10/test-classes... [success] total time: 112 s, completed 24 juin 2014 17:53:06

and that's it... no tests run. if seek run testonly, not found.

plus, if don't alter file, each time seek test app, source recompiled. not case play 2.2.

i don't have more logs show. when seek test activator ui have more logs no test run either.

if delete manually folders project/project, project/target , target, , run command activator test, next errors every test class:

[error] execution of test functional.actor.usereditinformationtest failed: java.lang.classnotfoundexception: functional.actor.usereditinformationtest [error] @ java.net.urlclassloader$1.run(urlclassloader.java:366) [error] @ java.net.urlclassloader$1.run(urlclassloader.java:355) [error] @ java.security.accesscontroller.doprivileged(native method) [error] @ java.net.urlclassloader.findclass(urlclassloader.java:354) [error] @ java.lang.classloader.loadclass(classloader.java:425) [error] @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308) [error] @ java.lang.classloader.loadclass(classloader.java:358) [error] @ com.novocode.junit.junitrunner$1.execute(junitrunner.java:120) [error] @ sbt.forkmain$run$2.call(forkmain.java:294) [error] @ sbt.forkmain$run$2.call(forkmain.java:284) [error] @ java.util.concurrent.futuretask.run(futuretask.java:262) [error] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) [error] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) [error] @ java.lang.thread.run(thread.java:744) [info] functional.actor.usereditinformationtest [info] ! functional.actor.usereditinformationtest [error] sbt.forkmain$forkerror: functional.actor.usereditinformationtest [error] @ java.net.urlclassloader$1.run(urlclassloader.java:366) [error] @ java.net.urlclassloader$1.run(urlclassloader.java:355) [error] @ java.security.accesscontroller.doprivileged(native method) [error] @ java.net.urlclassloader.findclass(urlclassloader.java:354) [error] @ java.lang.classloader.loadclass(classloader.java:425) [error] @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308)

how can prepare issue?

edit build.sbt file :

name := "myapp" version := "1.0.0" scalaversion := "2.10.4" offline := true // play core dependencies librarydependencies ++= seq( javajdbc, javaebean, cache ) // specific dependencies librarydependencies ++= seq( ... ) lazy val root = (project in file(".")).enableplugins(playjava) jacoco.settings parallelexecution in jacoco.config := false fork in test := true javaoptions in test += "-dconfig.file=conf/application.test.conf" testoptions in jacoco.config += tests.setup( () => system.setproperty("config.file", "conf/application.test.conf") )

i experienced same problem upgrading application play 2.2.1 2.3.7. somehow seems eclipse interfering. personal solution quit eclipse, , quit activator console too. run

activator clean activator cleanfiles

then

activator test

or

activator testonly <package>.<testclass>

sometimes not work @ fist attempt. when activator finds (and runs) tests, works smoothly, , can 1 time again turn on activator console , eclipse.

i hope help...

update

every time write new test class, testonly not find it. need run first combination clean - cleanfiles create testonly find (no necessity turn off eclipse in case).

sbt playframework-2.3

Bootstrap 3 navbar - how to style LI elements? -



Bootstrap 3 navbar - how to style LI elements? -

i've created own css override of bootstrap.min.css styling. i've managed alter things navbar height:

.navbar {height:100px;background-color:#d44043;opacity: 0.9;}

however i'm struggling find how alter things active state color, height of ul (which seems stuck @ 50px), ul text colors, hover colors, caret colors...

is there css reference of somewhere? can't see on getbootstrap.com site. appreciate advice, give thanks you. nj

.navbar>li>a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } .navbar>li{ float:left; position:relative; } utilize these codes style navbar li customize navbar li css codes here .navbar>li{ css.. } .navbar>li>a{ css.. }

twitter-bootstrap

javascript - Google Tag Manager submit form data -



javascript - Google Tag Manager submit form data -

i'm trying implement gtm passed values search form after post request.

datalayer.push({'event': 'check-availability', 'avcheckin': 'april 3, 2014', 'avcheckout': 'april 7, 2014', 'location': 'form name’, 'guests': '2', 'propertyname': 'property name'});

how create tag, rule , macros in gtm

gtm works javascript, not grab post values. you'd need grab values serverside, render them page code key/value paris in datalayer. can create new macros if datalayer type , values specifying key.

you might alter form utilize method, in case grab parameters via url macros (macro type "url", component type "query", "query key" key variable want url).

but long you're using post values there no way gtm alone, you'd need sort of server side scripting output values page code.

javascript seo google-tag-manager

c - sizeof Pointer differs for data type on same architecture -



c - sizeof Pointer differs for data type on same architecture -

i have been going through posts , noticed pointers can different sizes according sizeof depending on architecture code compiled , running on. seems reasonable plenty me (ie: 4-byte pointers on 32-bit architectures, 8-byte on 64-bit, makes total sense).

one thing surprises me size of pointer can different based on info type points to. have assumed that, on 32-bit architecture, pointers 4-bytes in size, turns out function pointers can different size (ie: larger have expected). why this, in c programming language? found article explains c++, , how the programme may have cope virtual functions, doesn't seem apply in pure c. also, seems utilize of "far" , "near" pointers no longer necessary, don't see entering equation.

so, in c, justification, standard, or documentation describes why not pointers same size on same architecture?

thanks!

the c standard lays downwards law on what's required:

all info pointers can converted void* , without loss of information. all struct-pointers have same representation+alignment , can converted each other. all union-pointers have same representation+alignment , can converted each other. all character pointers , void pointers have same representation+alignment.

all pointers qualified , unqualified compatible types shall have same representation+alignment. (for illustration unsigned / signed versions of same type compatible)

all function pointers have same representation+alignment , can converted other function pointer type , again.

nothing more required. commission arrived @ these guarantees examining current implementations , machines , codifying many guarantees could.

on architectures pointers naturally word pointers instead of character pointers, info pointers of different sizes. on architectures different size code / info spaces (many micro-processors), or additional info needed invoking functions (like itanium, though hide behind data-pointer), code pointers of different size info pointers.

c pointers sizeof

java - troubles with variables in PHP -



java - troubles with variables in PHP -

i new in php java background. in confusion next code:

class pupil { //public $name; public function __construct($name) { $this->name=$name; } public function showname() { echo $this->name; } }

on above code if comment line public $name; still works. however, in java not supposed work. want understand behavior in php.

php uses implicit declaration of properties. can declare , assign property anywhere (even outside class).

<?php $object1 = new user(); $object1->name = "alice"; echo $object1->name; class user {} ?>

would work fine , print "alice"...

java php

inheritance - Initializing objects using a super class instead of the subclass -



inheritance - Initializing objects using a super class instead of the subclass -

i saw illustration code , didn't know how i'd able find reply question had. in code dog object, cow object , snake object declared animal objects. valid declare object using more generic class? instance, declare object object (since classes subclasses of object class)? advantages/disadvantages of declaring specific or more general? ease of readability?

class animal { void whoami() { system.out.println("i generic animal."); } } class dog extends animal { void whoami() { system.out.println("i dog."); } } class cow extends animal { void whoami() { system.out.println("i cow."); } } class snake extends animal { void whoami() { system.out.println("i snake."); } } class runtimepolymorphismdemo { public static void main(string[] args) { animal ref1 = new animal(); animal ref2 = new dog(); animal ref3 = new cow(); animal ref4 = new snake(); ref1.whoami(); ref2.whoami(); ref3.whoami(); ref4.whoami(); } } output generic animal. dog. cow. snake.

you instantiate every other class object, not primitives, though have wrappers create them classes.

it's not object oriented practice because want programme fail safe possible.

put more varied methods classes , that's when start see problems.

lets dog has method chewbutt().

animal dog = new dog(); dog.chewbutt();

no problem there. that's not you're allowed do.

animal dog = new cow();

that compiles...

dog.chewbutt();

now have problem. cow can't reach butt.

you want stringent possible when declaring superclass loose plenty job done fast. reason may want looser this.

dogs , snakes little different. i'mma create new subclass mammal extends animal. set dog , cow , whatever else in it.

now can assured can do:

mammal mouse = new mouse(); mouse.suckleyoung(); cat.suckleyoung(); whale.suckleyoung();

but if accidentally try:

mammal snake = new snake();

i want compiler complain before dig myself coding hole.

i hope helps. experience fire points brain enough.

object inheritance declaration

r - Using glmer for logistic regression, how to verify response reference -



r - Using glmer for logistic regression, how to verify response reference -

my question quite simple, i've been unable find clear reply in either r manuals or online searching. there way verify reference response variable when doing logistic regression glmer?

i getting results consistently run exact opposite of theory , think response variable must reversed intention, have been unable verify.

my response variable coded in 0's , 1's.

thanks!

you simulate info know true effects ... ?simulate.mermod makes relatively easy. in case,

the effects interpreted in terms of effect on log-odds of response of 1 e.g., slope of 0.5 implies 1-unit increment in predictor variable increases log-odds of observing 1 rather 0 0.5. for questions of sort, glmer inherits framework glm. in particular, ?family states:

for ‘binomial’ , ‘quasibinomial’ families response can specified in 1 of 3 ways:

1. factor: ‘success’ interpreted factor not having first level (and hence of having sec level). 2. numerical vector values between ‘0’ , ‘1’, interpreted proportion of successful cases (with total number of cases given ‘weights’). 3. two-column integer matrix: first column gives number of successes , sec number of failures.

your info (common) special case of #2 (the "proportion of successes" either 0 or 100% each case, because there 1 case per observation; weights vector vector of ones default).

r logistic-regression lme4

Android: Catching uncaught exception, sending stacktrace to server, and still using default behavior -



Android: Catching uncaught exception, sending stacktrace to server, and still using default behavior -

is doing of in 1 possible? can't seem work. how catching uncaught exceptions:

public class myapplication extends application { private uncaughtexceptionhandler defaulthandler; public void oncreate() { defaulthandler = thread.getdefaultuncaughtexceptionhandler(); // setup handler uncaught exceptions thread.setdefaultuncaughtexceptionhandler(new thread.uncaughtexceptionhandler() { @override public void uncaughtexception(thread thread, throwable e) { handleuncaughtexception(thread, e); } }); } public void handleuncaughtexception(thread thread, throwable e) { intent crashreportintentservice = new intent(this, sendcrashreportintentservice.class); author writer = new stringwriter(); printwriter printwriter = new printwriter(writer); e.printstacktrace(printwriter); string s = writer.tostring(); crashreportintentservice.putextra(sendcrashreportintentservice.stack_trace, s); startservice(crashreportintentservice); defaulthandler.uncaughtexception(thread, e);// allow default handle , crash app } }

so grab it, stack trace, effort fire off service. after phone call startservice phone call defaulthandler.uncaughtexception() default "unfortunately app has crashed" message pop up. however, seems service never called.

this part of service looks like:

@override protected void onhandleintent(intent intent) { log.i(tag, "***** sendcrashreportintentservice: in onhandleintent!"); handleuncaughtexception(intent.getstringextra(stack_trace)); }

i have breakpoints never called , i'm getting no hits in database.

android exception android-service uncaught-exception

javascript - passing canvas image to php -



javascript - passing canvas image to php -

i'm going upload canvas image mysql. using php, before that, how can pass canvasdata php. i've done searching, of solution complicated me. that's why decide post question on here. i'm doing in localhost environment.

there capture button when click on it, activate function. capture canvas photo.

function() { context.drawimage(video, 0, 0, 300, 200); var canvasdata = canvas.todataurl("image/png"); }

as know right canvasdata variable base64 code.

what best solution me pass info php me upload database. give thanks in advance.

js side:

context.drawimage(video, 0, 0, 300, 200); var canvasdata = canvas.todataurl("image/png"), xhr = new xmlhttprequest(); xhr.open('post', url, true); xhr.onload = function() { alert('hooray! uploaded.'); } xhr.send(canvasdata);

php side illustration can take here get image base64 string

javascript php html5 canvas

html - Repeating background image on a svg rect element that is using clip-path -



html - Repeating background image on a svg rect element that is using clip-path -

i want add together repeating background image svg rect element using clip-path. svg file must have viewbox attribute.

see fiddle (http://jsfiddle.net/tbbtester/es9cb/2/) - want triangle have background looks similar rectangle - using same image background, why different?

html:

<p></p> <div class="section-top"> <div> <svg viewbox='0 0 100 50' preserveaspectratio="none"> <rect x="0" y="0" height="50" width="100" /> <defs><clippath id="section2a"><polygon points='0,0 100,5 100,50 '/></clippath> <pattern patternunits="userspaceonuse" id="pat1" x="0" y="0" width="1px" height="1px"> <image width="1px" height="1px" xlink:href="http://svgtest.tbb.dev.novicell.dk/bg.png" /> </pattern> </defs> </svg> </div> </div>

css:

.section-top{position:absolute;width:100%;top:250px;} .section-top div{height:0;position: relative;padding-top:50%;} svg{height: 100%;display:block;width: 100%;position: absolute;top:0;left:0;} rect{stroke:none;fill:url(#pat1);clip-path: url(#section2a);} p{height:200px;background: url(http://svgtest.tbb.dev.novicell.dk/bg.png);}

there isn't way create pattern not scale along svg. affected viewbox , preserveaspectratio settings same else.

if knew in advance scaling going be, apply inverse of transform in patterntransform attribute. otherwise, out of luck,.

html css svg viewbox

jquery - Fixed position div getting hidden for the smaller screen -



jquery - Fixed position div getting hidden for the smaller screen -

my code

i have created basic construction of html using bootstrap.

my issue when height of drop downwards in larger screen bottom part of drop downwards gets hidden header set using position: fixed.

i have lastly alternative add together scroll drop downwards if height greater screen.

i wants drop downwards scroll when larger screen. header position: fixed not able scroll drop down.

is there way out of this? give thanks you.

you can seek doing this

what did on window scroll calculated difference between height of screen , drop down.

and moved drop downwards using difference.

here code it.

jquery

var lastscrolltop = 0; $(window).scroll(function () { var pageheight = $(window).height() - $('.navbar').height(); if ($(window).height() < $('.dropdown-menu').height() && $('.dropdown-menu').height() > pageheight && $('#dropdownbtn').hasclass('activebtn')){ var scrollmove = $('.dropdown-menu').height() - pageheight; $('.dropdown-menu ').css('margintop',-scrollmove); } var st = $(this).scrolltop(); if (st < lastscrolltop){ $('.dropdown-menu').css('margintop','0'); } lastscrolltop = st; })

jquery html css css-position

C++ Visual studio 2012 to Linux -



C++ Visual studio 2012 to Linux -

i have project in c++ (including openmp) created in visual studio 2012. please easiest way create makefile files , project executed in linux?

my suggestion write makefile manually. unless project huge (e.g. 1000000 lines of source code), quite easy. this , that , that examples should help.

caveat: tab character important in makefile-s. utilize editor knowing (e.g. emacs)

and gnu create has documentation tutorial section.

you need add together -fopenmp cxxflags (or compile & link cxx=gcc -fopenmp)

ps: cmake (like automake) makefile generator. often, easier write them (i.e. makefile-s) hand.

c++ linux visual-studio-2012 gcc makefile

Checkboxlist in Lightswitch HTML client -



Checkboxlist in Lightswitch HTML client -

i'm new lightswitch please bear me if stupid, or obvious question. question lightswitch html client - not desktop client.

i have scenario have article can tagged against 1 or more destinations (countries). ideally, when adding or editing article, there multiple tabs. 1 details (title, standfirst, body etc.) , 1 tagging. i'd implement using checkboxlist.

any ideas on how implement scenario in lightswitch much appreciated.

many thanks

hope helps:

the default command type boolean info type flipswitch control, can substitute checkbox using custom control.

in screen designer, take node boolean field, , alter command type flipswitch custom control. in properties window, in height section, take min , come in 100.this necessary because checkbox command taller standard textbox control. if form uses other command types, may need adjust value. in general section, take edit render code link. in code editor, add together next code render method: javascript

// create checkbox , add together dom. var checkbox = $("<input type='checkbox'/>") .css({ height: 20, width: 20, margin: "10px" }) .appendto($(element)); // determine if alter initiated user. var changingvalue = false; checkbox.change(function () { changingvalue = true; contentitem.value = checkbox[0].checked; changingvalue = false; }); contentitem.databind("value", function (newvalue) { if (!changingvalue) { checkbox[0].checked = newvalue; } });

if you’re displaying checkbox required field on add/edit screen, you’ll want set initial value control, otherwise user may validation error. set initial value, in entity designer, on perspective bar, take htmlclient tab. in write code list, take created. in code editor, set initial values adding code created method: javascript entity.fieldname = new boolean(); entity.fieldname = 'true'; replace fieldname name of boolean field. initialize command unchecked state, replace true false.

visual-studio-lightswitch lightswitch-2013

javascript - Add function to the view model in order to set the OptionText in a select element -



javascript - Add function to the view model in order to set the OptionText in a select element -

i have next view model:

var viewmodel = function (list) { var self = this; self.selected = ko.observable(""); self.items = ko.observablearray(list); }

and html:

<select data-bind="options: items, optionsvalue: 'id', optionstext: function(item) { homecoming item.id + ' - ' + item.name }, value: selected">

note code below working perfectly.

i refectoring , optimize moving optionstext function within view model.

so tried (unsuccessfully) that:

view model:

var viewmodel = function (list) { var self = this; self.selected = ko.observable(""); self.items = ko.observablearray(list); self.displayname = function (item) { homecoming item.id + ' - ' + item.name; } }

html:

<select data-bind="options: items, optionsvalue: 'id', optionstext: displayname (item???), value: selected">

the problem cannot grab current item beingness rendered, cannot send function...

i know if each item view model move displayname function item view model (making computed function).

anyone know how it? or if possible it?

you need provide reference function knockout able pass current item:

optionstext: displayname

html:

<select data-bind="options: items, optionsvalue: 'id', optionstext: displayname, value: selected">

working fiddle

javascript html knockout.js

linux - Meaning of <<>> in x86 disassembly -



linux - Meaning of <<< and >>> in x86 disassembly -

i can't seem understand >>> , <<< characters seem in x86 disassembly

for example:

cmp byte ptr [eax+33h],0 je -126cb479h >>> +33

or

lea esi,dword ptr [ecx+0ch] <<< +19

i understand basic instruction here; jump when equal appears after compare , load effective address >>> , <<< confusing me. guidance helpful. give thanks you.

they're indicators of jump destinations. it's simplistic form of ida pro's output, similar many clones.

cmp byte ptr [eax+33h],0 je -126cb479h >>> +33

this indicates destination of je command +33 bytes farther downwards (>>> going somewhere...)

lea esi,dword ptr [ecx+0ch] <<< +19

this indicates instruction destination (<<< - coming from) of jump/branch/call +19 bytes farther down. 19 bytes later, 19 bytes higher in memory... idea...

they not part of standard assembly language, personally, indicators should used comment delimiter. example:

cmp byte ptr [eax+33h],0 je -126cb479h ; >>> +33 lea esi,dword ptr [ecx+0ch] ; <<< +19

pretend you're drawing lines showing logic flow...

cmp byte ptr [eax+33h],0 je -126cb479h ; >>> +33 ---+ | ; many wonderful , varied instructions here | | hlt ; <<< -33 ---+

does help?

linux assembly x86

postgresql - SQL: conditional SELECT -



postgresql - SQL: conditional SELECT -

i utilize next sql query receive entries older payment_target days.

select * orders where(extract(epoch age(current_date, date_trunc('day', orders.created_at))) - orders.payment_target*86400 >= 0)

however, want modify query in way orders.invcoice_sent_at used calculation basis if not null. otherwise, `orders.created_at' should used.

i tried next query guess more pseudo code valid sql. don't know how can set attribute used in statement block.

select * orders (extract(epoch age(current_date, date_trunc('day', if orders.invoice_sent_at not null begin orders.invoice_sent_at end else begin orders.created_at end ))) - orders.payment_target*86400 >= 0)

instead of if can utilize coalesce work on every database supporting ansi sql:

coalesce( orders.invoice_sent_at, orders.created_at) - orders.payment_target*86400 >= 0)

sql postgresql

CSS Positioning: Creating exact overlap with negative margin is off by several pixels -



CSS Positioning: Creating exact overlap with negative margin is off by several pixels -

i have 2 divs want overlap horizontally using negative margin-left.

html:

<div id=one></div> <div id=two></div>

css:

body{margin:0px;padding:0px,border:0px} #one {width:100px;height:100px;background-color:red;} #two {width:100px;height: 50px;background-color:blue;} #one,#two{display:inline-block;} #two{margin-left:-100px;}

before negative margin each div 100px wide:

after negative margin divs 4px overlapping exactly:

why setting negative margin on sec div not cause overlap first div?

btw, i'm experimenting margin-left...i know can absolutely position 2 divs within relative wrapper.

thanks in advance enlightenment!

inline block has weird "bug" phone call it, applies 4px space between elements assuming default font-size. created line-break between div's. you'll find can prepare quite making negative higher.

margin-left: -104px;

this prepare issue, it's not way prepare it.

you this... instead of:

<div id=one></div> <div id=two></div>

delete line-break between div's this:

<div id=one></div><div id=two></div>

this prepare issue.

you alternatively set font-size of containing element 0.

html:

<div class="container"> <div id=one></div> <div id=two></div> </div>

css:

.container { font-size: 0; }

but wait! there more. comment out line-break.

<div id=one></div><!-- --><div id=two></div>

you drop ending > origin of next element.

<div id=one></div ><div id=two></div>

css

c# - Update panel doesn't work in asp.net -



c# - Update panel doesn't work in asp.net -

i trying show online train in page without refresh. think have utilize updatepanel. panel should updated every second.

let explain code.

i set part of code in page:

<asp:scriptmanager id="scriptmanager1" runat="server"></asp:scriptmanager> <asp:updatepanel id="updatepanel1" runat="server" onload="updatepanel1_load"> <contenttemplate> </contenttemplate> </asp:updatepanel>

so set interval function refresh panel this,

<script type="text/javascript"> $(function () { setinterval("__dopostback('<%=updatepanel1.clientid%>', '');", 1000); });

in code behind set fetched data,

protected void updatepanel1_load(object sender, eventargs e) { foreach (var t in onlinetrainlist) { response.write("<div id='train-box' style='margin-left:" + (t.xtrainlocation - 8) + "px;margin-top:" + t.ytrainlocation + "px;background:" + t.train.traincolor + "'>" + "<span>" + t.trainid + "</span>" + "</div>"); list<sensor> passedsensor = new list<sensor>(); passedsensor = sensorrepository.findby(i => i.currenttrainid == t.trainid).tolist(); string color = trainrepository.findby(i => i.id == t.trainid).first().traincolor; foreach (sensor sensor in passedsensor) { response.write("<div class='currentcolor-sensor' style='margin-left:" + (sensor.xlocation - 1) + "px;margin-top:" + (sensor.ylocation + 8) + "px;background:" + color + "'></div>"); } } }

so problem panel doesn't refresh .and panel updatepanel1_load phone call 1 time.

so code is:

foreach (var t in onlinetrainlist) { response.write("<div id='train-box' style='margin-left:" + (t.xtrainlocation - 8) + "px;margin-top:" + t.ytrainlocation + "px;background:" + t.train.traincolor + "'>" + "<span>" + t.trainid + "</span>" + "</div>"); list<sensor> passedsensor = new list<sensor>(); passedsensor = sensorrepository.findby(i => i.currenttrainid == t.trainid).tolist(); string color = trainrepository.findby(i => i.id == t.trainid).first().traincolor; foreach (sensor sensor in passedsensor) { response.write("<div class='currentcolor-sensor' style='margin-left:" + (sensor.xlocation - 1) + "px;margin-top:" + (sensor.ylocation + 8) + "px;background:" + color + "'></div>"); } }

first thing must bring attending id assign divs, must unique , never same. utilize increment variable , append div's id eg: div0, div1... etc

now lets have @ first row within loop. has, <span> nested within <div> , containing attributes text.

the asp.net way of handling elements object oriented instead of html string:

protected void updatepanel1_load(object sender, eventargs e) { //clear update panel updatepanel1.contenttemplatecontainer.controls.clear(); //var generate unique div id's int dividincrement = 0; foreach (var t in onlinetrainlist) { //increment id generator dividincrement++; // create a div element htmlgenericcontrol _tempdiv = new htmlgenericcontrol("div"); //set attributes div _tempdiv.id = "train-box" + dividincrement.tostring(); _tempdiv.style["margin-left"] = (t.xtrainlocation - 8).tostring() + "px"; _tempdiv.style["margin-top"] = t.ytrainlocation.tostring() + "px"; _tempdiv.style["background"] = t.train.traincolor.tostring(); //create inner span htmlgenericcontrol _tempspan = new htmlgenericcontrol("span"); //set span's innertext _tempspan.innertext = t.trainid.tostring(); //add span div _tempdiv.controls.add(_tempspan); //add div updatepanel updatepanel1.contenttemplatecontainer.controls.add(_tempdiv); list<sensor> passedsensor = new list<sensor>(); passedsensor = sensorrepository.findby(i => i.currenttrainid == t.trainid).tolist(); string color = trainrepository.findby(i => i.id == t.trainid).first().traincolor; foreach (sensor sensor in passedsensor) { // create div sub stuff htmlgenericcontrol _tempsubdiv = new htmlgenericcontrol("div"); _tempsubdiv.attributes["class"] = "currentcolor-sensor"; _tempsubdiv.style["margin-left"] = (sensor.xlocation - 1).tostring() + "px"; _tempsubdiv.style["margin-top"] = (sensor.ylocation + 8).tostring() + "px"; _tempsubdiv.style["background"] = color.tostring(); //add sub stuff update panel updatepanel1.contenttemplatecontainer.controls.add(_tempsubdiv); } } }

c# asp.net updatepanel

javascript - Cascading dropdown lists in Mvc 4.0 -



javascript - Cascading dropdown lists in Mvc 4.0 -

i have been trying cascade dropdown lists. purpose using javascript in .cshtml page . don't know reason , i'm not able phone call js method , leave lone controller method later needs called within js method. dropdowns fetching state , city info i'm not getting city according state selected.

class="lang-html prettyprint-override"><div class="editor-label"> @html.labelfor(model => model.state_id) </div> <div class="editor-field"> @html.dropdownlist("state",null,"select state", new {@class="span4", id="state"}) @html.validationmessagefor(model => model.state_id) </div> <div class="editor-label"> @html.labelfor(model => model.cityid) </div> <div class="editor-field"> @html.dropdownlist("city",null,"select city", new {@class="span4", id="city"}) @html.validationmessagefor(model => model.cityid) </div> <script src="~/scripts/jquery-1.7.1.js"></script> <script src="~/scripts/jquery-1.7.1.min.js"></script> <script type="text/javascript" > $(document).ready(function(e) { $("#state").change(function (e) { var selectedvalue = $(this).val(); if(selectedvalue != "select") { $.ajax({ url: '@url.action("getcities","employer")', type: 'post', //data: { "selectedvalue": selectedvalue}, data: {id: $("#state").val()}, datatype: 'json', success: function(response) { var items = ""; $.each(response, function(i, city) { $("#city").append('<option value="' + city.value + '">' + city.text + '</option>'); }); }, error: function (ex) { alert("failed receive states" + ex); } }); } }); }); </script>

@html.dropdownlistfor(x => x.leagueid, model.leaguesl, "--select league--", new { id = "ddlleague"}) @html.dropdownlistfor(x => x.leagueid, model.divisionsl, "--select division--", new { id = "ddldivision"})

the sec dropdownlist empty, has alternative label --select division--

on alter event of 1st dropdown create ajaxrequest fills sec one.

var value = $("#dropdown1").val(); var ddldivision = $("#dropdowndivision"); ddldivision.html('');//clear current contents; $.ajax({ url: "/home/getdivisions", type: "get", data: { leagueid: value }, success: function (data) { $.each(data, function (index, item) { //item = //populate ddl ddldivision.append($('<option></option>') .val(item.proptwo) .html(item.propone)); }); }); public jsonresult getdivisions(int leagueid) { using (baseballentities context = new baseballentities()) { var divisions = (from x in context.table x.leagueid == leagueid select new { propone = x.divisionname, proptwo = x.divisionid }).tolist(); homecoming json(divisions, jsonrequestbehavior.allowget); } }

edit: side note improve utilize model fill dropdownlist. give model selectlist property

public list<selectlistitem> leaguesl { get; set; }//you need initialize in constructor public actionresult index() { myviewmodel model = new myviewmodel(); using (myentities context = new myentities()) { var leaguelist = context.league.tolist(); foreach (var item in leaguelist) { model.leaguesl.add(new selectlistitem() { text = item.leaguename, value = item.leagueid.tostring() }); } } homecoming view(model); }

javascript jquery asp.net-mvc-3 asp.net-mvc-4

In R: How to compare a csv file and a list to keep common terms, and to list those separately -



In R: How to compare a csv file and a list to keep common terms, and to list those separately -

i have csv file several columns of data, 1 of wish utilize directly. have read csv file r this:

list1<-readlines("myfile.csv")

should read in though?:

list1<-read.csv(file="myfile.csv",sep=",",head=true)

let's csv file, column 5, lists ("one", "three", "four")

i have list in r this:

list2<-c("one","two","three","three")

i want compare 5th column of csv file list2 , have mutual terms pulled , listed separately. want maintain repeats if mutual term listed more once, illustration "three" listed twice in list2, want list twice in new list well.

i want not list column 5 of csv file entire row contains mutual term column 5.

this best effort not acknowledge if mutual term found more 1 time in csv file, nor list entire row mutual term found in csv file.

list1<-readlines("myfile.csv") list2<-c("one","two","three","three") intersect(list1,list2)

result: one, three

thanks help!

to figure out elements of list2 in column 5 of list1:

list2[list2 %in% list1[,5]]

and rows of list1 there entries in column 5 in list2:

list1[which(list1[,5] %in% list2),]

a little shorter:

list1[list1[,5] %in% list2,]

consider side note: improve practice not phone call these 2 objects list1 , list2 since list1 data.frame , list2 vector , list type of info construction in r (see ?list).

r list csv intercept

python - Pyexiv2 with Multiprocessing -



python - Pyexiv2 with Multiprocessing -

i performing batch of distortion corrections on images using opencv. unfortunately output loses exif metadata. bringing using pyexiv2.

def propagate_exif(infile,outfile): import pyexiv2 msrc = pyexiv2.imagemetadata(infile) msrc.read() print msrc.exif_keys mdst = pyexiv2.imagemetadata(outfile) mdst.read() msrc.copy(mdst,comment=false) mdst.write()

however when running whole code using multiprocessing pyexiv2 crashes while copying on metadata. possible pyexiv2 starts operating on file cloning metadata while opencv still outputting it. best procedure around pyexiv2/opencv concurrent access issues ? parallel function below:

def distortgrid_file(infile,out_dir,mapx,mapy,idealise_matrix=false): outfile = os.path.join(out_dir,os.path.basename(infile)) #read calibration parameters apply_distortion(infile, outfile, mapx,mapy) #preserve exif parameters propagate_exif(infile,outfile)

upgrading latest pyexiv2 fixed issue.

python opencv multiprocessing pyexiv2

vb.net - ASP.net postbackurl to same page outside VS project vs. within -



vb.net - ASP.net postbackurl to same page outside VS project vs. within -

i have been able post same page within script successfully... however, when created web application project in visual studio 2013 express web , run same script, postback doesn't work... page refreshes... also, instead of before url "webform1.aspx" shows "webform" this:

http://localhost:49201/webform1

within project, form tag looks this:

<form method="post" action="webform1" id="form1">

vs outside looks this:

http://localhost:49621/webform1.aspx

and form tag looks this:

<form method="post" action="webform1.aspx" id="form1">

is there weird file extensions need configure postback same page?

edit:

when run programme outside of vs project, posts perfectly.

when add together programme web application project within vs, post doesn't work, page refreshes...

code below:

<asp:button id="button1" runat="server" commandname="submit" postbackurl="~/webform1.aspx" text="button" />

after 7 hours of searching... here's did prepare issue:

create brand new project in vs select framework 4 (versus 4.5 or 4.5.1) add together new item project menu (web form) paste code, update web.config

the script posts, makes no sense, works. hope helps not waste day of life.

asp.net vb.net post visual-studio-2013

Laravel spaces in url -



Laravel spaces in url -

i using laravel framework api resource server.

i have url

http://www.local.dev/method1?parameter1=2014-06-25&parameter2=0&parameter3=313&parameter4=test%20233&parameter5=02-04

however keeps giving me error paramter5 not defined. value of parameter 4 "test 233" space in between. how handle space or encoded space on api server side url?

thanks in advance help

how input parameters?

it works on side next code in controller:

// either \input or input $inputs = input::only('parameter4', 'parameter5'); print_r($inputs);

and code in routing:

route::get('/', function() { $testparam = new namespace\controllername; $testparam->index(); });

my url looks like:

http://dev.local/?parameter1=2014-06-25&parameter2=0&parameter3=313&parameter4=test%20233&parameter5=02-04

laravel-4

angularjs - debug second click - toggle dropdown -



angularjs - debug second click - toggle dropdown -

toggle functions fire on sec click. had problem time ago datetimepicker libary. problem exists bootstrap.

here jade-code:

ul.nav.navbar-nav.navbar-right li.dropdown a(href="#", class="dropdown-toggle", data-toggle="dropdown") einstellungen b.caret ul.dropdown-menu li a(href="#") test

the dropwdown toggles sec click. , dont no have search find mistake. there maybe code observe happend first click?

when user css collapse on hower works fine, first hover :(

ul.nav li.dropdown:hover ul.dropdown-menu{ display: block; margin-top:0px }

the project big post on fiddle :(

i hope can give me advices.

thanks!

one alternative might using angular-ui-bootstrap route instead of trying vanilla bootstrap javascript work angular app. below link angular-ui-bootstrap site; seek implementing 1 of angular-native directives drop downwards , see if trick.

http://angular-ui.github.io/bootstrap/

aside that, it's hard help if can't recreate problem. can seek recreating little version of problem in codepen or jsfiddle?

angularjs twitter-bootstrap-3

WPF datagrid text wrap for all columns -



WPF datagrid text wrap for all columns -

i know how wrap text in datagrid 1 column .. how can in project ... ... code ...

<datagrid name="datagrid1"> <datagrid.columns> <datagridtextcolumn width="*" header="person" binding="{binding path=person}" > <datagridtextcolumn.elementstyle> <style> <setter property="textblock.textwrapping" value="wrap" /> </style> </datagridtextcolumn.elementstyle> </datagridtextcolumn> </datagrid.columns> </datagrid>

paste code in app.xaml. style default applied grid.

<application.resources> <style targettype="datagrid"> <setter property="textblock.textwrapping" value="wrap" /> </style> </application.resources>

wpf datagrid

osx - Git clean single untracked file -



osx - Git clean single untracked file -

i file untracked unlike

git clean

which remove untrack files. best way that.

thanks.

delete (with rm or whatever facility os provides deleting files).

if want maintain file, add together repo's .gitignore file, , git won't seek track anymore.

osx git

Solr exact match regarding words number -



Solr exact match regarding words number -

i've been looking week working solution allow following:

documents: [phrase:"cat"], [phrase:"pussy cat"], [phrase:"cats"]

search query: "cat" => results: "cat", "cats" (but not "pussy cat")

search query: "cats" => results: "cats", "cat" (but not "pussy cat")

i saw several suggestions on web on how accomplish this. somewhere saw suggestion insert marker tokens @ origin , end of field values when indexing, , "phrase queries" include marker tokens. in other place saw suggestion calculate number of unique terms in each document.

i find sec suggestion (with calculating words) quite complicated, , cannot recognize on how utilize first suggestion.

so question give hint on how implement "exact match regarding requested words number , using stemming (word forms)" in solr?

any thoughts appreciated.

well have solved problem follows (with prefixes , suffixes):

in solrconfig.xml:

<updaterequestprocessorchain name="exact"> <processor class="solr.clonefieldupdateprocessorfactory"> <str name="source">phrase</str> <str name="dest">phraseexact</str> </processor> <processor class="solr.regexreplaceprocessorfactory"> <str name="fieldname">phraseexact</str> <str name="pattern">^(.*)$</str> <str name="replacement">_prefix_ $1 _suffix_</str> <bool name="literalreplacement">false</bool> </processor> <processor class="solr.logupdateprocessorfactory" /> <processor class="solr.runupdateprocessorfactory" /> </updaterequestprocessorchain> <!-- other contents of solrconfig.xml... --> <requesthandler name="/update" class="solr.updaterequesthandler"> <lst name="defaults"> <str name="update.chain">exact</str> </lst> </requesthandler>

in schema.xml:

<field name="phrase" type="text_en" indexed="true" stored="true"/> <field name="phraseexact" type="text_en" indexed="true" stored="true"/>

after changes needed restart solr instance re-index (re-add) documents.

now have documents this:

{ "phrase": "test", "id": "9c95fac2ed78149c", "phraseexact": "_prefix_ test _suffix_", "_version_": 1471599816879374300 }, { "phrase": "test phrase", "id": "9c95fac2ed78123c", "phraseexact": "_prefix_ test phrase _suffix_", "_version_": 1471599816123474300 },

if search documents queries like

"q=phraseexact:"_prefix_ test _suffix_" "q=phraseexact:"_prefix_ testing _suffix_" "q=phraseexact:"_prefix_ tests _suffix_"

we receive {"phrase":"test"} document (and not {"phrase":"test phrase"})

solr exact-match

ruby - Regex help: Targeting text between *| and |* -



ruby - Regex help: Targeting text between *| and |* -

i'd love help me regex. i'd able isolate regex observe characters in string below between * | , | *:

hello "*|first_name||default_value|*"

i appreciate help.

use this:

if subject =~ /\*\|\k.*?(?=\|\*)/ match = $&

see demo.

\*\| matches *| \k tells engine drop matched far match report .*? lazily matches to... a point lookahead (?=\|\*) can assert follows |*

reference

lookahead , lookbehind zero-length assertions mastering lookahead , lookbehind

ruby regex

Why check "Create new baselines" when creating a new snapshot in RTC source control -



Why check "Create new baselines" when creating a new snapshot in RTC source control -

when creating new snapshot difference checking "create new baselines" create ?

if unchecked, snapshot created , components in snapshot backed , created baselines ?

if checked new baselines created seem created when "create new baselines" checked.

as per this thread

a snapshot set of baselines (each baseline different component). it's clearcase phone call "composite baseline".

you can snapshot state of either workspace or stream, whichever prefer. automatically create baselines when needed, i.e., when current configuration of component in workspace/stream not captured in baseline

so, mentioned in this thread

when create new snapshot, create new baselines in changed components, not in components have no changes.

i suspect checking in "create new baselines" forcefulness creation of baselines all components, including ones @ baseline.

that enforces consistency in name of baselines included in snapshot.

version-control rtc

r - How to use grid.gradientFill -



r - How to use grid.gradientFill -

i'm trying utilize function grid.gradientfill gridsvg package, unfortunately i'm not able see gradient in svg output.

i'm not sure if code right or browser not work (chrome: 35.0.1916.153 m), can please give advise?

here r code:

library(grid) library(gridsvg) lg <- lineargradient(col = c("black", "white", "black")) x <- c(0.2,0.2,0.35,0.5,0.65,0.8,0.8,0.65,0.5,0.35) y <- c(0.5,0.6,0.61,0.7,0.81,0.8,0.7,0.71,0.6,0.51) s <- c(0,0,-1,0,-1,0,0,-1,0,-1) grid.newpage() vp <- viewport(width=0.75, height=0.75) pushviewport(vp) grid.rect(gp=gpar(col="blue")) pushviewport(viewport(layout.pos.col=1, layout.pos.row=1)) grid.rect(x = unit(0.5, "npc"), y = unit(0.5, "npc"), width = unit(1, "npc"), height = unit(1, "npc"), = "centre", default.units = "npc", gp=gpar(col="green", fill = "blue"), draw = true, name = "tom") grid.xspline(x = x, y = y,shape=s, open=false, gp=gpar(col=na, fill="darkred"), name="spline") grid.gradientfill("spline", lg) grid.gradientfill("tom", lg) grid.export("c:/@temp/somekindofgradient.svg")

i'm interested in giving spline gradient ...

any hint appreciated :-)

so, found solution :-)

if want use

grid.gradientfill(object, ...)

the object, in question grid.xspline(...) object called "spline" not have have fill parameter, meaning ...

replacing

grid.xspline(x = x, y = y,shape=s, open=false, gp=gpar(col=na, fill="darkred"), name="spline")

with

grid.xspline(x = x, y = y,shape=s, open=false, gp=gpar(col=na), name="spline")

and there beautiful gradient :-)

r r-grid

php - filter_input() $_SERVER["REQUEST_URI"] with FILTER_SANITIZE_URL -



php - filter_input() $_SERVER["REQUEST_URI"] with FILTER_SANITIZE_URL -

i'm filtering $_server["request_uri"] such that:

$_request_uri = filter_input(input_server, 'request_uri', filter_sanitize_url);

as explained in php.net:

filter_sanitize_url

remove characters except letters, digits , $-_.+!*'(),{}|\^~[]`<>#%";/?:@&=.

however,

the browser sends request_uri value urlencode'd , hence not sanitized in filter_input() function. address is

http://www.example.com/abc/index.php?q=abc��123

and sanitized request url is

/abc/index.php?q=abc%ef%bf%bd%ef%bf%bd123

but should be

/abc/index.php?q=abc123

it possible urldecode($_server["request_uri"]) , using filter_var() can sanitized value.

$_request_uri = filter_var(urldecode($_server['request_uri']), filter_sanitize_url);

i don't know why lastly 1 seems me "inelegant" , i'm looking elegant way, sanitizing $_server["request_uri"].

maybe, accessing super global array straight ($_server['request_uri']) while coding disturbs me, "inelegant".

is there elegant way?

i think utilize either mod_rewrite or apaches setenv directive undecode url server side. have effect of changing request_uri in apache , consequently value of $_server["request_uri"] in php.

i dont solution, , dont want this. issues see:

it not allow multiple parameters may have different validation rules. it allows arbitrary parameters. it requires permissions user may not have , changes default server behavior. mod_rewrite seldom solution.

a good solution avoids global phone call filter_input or filter_input_array on input_get (instead of input_server).

$urlparameters = http_build_query( filter_input_array( input_get, filter_sanitize_url ) ); $_request_uri = filter_input(input_server, 'script_url', filter_sanitize_url). ($urlparameters ? "?{$urlparameters}" : ""); print_r($_request_uri);

a better solution whitelist specific parameters , utilize specific rules validation, , utilize these parameters straight (avoiding setting , parsing $_request_uri)

$_request_parameters = filter_input_array( input_get, array( 'q' => filter_sanitize_url, ) ); print_r($_request_parameters['q']);

php global-variables filtering input-sanitization request-uri

extract password protected sfx archive using c# -



extract password protected sfx archive using c# -

i have winrar sfx file. know can extract archive using next code:

process process = new process(); process.startinfo.filename = "unrar.exe"; process.startinfo.arguments = "x file.rar d:\myfolder"; process.start(); process.waitforexit();

but how can extract sfx file when have known password?

you can utilize -p parameter assuming password 123456

process process = new process(); process.startinfo.filename = "unrar.exe"; process.startinfo.arguments = "x -p123456 file.rar d:\myfolder"; process.start(); process.waitforexit();

c# sfx

Datepicker content control - extract value into another document using VBA in Word -



Datepicker content control - extract value into another document using VBA in Word -

i have 2 word documents (doc1.docm) , (doc2.docm). in doc1.docm, select month , year (the format: mmmm yyyy), using date picker content control. defined date picker field "date1".

i trying automnatically update new content field in doc2.docm in header when select month , year in doc1.docm.

i can in same document using doc1.docm when using code:

private sub document_contentcontrolonexit(byval contentcontrol contentcontrol, cancel boolean) dim cctrl contentcontrol if contentcontrol.title = "date1" each cctrl in activedocument.contentcontrols if cctrl.title = "date2" cctrl .lockcontents = false .range.text = format(contentcontrol.range.text, "mmmm yyyy") .lockcontents = true end exit end if next end if end sub

does know how can update doc2.docm when select month , year in doc1.docx?

you have open other word document. can achieved programatically via:

dim worddoc object set worddoc = createobject("word.application") worddoc.documents.open("c:\doc2.docm")

you can manipulate contents of doc2.docm programatically, doing doc1.docm. if wondering why document doesn't show up: it's hidden. create visible have set worddoc.visible = true. don't forget close doc2 1 time changes have been made via worddoc.quit

vba ms-word word-vba

z3 - Z3Py: randomized results (phase-selection) not random? -



z3 - Z3Py: randomized results (phase-selection) not random? -

i tried utilize bit vectors randomized results in model values suggested de moura here z3py instead of smtlib. translated illustration to:

from z3 import * s = solver() x = bitvec('x', 16) set_option('auto_config', false) set_option('smt.phase_selection',5) s.add(ult(x,100)) s.check() s.model() s.check() s.model()

however, result seems same, i.e. - repetitive checking s.check() not alter result. - after restart of python interactive shell result of execution same

adding alter of random seed did not alter results: set_option('smt.random_seed', 123)

does have thought why not working desired?

thanks in advance!

carsten

this case simple. it's solved preprocessor , never gets point needs select phase, random phase selection has no effect. leo's reply cited post little bit out of date , z3 has changed, doesn't replicate using latest unstable version because z3 chooses utilize different solver. can still random behavior if forcefulness utilize incremental solver adding (push) command though; here's updated illustration seed dependent:

(set-option :auto_config false) (set-option :smt.phase_selection 5) (set-option :smt.random_seed 456) (declare-const x (_ bitvec 16)) (assert (bvult x (_ bv100 16))) (push) (check-sat) (get-model) ;; seek 1 time again different model (check-sat) (get-model) ;; seek 1 time again different model (check-sat) (get-model)

z3 z3py

javascript - D3JS - animate a circle along an svg path at a constant speed -



javascript - D3JS - animate a circle along an svg path at a constant speed -

i'd move circle along path using d3.js. used code mike bostocks' website here:

http://bl.ocks.org/kogor/8162640

i'd move circle @ constant speed along path , have moving after has been added svg. cannot see how twist code here create work.

does have thought how this?

best

you should add together line

.ease("linear")

after .duration(7500), , should set.

this documentation on ease(), should read related transitions, while ate @ it...

here test example various possibilities related ease():

javascript animation svg d3.js transition

hibernate - Why I get "Parameter value [appa] did not match expected type [java.lang.Integer (n/a)]"? -



hibernate - Why I get "Parameter value [appa] did not match expected type [java.lang.Integer (n/a)]"? -

i don't understand why error. seems right me. followings class definitions:

@entity @table(name = "product") public class product implements comparable<product>, java.io.serializable { //... protected section department; //... } public class section implements serializable { private string id; //... @id @column(name = "id") public string getid() { homecoming id; } }

and hql:

@suppresswarnings("unchecked") public list<product> findproductsbydepartment(final string deptid, string final int limit) { homecoming entitymanager .createquery( "select product left bring together ... ... , i.department.id = :deptid").setparameter("deptid", deptid).setmaxresults(limit).getresultlist(); }

the exception stack points statement setparameter("deptid", deptid). @id type can string (http://docs.oracle.com/javaee/6/api/javax/persistence/id.html). don't know why expects integer.

check product table (in database), because id field must numeric field (i supoose). mapping string, must alter type integer:

private integer id; //... @id @column(name = "id") public integer getid() { homecoming id; }

java hibernate

ios - how to set different color for tableview cell -



ios - how to set different color for tableview cell -

how can set different color multiple rows in tableview, maybe 10 different colors. figured part alternative row colors.

//alternate row colour if (indexpath.row % 2) { cell.contentview.backgroundcolor = [[uicolor alloc]initwithred:87.0/255.0 green:84.0/255.0 blue:229.0/255.0 alpha:1]; } else { cell.contentview.backgroundcolor = [[uicolor alloc]initwithred:187.0/255.0 green:184.0/255.0 blue:229.0/255.0 alpha:1]; }

int frequency = indexpath.row %10; switch (frequency) { case 0: //color 1 break; case 1: //color 2 break; case 2: //color 3 break; case 3: //color 4 break; //up case 9 default: break; }

alternatively, set array of color objects somewhere , phone call colors[frequency]. same number of code lines, not messy

ios objective-c uitableview ios7.1

customization - Custom department-like structure in NetSuite -



customization - Custom department-like structure in NetSuite -

there need create custom construction in netsuite. construction must closer possible existing section record type. standard classifications occupied, need more classifications.

i created custom record type 2 fields: name , parent. parent points record of same type. question how create nicely formatted name like: "parent_of_the_parent : the_parent : child". need specify parent names in record name. best way accomplish netsuite customization capabilities?

i previous solution suite resources if there 3 levels classifications.

if absolutely need many levels classifications (like departments or class), can create custom record (with inline editing disabled) , utilize script update of sub-classifications alter if edit classification.

for example, if create custom record id = 'customrecord_classification' , have fields (custrecord_classificationname [type=freeformtext], custrecord_classificationparent [type=listrecord] referring new custom record type, , custrecord_classificationfullname [type=freeformtext]), can use/modify next script wrote below. tested , works great, if want utilize error handling, logging, etc. should added.

function beforesubmit(type) { // create sure turn off inline editing on custom record type don't have handle xedit events // context record changed , run when alter made in ui var context = nlapigetcontext(); if (context.getexecutioncontext() == 'userinterface') { // if creating new classification record if (type == 'create' ) { // current record fields: internal id, custrecord_classificationname, custrecord_classificationparent var classificationid = nlapigetrecordid(); var classificationname = nlapigetfieldvalue('custrecord_classificationname'); var parentid = nlapigetfieldvalue('custrecord_classificationparent'); // check if classification has parent specified var hasparent = parentid.length == 0 ? false : true; var classificationfullname; // if classification has parent specified lookup parent's total name , append new classification name if (hasparent == true) { var parentfullname = nlapilookupfield('customrecord_classification', parentid, 'custrecord_classificationfullname'); classificationfullname = parentfullname + ' : ' + classificationname; } // if classification not have parent total name equal name else { classificationfullname = classificationname; } // set classification total name on current record nlapisetfieldvalue('custrecord_classificationfullname', classificationfullname); } // if editing existing classification record else if (type = 'edit') { var classificationid = nlapigetrecordid(); // recored before record edited grab old value total classification name var previousclassificationrecord = nlapigetoldrecord(); var oldclassificationfullname = previousclassificationrecord.getfieldvalue('custrecord_classificationfullname'); var classificationname = nlapigetfieldvalue('custrecord_classificationname'); var parentid = nlapigetfieldvalue('custrecord_classificationparent'); var hasparent = parentid.length == 0 ? false : true; var classificationfullname; if (hasparent == true) { var parentfullname = nlapilookupfield('customrecord_classification', parentid, 'custrecord_classificationfullname'); classificationfullname = parentfullname + ' : ' + classificationname; } else { classificationfullname = classificationname; } nlapisetfieldvalue('custrecord_classificationfullname', classificationfullname); var filters = new array(); var columns = new array(); // filter saved search classifications have total classification name origin old classification name filters[0] = new nlobjsearchfilter( 'custrecord_classificationfullname', null, 'startswith', oldclassificationfullname ); // create sure current record not 1 of records returned filters[1] = new nlobjsearchfilter( 'internalid', null, 'noneof', classificationid ); columns[0] = new nlobjsearchcolumn( 'custrecord_classificationfullname' ); var affectedclassifications = nlapisearchrecord( 'customrecord_classification', null, filters, columns ); // loop through of classifications need updated ( var = 0; affectedclassifications != null && < affectedclassifications.length; i++ ) { var subclassificationtofix = affectedclassifications[i]; var subclassificationtofixid = subclassificationtofix.getid(); // load sub-classification record fix, right it's value re-submit var subclassificationtofixrecord = nlapiloadrecord('customrecord_classification', subclassificationtofixid); var subclassificationtofixoldfullname = subclassificationtofixrecord.getfieldvalue('custrecord_classificationfullname'); var subclassificationtofixnewfullname = subclassificationtofixoldfullname.replace(oldclassificationfullname, classificationfullname); subclassificationtofixrecord.setfieldvalue('custrecord_classificationfullname', subclassificationtofixnewfullname); var id = nlapisubmitrecord(subclassificationtofixrecord, false); } } } }

customization netsuite

Upload and download information to an android application news application using some thing like Database on server -



Upload and download information to an android application news application using some thing like Database on server -

i have build android application show news, each news dependent , users can comment on each news dependently these news updated , user can upload new news how should think in database found on net , application deal show store hope ideas.

like application on google play "al arabiya - العربية"

android database

ember.js - Play/Pause Jquery toggle using actions in Ember -



ember.js - Play/Pause Jquery toggle using actions in Ember -

i building sound player/playlist in ember using soundmanager2 player.

i using next code play/pause actions, trigger song play , pause.

the problem running song play, pause not work. assume because variable mysound in pause action technically different song mysound in play action.

here code:

actions: { play: function(){ var track_id = this.id; var mysound = soundmanager.createsound({ id: track_id, url: 'https://api.soundcloud.com/tracks/' + track_id + '/stream?client_id=d61f17a08f86bfb1dea28539908bc9bf', autoplay: false, whileplaying: function() { $('#positionbar').css('width', ((this.position/this.duration) * 100) + '%'); }, }); this.set("isplaying", true); soundmanager.stopall(); mysound.play(); }, pause: function(){ var track_id = this.id; var mysound = soundmanager.createsound({ id: track_id, url: 'https://api.soundcloud.com/tracks/' + track_id + '/stream?client_id=d61f17a08f86bfb1dea28539908bc9bf', autoplay: false, whileplaying: function() { $('#positionbar').css('width', ((this.position/this.duration) * 100) + '%'); }, }); this.set("isplaying", false); mysound.pause(); }, }

any help helpful. new ember perhaps method of doing can done different, more efficient way.

just maintain track of mysound property , utilize in pause method.

actions: { play: function(){ var track_id = this.id; var mysound = soundmanager.createsound({ id: track_id, url: 'https://api.soundcloud.com/tracks/' + track_id + '/stream?client_id=d61f17a08f86bfb1dea28539908bc9bf', autoplay: false, whileplaying: function() { $('#positionbar').css('width', ((this.position/this.duration) * 100) + '%'); }, }); this.set("isplaying", true); this.set('mysound', mysound); soundmanager.stopall(); mysound.play(); }, pause: function(){ var mysound = this.get('mysound'); this.set("isplaying", false); if(mysound && mysound.pause){ mysound.pause(); } }, }

jquery ember.js

php - Increasing mysql connections -



php - Increasing mysql connections -

we got big problem our mysql server setup. utilize zend framework 2 doctrine 2 , pdo mysql connection. our problem is, connections shown mysql > show status increasing , increasing. seems behavior slowing our whole application. @ moment connection count 150000. 5 hours before 2000.

we activated persistant connections in php.ini , on pdo connection. => no change

can behavior slow downwards our whole scheme or normal?

what problem?

thanks help

the 'connections' figure shown on show status total number of connection attempts made since server started (see: http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html#statvar_connections). it's normal number maintain increasing, , it's highly unlikely slowing downwards application.

if application running should benchmark seek see bottleneck is.

php mysql doctrine2 zend-framework2

dll - GetProcAddress returning NULL -



dll - GetProcAddress returning NULL -

i'm trying load dll using loadlibrary , getprocaddress. loadlibrary returns valid handle calls getprocaddress homecoming null. phone call getlasterror returns 87 error_invalid_parameter. verified function name i'm passing getprocaddress same returned when running dumpbin /exports on dll. unfortuantely work can't include actual code. here editted version give thought of i'm doing.

hinstance hdll = null; hdll = loadlibrary(l"<path dll>"); if (hdll == null) { // error handling code } g_var1 = (var1_type) getprocaddress(hdll, l"function1name"); g_var2 = (var2_type) getprocaddress(hdll, l"function2name"); if (!g_var1 || !g_var2 ) { // error handling code }

i've looked @ number of related questions on , other forums typically issue due c++ name mangling. since i'm using same name dumpbin shows don't think problem. ideas?

update

i think may have narrowed downwards issue. there existing older version of dll on target (this embedded wince solution). need utilize newer version of dll has function need; unfortuanatley can't update old dll. new dll , application using dll packed cab file loaded onto target. tried getprocaddress couple of functions in old dll , worked. seems though i'm calling loadlibrary path new dll it's loading dll on target. can confirm happen?

answer previous question

when windows ce loads dll, path info ignored when determining if dll loaded. means dll same name different path can loaded once. in addition, module ending extension .cpl treated if extension .dll.

source: http://msdn.microsoft.com/en-us/library/ms886736.aspx

yes, that's mutual pitfall. if don't provide total path dll, loadlibrary homecoming handle loaded dll of same name.

from msdn:

if lpfilename not include path , there more 1 loaded module same base of operations name , extension, function returns handle module loaded first.

i believe can exact dll want providing absolute path loadlibrary.

dll windows-ce getprocaddress