Posts

Showing posts from April, 2010

parse.com - Asynchronous messaging with Android Parse push Notification -

i wanted send asynchronous messaging parse, when push notification,client devices may not online wish them receive notifications after being online. when pushed 2 notification client received 1 notification(the last one). is there queue semantic android parse push notification?

objective c - iOS silent notification internet connection -

i know how implement silent notifications load app , reschedule local notifications if user not have internet connection? possible or silent notifications won't received unless there internet connection? silent push notification won't received unless there internet connection. silent push notification send server.

Javascript error - extensions::SafeBuiltins:82 -

Image
uncaught typeerror: illegal invocation everything works noticed there error in console. know this? if have same problem me, try disable extensions. example, when disable "open seo stats", error message disappeared.

asp.net mvc 4 - MVC - Store secure information -

i come cross question during mvc studies. possible b correct answer? you designing distributed application. application must store secure information specific individual user. data must automatically purged when user logs off. need save transient information in secure data store. data store should use? a. session state b. database storage c. profile properties d. application state thanks, if "the data must automatically purged when user logs off", there literally no need b or c. d (application state) single across users, best bet a. from msdn ...application state useful place store small amounts of often-used data not change 1 user another. information on saving data on per-user basis see asp.net session state overview , asp.net profile properties overview . [ref] this indicates , c possibilities, - [profile properties] similar session state, except profile data not lost when user's session expires. [ref] which not satisfy, &quo

android - Explode transition affects shared element transition -

Image
i have recyclerview displaying images in grid. when click 1 of these images add new fragment image shared element. use explode transition move other items in recyclerview off screen. when add fragment transitions run fine , image scales full screen. when pop stack animations dont run in reverse though would. shared elements scale , translates wrong position on screen. dont have problems if use transition such fade. here grid fragment add detail fragment. public class gridfragment extends fragment implements itemadapter.bobbleclicklistener { @bind(r.id.image_recycler_view) recyclerview mimagerecycler; public static gridfragment newinstance(int imagearrayresource, int titlesarrayresource) { gridfragment fragment = new gridfragment(); bundle args = new bundle(); args.putint("key_images", imagearrayresource); args.putint("key_titles", titlesarrayresource); fragment.setarguments(args); return fragme

linux - how to issue command to server and issue a command with a delay for 5sec to DUT using single python file -

i want start linux server , issue command wait 5seconds , issue command on dut using python script. is possilbe within single python script or if @ use 2 python script how it? this doing 1)i have set ssh login withut password - working fine 2)start server command "ssh -i ~/.ssh/id_rsa server_name@ip-address < command >" - working fine 3)wait 5second - working fine 4)need start dut command - not working :( please me find solution using python not sure mean dut, commands accepted ssh command parametr: $ ssh -i ~/.ssh/id_rsa server_name@ip-address command and if want run command, wait , run second command, easiest way be: $ ssh -i ~/.ssh/id_rsa server_name@ip-address "command1; sleep 5; command2"

Diagnosing proxy issue with python -

so trying work python 2.7 various things require pulling data internet. have not been successful, , looking diagnose doing wrong. firstly managed pip work by defining proxy so, pip install --proxy=http://username:password@someproxy.com:8080 numpy . hence python must capable of getting through it! however when came writing .py script same have had no success. tried using following code urllib2 first: import urllib2 uri = "http://www.python.org" http_proxy_server = "someproxyserver.com" http_proxy_port = "8080" http_proxy_realm = http_proxy_server http_proxy_user = "username" http_proxy_passwd = "password" # next line = "http://username:password@someproxyserver.com:8080" http_proxy_full_auth_string = "http://%s:%s@%s:%s" % (http_proxy_user, http_proxy_passwd, http_proxy_server,

c++ - When using IBO/EBO, program only works when I call glBindBuffer to bind the IBO/EBO AFTER creation of the VAO -

for reason, program works when bind ibo/ebo again , after create vao. read online, and multiple posts , glbindbuffer binds current buffer, , not attach the vao. thought glvertexattribpointer function attached data vao. float points[] = { -0.5f, 0.5f, 0.0f, // top left = 0 0.5f, 0.5f, 0.0f, // top right = 1 0.5f, -0.5f, 0.0f, // bottom right = 2 -0.5f, -0.5f, 0.0f, // bottom left = 3 }; gluint elements[] = { 0, 1, 2, 2, 3, 0, }; // generate vbo (point buffer) gluint pb = 0; glgenbuffers(1, &pb); glbindbuffer(gl_array_buffer, pb); glbufferdata(gl_array_buffer, sizeof(points), points, gl_static_draw); // generate element buffer object (ibo/ebo) gluint ebo = 0; glgenbuffers(1, &ebo); glbindbuffer(gl_element_array_buffer, ebo); glbufferdata(gl_element_array_buffer, sizeof(elements), elements, gl_static_draw); // generate vao gluint vao = 0; glgenvertexarrays(1, &vao); glbindvertexarray(vao); glbindbuffer(gl_array_buffer, pb); g

javascript - Multiple nested dropdown menu from MySQL -

i have following php page 4 dropdown list correctly populated 4 differents mysql query. populate categories_2 through query depending on categories_1.c_id , same nested others dropdown. tried call myfunction() onchange seems not working. don't alert. does know how this? appreciated. i know have use mysqli it's existing page , later. <script> var mydropdown=document.getelementsbyname('cat1')[0]; function myfunction(){ alert('option changed : '+mydropdown.value); } </script> <form enctype="multipart/form-data" method="post" action="import.php"> <label for="cat_name">categories_1</label> <select name = "cat1" onchange="myfunction()"> <?php $s = mysql_query("select * `categories_1`"); while($row = mysql_fetch_assoc($s)) { echo ('<option value="' . $row['c_i

c# - How to get methods declared in Base class using Reflection? -

i trying invoke methods using reflection in windwos 8 store application. tried list of methods base class method using this.gettype().gettypeinfo().declaredmethods. var methodlist = base.gettype().gettypeinfo().declaredmethods; i able methods declared in child class , invoke them. unable list of methods defined in base class. wrong approach? project built using .net windows store gettype().getruntimemethods() this method gave wanted. got methods present inside object during runtime.

java - How to start RMI via weblogic concole? -

i have migrate web application weblogic, , web app requires rmi run, in previous system, have execute startrmiregistry.sh contain of: #!/bin/sh exist="false" var in `ps -ef | grep rmiregistry` if [ "$var" = "rmiregistry" ] exist="true" fi if [ "$var" = "8206" ] if [ "$exist" = "true" ] echo "rmiregistry running." exit fi fi done classpath=.:/home/cms/server/cms.jar:/home/cms/lib/lucene-1.4.2.jar export classpath rmiregistry 8206 & echo rmiregistry started echo $! > rmiregistry.pid and need start rmi registry via server start argument in weblogic console. think need start via console make sure rmi server run in managed server, right? need suggestion, how can start rmi server mode under managed server? i sorry if explanation quite confusing, :) regards the server start arguments not correct p

excel - Lock a folder but access its files from VBA in windows 7 -

i have created excel tool runs program files saved in particular folder. need protect folder , still able access these files while vba program running. how accomplish it? if you're trying access excel files in folder, instead of locking folder, can lock of excel files , open them using workbook.open method documented here allows pass password argument.

Facebook Open Graph doesnt update -

Image
hy! can me if it's possible force facebook new scan each new "ajax"-url person adds. wanna link user-profiles our car-club, .. see .. to begin first point: 0) have url: user-url: https://xxxxx-carclub.at/#!/facebook 1) pass open-graph request in index.php with: if (preg_match("/facebookexternalhit/is", $_server['http_user_agent'])) { include("./includes/opengraph/facebook.php"); exit(); } 2) give output crawler: (with body, etc.) <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-2" /> <title>xxxxxxaustria - opengraph</title> <!-- facebook open graph meta tags --> <meta property="og:title" content="audi a4, 2.5 tdi quattro von christoph eder" /> <meta property="fb:app_id" content="xxxxxx"/> <meta property="fb:admins" content="xxxxxx"/> <me

python - Selecting rows in Pandas Panel -

is there way select rows across pandas panel? for instance in following example rows job == "b" across dataframes? in regular dataframe know using df1[df1["job"] == "a"] but i'm unsure how in pandas panels without loops. df1 = pd.dataframe({"job":["a", "b", "c", "d"],"date":["datea1", "dateb1", "datec1", "dated1"]}) df2 = pd.dataframe({"job":["b", "c", "d", "e"],"date":[ "dateb2", "datec2", "dated2", "datee2"]}) p = pd.panel({"df1":df1, "df2":df2}) my question might duplicate of one boolean masking in panels it might more convenient (at least me :-)) work 2d df rather 3d panel. df1 = pd.dataframe({"job":["a", "b", "c", "d"],"date":["datea1&qu

c++ - Same operations taking different time -

Image
i in process of optimizing code n-body simulator, , when profiling code, have seen this: these 2 lines, float diffx = (pnode->centerofmassx - pbody->posx); float diffy = (pnode->centerofmassy - pbody->posy); where pnode pointer object of type node have defined, , contains (with other things) 2 floats, centerofmassx , centerofmassy where pbody pointer object of type body have defined, , contains (with other things) 2 floats, posx , posy . should take same amount of time, not. in fact first line accounts 0.46% of function samples, second accounts 5.20%. now can see second line has 3 instructions, , first has one. my question why these seemingly same thing in practice different things? as stated, profiler listing 1 assembly instruction first line, 3 second line. however, because optimizer can move code around lot, isn't meaningful. looks code optimized load of values registers first, , perform subtractions. performs action first lin

python - Render Input & Label tags at the same DOM level with Django ChoiceInput -

the default django choiceinput outputs <input> within <label> tag & i've been asked output them @ same level in dom have written custom renderer. the field isn't rendering safe html in browser i'm seeing field label, raw html choices. i've looked on choicefieldrenderer i'm inheriting & it's render function returns mark_safe() string, why field render raw html? my form field declared so; class signupform(forms.modelform): my_field = forms.nullbooleanfield( widget=forms.widgets.radioselect( choices=field_choices, renderer=myradiofieldrenderer ), required=true, initial=true ) and custom renderer; class mychoiceinput(forms.widgets.choiceinput): def render(self, name=none, value=none, attrs=none, choices=()): if self.id_for_label: label_for = format_html(' for="{0}"', self.id_for_label) else: label_for

javascript - How to add new attribute to Struts 1 <s:form>? -

this document zurb abide validation tool: http://foundation.zurb.com/docs/components/abide.html#setting-up-validation i use struts 1 form, , try this: <s:form styleid="frmaddestate" action="${addestateprofile}" data-abide> // input fields... </s:form> but not working. please me put "data-abide" form tag. (i think revise file *.tld - tag lib definition). you can use javascript add attributes form when has been loaded. document.getelementbyid("frmaddestate").onload = function() {myfunction()}; function myfunction() { var att = document.createattribute("data-abide"); document.getelementbyid("frmaddestate").setattributenode(att); }

javascript - Can't use this to point a selected element with jQuery -

why js not apply class element please ? <input type="password" name="customer-new-password" class="form-control"> <script> if($("input[name='customer-new-password']").val()=='') { $(this).addclass('required'); } else { $(this).removeclass('required'); } </script> thanks. why think $(this) point selected object? try instead: var $input = $("input[name='customer-new-password']"); if($input.val()=='') { $input.addclass('required'); } else { $input.removeclass('required'); }

sockets - Unable to fix Error 10038 WSAENOTSOCK -

i'm trying learn berkeley socket programming, stuck here: have 10038 error both of server , client program, according msdn means: " an operation attempted on not socket " socket "socket". here server/client code: my client : #include <winsock.h> #include <stdio.h> #include <string.h> #define buffsize 32 void diewitherror(char *errormessage); int main(int argc, char* argv[]){ int sock, byteslen; struct sockaddr_in servaddr; unsigned short servport =13; char * servip; char buff[buffsize+1]; wsadata wsadata; if(argc == 2){ servip = argv[1]; } if(wsastartup(makeword(2,0), &wsadata) != 0){ puts("error wsa"); } if(sock=socket(af_inet, sock_stream, 0) < 0){ puts("error socket"); } memset(&servaddr, 0, sizeof(servaddr)); servaddr.sin_family = af_inet; servaddr.sin_port = htons(servport); servaddr.sin_addr.s_addr

cartocss - How do I make the class 'path' show up at higher zoom levels using carto CSS in MapBox Studio? -

i working styling map in mapbox studio. trying make road class path show @ zoom level less 14. go level 13 or less paths disappear. know how make paths show @ levels 12 , 13? i have tried in css. [class='path'] { ::path[zoom>=10]['mapnik::geometry_type'=2] { line-join: round; line-width: 1.0; } } the mapbox-streets-v5 vector dataset ships mapbox studio has vector data layers @ each zoom level. path data not appear in dataset @ zoom lower 14, why can't style @ other zoom level. fortunately, data comes openstreetmap, can add custom source in mapbox studio , style along other data! there guide on grabbing data openstreetmap overpass turbo .

ios - UIImage Filter to detect face and convert to emoticon/smiley -

Image
i need generate emoticon capturing photo of person, lets image capture device (iphone/ipad) need extract/get face(by removing background , other parts image) , add filter image( uiimage ) converted : emoticon cartoon face this i need thing sorted out, please share idea or link has code similar kind functionality. thanks in advance.

xslt - modify xml node value or attribute value with xsl without specifying -

i working on project modifies xml documents. want modify either node value or attribute value. able if specify it's node or attribute value want modify. modifying node value in xsl: <xsl:template match="xpath/text()">newvalue</xsl:template> modifying attribute value in xsl: <xsl:template match="xpath"> <xsl:attribute name="attributename">newvalue</xsl:attribute> </xsl:template> but want modify values without specifying node or attribute. example here short xml: <example> <test> <node attrname="oldattrvalue"> oldnodevalue </node> </test> </example> i modify "attrname" attribute value or "node" node value without specifying which. somehow possible, maybe xpath? thank you. i modify "attrname" attribute value or "node" node value without specifying which. somehow possible if underst

javascript - Create link in handlebars.js using helper -

i have tried follow example in handlebars documentation on how create link, instructions unclear me. handlebarsjs.com/expressions.html (see "helpers") first of all, without link helper can make link text appear on screen, text, not link. <script id="template" type="text/x-handlebars-template"> <h4>{{{my_link}}}</h4> </script> and text retrieved ajax request. add link keyword <h4>{{{link my_link}}}</h4> and nothing displayed. helper code have currently, doesn't work: $(function(){ handlebars.registerhelper('link', function(my_link) { var url = handlebars.escapeexpression(my_link.url); var result = "<a href='" + url + "'></a>"; console.log(result); return new handlebars.safestring(result); }); }); is relevant put piece of code in javascript? when click submit button, ajax request made , link retri

java - Count instances of string x until string y is found -

i've been trying hour or managed code can count or can search. goal put not specific string(let's call "stringtofind") count instances of specific(let's call "stringtocount") string until finds "stringtofind". here's how count: int count = 0; scanner scanner = new scanner("example.xml"); while (scanner.hasnextline()) { string nexttoken = scanner.next(); if (nexttoken.equalsignorecase("stringtocount")) count++; } and here's how find(i want find it's line): int linen = 1; //set 1 loop return correct line number scanner scanner = new scanner("example.xml"); while (scanner.hasnextline()) { linenum++; if("stringtofind".equals(scanner.nextline().trim())) { system.out.println("found on line: "+linenum); } } i thought looking stringtofind, getting it's line number , making first scanner count stringtocount till line programming skills aren'

php - Localize custom field values in wordpress -

how localize custom field values in wordpress? have these custom field values being displayed in post through restapi in wordpress using json-api plugin. what i'm trying localize these custom field. these values being entered through wordpress cms, when goto posts , have query string (i.e. ?lang=es, page translated spanish) in url, it'll show custom translated values.

logging.config configuration for spring boot -

i wanted configure location of log4j.xml file in spring boot application. have added logging.config property application.properties configuration, indicating log4j.xml file path. seems property ignored. should work accorindg spring boot docs: logging.config= # location of config file (default classpath:logback.xml logback) have did wrong? spring boot includes starters can used if want exclude or swap specific technical facets. it's using logback default, if you're gonna use log4j add spring-boot-starter-log4j in classpath. example, maven this: <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-log4j2</artifactid> <version>1.2.4.release</version> </dependency> and log4j 1.x: <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-log4j</artifactid>

Search for all git commits (on all branches) that contain a specified file? -

i trying list git commits on branches on specific file exist. know full path file. not trying search commits mention file in commit message, rather commits contain file itself. git rev-list --all | xargs -i commit \ bash -c 'git cat-file -e commit:myfile.py 2> /dev/null && echo commit'

scala - How to implement parametric lenses that change type of state -

so in scala have typical lens signature as: case class lens[o,v](get: o => v, set: (o,v) => o) but can see, updates , sets values of same type, not set 1 type another. have in mind more this: case class lens[o[_],a,b](get: o[a] => a, set: (o[a],b) => o[b]) with a , b make sense o[_] my question is. stop being isomorphic? there simpler way without breaking rules? i think figure out right lens abstraction, helpful have concrete lens-able type in mind. however, particular example, there can say: case class lens[o[_],v[_],a,b](get: o[a] => v[a], set: (o[a],v[b]) => o[b]) i not think kind of lens can composed. in order compose lenses, result of get has able feed set . here, result of get v[_] , whereas set needs o[_] . as further explanation, here possible kind of polymorphic lens, not 1 fits needs: trait lens[t[_]] { def get[a](t: t[a]): def set[a,b](t: t[a], x: b): t[b] } it can composed so: def composelenses[t[_],u[_]](lens1:

python - Plotting a Heat Table Based on bokeh -

Image
i trying make heat map 1 bokeh: where code here: http://bokeh.pydata.org/en/latest/docs/gallery/unemployment.html i got pretty close, reason printing values in diagonal order. i tried format data same way , substitute it, got little more complicated that. here data: from collections import ordereddict import numpy np import pandas pd bokeh.plotting import columndatasource, figure, show, output_file bokeh.models import hovertool import pandas.util.testing tm; tm.n = 3 df = pd.read_csv('mydata.csv', usecols=[1, 16]) df = df.set_index('recvd_dttm') df.index = pd.to_datetime(df.index, format='%m/%d/%y %h:%m') result = df.groupby([lambda idx: idx.month, 'companyname']).agg(len).reset_index() result.columns = ['month', 'companyname', 'numbercalls'] pivot_table = result.pivot(index='month', columns='companyname', values='numbercalls').fillna(0) s = pivot_table.sum().sort(ascending=false,inpla

c++ - Deducing template parameter from functor argument type -

this question has answer here: is possible figure out parameter type , return type of lambda? 3 answers i have following code meant accept qt qvariant , apply functor if variant contains value: template<typename t, typename functor> inline qvariant map(const qvariant& v, functor f) { return v.isvalid() ? qvariant{f(qvariant_cast<t>(v))} : v; } my problem compiler cannot deduce type of t when invoke function as map(somefuncreturningqvariant(), [](const qbytearray& array) -> qstring { return array.tostring(); }); the compiler complains (cleaned original error, has longer type names): error: no matching function call `map(qvariant, <lambda(const qbytearray&)>)` note: candidate is: template<class t, class functor> qvariant map(const qvariant&, functor). note: template argument deduct

android - Service loses it's intent when it is restarted by system -

i starting service this: intent intentservice = new intent(getactivity(), acnotificationservice.class); intentservice.putextra("acreservation", reservationactivity.acreservation); getactivity().startservice(intentservice); and service class: /* variables */ private notificationmanager notificationmanager; private countdowntimer countdowntimer; private static int notification_countdown = 0; private static int notification_ranout = 1; private acreservation acreservation; /* callbacks */ @override public void oncreate() { super.oncreate(); // initialize variables notificationmanager = (notificationmanager) getapplicationcontext().getsystemservice(context.notification_service); // register eventbus eventbus.getdefault().register(this); } @override public ibinder onbind(intent intent) { return null; } @override public int onstartcommand(intent intent, int flags, int startid) { // reservation data extras if (acres

numpy - Read text file only for certain rows to split up file in Python -

i loading text file using np.loadtxt , have python split in four. copy paste each set of data different text files , np.loadtxt each text file, i'm going have hundreds of times way time consuming. here shortened version of text file. i'd have python read first number (0.6999) , discard it, read 5 following rows of values , assign variable names each column, , next 5 rows variables each column again, , on. is there way tell python maybe np.loadtext row 1, row 2 6, 7 12 etc? 0.699999988 1 0.2000 0.0618 2 0.2500 0.0417 3 0.3000 0.0371 4 0.3500 0.0390 5 0.4500 0.0761 670.0000 169.4000 6.708e-09 635.0001 169.1806 1.584e-08 612.9515 168.6255 2.724e-08 591.2781 168.2719 4.647e-08 670.00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 0.0e+00 635.00 9.8e-07 4.2e-07 2.1e-07 1.2e-07 4.4e-08 1.8e-08 1.4e-08 612.95 6.0e-06 3.5e-06 2.1e-06 1.3e-06 4.7e-07 1.8e-07 1.4e-07 591.28

sql - MySQL Join three tables return multiple results -

i have 3 tables: let's call customer, log , review the customer table is: id name == ==== 1 john 2 jane 3 mike the log table is id customer_id created_at == =========== ========== 1 1 2015-06-10 2 1 2015-06-10 3 2 2015-06-11 4 1 2015-06-13 5 2 2015-06-15 6 1 2015-06-15 the review table is id customer_id created_at == =========== ========== 1 1 2015-06-10 2 2 2015-06-10 3 2 2015-06-11 4 1 2015-06-13 5 1 2015-06-15 6 1 2015-06-15 7 1 2015-06-18 what wanted customer_id name log_qty review_qty =========== ==== ======= ========== 1 john 4 5 2 jane 2 2 3 mike 0 0 what got: customer_id name log_qty review_qty =========== ==== ======= ========== 1 john 20 20 2 jane 4 4 3 mike 0 0 my query:

regex - RewriteRule for multiple URL matches in one line -

i use following lines in .htaccess file rewrite several subdirectory urls root of website: rewriterule ^work(.*)$ $1 rewriterule ^why-me(.*)$ $1 rewriterule ^prices(.*)$ $1 rewriterule ^contact(.*)$ $1 however, there way of expressing in 1 line instead? i tried: rewriterule ^(work|why-me|prices|contact)(.*)$ $1 but (unsurprisingly, given complete lack of knowledge when comes regexes), didn't work , resulted in these urls giving me 404 errors. rewriterule "^(work|why-me|prices|contact)(.*)$" "$2" or rewriterule "^(?:work|why-me|prices|contact)(.*)$" "$1" $1 refers first capturing group, whatever defined in first set of parenthesis. since you've created set within parenthesis, $1 no longer refers follows, instead contains work , why-me , etc. the first solution needs $2 because $1 1 of: work,why-me, etc. , $2 whatever follows it. the second solution works using non-capturing group first group (it isn't

angular - How to call function after dom renders in Angular2 -

this question has answer here: how run jquery function in angular 2 after every component finish loading 5 answers i new angular2 , angular in general , trying jquery fire after dom updated when data of component changed. jquery needs calculate heights of elements can't use data. unfortunately looks onallchangesdone fires after data changes, not dom. the solution i've found lifecycle hook ngafterviewchecked . example of chat have scroll down messages list after adding , rendering new message: import {component, afterviewchecked, elementref} 'angular2/core'; @component({ selector: 'chat', template: ` <div style="max-height:200px; overflow-y:auto;" class="chat-list"> <ul> <li *ngfor="#message of messages;"> {{ message }}

ssl certificate - openssl not fetching certification details -

we able connect not fetching certification details. $ bash-3.2# echo | openssl s_client -host $h -port $p 2>/dev/null connected(00000005) $ you need pipe openssl , tell parts or whole certificate, want. example tag on | openssl x509 -text -noout end can see entire certificate. the kind of command add on ends of statement define information pulled output. have piece of information in mind want get?

c - Difference between xxxxx_(), LAPACK_xxxxx() and LAPACKE_xxxxx() functions -

let's want use lapack solve system of linear equations in c (gcc). set problem follows: /* want solve ax=b */ int n = ...; // size double *a = ...; // nxn matrix double *b = ...; // length-n vector int m = 1; // number of columns in b (needs in variable) double *pivot; // records pivoting int info; // return value now seems can use 1 of 3 functions solve problem. first 1 this: dgesv_( &n, &m, a, &n, pivot, b, &n, &info ); i surprised see did not require #include s, seems... weird. the second function has same signature, except prefix lapack_ think causes less ambiguity , possibly less error-prone: #include <lapack/lapacke.h> lapack_dgesv( &n, &m, a, &n, pivot, b, &n, &info ); note requires me include lapacke.h . the third function changes signature returning info , not taking arguments pointers: #include <lapack/lapacke.h> info = lapacke_dgesv( lapack_col_major, n, m, a, n, pivot, b

How can I add a .png to an outgoing PHP Email with HTML? -

i've been trying add png php email quite sometime no luck. tried traditional methods , i've tried add base64 both html , css using site http://www.base64-image.de but no matter blank header. can please tell me, step step have make png appear on email send, , no can't attachment. thanks in advanced. <?php // $email , $message data being // posted page our html contact form $email = $_request['email'] ; $mail2 = new phpmailer(); // set mailer use smtp $mail2->issmtp(); // email.php script lives on same server our email server // setting host localhost $mail2->host = "smtp.comcast.net"; // specify main , backup server $mail2->smtpauth = true; // turn on smtp authentication // when sending email using phpmailer, need send valid email address // in case, setup test email account following credentials: // email: send_from_name@comcast.net // pass: password $mail2->username = "name@comcast.net"; // smtp username $mail2-&g

jquery - How to call javasscript_tag in rails? -

i followed each step of above question , here changes: in show.html.erb (http://localhost:3000/posts/24) <% javascript_tag %> $(function() { setinterval(function(){ $.get("/posts/<%= @post.id %>"); }, 5000); }); <% end %> <span id="changed_data"> should change after every 5 seconds </span> controller class def show @post = post.find(params[:id]) respond_to |format| format.js format.html end end added new file app/views/posts/show.js.erb $("#changed_data").html("<h2> changed </h2>"); but sounds javascript_tag not calling jquery method. doing wrong here? try this: <% javascript_tag %> $(function() { setinterval(function(){ $.get("/posts/<%= @post.id %>"); }, 5000); }); <% end %> change <script> $(function() { setinterval(function(){ $.get("/posts/<%= @post.id %>"); }, 5000); }); </sc

java lang Verify Error making request on android -

i'm trying make request restful api android app using retrofit make request, signpost authenticate , retrofit-signpost connect 2 i'm getting error on request: java.lang.verifyerror: com/squareup/okhttp/internal/http/httpconnection$abstractsource any idea why might be? edit: logcat error log: 07-02 09:15:30.626 28584-29830/com.example e/dalvikvm﹕ not find class 'okio.forwardingtimeout', referenced method com.squareup.okhttp.internal.http.httpconnection$abstractsource.<init> turns out using outdated version of okio didn't include needed class. downloaded latest 1 square/okio's github site , worked.

jquery - JavaScript runtime error: cannot call methods on dialog prior to initialization; attempted to call method 'close'" -

error running below code block: "0x800a139e - javascript runtime error: cannot call methods on dialog prior initialization; attempted call method 'close'". failing @ statement: $(this).dialog("close"); function deletereport(reporttitle, reportid) { reportidtodelete = reportid; var buttons = [ '<button id="btnyes" class="modalbtn" onclick="confirmdeletereport();">yes</button>', '<button id="btnno" class="modalbtn" onclick="$.modal.close();">no</button>' ]; showmessage('are sure want delete report:' + reporttitle + '?<br>this action cannot undone.', '', buttons); } function confirmdeletereport() { $.ajax({ url: "/report/deletereport", data: { reportid: reportidtodelete }, type: 'get', success: function (data) { if (data.code

python - NoReverseMatch in Django (url ploblem) -

i'm beginner of django want set url database field_name instead of use primary key django tutorial. code. *mysite* **dwru/urls.py** urlpatterns = [ url(r'^$', include('product.urls', namespace="product")), ] *myapp* **product/urls.py** urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^(?p<name_catalog>[-_\w]+)/$', views.product_list_from_index, name='catalog'), ] **product/views.py** def product_list_from_index(request, name_catalog): catalog = get_object_or_404(catalog, name_catalog=name_catalog) context = { 'catalog': catalog } return render(request,'product/product_list.html', context) **product/models.py** class catalog(models.model): name_catalog = models.charfield(max_length=45) product = models.manytomanyfield(product) **template/product/index.html** {% catalog in catalog_list %} <h1><a href="{% url 'product:catalog' catal

objective c - Facebook iOS SDK 4.1.0 Share Callback -

using fbsdk mentioned in title of question, present simple share dialog in view controller: // setup content share fbsdksharelinkcontent *content = [[fbsdksharelinkcontent alloc] init]; content.contenturl = linkurl; content.contentdescription = description; content.contenttitle = title; content.imageurl = imageurl; // show share dialog [fbsdksharedialog showfromviewcontroller:controller withcontent:content delegate:somedelegate]; and implement delegate method... - (void)sharer:(id<fbsdksharing>)sharer didcompletewithresults:(nsdictionary *)results { nslog(@"sweet, shared."); } so far good, long user has facebook application installed on device. issue arises when user not have facebook installed. if case, safari opens web version of facebook's login flow (this fine), if switch original application without logging facebook / performing additional tasks, completion delegate method shown above

java - Issue displaying a letter made of asterisks -

i display letter a made of asterisks. first program ask size of letter , depending on given size scale letter size. this have far, i'm not sure doing wrong. can see prints 1 line. great. code: import java.util.scanner; public class problem7 { public static void main(string[] args) { scanner kbd = new scanner(system.in); int input, size, i; system.out.print("enter size: "); input = kbd.nextint(); while (input <= 1) { system.out.print("enter size: "); input = kbd.nextint(); } (int col = 0; col < input; col++) { (int row = 0; row < input; row++) { if (col == 1 || col == input || row == col) system.out.print("*"); else system.out.print(" "); } } } } result: enter size: 5 * ***** * * * if want new line use: sy

angularjs - Using angular-local-storage Inside a Service? -

i trying use angular-local-storage module ( https://github.com/grevory/angular-local-storage ), version 0.2.2 (according bower) in service within application. seem having issues when call within service, works fine when put inside controller. i have configured this: angular.module('myapp', [ 'localstoragemodule' ]) .config(function (localstorageserviceprovider) { localstorageserviceprovider .setprefix('test') .setstoragetype('localstorage'); })... and in service, have (simplified, testing purposes): angular.module('myapp') .service('userservice', [ 'localstorageservice', function(localstorageservice) { return { save: function() { localstorageservice.set('user', 'me'); } }; }]); this code yields error of: typeerror: localstorageservice.set not function on other hand,

selenium - JQuery: How to set FOCUS to a TinyMCE editor? -

i'm trying add text tinymce using selenium . i've been able add text using code: $('iframe').last().contents().find('body').text('401c484b-68e4-4bf2-a13d-2a564acddc04'); the tinymce editor displaying guid . however, when selenium click submit button, i'm getting error: please, enter text. . i've noticed that, while selenium running, need click (manually) on tinymce then, when update button clicked, text returned. so how click tinymce using javascript or jquery ? my answer came this post @siking pointed me to. public void entertextintinymce(int n, string notetext, string escapeelementcss) { driver.switchto().frame(n - 1); iwebelement body = driver.findelement(by.xpath("//body")); body.click(); wait(3); ijavascriptexecutor jse = driver ijavascriptexecutor; jse.executescript("arguments[0].innerhtml = '" + notetext + "'", body);

sql - FORALL vs FOR bulk update -

this asked in interview. question is, 1 faster, forall on 5000 or using on 500 records? well, think indeed forall faster far processing speed concerned still depends on number of rows processed, in case of above question. please share thoughts. it depends. first, how test set up? in normal code, for loop runs query , if you're measuring performance of loop, you're combining time required run query, fetch results, , results. for x in (<<some select statement>>) loop <<do x>> end loop; a forall on other hand, implies you've done work of fetching data need process local collection. forall in 1..l_collection.count <<do something>> a performance comparison includes time required run query , fetch results in 1 case , excludes time other case not fair comparison. you'd either need include cost of populating collection in forall case or need for loop iterate on populated collection comparison fair one. approa

maven - How to go back one directory from working directory in Java? -

i'm using code in order read file content in maven module. file stored in 1 directory working directory. string configfilepath = system.getproperty("user.dir") + "../conf/gce-configuration.xml"; file configfile = new file(configfilepath); then when try read file gives me file not found error. file cannot found : /home/xxxx/bin../conf/gce-configuration.xml i tried different ways still i'm getting error. i'm doing wrong here? edit: seems forgot mention file name in assembly/bin.xml in maven module. xml file not include package. bad! as want go 1 level above current dir can by string configfilepath = new file(system.getproperty("user.dir")).getparent() + "/conf/gce-configuration.xml";

How to get the blktrace tool to show the D - issued action -

this question blktrace tool. on several unbuntu 3.16.0 machines in our lab need trace software vs device block io performance. use our custom nvme driver , standard one. here excerpt of blkparse output (with standard nvme driver): 259,0 2 189505 9.997188463 8160 q r 126875648 + 248 [fio] 259,0 2 189506 9.997191290 8160 q r 126875896 + 8 [fio] 259,0 2 189507 9.997215574 8160 q r 363057152 + 248 [fio] 259,0 2 189508 9.997218444 8160 q r 363057400 + 8 [fio] 259,0 2 189509 9.997219210 8160 c r 216536568 + 8 [0] 259,0 2 189510 9.997220497 8160 c r 126875896 + 8 [0] 259,0 2 189511 9.997230160 8160 c r 363057400 + 8 [0] 259,0 2 189512 9.997248050 8160 q r 147316736 + 248 [fio] 259,0 2 189513 9.997250930 8160 q r 147316984 + 8 [fio] 259,0 2 189514 9.997277161 0 c r 147316984 + 8 [0] this shows queued , complete actions not d - issued actions interested in