Posts

Showing posts from August, 2015

Why we call the signal function in the start of the linux c program? -

the program simple, have handler function named fintr() , program is: void fintr(); int main() { int i; signal(sigint,fintr); while(1) { printf("*"); } return 0; } void fintr() { printf("signal received"); exit(1); } can put signal(sigint,fintr); @ end of function main() ? , why have put in beginning of main() ? putting @ end means come after while (1) ... loop, no, can't put in end, because never executed. also, pay attention code place inside signal handlers: not safe call printf() inside signal handler.

Python: How would I compare two strings using a function with only one of the strings as an argument? -

i've created class, , unsure how approach following problem. possible create function able in example? (for practical uses, comparing dates , returning true if day , month same not years same) example: >>>strvar1 = 'abc-123' >>>strvar2 = 'abc-456' >>>strvar1.myfunction(strvar2) true class code class date(object): def __init__(self, x0 = 1900, y0 = 1, z0 = 1): self.x = x0 self.y = y0 self.z = z0 def __str__(self): date = str(self.x) + "-" + str(self.y).rjust(2, '0') + "-" + str(self.z).rjust(2, '0') return date def myfunction(j): so example like: d1 = date(1999, 1, 1) //d1 = "1999-01-01" d2 = date(2000, 2, 2) //d2 = "2000-02-02" d3 = date(2001, 2, 2) //d3 = "2001-02-02" >>>d1.myfunction(d2) false >>>d2.myfuction(d3) true yes absolutely, reason having classes. read on https://d

php - query inside while loop only shows 1 result -

i'm making while loop in php , goes problem don't want id of user other stuff inside table, when go ahead , make query inside while loop , select second table (where id equal id of result first query), returns 1 result... so code have: public function getfriends($id) { global $params; $get = $this->db->select("{$this->db['data']['friends']['tbl']}", "*", array( "{$this->db['data']['friends']['one']}" => $id ) ); if($get) { while($key = $get->fetch()) { $query = $this->db->query("select * {$this->db['data']['users']['tbl']} {$this->db['data']['users']['id']} = :id", array( &q

javascript - addition in angular js -

i'm new angular.js , have simple question. trying make calculator takes input , adds input value total. however, scope.add function not work. below code. appreciated. html code: <div class="card"> <div class="item item-text-wrap" style="font-size: 35px; text-align: right"> {{result}} total </div> </div> <div class="padding"> <label class="item item-input"> <input class="input-label" placeholder="add" type="tel" ng-model="t" style="font-size: 35px; text-align: right"> calories </label> </div> <div class="row"> <button class="button ion-refresh button-balanced col" ng-click="reset()" style="font-size: 40px"></button> <button class="button ion-plus-round button-calm col" ng-click="add(t)" style="font

vb.net - Javascript alert for ASP.NET (VB) will not appear? -

for reason message box not show up. type in code 0 errors, run page, click button, , nothing happens. idea what's going on? here code: protected sub btncheckin(byval sender object, byval e system.eventargs) dim message string = "checked-in!" dim sb new system.text.stringbuilder() sb.append("<script type = 'text/javascript'>") sb.append("window.onload=function(){") sb.append("alert('") sb.append(message) sb.append("')};") sb.append("</script>") clientscript.registerclientscriptblock(me.gettype(), "alert", sb.tostring()) end sub

Automatically turn on enriched mode and make newlines between paragraphs hard in Emacs -

i want turn on enriched-mode in emacs default, *scratch* buffer open in mode. i've got *scratch* persistent across sessions ( http://dorophone.blogspot.com/2011/11/how-to-make-emacs-scratch-buffer.html ). i added (enriched-mode) .emacs file, every start need answer question: make newlines between paragraphs hard? (y or n) . tried add (use-hard-newlines) before or after (enriched-mode) , add 'yes , 1 , others both commands, doesn't work. c-h f enriched-mode shows no answer. i did today. first of loading of autosaved scratch file done shell's cat function , replaced insert-file . (enriched-mode) had added loading script. once scratch edited rich text ( m-x enriched-mode , answering hard-lines prompt) open in enrichment mode without prompting. here's function: (defun load-persistent-scratch () "load contents of persistent-scratch-filename scratch buffer, clearing contents first." (if (file-exists-p persistent-scratch-filenam

dynamics crm - Workflow to send an email to the users within the record is shared -

i using microsoft dynamics crm 2015 on-premise version. i created custom entity(news). use of entity: system administrator can share records(news) selected system users. my question: how send email notification (to selected users) on record sharing? there isn't built in functionality run workflow on users selected in record sharing form/window. if wanted users able run workflow send email particular record based on shared to, need have crm plugin written and/or custom web resource built if wanted more of manual process sent when user says run workflow vs. plugin can setup run time when record shared user. below few links of example crm plugin code has been written send email out users whom record has been shared them. https://social.microsoft.com/forums/en-us/1b40cb49-d62c-4a71-9282-a9a8b255446d/send-email-to-shared-users?forum=crm https://social.microsoft.com/forums/en-us/68fc025e-360f-4afc-af72-d59c0665a099/to-send-email-to-shared-users-with-whom-the-lead

jenkins ssh AgentForwarding -

jenkins@jenkins-server --- authenticates (w/ rsa key) ---> git@gitlab-server jenkins@jenkins-server --- authenticates (w/ rsa key) ---> user@qa-server from command line output expected jenkins@jenkins-server $ ssh user@qa-server 'ssh -t git@gitlab-server' welcome gitlab, anonymous! running same command jenkins job "execute shell" build step, output same (as expected). when using "send files or execute commands on ssh" build step, jenkins able connect user@qa-server then, ssh -t git@gitlab-server remote command fails with permission denied, please try again. permission denied, please try again. permission denied (publickey,password). it looks ssh-agent not running on qa-server in particular case. all servers running ubuntu server. have jenkins ssh agent plugin installed , configured. how debug (and/or fix). how can see exact command jenkins running? somehow or mistake (i'm not sure) ssh-agent runni

java - Adding zeros in front of double -

i have double ex: -2.34 i want add 9 zeros in front of make length fixed 10 digits. result: -0000000002.34 i tried: string formatted = string.format("%010d", number); but can pass double string format function? what efficient method this? the easiest way create decimalformat object , supplying pattern yourself. 0 characters indicate digit should printed here, if unnecessary. decimalformat df = new decimalformat("0000000000.00"); string formatted = df.format(-2.34); outputting: -0000000002.34 with string.format , can supply total length decimal characters used. use 14 total length, account 10 "whole" digits, negative sign, decimal point, , 2 decimal digits. string.format("%014.2f", test) the output is: -0000000002.34

Passing arguments when python subprocess.Popen in running -

i have simple application (*.exe) passing command line arguments using python subprocess.popen shown below: write_data = popen(["test.exe", arg1, arg2)], cwd = target_path, shell = true, stdin=pipe, stdout=pipe) output = '' line in iter(write_data.stdout.readline, ""): print line, output += line i have programmed application receive arguments , operations. calling subprocess function multiple times every time want test application different data. is possible run subprocess once , send arguments running process? i tried write_data.stdin.write(arg3, arg4) , doesn't seem work. i think arguments no tool inter-process communication. you can interact running program using stdin , stdout tried can write stdin write file , read stdout. there no parameters in stdin. what happens when write stdin depends on receiver. can call receiver on command lin

jquery - Cross-Domain scripting working in every browser except IE8 & 9 -

i have site @ myapp.myurl.com making ajax request api.myurl.com . understand considered "cross-domain." don't understand why ajax call works in every browser except ie8 , ie9. here's code details removed. $.ajax({ type: "post", datatype: "json", headers: header, data: data, url: "api.myurl.com/getdata", success: function (data) { //dostuff } }); is there can do? here's response when run script manually in ie8 {readystate: 0, responsejson: undefined, status: 0, statustext: "no transport"} here's response when run script manually in chrome object {readystate: 1, getresponseheader: function, getallresponseheaders: function, setrequestheader: function, overridemimetype: function…} and has correct json response. ie 8 , 9 have partial cors implementation . use non-standard object called xdomainrequest to cross-domain requests. you may need write special code it,

pointers - dynamic allocation for an array in C -

#define _crt_secure_no_warnings #include <stdio.h> #include <conio.h> #include <stdlib.h> int *alocare(int *a, int *n) { printf("introduceti numarul de elemente din sir"); scanf("%d", n); = (int*)(malloc(*n*sizeof(int))); //alocam memorie dinamica (in zona heap) pentru memorarea unui vector in mod dinamic de n elemente if (!a) { printf("eroare la alocare\n"); return 0; } return a; } void citire(int *a, int n) { (int = 0; < n; i++) { printf("\telem %d\n", + 1); scanf("%d", &a[i]); } } void afisare(int *a, int n) { (int = 0; < n; i++) printf("%d\n", a[i]); } void main(void) { int *a, n; a=alocare(a, &n); citire(a, n); afisare(a, n); _getch();

matlab - Switching values to plot using keyboard input -

Image
i have sets of data in matrix. want plot on set , use keyboard input move one. it's possible way: for t=1:n plot(data(:,t)) pause end but want move forward , backward in time t (e.g. using arrows). ok, done this: direction = input('forward or backward?','s') if direction=='forward' plot(data(:,ii+1)) else plot(data(:,ii-1)) end but isn't there more elegant? (on 1 click without getting figure of sight - it's big full sreen figure.) you can use mouse clicks combined ginput . can put code in while loop , wait user click somewhere on screen. ginput pauses until user input has taken place. must done on figure screen though. when you're done, check see key pushed act accordingly. left click mean plot next set of data while right click mean plot previous set of data. you'd call ginput way: [x,y,b] = ginput(1); x , y denote x , y coordinates of action occurred in figure window , b button pushed. do

c# - Control Names on QueryString different in IIS-8 Classic Mode -

we have moved application windows server 2003 iis-6 new windows 2012 server iis-8 , setup app pool "classic". problem existing code pulls value off query string in controller method using querystring. string tmpid= request[string.format("disabilityrepeater:_ctl{0}:dddisability", num)]; i have hit old , new site , format of control has changed. consistently different between platforms , not affected browser. for example here name querystring in iis-6: disabilityrepeater:_ctl1:dddisability and iis-8: disabilityrepeater$ctl01$dddisability i have searched "breaking change" name munging have been unable find solution in configuration. i make code change, migrating application on server 2003 server 2012 , includes 75 applications , configuration update preferable.

java - RxJava - Non Deterministic behaviour when calling Observables methods -

i have problem following code: public void foo(list<player> players_list) { jsonarray playersarr = new jsonarray(); rx.observable.from(players_list) // assume players_list list contains 2 players .concatmap(player -> { return getuser(player.getuserid()) // entity 'user' db .flatmap(userobj -> { user user = ...; playersarr.add(new jsonobject() .putstring("uid", player.getextuserid()) ); return rx.observable.just(playersarr); }); }).subscribe(playersobj -> { }, (exception) -> { log.error("", exception); }, () -> { // @ point expect 'playersarr' consist 2 entries! }); } when running code seems output non-deterministic, meaning - of times valid results of 2 entries in jsonarray, 1 entry. i'm trying figure out why?? edit: tried switching .flatmap --> .concatmap , seems solve problem im not sure it'

javascript - Quiz answer highlighting both options -

i building employability quiz @ university , each question has yes , no answer. if click yes answer, highlights green , shows answer below. if click no answer however, highlights red, , highlights yes answer box green though hasn't been clicked. this question 1 html: $(document).ready(function() { //get total of questions var $questionnumber = $('h2').length; console.log($questionnumber); //caching final score var $totalscore = 0; $('li').click(function() { //caching variables var $parent = $(this).parent(); var $span = $(this).find('.fa'); //deactivate options on click $parent.find('li').off("click"); //check .correct class //if yes if ($(this).hasclass('correct')) { //add .correctanswer class $(this).addclass('correctanswer'); //find next span , change

javascript - Gmaps not working properly on js -

Image
i've gmap loading problem google javascript api , not load when initialized project. tried of available solutions did not work. in addition, if reloaded or resized page, works. <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=aizasydwtqpi0gtmb6hoijbblcgyfzlakadmqli"></script> @scripts.render("~/bundles/gmaps") <script type="text/javascript"> $(document).ready(function () { var map = new gmaps({ div: '#gmap_basic', lat: 25.261502, lng: 55.29155, zoom: 15, width: '100%', height: '300px', }); map.addmarker({ lat: 25.261502, lng: 55.29155, }); }) </script> html: <div class="portlet-body"> <div id="gmap_basic" class="

html - css calc() not producing expected result -

i trying achieve specific of responsive search bar display search input, select option filters , submit button in 1 row. submit button , select have defined widths of 44px , 110px respectively , want search input field occupy rest of available space, therefore use width: calc(100% - 154px); . not working intended. please see example here https://jsfiddle.net/t97fqqxu/ html: <div id="main-search"> <form> <input type="text" placeholder="search.." /> <select> <option>option</option> </select> <input type="submit" value="submit"/> </form> </div> css #main-search { background-color: @palette-white; } #main-search form { width: 100%; background: green; } #main-search input[type="text"] { width: calc(100% - 154px); } #main-search select { width: 110px; } #main-search input[type="submi

java - Libsvm classes not in CLASSPATH -

i trying use weka libsvm implementation. have installed weka - 3.6 version , add in weka folder libsvm.jar file. put whole path of .jar file in classpath in environment variables. when tried use libsvm function weka api receiving following message: libsvm classes not in classpath . when type in console echo %classpath% getting c:\program files\weka-3-6\libsvm.jar libsvm file. idea may wrong? the default batch script run weka using following commands: set _cmd=%1 set _java=javaw if "%_cmd%"=="" set _cmd=default if "%_cmd%"=="-h" set _java=java %_java% -classpath . runweka -i .\runweka.ini -w .\weka.jar -c %_cmd% "%2" i tried run weka.jar file java -jar weka.jar. got same message error in both cases. if explicitly use -classpath flag, %classpath% variable not used. can either add libsvm -classpath (it's semicolon separated on windows) or add weka classpath variable.

java - How to set the Exchange of a bean to ProducerTemplate -

i m running test cameltestsupport, public class testintegrationbeanctrlcontrat extends cameltestsupport { @endpointinject(uri = "mock:result") protected mockendpoint resultendpoint; @produce(uri = "direct:start") protected producertemplate template; @override protected routebuilder createroutebuilder() { return new routebuilder() { @override public void configure() { this.from("direct:start") .bean(myclassa.class, "methodofmyclassa").to("mock:result"); } }; } @test public void test_controlebean_integration() { this.template.sendbody(....); } i m trying put body of bean producer template , exemple : template.sendbody( bean(myclassb.class, "methodofmyclassb") ) is possible ? in general how can setup input in producetemplace. i’m not sure understand needs if want inject result of bean in route process should use camel mock inject bean process (mycl

scipy - error in solving acoupled,first order differential equations in ipython -

i have following coupled, first order differential equations: db(t)/dt=-a*a(t); da(t)/dt=b*b(t); dj(t)/dt=c a(t)-d b(t) solve system using paramenters = 0.05, b = 0.02, c = 0.03 , d = 0.04 of own choice on time interval 0 200. here code: a=0.05 b=0.02 c=0.03 d=0.04 def function(x,t): x1, x2, x3 = x[0], x[1], x[2] #x1, x2, x3 = a, b, j dx1=b*x1 dx2=-a*x0 dx3=c*x0-d*x1 return [dx1, dx2, dx3] x0 = [100,100, 1] t = linspace(0, 200, 200) x = odeint(function, x0, t) the output got is: --------------------------------------------------------------------------- typeerror traceback (most recent call last) <ipython-input-11-f8f398346307> in function(x, t) 8 #x1, x2, x3 = a, b, j 9 dx1=b*x1 ---> 10 dx2=-a*x0 11 dx3=c*x0-d*x1 12 return [dx1, dx2, dx3] typeerror: can't multiply sequence non-int of type 'float' -----------------------------------------------

Postgresql and Docker -

we have application splitted in several git repositories: webapp git repository (django + postgres + celery) workers (python + celery) with need rabbitmq-server. able dockerize first webapp had questions dockerisation , more postgres. today have 1 database, used our webbapp. database created in postgres container using script placed in /docker-entrypoint-initdb.d specified in official postgres container . if tomorrow, have second web apps, need use postgres database, absolutely need modify current postgres container create new database ? better create new postgres container particular database? , 1 thing have difficulties with: data in container not persistent. data written in postgres container destroyed when container stopped. docker's compliant solution keep thoses data persistent ? thanks help. you should use data volume make data persistent. docker run -v /var/lib/postgresql/data --name dbdata busybox /bin/true docker run --volume-from dbdata post

ios - xcode 6.2. view controllers greyed out, locked -

i have xcode project buttons , other objects in it. objects greyed out in view now. project still compiles , shows buttons fine. saw posts using auto-layout, changing size-classes, , modifying ib. whenever make of changes, lock icon shows on screen , nothing changes. can go old version of code, i'd rather find out fix issue. what doing break it? exploring through different xcode windows , views, , don't know when viewcontroller objects became affected.

Python Pandas: How to groupby and compare columns -

here datafarme 'df': match name group adamant adamant home network 86 adamant adamant, ltd. 86 adamant bild tov adamant-bild 86 360works 360works 94 360works 360works.com 94 per group number want compare names 1 one , see if matched same word 'match' column. so desired output counts: if match count 'tp' , if not count 'fn'. i had idea of counting number of match words per group number not want: df.groupby(group).count() does body have idea how it? if understood unclear question, should work: import re import pandas df = pandas.dataframe([['adamant', 'adamant home network', 86], ['adamant', 'adamant, ltd.', 86], ['adamant bild', "tov adamant-bild", 86], ['360works', '360works', 94], ['360works &

how to add multiple map markers in android app -

i have google map displayed complete in app. problem how add multiple map markers in app. different locations? , try coded here problem not work.. like this import android.os.bundle; import android.support.v4.app.fragmentactivity; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.markeroptions; public class mapsactivity extends fragmentactivity { private googlemap mmap; // might null if google play services apk not available. @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_maps); setupmapifneeded(); } @override protected void onresume() { super.onresume(); setupmapifneeded(); } private void setupmapifneeded() { if (mmap == null) { // try obtain map suppor

.net - in NCalc why does 'if (12 > 8)' resolve to false? -

brand new ncalc. i have formula evaluated , im getting unexpected (to me) results. the @t_no_starters parameter used = 12. if formula if (@t_no_starters >= 8 ,'t','f') result false if formula if (@t_no_starters >= 8.0 ,'t','f') result true if formula if (@t_no_starters >= 10 ,'t','f') result true im not sure going on, why 8 false yet 8.0 true 10 again whole number true? how can ensure evaluation correct? turn every number decimal? can set parameter type? when im entering parameters? below test code use arrive @ above. private sub button40_click(sender object, e eventargs) handles button40.click dim formulaline string = "if (@t_no_starters >= 8 ,'t','f')" dim parms new dictionary(of string, string) parms.add("t_no_starters", 12) dim ouranswer = formulacalculator.msgboxeval(formulaline, parms) end sub function msgboxeval(formula st

Change in recent Swift update regarding mutating structs? -

i following along in stanford ios course , have question believe related recent update. here section of code: func evaluate(ops: [op]) -> (result: double?,remainingops: [op]) { let op = ops.removelast() //*i thought ops immutable? } on video, instructor gets error says cannot because ops immutable. makes complete sense when try typing in not error. mean? change in recent swift update structs passed methods mutable? ideas? in video, instructor solves problem creating instance variable copy of ops no longer error , understand why is. edit when typing playground still error not in swift file. reference here entire file far. ideas? want understand going on here: import foundation class calculatorbrain { private enum op { case operand(double) case unaryoperation(string,double -> double) case binaryoperation(string, (double,double) -> double) } private var opstack = [op]() private var knownops = [string:op]()

php - ACF Custom fields empty display text -

can know answer have field set , want when empty show text there showing nothing <div class="place-bottom-row"> <?php if(get_field('pojedynczy_wpis')): $i = 0; $today = date('d-m-y'); //this has match format of date field ?> <?php while(has_sub_field('pojedynczy_wpis')): ?> <?php if(strtotime($today) <= strtotime(get_sub_field('danie_na_dzien'))){ ?> <?php if($i < 2){ ?> <?php $i++; ?> <?php the_sub_field('danie_rodzaj'); ?> <?php the_sub_field('danie_opis'); ?> <?php the_sub_field('danie_cena'); ?> <?php } ?> <?php } ?> <?php endwhile; ?> <?php else: ?> <?php endif; ?> </div><!-- place bottom row end --> rather using the_sub_fie

php - WordPress Taxonomy get category -

Image
hopefully easy fix someone! i have custom post type, named 'products'. using code, getting name of each 'product': <?php //define custom post type name in arguments $args = array('post_type' => 'products'); //define loop based on arguments $loop = new wp_query( $args ); //display contents while ( $loop->have_posts() ) : $loop->the_post(); ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php endwhile;?> each of these products inside category. want not the_title, category. i tried using <?php the_category(); ?> no luck. anyone got clue? edit: sorry, have these created inside products custom post type. add_action( 'init', 'create_product_cat_external' ); function create_product_cat_external() { register_taxonomy( 'externalproducts', 'products', array( 'label' => __( 'e

google chrome - How to show Haxe compiled to Javascript Runtime Exceptions? -

i'm working on haxe project, runtime exceptions don't appear messaging, if have rte in messagehandler, never know if code didn't executed correctly. how can make them appear? i'm using chrome. haxe errors not special in way. if throw (or code does) see same kind of error messages used plain js. guess should investigate code try/catch hide errors , such.

javascript - How do you correctly import react into a node-webkit app? -

i'm trying create node-webkit app, , want use react.js framework. after trying react , creating components, tried use follows in node-webkit app: 'use strict'; require('react'); whenever open node-webkit app, includes above script @ end of body error: referenceerror: document not defined @ object.<anonymous> (c:\users\rtol\dropbox\code\node- webkit\wallpapermanager3.0\node_modules\react\lib\csspropertyoperations.js:31:7) .... am doing wrong? documentation i've found indicates correct way include react when using node. have npm installed react, according package.json version 0.13.2. for instance react-nodewebkit starter kit has it's index.jsx follows. var react = require('react'); var helloworld = require('./components/helloworld.jsx'); react.render(<helloworld />, document.getelementbyid('content')); so can't figure out why doesn't work. nw.js (which node-webkit renamed to) has 2 conte

c++ - Drawing polylines with specific angles in QT -

is possible add specific angles polyline in qt? i draw polyline with: qpointf points[3] = { qpointf(x,y), qpointf(x2,y2}; qpointf(x3,y3}; painter.drawpolyline(points, 3); i need polyline arrow @ end. idea copy last line part, reduce size , give him specific angle. i don't think possible, can suggest @ analog clock example on documentation see how draw rotated arrow.

sql - PHP & MYSQL: How to resolve ambiguous column names in JOIN operation? -

i have 2 tables in database: news ('id' - news id, 'user' - user id of author) users ('id' - user id) i want make select * news join users on news.user = user.id , when results in php it's like: $row = mysql_fetch_array($result) , , column names $row['column-name'] ... how news id , user id, having same column name? update: quick answers. aliases seem best solution. you can set aliases columns selecting: $query = 'select news.id newsid, user.id userid, [other fields here] news join users on news.user = user.id'

java - How to get a value from a list in apache velocity file? -

how value uirowformatlist in vm file? using below code this. #set($i = $velocitycount-1) #set($rowformatcomponents = $uirowformatlist.get($i)) i getting exception when run this: "fo:table-body" missing child elements. required content model: marker* (table-row+|table-cell+) when hardcoding value of 0 in method this, displaying proper values: #set($rowformatcomponents = $uirowformatlist.get(0)

php - dompdf->render(); not working in api class -

i'm having problem when trying render html pdf using dompdf. i have code placed inside class , after procedure code create pdf of html. this code have @ moment: $templatefile = file_get_contents("templates/costreport.htm"); //fill headers $templatefile = str_replace("%dates%",stripslashes($startdate)." - ".stripslashes($enddate),$templatefile); if ($siteid>0) { $pdfname = "costreport-".$clientid.".pdf"; } else { $pdfname = "costreport-".$clientid."-".$siteid.".pdf"; } //insert database //close , output pdf document $pdfname = str_replace("/","-",$pdfname); $pdfname = str_replace("\\","-",$pdfname); //create pdf // unregister yii's autoloader spl_autoload_unregister('my_autoloader'); // register dompdf's autoloader require_once("../system/dompdf/dompdf_config.inc.php"); // register yii's autoloader again spl_

android - Fonts have different physical sizes on different displays even when sizes are setted in SP -

i'm testing app on 2 devices. first htc 1 s have 540x960 4.3 inches display , 256ppi. second sony miro - 320x480, 165ppi, 3.5 inches. in app set font sizes "sp" units, should provide density-independence , make fonts looks same on display: <style name = "whitetextmedium" parent="@android:style/textappearance.medium"> <item name="android:textcolor">@color/white</item> <item name="android:textsize">16sp</item> </style> but got fonts on sony phone bigger on htc one. how make them same? or not getting how should work? compared font sizes on these 2 devices in other apps , on both devices fonts have same physical sizes.

javascript - Adding ruler in leaflet and toggling grids on map -

is there way add ruler map ? requirment add ruler on map. along x , y axis. http://www.cap-ny153.org/a%20utm%209.gif i using leaflet creat floorplan application , need ruler , grid on map. also ,i used simplegraticule draw grid on floormap. need toggle button or control switch on or switch off grids , rulers on map. please suggest if possible in leaflet draw ruler on map , providing toggle switch on , off. since simplegraticule extends l.layergroup( https://github.com/ablakey/leaflet.simplegraticule/blob/master/l.simplegraticule.js#l6 ), have option of adding standard overlay layer leaflet's layer control...which provides simple checkbox toggling overlays on , off.looks like var sg = l.simplegraticule(options); sg.addto(map); var overlaymaps = {"graticule": sg}; l.control.layers(null, overlaymaps).addto(map);

python - wxpython: small square panel in corner -

Image
iam trying place small square panel(panel2) @ bottom rignt corner of panel(panel1). the panel1 should fill entire frame , expand frame resized, squarepanel (panel2) should remain without expanding or resizing. something this: i think iam missing small thing can't figure out how acheive this. square panel expands along panel1 , don't want happen. here's simplified code: import wx class myframe(wx.frame): def __init__(self, parent, id, title): wx.frame.__init__(self, parent, id, title,size=(250, 250)) #toppanel = wx.panel(self) panel1 = wx.panel(self, -1) panel2 = wx.panel(panel1, -1, size = (100,100)) panel2.setbackgroundcolour('gray') s = wx.boxsizer(wx.vertical) s.add(panel2,1, wx.align_right | wx.align_bottom) panel1.setsizer(s) sizer = wx.boxsizer(wx.vertical) sizer.add(panel1,1,flag = wx.expand) self.setsizer(sizer) class myapp(wx.app): def oninit

plsql - Oracle pipelined table and Materialzed View -

i have type defined in oracle, have function returns collection of type. like: type: create or replace type mildap object (then type definition here) the collection: create or replace type mildaps table of mildap; the function: function f_testquery return mildaps (function work here populate mildaps) when execute sql query return mildap results expected. looks this: select * table(f_testquery) due work function doing runs pretty slow, wanting materialize it...like so: create materialized view wevldap_mv refresh complete on demand start to_date('29-04-2015', 'dd-mm-yyyy') next trunc(sysdate +1) select * table(f_testquery); but ora-06502 numeric or value error. is possible materialize in way?...any ideas? please try this. create materialized view wevldap_mv refresh complete on demand start to_date('29-04-2015', 'dd-mm-yyyy') next to_date(sysdate, 'dd-mm-yyyy')+1 select * table(f_testquery); regards.

javascript - Image cropping with scrollbar - JQuery Issue on Mobile device -

i developing asp.net (c#) webpage. accessing on mobile. image displayed in asp image control scrollbar. after cropping need crop image. code is <asp:image id="imgcrop" runat="server" /> for scrollbar, external jquery used (overflow & panel scrollbar not supported in mobile) $(function () { $('.scroll-pane').jscrollpane(); }); i using "jquery.jcrop.js"" jquery image cropping , assign contol jquery('#imgcrop').jcrop({ onselect: storecoords }); here, below code used display asp.net image jscrollbar <div class="scroll-pane"> <asp:image id="imgcrop" runat="server" /> </div> css: .scroll-pane{ width: 400px; height: 200px; overflow: auto; } i used above code. can able see scrollbar in mobile. once upload image, scrollbar showing. problem when i trying move scrollbar, croppin

selenium - Optimal Pattern or Model for parameterized data driven testing Webdriver & Java -

i should preface saying relative novice java quite easy 1 crack in terms of simple , efficient solution. haven’t familiarized patterns yet! i have need automate population of form field data in web app using webdriver , java. i have number of properties: “house1”, “house2”, “house3” select dropdown @ top of form. if select “house1” must populate address “123 boulevard” if select “house2” must populate address “101 ocean drive” etc... i can think of 2 ways of organizing in junit/webdriver/java setup: 1: use junit 4’s @runwith(parameterized.class) feature wherein read each house name in flat file (.csv example) , pass in test invoked once each time each of 3 rows of data (house names):- @before public void setup(){ driver.get(this.house); } @test public void oakleaficonpresent(){ webelement formfieldone = driver.findelement(by.xpath(".//formfieldone")); switch (house) { case "house1": { formfieldone.sendkeys("

code analysis - CA2202 Do not dispose objects multiple times - many times in managed c++ -

we getting many instances of: "ca2202 not dispose objects multiple times" in managed c++ code analysis on. to me seems mistake in code analysis, may missing something. ca2202 not dispose objects multiple times object 'gcnew configurationdataassembler()' can disposed more once in method 'dataassembler::createconfiguration(guid, int^, int^, objectreference^, objectreference^, objectreference^, list^%, plresult^%)'. avoid generating system.objectdisposedexception should not call dispose more 1 time on object.: lines: 935, 938 pl dataassembler.cpp 935 the 2 lines mentions "return nullptr" , "return configdto" i have marked lines comments // here, // , here here function //--------------------------------------------------------------------------------------------------------- // idataassembler ivara::pl::data::uidata::control::mclbconfig^ dataassembler::createconfiguration( system::guid activitykey, int subscript

minify - Is it possible to remove code comments with Git -

might go against git best practise, possible remove code comments or minify code git command. git pull --minify . no. git must not change code goes in or out of repository unless change symmetric, when can repeat transformation in both ways. typical cases here end of line transformations (unix / mac / windows). dangerous (just try image file). the reason why git can't changes stripping comments: if made change file, git have remember "i did strip comments", put comments (hoping merge wouldn't create additional conflicts) , commit result repository. so create more places can break. worse, being "hidden" part of process, see surprising error messages ("??? didn't write this?? git doing????")

visual studio 2010 - Get data into tabular format on printing in vb.net -

i have program takes attendee’s names , contact details , writes them text file. in all, there 20 rows , 5 columns used in form when user clicks on ‘save’ button, these details written text file. the code using works fine, , shown below. please note code truncated first attendee only. dim attendeedata = new directoryinfo(path.combine(environment.getfolderpath(environment.specialfolder.desktop), "attendee information\" & textbox1.text)) dim filenametxt string = path.combine(attendeedata.fullname, "attendee data" + ".txt") dim filetxt new system.io.streamwriter(filenametxt) ‘write attendee details text file ‘attendee number 1 filetxt.write(form1.textbox2.text) ‘attendee’s name filetxt.writeline("") filetxt.write(form1.textbox3.text) ‘attendee's nationality filetxt.writeline("")

ios - How to transfer user from Apple Watch Notification to Apple Watch App? -

when push notification displayed on apple watch, possibility open apple watch app tap app icon in upper left corner. now, i´m reviewing our tracking data, no user seems know this. how can install tap area in notification view transfers user in watch app? the first thing understand notifications aren't specific either iphone or apple watch. they're same old notifications we've been dealing years, , nothing has changed. means there's no such thing "apple watch-specific notification" or "iphone-only notification." ios decides route notification based on own heuristics. there no way programmatically control device receives alert. that said, stk correct have add actions category set notification. notification essentials section of apple watch programming guide has sample code. because there no such thing iphone- or watch-specific notification, you're correct see these actions on both devices. so, you'll have meaningful on bot

Sharepoint 2010: Central Admin connection failing with - The login is from an untrusted domain and cannot be used with Windows authentication -

our setup: server1: sharepoint running server2: sql server running our sharepoint 2010 working fine , website went down , when tried accessing central admin found following issue in error log: system.data.sqlclient.sqlexception: login failed. login untrusted domain , cannot used windows authentication. i read on internet happens when server loses trust domain removed sharepoint server domain , added back. result: same. no solution. i tried other methods people have asked updating host file did not work. in order check if connection working or not...i did udl test created file networkcheck.udl on sharepoint server machine (server1) , tried running windows authentication , tried connect db server (server2). result: connection successful. can please guide regarding this. don't know why sharepoint won't connect after udl test being successful. because don't know enough farm whole may best looking @ issue unrelated sharepoint. are bother servers in s

javascript - How to change the direction of writing depending of the country? -

i working major improvement in website, language english need support hebrew, have modify text components , forms purpose. at moment have added next line: <meta http-equiv="content-language" content="de, fr, it, en, he, iw"/> for support special characters or symbols (right?) but have seen metadata dir in html tag needed specify direction of writing, suppose needed in text components. question is: how change direction of writing in these form components depending of country? i have found clean solution topic, working class or tag name or id can specify in css stylesheets property direction: rtl | ltr for example, if need more possibilities of customizing inside website or hybrid app can try work media queries, different stylesheets depending device , on, know, beautiful world of media queries!