Posts

Showing posts from March, 2012

How to remove the default margin on the content of a wpf TabItem in C# Code -

Image
i'm using tabcontrol class in wpf , i've noticed content of each tabitem has default margin of 4 pixels on sides. i'm building tab control dynamically in c# code, i've seen xaml solution below. how achievable in c# code or templating. <tabitem> <grid margin="-4"> </grid> <tabitem> you have assign grid id, example (pertinent case): <grid name ="grd"> </grid> then apply margin spec following: grd.margin = new thickness(-4); also, can use variation of syntax: grd.margin = new thickness(-4,-4,-4,-4); the same technique can apply other controls. read more on topic (wpf margin) at: https://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.margin.aspx hope help.

Should I use Try as return type in Scala services? -

i'm creating services in scala in java: trait personservice { def getbyid(id: long): person def getall: iterable[person] } and have corresponding implementation of service. actually service interacts db layer , business logic. methods can throw exceptions. so have question: should wrap return type of methods of service try ? i.e. should use following declaration: trait personservice { def getbyid(id: long): try[person] def getall: try[iterable[person]] } it depends on whether error produced service meaningful consumer. i.e. expected know different db failures , potentially retry? or mapping exceptions consumer meaningful instance? in both of cases, use try[person] if end logging error , trying avoid, i'd recommend logging in personservice , returning option[persons] . alternatively, if want communicate information distinguish failure empty not rise level of exception, consider using either[failurereason,person]

Multiple strings in oracle -

i make multiple strings in oracle following table http://sqlfiddle.com/#!4/546b1 create table test ( client varchar(20), dat varchar(20),secuence varchar(20),cod1 varchar(20),cod2 varchar(20), personal varchar(20),comments varchar(140), area varchar(20),phone varchar(20)); insert test values ('2869', '17/04/2010 03:12','2','..', '','','drummer lars ulrich in local newspaper.','',''); insert test values ('2869', '17/04/2010 03:12','1','..', '','','formed in 1981 when vocalist/guitarist james hetfield responded advertisement posted by','',''); insert test values ('2869', '17/04/2010 03:12','0','ls', 'te','1abfrn','metallica american heavy metal band formed in los angeles, california. metallica wasadvertisement posted drummer lars ulrich in a,','01442','2236087&#

jsonschema - choosing between different objects in JSON-schema -

i'm creating schema receipts , want have master schema core concepts variety of different detail objects specialized receipt types (e.g. itemized hotel receipts, etc.) current implementation leveraging oneof mechanism in json-schema { "$schema": "http://json-schema.org/draft-04/schema#", "title": "receipt", "type": "object", "properties": { ... "amount": { "type": "number" }, "detail": { "type": "object", "oneof": [ { "$ref": "general-detail.schema.json" }, { "$ref": "hotel-detail.schema.json" }, ... ] } } } the problem approach when validate (using tv4), appears of schemas specified in oneof being checked, , in fact, returning errors. can minimize effect gettin

c# - Azure Mobile Services - UpdateAsync Does Not Update All Fields -

i'm using azure mobile services , running issue "updateasync" method. many of properties storing in item updateasync method works fine. others update ignored. has ran issue before? call making nothing fancy , code below. it seems issue of property not being updated may limited properties contain number in name. example cp20m 1 of properties not updating through method. property, "weight" updates without issue. both doubles. make sense? way have of updating these fields seems work delete entry , insert new entry. appropriate values properties. any ideas appreciated. public async task updateuserprofileitemasync(userprofile userprofile) { await _userprofiletable.updateasync(userprofile); await syncasync(); } just rename field having problem with. worked me.

angularjs - MediaWiki Query and/or WikidataQuery to find Wikipedia article -

this isn't question abut angularjs wikimedia , wikidata query api's. although trying display content of wikipedia article in angularjs after doing query isn't problem. know how display it... problem search article or articles. i'm trying query wikipedia historical event date as well geo-location. let's pick random event, event. let's " 1986 mozambican tupolev tu-134 crash ". link: http://en.wikipedia.org/wiki/1986_mozambican_tupolev_tu-134_crash from article, can see exact date: 19 october 1986 geo-location of event: -25.911389, 31.957222 i'm trying build search in angularjs can use either date-range and/or geolocation coordinates find event. i aware mediawiki has geolocation api now, , able find above event either keyword or coordinates. result turns other articles exist within radius around using this: http://en.wikipedia.org/w/api.php?action=query&list=geosearch&gsradius=10000&gscoord=-25.911389|31.957222&pro

DATALENGTH VARCHAR in SQL Server -

according msdn storage size of varchar data type actual length of data entered + 2 bytes. i'm trying understand why when run query: declare @varchar varchar(40) = 'racing club de avellaneda' select datalength(@varchar) bytes, len(@varchar) characters; the storage size of @varchar same char data type, it's 25 , not 27 (25+2). does has datalength function? datalength tell number of bytes of data, doesn't include 2 bytes precede data in storage. 2 byte overhead of varchar recording number of bytes in string - i.e. in case 25

ruby on rails 3 - How to handle concurrent requests that delete and create the same rows? -

i have table looks following: game_stats table: id | game_id | player_id | stats | (many other cols...) ---------------------- 1 | 'game_abc' | 8 | 'r r b s' | ... 2 | 'game_abc' | 9 | 's b s' | ... a user uploads data given game in bulk, submitting both players' data @ once. example: "game": { id: 'game_abc', player_stats: { 8: { stats: 'r r b s' }, 9: { stats: 's b s' } } } submitting server should result in first table. instead of updating existing rows when same data submitted again (with revisions, example) in controller first delete existing rows in game_stats table have given game_id: class gamestatcontroller def update gamestat.where("game_id = ?", game_id).destroy_all params[:game][:player_stats].each |stats| game_stat.save end end end this works fine single threaded or single process server. problem i'm

decorating a method in python -

i making little wrapper module public library, library has lot of repetition, after object creation, maybe methods require same data elements. i have pass same data in wrapper class, don't want pass same thing on , over. store data in wrapper class , apply if not included in method. if things hairy down road, want method arguments overwrite class defaults. here code snippet illustrates goals. class stackoverflow(): def __init__(self,**kwargs): self.gen_args = {} #optionally add repeated element object if 'index' in kwargs: self.gen_args['index'] = kwargs['index'] if 'doc_type' in kwargs: self.gen_args['doc_type'] = kwargs['doc_type'] #this problem def gen_args(fn): def inner(self,*args,**kwargs): kwargs.update(self.gen_args) return fn(*args,**kwargs) return inner #there bunch of these do_stuffs require ind

c code: for loop compiles with gcc but doesn't run -

Image
i'm new c programming. i'm trying print numbers 1 10. #include <stdio.h> int main(){ int i; for(i=1; i<11; i++){ printf("%s\n", i); } getchar(); } it compiles in powershell when type: gcc .\forloop.c when try run program ./a error message: any appreciated. printf("%s\n", i); that tries print string. i integer. crash when dereferences i string. try printf("%d\n", i);

apache - Are the .config files part of ASP.NET? -

i'm programming web mvc pattern, i've created web.config files needed (~/web.config , ~/views/web.config), want run web in apache. i've heard .config files run in iis. can do? multiplatform solution need? example of web.config <system.web.webpages.razor> <host factorytype="system.web.mvc.mvcwebrazorhostfactory, system.web.mvc, version=5.2.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" /> <pages pagebasetype="system.web.mvc.webviewpage"> <namespaces> <add namespace="system.web.mvc" /> <add namespace="system.web.mvc.ajax" /> <add namespace="system.web.mvc.html" /> <add namespace="system.web.optimization"/> <add namespace="system.web.routing" /> <add namespace="myweb" /> </namespaces> </pages> </system.web.webpages.razor>

python - settings.DATABASES is improperly configured. Please supply the NAME value -

i know people asked similar question before. it's engine value. 1 know how solve error name value? deployed heroku , works fine. however, in local, gives me error here traceback: traceback: file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) file "/users/qiaoweiliu/google drive/heroku/luxingnan/views.py" in home 17. return render(request,'luxingnan/home.html',{'auth_form':auth_form, 'user_form':user_form,'cars':cars,'next_url': '/',}) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/shortcuts.py" in render 67. template_name, context, request=request, using=using) file "/users/qiaoweiliu/.virtualenvs/heroku/lib/python2.7/site-packages/django/template/loader.py" in render_to_s

ajax - Display database value in array PHP MYSQLi -

i"m attempting display data i've sent ajax php file, reason not displaying on page. way works enter search term input field, , ajax script post value php script, return database value requested back. error_reporting(e_all); ini_set('display_errors', '1'); if (isset($_post['name']) === true && empty($_post['name']) === false) { //require '../db/connect.php'; $con = mysqli_connect("localhost","root","root","retail_management_db"); $name = mysqli_real_escape_string($con,trim($_post['name'])); $query = "select `names`.`location` `names` where`names`.`name` = {$name}"; $result = mysqli_query($con, $query); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_array($result)) { $loc = $row['location']; echo $loc; }//close while loop } else {

mysql - echo PDO query as string in PHP -

basically trying return total number of columns correspond given criteria: $exec = $link->query("select count(*) `requests` language='php'"); $result = $exec->fetch(pdo::fetch_assoc); echo $result[0]; however, above not return sql query correct since returns value when executed in phpmyadmin. since explicitly used flag pdo::fetch_assoc , need point on associative index returns. i'd suggest put alias on count() select count(*) total `requests` language='php' then access after fetching: echo $result['total']; another way use ->fetchcolumn() : $count = $exec->fetchcolumn(); echo $count;

c++ random number generator that allows user to choose range -

i have come random number generator generate 5 random numbers within range of 2 number entered user. example: user first enters 1 10. random numbers generated 2,3,4,5,8. can give me 1 random number 5 times, not 5 different random numbers. please see below. appreciated. thanks! #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { int num1, num2, randnum, seed; cout << "enter number 1.\n"; cin >> num1; cout << "enter number 2.\n"; cin >> num2; seed = num1 - num2; randnum = rand() % seed + 1; cout << randnum << "\n"; cout << randnum << "\n"; cout << randnum << "\n"; cout << randnum << "\n"; cout << randnum << "\n"; return 0; } randnum isn't modified each time call cout di

php - Accessing @attribute from SimpleXML -

i having problem accessing @attribute section of simplexml object. when var_dump entire object, correct output, , when var_dump rest of object (the nested tags), correct output, when follow docs , var_dump $xml->office->{'@attributes'} , empty object, despite fact first var_dump shows there attributes output. anyone know doing wrong here/how can make work? you can attributes of xml element calling attributes() function on xml node. can var_dump return value of function. more info @ php.net http://php.net/simplexmlelement.attributes example code page: $xml = simplexml_load_string($string); foreach($xml->foo[0]->attributes() $a => $b) { echo $a,'="',$b,"\"\n"; }

javascript - Variable Implicitly Declared and Prototypes -

trying keep short. using phpstorm on code , got few errors. it says function naming locations has "variable implicitly declared" function towngate10() { updatedisplay(locations[10].description); if (!gate10) { score = score+5; gate10 = true; } playerlocation = 10; displayscore(); document.getelementbyid("gonorth").disabled=true; document.getelementbyid("gosouth").disabled=false; document.getelementbyid("goeast").disabled=true; document.getelementbyid("gowest").disabled=true; } also, want make sure went prototypes correctly sample global arrays: var locations = [10]; locations[0] = new location(0,"intersection","this awoke."); locations[1] = new location(1,"cornfield","the cornfields expand miles."); locations[2] = new location(2,"lake","a large lake formed river flowing east.", new item(1,"fish","a

Drawing an SVG Selection Box with Batik -

Image
i notice on many svg builder tools each element can resized , rotated. shown below what common way implement whenever element whenever clicked, bordering line appear long side small rectangles used resizing rotating ? are these objects "hidden" default , visible during mouse click ? or have drawn on every mousedown , removed on every mouseup ? are these objects "hidden" default , visible during mouse click ? no have draw elements yourself. all tools see floating around have code somewhere create rectangle see on top of selected item - rectangle called visible bounding box of element - in modern browser fetched using svg getbbox() method. more info on method here . the returned bbox gives information need( x,y,width,height ) draw selection rectangle minus colors , strokes how svg tools work in regards this: typically have canvas on work (might div, might svg rectangle whatever) - nothing html5 canvas here - note you dra

ios - Swift Cannot Assign to immutable value of type NSData -

this question has answer here: convert utf-8 encoded nsdata nsstring 6 answers i have let data = nsdata(bytes: &positionvalue, length: sizeof(uint8)) and let datastring=nsstring(bytes: &data, length: sizeof(uint8), encoding: nsutf8stringencoding) unfortunately compiler throws error @ second line, saying can't assign immutable value of type nsdata. how go converting original data variable string encoding sutf8stringencoding ? update: xcode 7.2 • swift 2.1.1 let myteststring = "hello world" // converting string nsdata if let mystringdata = myteststring.datausingencoding(nsutf8stringencoding) { // converting nsdata string let mystringfromdata = string(data: mystringdata, encoding: nsutf8stringencoding) ?? "hello world" }

.htaccess - CSS is not working in my CodeIgniter Project, But why? -

my project directory @ server address : ci.xyz.com/ci/h/ used on codeigniter project: $config['base_url'] = './'; $config['index_page'] = '';//index.php route as: $route['default_controller'] = "home/index/"; htaccess <ifmodule mod_rewrite.c> rewriteengine on rewritebase /ci/h/ rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php?/$1 [l] rewritecond %{request_uri} ^application.* rewriterule ^(.*)$ /index.php?/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?/$1 [l] <ifmodule !mod_rewrite.c> errordocument 404 /index.php </ifmodule> when index function of home (from route default controller) loaded resources working. when click link (such home/aboutus) resources not working display text. used link echo base_url('home/aboutus'); , resoureces echo base_url('assets/theme/css/style.css'); what wrong ?

PHP Combine Multidimensional Array -

i trying merge 2 arrays containing multidimensional array , create third array in format below" here first multidimensional array: array ( [usa1] => array ( [0] => newyork [1] => mass ) [usa2] => array ( [0] => newyork ) [usa3] => array ( [0] => newyork ) ) this second multidimensional array: array ( [usa1] => array ( [newyork] => array ( [0] => array ( [0] => town1 [1] => town2 ) ) [mass] => array ( [0] => array ( [0] => town3 [1] => town4 ) ) ) [usa2] => array ( [newyork] => array ( [0] => array (

Jmeter two response code assertion -

i made response code 422 success http request in jmeter response assertion, , works. jmeter assign response code 200 failed http request. i add 422 , 200 in pattern test jmeter assert response code 200 success http request. how assign response code 200 or 422 success http request? regards, stefio 200|422 the pipe character | or operator in general, can use perl5 regular expressions in jmeter

javascript - Testing HTML5 game in browser? -

hey im new web development , writing simple html5 game 3 files(index.html, style.css, , game.js) in folder , wasnt sure if there way test in browser? ive tried opening html file in browser doesnt have functionality or visual differences .js file. im wondering if can localhost or can see progress. make sure files in same folder , link them such: <link href="style.css" rel="stylesheet" type="text/css"/> <script src="game.js"></script> then can open html file in browser, long don't require server run app, code run fine.

python - Recommended way to build cross platform desktop application using linux development machine -

i pretty familiar building web based apps using python django on linux machine. when decided try hand @ building desktop applications can run on windows/linux didn't know begin. i know can surely build windows desktop application on windows machine. pretty comfortable linux , don't want out of comfort zone. can guide me tools can begin develop simple windows desktop application. target windows 7 starters. any guidance hugely appreciated. what looking gui tool-kit bindings python. tkinter de facto standard python gui , cross platform. qt popular choice license more restrictive tkinter allow transition c++ programming qt easier if may want down road. choice you.

bash - grep -l 'string' path prints the path followed by 'is a directory' -

i have no idea i'm doing wrong. i'm trying grep return string matches in files in directory, instead returning path followed 'is directory'. looked in man pages , did grep --help, not understand syntax. you need -r recursive. the following search through some_directory looking files contain something : grep -l -r some_directory if don't specify -r , grep thinks trying search directory , appropriately responds: grep: some_directory: directory with -r , grep understands want files in directory tree starting some_directory . to retrieve file names without paths to remove paths file names, can, example, use basename : grep --null -l -r some_directory | xargs -0 -n1 basename if want eliminate some_directory while keeping subdirectories, use: ( cd some_directory; grep -l -r . )

sql - how to get the prepared statement query after binding -

i using prepared statement this preparedstatement pstmt = getconnection().preparestatement(insert_query); pstmt.setint(1,userdetails.getusersid()); log.debug("sql inserting child transactions " + pstmt.tostring()); i want log exact sql statement after binding log file thing not working. logging sqlserverpreparedstatement:7 . searched on internet did not satisfactory answer. appreciated. you can try enable jdbc internal logging setting printwriter on drivermanager. log4j2 provides io streams module can include output in normal log file. sample code: printwriter logger = iobuilder.forlogger(drivermanager.class) .setlevel(level.debug) .buildprintwriter(); drivermanager.setlogwriter(logger); in addition, individual jdbc drivers provide proprietary logging mechanisms, enabled system property. need consult documentation specific driver details.

unit testing - How to test function in AngularJS service with mock data -

how create jasmine unit test 1 function in angularjs service provider. want create mock data myobject , test function getobjectshape() mock data parameter. how achieve that? (function () { 'use strict'; angular.module('objectshapes') .provider('shapesresolver', shapesresolver); function shapesresolver() { this.$get = function () { return resolver; }; function resolver(myobject) { var service = { getobjectshape: getobjectshape }; function getobjectshape() { return myobject.shape; } } } })(); here's skeleton of test service. describe('shapesresolver service', function() { var shapesresolver; beforeeach(module('objectshapes')); beforeeach(inject(function(_shapesresolver_) { shapesresolver = _shapesr

virtualization - How to share generated google graph on facebook -

i have generated graph using google line graph database have share graph on facebook,twitter,.. please suggest idea. thanks you can export google charts png image. source

php - PHPMYADMIN ,,Error in Processing Request Error code: 200 Error text: OK -

using phpmyadmin php , mysql stack in ubuntu encounter problem: 1146 – table ‘phpmyadmin.pma_table_uiprefs’ doesn’t exist to solve added: $ cfg [‘servers’] [$ i] [‘table_uiprefs’] = ‘pma_table_uiprefs'; changed to: $ cfg [‘servers’] [$ i] [‘pma__table_uiprefs’] = ‘pma__table_uiprefs'; in config.inc.php file after i've got problem like: error in processing request error code: 200 error text: ok how can solve this? looks config has been modified put in /var/www/phpmyadmin/config.inc.php , change password below if set else blank $cfg['blowfish_secret'] = 'a8b7c6d'; /* must fill in cookie auth! */ /* * servers configuration */ $i = 0; /* * first server */ $i++; /* authentication type */ $cfg['servers'][$i]['auth_type'] = 'config'; /* server parameters */ $cfg['servers'][$i]['host'] = 'localhost'; $cfg['servers'][$i]['connect_type'] = 'tc

Get Updated Contacts in Android for Contact Sync -

i working on contact sync in android , have done first time contact sync. here doing. 1. fetching contacts , saving each contact in db contact._id 2. fetching names , phone numbers , saving in db. after sending contacts data server server can updated. now problem how can check whether particular contact updated or not ? i have implemented broadcast receiver app can intimated updation/addition/deletion of contact. want tract particular contact. i found 1 solution dirty flag. tells contact whether updated or not, here reference link : http://developer.android.com/reference/android/provider/contactscontract.rawcontacts.html but not able use dirty flag, please me implementing dirty flag. thanks in advance ! the contacts should have value contactscontract.rawcontacts.version . if save version on server (or in database in app), can determine if contact has changed since last sent server.

java - Mule REST Component Return type -

i trying implement rest component in mule flow , able expose rest services , response coming client also. when put mule java component access properties of rest component response, not able that. below code of mule message processor, public class restresponseprocessor implements callable{ @override public object oncall(muleeventcontext eventcontext) throws exception { object messagepayload = eventcontext.getmessage().getpayload(); system.out.println("message payload class " + messagepayload.getclass()); org.mule.module.jersey.jerseyresourcescomponent jerseyresponse = (org.mule.module.jersey.jerseyresourcescomponent) messagepayload; system.out.println("jerseyresponse.getclass() " + jerseyresponse.getclass()); return eventcontext; } } the output first sysout message payload class class org.mule.module.jersey.jerseyresourcescomponent$2 when trying cast org.mule.module.jersey.jerseyresourcescomponent object, giving classcastexception,

I have several questions regarding to following PYTHON code segments. -

*****actually question how python automatically assign values 'i' in following different python code segments. data=[5,1,23,10] datacount=len(data) print ('value of datacount is',datacount) in range(datacount-1): print ('value of is',i) k in range(i,datacount): print ('value of k is', k,'value of is', i, 'value of datacount is', datacount) print(data) if data[i]>data[k]: temp=data[i] data[i],data[k]=data[k],temp in range(datacount): print(data[i]) the result is: >>> ('value of datacount is', 4) ('value of is', 0) ('value of k is', 0, 'value of is', 0, 'value of datacount is', 4) [5, 1, 23, 10] ('value of k is', 1, 'value of is', 0, 'value of datacount is', 4) [5, 1, 23, 10] ('value of k is', 2, 'value of is', 0, 'value of datacount is', 4) [1, 5, 23, 10] ('value of k

wordpress - Remove Add to Cart Button from MyStile Theme in Woocommerce -

i have difficulty doing after following instructions of how it. don't know if structure of woocommerce have changed since below snippet given. below code tried using remove add cart button in homeapage , shop page . mind you, pasted in theme functions (functions.php) , use mystile theme . i able remove add cart button single page not homepage , shop page . code function remove_loop_button(){ remove_action('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); } add_action('init', 'remove_loop_button'); thanks in advance. you can use following code. put in functions.php : remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart'); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); to remove “add cart” button need paste following lines of code in functions.php file located in

Alternate option for call a function in all controller in spring -

i have notification section in user area in project. users there lot of pages , each page need show notification on top each page calling different controller function. question there option me notification list on each user pages without calling same notification fetching function on controller or on request mapping function.

c - What operand to use for char type array? -

i've got silly problem , can hang of it. have easy c code (just want find if string str1 starts str2): int main() { int i, j; char sir1[150], sir2[150], sir3[150]; printf("insert first string (sir1) , hit enter \n"); gets(sir1); printf("insert second string (sir1) , hit enter \n"); gets(sir2); printf("\n"); int len_sir2=strlen(sir2); (i=0;i<len_sir2;i++) { sir3[i]=sir1[i]; } (j=0;j<len_sir2;j++) { if (sir3[i]!=sir2[i]){printf("string 1 not start string 2\n");break;return 0;} } printf("sir1 starts sir2 \n"); getch(); } my problem example "bananna" , "ana", code seems have equal values sir2[0] , sir3[0], though in quick watch values showed 98'b' , 97'a'. i'm doing wrong? many in advance, one error loop on j , use i inside loop. for (j=0;j<len_sir2;j++) { if (sir3[i]!=s

php - wordpress, opening custom post shows empty taxonomy -

Image
when edit post, no data added taxonomy field (img 1) - although know have chosen taxonomy (img 2). when update post, entered taxonomies dropped (added taxonomies still update post, wont show after update, repeating mentioned behaviour). have slightest hunch cause data not entered? i trailed issue few loops use in edit, apparently there's issues looping inside loops in posts. found https://core.trac.wordpress.org/ticket/18408 4 year old unresolved ticket explaining behaviour. resolved totally circumventing wp loops , straight querying need instead.

html - Chrome browser changed submit button shape -

since update latest chrome browser version (42.0.2311.90, 64-bit, on mac os x), shape of submit buttons has changed -- without me having changed code @ all! buttons considerably higher (more empty space above , below button text) before. in fact, have tested buttons having no formatting or css @ all, , difference old button shape , buttons shown in e.g. firefox considerable. buttons overlap of text! i have not been able figure out way make buttons narrower again not overlap text above them. surely cannot 1 having issue, have searched , not found issue on forum. help. screenshots: button in chrome browser without css files involved: https://encoding.blitzeinschlag.de/button_chrome_no_css.png button in firefox browser (including css files): https://encoding.blitzeinschlag.de/button_firefox.png html code of div shown in screenshots: <p style='margin: 4px 0px 2px 0px; padding: 0; font-size: 13px; font-weight: bold;'>stein20</p> <p style='margin

symfony - Non-existent service "request_stack" -

i writing symfony 2.6 application , i've encountered problem when trying inject requeststack service. want able current request within service, i'm getting following exception: servicenotfoundexception: service "host_service" has dependency on non-existent service "request_stack". my service code service looks this: <?php namespace mybundle\dependencyinjection; use symfony\component\httpfoundation\requeststack; class hostservice { protected $request; public function __construct(requeststack $requeststack) { $this->requeststack = $requeststack; } public function getsomething() { $request = $this->requeststack->getcurrentrequest(); // stuff request stack // return } } services.yml i've created services.yml file this: # mybundle/resources/config/services.yml services: host_service: class: mybundle\dependencyinjection\hostservice arguments

c# - Not able to access wcf restful post method in ios -

i using post method in wcfrestful services , using ios not getting parameter value in wcf method. [operationcontract] [faultcontract(typeof(servicedata))] [webinvoke(method = "post", responseformat = webmessageformat.json,bodystyle = webmessagebodystyle.wrapped, uritemplate = "json/passtwoparamstocheckfault?firstparam={firstparam}")] string passtwoparamstocheckfault(string firstparam); to access query string of post request [operationcontract] [faultcontract(typeof(servicedata))] [webinvoke(method = "post", responseformat = webmessageformat.json,bodystyle = webmessagebodystyle.wrapped, uritemplate = "json/passtwoparamstocheckfault?firstparam={firstparam}")] string passtwoparamstocheckfault(string firstparam){ if (context != null) { var result = weboperationcontext.current.incomingrequest.uritemplatematch.queryparameters["firstparam"]; } }

How to consume a C# webservice from Java having only the wsdl -

i'm new webservices. have develop webservice client seems wcf webservice. have wsdl problem wsdl not define wsdl:service. i 've tried wsdl2java gives me warning warning: wsdl document http://184.13.69.115:7085/xonegenericloader/v2/mex?wsdl=wsdl0 not define services the webservice defines binding : <wsdl:binding name="externalinterfaces-soap-binding-streaming_ixonegenericloaderservice" type="tns:ixonegenericloaderservice"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> ideas ? just hunch : have tried using ?singlewsdl parameter ? on web service have 2 interfaces : this svcutil.exe : svcutil.exe http://localhost:8890/calfitececc/wsvccalfitec.svc?wsdl and full wsdl file : http://localhost:8890/calfitececc/wsvccalfitec.svc?singlewsdl try ?wsdl or ?singlewsdl rather ?wsdl=wsdl0

android - How to make Linearlayout scrollable with two listviews scrollable which wrap their content -

i know has been asked many times still have yet find solution like. can please suggest elegant way i'm trying do: i have 2 listviews have in linearlayout (vertical). want listviews wrap content when comes height never need scroll internally. instead, scroll down on page in order see overflows. thanks in advance help! if suggest re-doing architecture i'm open well. thing ask solution clean , simple possible. hackish workarounds not preferred. :) as far know, trying make listview height content requires. you can create custom listview extends listview , override onmeasure method this: public class unscrollablelistview extends listview { public unscrollablelistview(context context) { super(context); } public unscrollablelistview(context context, attributeset attrs) { super(context, attrs); } public unscrollablelistview(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyl

Set up atom linter-python on Windows? -

i trying python linter working in atom editor on windows 7 seems nothing. i have: installed latest atom editor (version 0.194.0) on windows, installed linter , , installed linter-pyflakes . set following in atom config file instructed in linter-pyflakes' readme file. "linter-pyflakes": pyflakesexecutablepath: "c:\users\blokeley\anaconda3\scripts" there seems no linter activity when edit python file. i opened issue on linter-pyflakes project got no response. is path executable wrong? how can check linter doing? install linter-flake8 instead.

rest - Android fragments preserve content -

i using viewpager activity 3 tabs. each tab having single fragment display(swipable). each fragment , data retreieved server via rest api , displayed in form of cards(using this library ). hence, coding this: public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { ... fetch_item1_card1(); //fetches data 1 , displays on card 1 fetch_item2_card2(); //fetches data 2 , displays on card 2 ... } this working until when clicked button shows card detail in new activity (lets activity b). so, on pressing button, brought fragment mentioned above(using finish(); ), , same data again retrieved api. hence thought fetch data when activity first created. achieved doing this: public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { ... if(savedinstancestate == null) { fetch_item1_card1(); //fetches data 1 , displays on card 1 fetch_item2_card2(); //fetches d

mysql - Join two rows of the same table which points to the same thing in another table -

tablea key | col1 | col2 | =========================|=============| 1 | 1 |1 | 2 | 2 |3 | 3 | 10 |5 | 4 | 55 |7 | tableb b_key | col3 | =========================| 1 | name1 | 2 | name2 | 3 | name3 | 7 | name7 | 10 | name10 | 55 | name55 | expected result | col1_join | col2_join ==================|============= | name1 |name1 | name2 |name3 | name10 |name5 | name55 |name7 i have 2 tables , b. col 1 , col 2 foreign keys refer table b's pk. what want way join these 2 tables , b , corresponding col3. i tried select * tbl_a inner join tbl_b on tbl_a.col1 = tbl_b.b_key or tbl_a.col2 = tbl_b.b_key you may select b1.col3 col1_join, b2.col3 col2_join tab

Fatal error: Using $this when not in object context in C:\xampp\htdocs\sum.php on line 52 -

<?php echo '<body style="background-color:046c33">'; echo '<body style="background-color:orange">'; mysql_connect("127.0.0.1", "root", "") or die(mysql_error()); mysql_select_db("customers") or die(mysql_error()); ?> <html> <head> <title>search</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <form method="post" > <table border="0" cellpadding="0" cellspacing="0"> <tr>enter nic number <td><input type="text" name="query" id="text" />&nbsp;</td> <td><input type="submit" name="submit" id="search" value="search" /></td> </tr> </table> </form> <?php if(isset($_post['submit'])) { $query =

CMake: How to Unit-Test your own CMake Script Macros/Functions? -

i've written convenience wrappers around standard cmake commands , want unit-test cmake script code ensure functionality. i've made progress, there 2 things hope with: is there "official" way of unit-testing own cmake script code? special mode run cmake in? goal "white-box testing" (as possible). how handle global variables , variable scopes issues? inject global variables test via loading project's cache, configure test cmake file or pushing via -d command line option? simulation/testing of variable scopes (cached vs. non-cached, macros/functions/includes, parameters passed references)? to start i've looked cmake source code (i'm using cmake version 2.8.10) under /tests , under tests/cmaketests. there huge number of varieties found , looks lot of them specialized on single test case. so looked available cmake script libraries cmake++ see solution, - when have unit tests - heavily depending on own library functions. here

junit - Not able to mock constructor using PowerMock -

here in below code not able mock constructor using powermock. want mock below statement. apspportletrequest wrappedrequest = new apspportletrequest(request); below mocking steps @preparefortest({apspportletrequest.class}) @runwith(powermockrunner.class) public class reminderportletcontrollertest { private portletrequest requestmock; private apspportletrequest apspportletrequestmock; public void setup() throws exception { requestmock = easymock.createnicemock(portletrequest.class); apspportletrequestmock = easymock.createnicemock(apspportletrequest.class); } @test public void testexecutemethod() throws exception { powermock.expectnew(apspportletrequest.class, requestmock).andreturn(apspportletrequestmock).anytimes(); easymock.replay(apspportletrequestmock, requestmock); powermock.replayall(); } } please suggest me on that. as want mock line apspportletrequest wrappedrequest = new apspportletrequest(r

xml - select parent of a tag with XSLT -

i want select parent of xmi tag in for-each loop. here's input : <xmi xmi.version='1.2' xmlns:uml="org.omg.xmi.namespace.uml"> <xmi.content> <uml:model xmi.id='eee_1045467100313_135436_1' name='data'> <uml:namespace.ownedelement> <uml:package xmi.id='_9_0_bc102e5_1427365805826_580042_23' name='migration2'> <uml:package xmi.id='_9_0_bc102e5_1427365805826_580042_22' name='migration'> <uml:class xmi.id='_9_0_bc102e5_1427367042666_255023_151' name='employee'> <uml:classifier.feature> <uml:attribute xmi.id='_9_0_bc102e5_1427367052819_893122_168' name='cin'> </uml:attribute>

Add new attribute to MagicSuggest div -

is possible add new attribute main div. for example in html output(by default): <div id="my-id" class="ms-ctn form-control ms-ctn-focus" style=""> .... </div> instead (add new-attr="value"): <div new-attr="value" id="my-id" class="ms-ctn form-control ms-ctn-focus" style=""> .... </div> edit directly magicsuggest source code adding attr, or use jquery add new attribute with: $('my-id').attr('new-attr', 'value'); http://api.jquery.com/attr/

amazon web services - Linux Split command very slow on AWS Instance -

i have deployed application in aws instance , application using linux system commands called via simple shell script. below sample script content: #!/bin/bash echo "file split started" cd /prod/data/java/ split -a 5 -l 100000000 samplefile.dat echo "file split completed" actually same script running faster in our local server. in local server taking 15 minutes complete , in aws instance took 45 minutes. huge difference. update: in aws not using more cpu, hardly 2 5 percentage, thats why slow. both 64 bit os , local server rhel 5(2.6.18) , aws rhel 6(2.6.xx) can on this? regards, shankar

APDU for get UID from mifare desfire? -

i new apdus. read datasheet desfire. according have: cla = 0x90 ins = desfire cmd code p1 = 0x00 p2 = 0x00 lc = length of wrapped data data = desfire command parameter(s) le = 0x00 i want desfire uid, can't create command apdu this. can lead me right direction? created apdu not sure if it's correct: byte[8] cmd_apdu_getuid_part1= {0x90 , 0x93 , 0x20 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00}; and don't understand concept of parameters lc , don't find ins uid. 0x93 ox20 part 1 of uid , 0x95 0x20 part 2 of uid? the commands 9x 20 part of lower iso 14443-3 protocol , used during anticollision , activation of card. apdus, on other hand, exchanged on higher protocol layer , after activation of card. hence, can't use these command codes in apdus. how uid desfire (ev1) card depends on type of id want get: get uid used during anti-collision phase : depends on reader (and possibly