Posts

Showing posts from June, 2010

oracle - Pl-Sql User Connection -

i've been starting oracle on job. i've been using ms time. have problem on user-shema structure. tryed create table sql query, table had been created in somewhere else wanted. (i've created user named lpa) wrote query, , table in (generaldatabase) tablespaces->users->(here). want create table in lpa schema, under table folder. i've been searching could'nt it. need please. ps:i found need connect user, write query ts_lpa(thats tablespace). cant connect user lpa.(we can first problem) in oracle there no "dbo" or default schema, in case looking for. must specify target user account when connect (log in) database, , account used default schema of subsequent actions. (this similar home directory in linux, if log in williamr , create file, belong williamr , not generic default account.) in case suspect connecting sys or similar, in case table belongs sys (or whoever connected as). you'll need drop , try again. if don't want p

delphi - How to process an asynchronous queue from within the main UI thread? -

i designing 2 components asynchronously receive objects of custom class (tmelogmessage) , store them in thread-safe internal container. first component non visual (tmefilelogger) , should write info these objects log file (non surprisingly). second component (tmeloggrid) visual fmx.grid descendant should visualize info these objects in ui. these objects is, think, irrelevant. the problem facing these components not know when these objects enqueued in internal container, have check container see if there new objects need processing, process them , remove them queue. ideally i'd want done when application not busy, in way similar action updating, not bog down ui. it wrong component hook event handler application.onidle... maybe subscribe tidlemessage, i'm not sure idea, i've read applications never go idle. using internal timer seems bit old-school. maybe use low priority thread poll queue , synchronize ui when find object process. don't have other ideas though.

python - Numpy vectorized summation with variable number of factors -

i computing function contains summation on index. index between 0 , integer part of t; ideally able compute summation several values of t. in real-life case, of values of t small, small percentage can 1 or 2 orders of magnitude larger average. what doing is: 1) define vector t, e.g. (my real-life data have larger number of entries, give idea): import numpy np t = np.random.exponential(5, 10) 2) create matrix containing factors between 0 , int(t), , zeroes: n = int(t.max()) j = ((np.arange(n) < t[:,np.newaxis])*np.arange(1,n+1)).astype(int).transpose() print(j) [[ 1 1 1 1 1 1 1 1 1 1] [ 2 0 2 2 2 0 2 0 2 2] [ 0 0 3 0 3 0 3 0 3 3] [ 0 0 4 0 4 0 0 0 4 4] [ 0 0 5 0 5 0 0 0 5 5] [ 0 0 6 0 6 0 0 0 6 6] [ 0 0 7 0 7 0 0 0 0 7] [ 0 0 8 0 8 0 0 0 0 8] [ 0 0 9 0 9 0 0 0 0 9] [ 0 0 0 0 10 0 0 0 0 10] [ 0 0 0 0 11 0 0 0 0 0] [ 0 0 0 0

c# - How to call this method in a background worker? -

i beginner in c# , wpf , building project in have trigger when mouse moved. under conditions, have use background worker. want call mouse_moved method in background, don't know how . can me please? code far: public mainwindow() { initializecomponent(); mouse = new mouseinput(); mouse.mousemoved += mouse_mousemoved; } void mouse_mousemoved(object sender, eventargs e) { //the code need } private void worker_dowork(object sender, doworkeventargs e) { //where want call mouse_moved method } create method , call both: void mouse_mousemoved(object sender, eventargs e) { domousemovedwork(); } private void worker_dowork(object sender, doworkeventargs e) { domousemovedwork(); } private domousemovedwork() { //the code need }

NLog callback possible? -

i in process of converting home grown logging system nlog , wondering if there way add event logger or otherwise support mechanism when log message can callback final formatted message , loglevel. use send server messages connected client. thx this mcve of talking in comments. create target accepts callback functions: [target("myfirst")] public sealed class myfirsttarget : targetwithlayout { private readonly action<string>[] _callbacks; public myfirsttarget(params action<string>[] callbacks) { _callbacks = callbacks; } protected override void write(logeventinfo logevent) { foreach (var callback in _callbacks) { callback(logevent.formattedmessage); } } } configure nlog use target. programmatically since callbacks passed in constructor. can configure target in nlog.config, target need singleton can register callbacks in code. class program { public static void main(

Styling ASP.net controls with bootstrap -

i trying style quiz checkbox/radio button lists controls in asp.net match of bootstrap static variants found here: http://getbootstrap.com/javascript/#buttons-checkbox-radio this works fine using following lines of code: <asp:radiobuttonlist id="rblquestion1" runat="server" repeatdirection="vertical" repeatlayout="flow" cssclass="btn-group" data-toggle="buttons"> <asp:listitem class="btn btn-default radio-inline" value="1">answer one</asp:listitem> <asp:listitem class="btn btn-default radio-inline" value="2">answer two</asp:listitem> </asp:radiobuttonlist> but have 3 problems: the items rendered in steps so: http://i.imgur.com/am1a1gh.png , believe cause "repeatlayout=flow" property, without element isn't displayed shown on bootstrap website http://getbootstrap.com/javascript/#buttons-checkbox-radio when displayed on

android - can't get values out of ondatachange method -

i'm developing android app i'm using firebase database when in got variable in ondatachange method , assign them global variables got null variables when call variables in ondatachange method not null. public class positionatemarkertask extends asynctask { public arraylist<location> arraylist= new arraylist<>(); public void connect() { //setting connexion parameter final firebase ref = new firebase("https://test.firebaseio.com/test"); query query = ref.orderbychild("longitude"); //get data db query.addlistenerforsinglevalueevent(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { //checking if user exist if(datasnapshot.exists()){ (datasnapshot usersnapshot : datasnapshot.getchildren()) { //get each user has target username locatio

javascript - Bootstrap menu click event in jQuery -

html : <ul id="mydatatabs" class="nav nav-tabs nav-justified"> <li class="active"><a data-toggle="tab" href="#details" id="tabdetailslink">personal details</a></li> <li><a data-toggle="tab" href="#tab1" id="tabtab1link">tab1</a></li> <li><a data-toggle="tab" href="#tab2" id="tabtab2link">tab2</a></li> <li><a data-toggle="tab" href="#tab3" id="tabtab3link">tab3</a></li> <li><a data-toggle="tab" href="#tab4" id="tabtab4link">tab4</a></li> </ul> js : $("#mydatatabs li").click(function (e) { e.preventdefault(); alert(1); var myid = $("#myid").val(); alert(2); switch ($(this).children(":first").att

javascript - Portia Scrappy fails to load responsive -

i installed portia on machine crawl content interactive supporting it. found headless browser, splash, can not load responsive images, i.e www.bbc.com i knew portia removes javascript in html case may need render these images. is there ways attach javascript in order to lookup placeholder elements replace placeholders transparent images update src attribute each image , assign best quality/size ratio url like https://github.com/bbc-news/imager.js ? i found function in portia project did not point, please give me hints try def populate_window_object(self): main_frame = self.tab.web_page.mainframe() main_frame.addtojavascriptwindowobject('__portiaapi', self.js_api) self.tab.run_js_files( os.path.join(self.assets, 'splash_content_scripts'), handle_errors=false)

logging - How to make the logstash 2.3.2 configuration file more flexible -

i using logstash 2.3.2 read , parse log file of wso2 esb. able parse log entries , send them api in json format. in log file there different log levels such "info,error, warn , debug" . currently, sending log entry through, if logtype error. sample log file: tid: [-1234] [] [2016-05-26 11:22:34,366] info {org.wso2.carbon.application.deployer.internal.applicationmanager} - undeploying carbon application : customerservice_ca_01_001_1.0.0... {org.wso2.carbon.application.deployer.internal.applicationmanager} tid: [-1234] [] [2016-05-26 11:22:35,539] info {org.apache.axis2.transport.jms.servicetaskmanager} - task manager service : customerservice_01_001 shutdown {org.apache.axis2.transport.jms.servicetaskmanager} tid: [-1234] [] [2016-05-26 11:22:35,545] info {org.apache.axis2.transport.jms.jmslistener} - stopped listening jms messages service : customerservice_01_001 {org.apache.axis2.transport.jms.jmslistener} tid: [-1234] [] [2016-05-26 11:22:35,549] info {org.

javascript - Meteor SEO when Template-level subscriptions -

i've wrote web-app using meteor , encounter difficulties seo. i'm using fork of spiderable (jazeee-meteor-spiderable) meteor , i'm having trouble setting meteor.isreadyforspiderable = true; when subscriptions defined in template , not route. paginated tables example of case. i tried wait template.subscriptionready() in template.templatename.oncreated callback, there's nothing concluent. any idea handling kind of data loading ? here's code: template.list.oncreated(function () { this.autorun(() => { if (this.subscriptionready()) { meteor.isreadyforspiderable = true; console.log('ready'); } else { meteor.isreadyforspiderable = false; console.log('not ready yet'); } console.log(meteor.isreadyforspiderable); }); }); thanks,

c# - Can you call a place in an array with a char that is a valid int but defined as a string? -

for example, have array (called array1): {"1","2","3"} and string (called string1): "0" can following: array1[string1] and have equal: "1" i have checked how can evaluate c# expression dynamically? , call c# function defined in string did not understand answers. apologize. when try string1 = int.parse(string1); error: or string1 = convert.toint32(string1); : cannot implicitly convert type 'int' 'string' to elaborate, (sorry if description wasn't clear), code this: btnname = btn.name.tostring(); //btnname example == btn01 btnco1 = btnname[3].tostring(); // btnco1 equal "0" btnco2 = btnname[4].tostring(); //btnco2 equal "1" btnco1 = convert.toint32(btnco1); //i want btnco1 int use : btnco2 = convert.toint32(btnco2); grid[btnco1][btnco2] //grid jagged array you have parse string int, preferably using tryparse : int idx; if (int32.tryparse(string1, out idx)

javascript - How to add text to element without affecting it child elements -

i have html hierarchy 1 here <ul id="mylist"> <li id="el_01"> <div class="title"> <span class="openclose"></span> </div> </li> </ul> what add text element .title div without removing span element. it append input text element in .title div. $(".title").append("<input type='text' />"); it append simple text .title div: $('<p>hello all</p>').appendto('.title'); $(".title").append("<input type='text' />"); $('<p>hello all</p>').appendto('.title'); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <ul id="mylist"> <li id="el_01"> <div class="title"> <span class="openclose">

Garbled characters in cmd window? -

Image
i have met garbled character in cmd window. show when type echo %date% but in other server,it shows "??" how happen? same windows server 2008 system. i have found second has no default code page option? why? how fix it? the first 1 : and second this:

ng switch - ngSwitchCase in angular 2 instead of ngSwitchWhen -

i using ngswitchwhen & want use ngswitchcase, referred syntax here https://angular.io/docs/ts/latest/api/common/index/ngswitch-directive.html & did same in application. there aren't errors isn't working fine either. somehow plunker available in above link example provided uses ngswitchwhen. here's sub.component.ts: @component({ selector: 'subjects', templateurl: 'app/subjects.component.html' , styleurls: ['app/app.component.css'], directives:[mdbutton,mdcard,mdtoolbar,mdicon,mdinput,md_input_directives,mdcheckbox,profiledetailscomponent,router_directives], providers:[mdiconregistry] }) export class subjectscomponent{ viewmode='first'; view='one'; statenext: boolean = false; private buttonstate: boolean = true; private classes1 = [{label: 'english', state: false},{label: 'hindi', state: false},{label: 'mathematics', state: false},{label: 'science'

Selenium via java - sendKeys doesn't send specific chars to input -

i'm having strange condition i'm trying type input using sendkeys , reuslt specific chars doesn't seem implemented in input @ all. i'm trying do: webdriver.findelement(by.id("additionalinfo(token_autocompleteselectinputid)")).sendkeys("(test)"); the result input field : test) , missing char '(' . if try webdriver.findelement(by.id("additionalinfo(token_autocompleteselectinputid)")).sendkeys("((((((((((") the result input empty. anyone ever faced issue before? happening on specific input in app, couldn't find related in html code. in advance. edit: can manually type ( in input field. maybe it's special character selenium, have tried using escape characters? backslash before if allows it. edit: found issue report on github last year, not sure if agreed not fix it. executing script type "(" seems alternative. source: https://github.com/seleniumhq/selenium/issues/674

mc - How to change file permissions recursively on Midnight Commander? -

if select files , use ctrl + x c asks me change permissions selected files individually , if @ directory level of files inside unaffected. there way change permissions of selected files @ once? chmod, chown , advanced chown don't work recursively. use external panelize command list files in panel, select or files , execute chmod.

java - mysql utf-8 returns gibberish from one machine -

i have mysql db utf-8 , application written in java hibernate. when run application in eclipse fine. in production on different machine values returned db corrupted. print values log (immediately after getting them) , see values db corrupted in production. the db same db both environments. values stored fine. any ideas can reason this? update: i forgot happens sometimes. think in 50% of times works fine. update 2: here hibernate.cfg.xml: <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.url">jdbc:mysql://mydb:3306/myapp?autoreconnect=true&amp;useunicode=true&amp;createdatabaseifnotexist=true&am

go - Cast interface{} to type in template -

templates.executetemplate(w, "index.html", map[string]interface{} { "games": games}) } where games []map[string]interface{} (mapped result of sql query) in template: {{ range $gval := .games }} {{ how make like: $gval.name.(string) }} {{end}} how cast interface{} value of map string(or int) in template? in 'go' can games[0]["name"].(string) when $gval.name writes hex string i don't think it's possible type assertions template. you'll have write own function , call template. example: func tostring(value interface{}) string { switch v := value.(type) { case string: return v case int: return strconv.itoa(v) // add whatever other types need default: return "" } to able call function template have call funcs() method on template: tpl.funcs(template.funcmap{"tostring": tostring}) now can {{$gval.name | tostring}} inside template

c# - How to get referrer data in a Custom Authorize Attribute in ASP.NET -

how referrer data ip address , apikey in custom authorize attribute in asp.net. in code below i'd data mentioned above: [attributeusage(attributetargets.method)] public class auth : authorizeattribute { protected override bool isauthorized(httpactioncontext actioncontext) { var cnt = httpcontext.current; return false; } } in httpcontext.current can url referrer doesn't have data need. please let me know if question unclear or incomplete. update : need know, code below shows how. [attributeusage(attributetargets.method)] public class auth : authorizeattribute { protected override bool isauthorized(httpactioncontext actioncontext) { var cnt = httpcontext.current; int id = int32.parse(cnt.request.params["id"]); string apikey = cnt.request.params["apikey"]; string ip = httpcontext.current.request.servervariables["remote_addr"]; return true; } }

objective c - How to disable "Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead" -

how disable following warning in xcode: values of type 'nsinteger' should not used format arguments; add explicit cast 'long' instead please note want disable warning only, know can cast nsinteger long, don't want to. you can use %zd nsinteger instead disable warning use #pragma

Odoo 8 declare view file programmatically -

i want declare view file struct loaded database. know in order have declare on openerp .py file. have many user, , want each of theme when access module (form view - instance) have difference view (fields), mentions fields on database, not "how hide fields user?". there solution this? thanks you can use field access right. as of openerp 7.0, can create field level access rights. can achieve adding groups attribute in field definition in module: _columns = { 'my_field': fields.char('my field', groups="base.group_erp_manager,base.group_system") }` it's still valid in odoo 8. check odoo documentation security https://www.odoo.com/documentation/8.0/reference/security.html

javascript - Getting errors: How can I properly consume my transpiled and typed typescript npm module from typescript? -

i'm still giving shot @ typescript. i've written trivial "hello world" typescript module , published npm . trivial, default export: export default function hello(target: string = 'world'): void { console.log(`hello, ${target} :-(`) } it consumed node.js 0.10 -> 6. module has proper "typings" property in package.json, pointing existing .d.ts file generated tsc as explained in official documentation : export default function hello(target?: string): void; however, can't consumed typescript code, neither in typescript 1.8 nor 2 : import hello = require('hello-world-emo') hello() hello('offirmo') transpiling tsc or executing ts-node both give same error message: tserror: ⨯ unable compile typescript hello.ts (3,1): cannot invoke expression type lacks call signature. (2349) however, generated .js works. seems typing issue. using other import formats import hello 'hello-world-emo' doesn't wor

javascript - What does bootstrap function do in Angular 2 -

i'm new frontend frameworks , learning angular 2. in tutorial, tells include line bootstrap(appcomponent) . bootstrap function do? starts app? i'm guessing has nothing twitter-bootstrap ui framework. from the docs : you instantiate angular application explicitly specifying component use root component application via bootstrap() method. so yes, starts application.

php - MySQL Syntax error - at line 1 -

i stuck @ error in php. can me? i error: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'fulltext, surl, burl, date) values 'webite online!', 'this short text lo' @ line 1 and code: <?php if(isset($_post['submit'])) { if(!empty($_post['titel']) && !empty($_post['stext']) && !empty($_post['fulltext']) && !empty($_post['surl']) && !empty($_post['burl'])) { $titel = secure($_post['titel']); $stext = secure($_post['stext']); $fulltext = secure($_post['fulltext']); $surl = secure($_post['surl']); $burl = secure($_post['burl']); $date = date('d/m/y h:i:s'); $sql = mysql_query("insert news (titel, stext, fulltext, surl, burl, date) values '".$titel."', '

php - which database storage option is better for faster processing on android..? -

i trying create hotel room booking application. far have done when user selects check-in date, check out date , type of room , app checks availability , returns status accordingly … if rooms available selected date new row gets inserted in database particular dates , types of rooms … here code this $con = mysqli_connect(host,user,pass,db); $type = $_post['pincode']; $cin = $_post['cin']; $cout = $_post['cout']; $sql="select * avalability type = '$type' , cout>='$cin' cin<='$cout'"; $res=mysqli_query($con,$sql); $check=mysqli_fetch_array($res); if(isset($check)) { echo "rooms not available"; } else { echo "rooms available"; $insert="insert login.avalability(type,cin,cout) values('$type','$cin','$cout')"; $mysqli_query($con,$insert); } mysqli_close($con); ?> now question …. better way or store entire date database 2 years or , change status column

sql server - Correct way to perform Sql self union -

let's have table below: table1: **t1** **t2** **t3** abc xyz aaa can like: select * from( (select t.t1,t.t2,t.t3 table1 t) tmp union (select tmp2.t1,'someothervalue' t2,tmp2.t3 tmp tmp2)) result order result.t1 basically union operation first tmp table itself. let's t1,t2,t3 of varchar type. from tmp tmp2 not possible instead of use from table1 tmp2 , updated sql query select * from( select t.t1,t.t2,t.t3 table1 t union select tmp2.t1,'someothervalue' t2,tmp2.t3 table1 tmp2 ) result order result.t1

I wants to Pull first 3 observation of each ID in sas -

i wants pull first 3 observation of each id code using :-> data new; infile vlv dlm = ' '; input x1 x2; run; proc sort data = new ; x1 x2; run; proc print data = new; run; data vis; set new; retain 0; if first.x1 i=0; i+1; run; proc print data = vis;run; data new ; set vis; if lt 2 output; run; title 'output'; proc print data = new; run; infile using 18 1 18 2 18 4 18 6 18 3 19 7 19 6 19 4 20 66 20 67 20 3 20 7 21 6 21 7 21 8 36 2 36 3 36 3 36 1 i expected output :-> 18 1 18 2 18 4 19 7 19 6 19 4 20 66 20 67 20 3 21 6 21 7 21 8 36 2 36 3 36 3 thanks !! your output criteria incorrect. if lt 2 output; it should less 4 if want top 3. if lt 4 output; also, although can reuse same dataset name on , on it's not recommended. suggest changing final dataset name new aren't overwriting input data set.

c# - Creating social website in asp.net -

i'm creating social networking website used "social networking website in asp.net - open source" http://www.c-sharpcorner.com/uploadfile/rahul4_saxena/social-networking-website-in-asp-net-open-source-project/ when tried run project on visual studio 2012 edition showing error below, a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server) source error: using system; using system.collections.generic; using system.linq; using system.web; using system.data; using system.data.sqlclient; /// <summary> /// summary description databaseclass /// </summary> public class databaseclass { sqldataadapter da; sqlconnection con; sqlcommand cmd = new sqlcommand(); dataset ds = new dataset(); datatable dt = new datat

How can I find the error code thrown in SQL Server? -

i have code: if (@@rowcount != 1) throw 50004,'mark_test - problem setting test status marked',1 i know can error message this: set @errormessage = error_message() but how can number 50004 ? use error_number function returns error number of error caused catch block of try…catch construct run. demo begin try select 1 union select 1 if ( @@rowcount != 1 ) throw 50004, 'mark_test - problem setting test status marked', 1 end try begin catch select error_number=error_number(), error_message=error_message() end catch result error_number error_message 50004 mark_test - problem setting test status marked

c++ - Operator overloading, need an explanation -

this question has answer here: what basic rules , idioms operator overloading? 7 answers there code: class precision { int digits; public: precision(int digits) : digits(digits) {} friend ostream& operator<<(ostream& os, const precision& p) { os.precision(p.digits); return os; } }; it's meant make command line like: cout << precision(5) << << " " << precision(2) << b << endl; to work, instead of doing: cout.precision(5); cout << << " "; cout.precision(2); cout << b << endl i fail understand how friend function part works. why friend? , how come receives 2 arguments instead of one? thanks. it friend can access private value digits . the 2 arguments come compiler matching cout << p

game engine - Luxe - "Type not found : UserConfigDef" after updating -

i've updated haxe, luxe, hxcpp, etc. on windows after not using them while, , none of projects compile, not "empty" sample. following in cmd: c:\gamedev\empty>haxelib run flow run flow / 1.0.0-alpha.2 (node.js v0.12.7) flow / target windows ( arch 32 ) flow / haxe version 3.3.0 flow / build - empty 1.0.0 windows flow / build - running haxe ... c:\haxetoolkit\haxe\lib\snow\git\snow/types/types.hx:72: characters 25-38 : type not found : userconfigdef c:\gamedev\empty> same error when building sublime package. possible i've broken something? should attempt reinstall? it seems luxe not compatible haxe 3.3.0-rc1 yet - there open issue on github. try downgrading haxe 3.2.1 . you may need downgrade hxcpp 3.2.205 if run cpp compilation issues.

python 2.7 - Odoo - How to update a pre defined DATE field value -

i'm trying modify hr.contract model ' end_date ' field gets value of ' effective_date ' in model ' resignation_application '. concept when employee fill resignation application updates contract end date. here's code: class resignation_application(osv.osv): _name = 'resignation.application' _columns = { 'employee_id': fields.many2one('hr.employee', "employee", select=true, invisible=false, readonly=true, states={'draft':[('readonly',false)], 'confirm':[('readonly',false)]}), 'effective_date': fields.date('effective date', readonly=true, states={'draft':[('readonly',false)], 'confirm':[('readonly',false)]}, select=true, copy=false), class hr_contract(osv.osv): _inherit = 'hr.contract' _columns = { 'end_date': fields.date('end date', compute= '_compute_effecti

javascript - Div height to image height and image width to div width -

i have div use container , image use "background" (not literally, told couldn't background attribute) , content div: css #container { display:table; width: 100%; min-width:100%; } .img1 { //don't know put here; } #content { //not important; } html <div id="container"> <img class="img1" src="img.png"/> <div id="content"> content </div> </div> i need container div 100% screen width, , contained image, while both of them must have image's resulting height (after resizing taking 100% screen width) (no stretching). way that? tried lot of min-height , width combination nothing worked far. prefer css , html solutions, if possible. not sure mean, how look: https://jsfiddle.net/b76fjtcv/ basically it's .img1 {width: 100%;} this updated version of fiddle adds max width img doesn't fuzzy. set max-width of .img1 image's full width.

java - Why can't I initialize an abstract class's method without changing them to static? -

this question has answer here: non-static variable cannot referenced static context 11 answers i'm taking tutorial on building simple behavior ai. it's 'brain' class abstract , contains states in "running","success","failure". in ai unit - droid class have method start droid up public void update(){ if(routine.getstate()==null){ routine.start(); } routine.act(this, board); } eclipse tells me methods routine not valid because: cannot make static reference non-static method getstate() type routine which can getstate have change routinestate static well, can't start or act containt this. this brain of ai far: public abstract class routine { public enum routinestate{ success, failure, running } public routinestate getstate(){ return sta

Error inflating class fragment. Must specify unique android:id, android:tag, or have a parent with an id -

i trying run fragment application keeps on crashing when run it. trying load main activity can display webview in having no luck. mainactivity import android.os.bundle; import android.support.v4.app.fragmentactivity; public class mainactivity extends fragmentactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } } fragment code import android.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.webkit.websettings; import android.webkit.webview; public class webviewfragment extends fragment { private webview mwebview; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.fragment_main, container, false);

javascript - span.style.textAlign not working -

i've created function allows user align highlighted/selected text right/left/center, doesn't seem working. function docenter() { { var selection = window.getselection().getrangeat(0); var selectedtext = selection.extractcontents(); var span = document.createelement("span"); span.style.textalign = "center"; span.appendchild(selectedtext); selection.insertnode(span); } } i've tried separate function same thing, except highlights words instead of aligning them, , works: function highlighter() { { var selection = window.getselection().getrangeat(0); var selectedtext = selection.extractcontents(); var span = document.createelement("span"); span.style.backgroundcolor = "yellow"; span.appendchild(selectedtext); selection.insertnode(span); } } can tell me what's wrong first code? span inline element whereas

java - log4j2 does not print messages fired in a thread -

i surprised log4j2 not print messages when executed in thread. details log4j2 version 2.6.2 debug , runtime affected two standard appenders (file, console) calls log.error("msg"); , log.error("msg", e); or log.info("bad news", e); runs in separate thread , subsequent log calls not represented eclipse mars release (4.5.0) java jdk 1.8.0_51 maven 3.x project launched out of eclipse win 7 (professional) init private static final logger log = logmanager.getlogger(mainprocess.class); configuration <?xml version="1.0" encoding="utf-8"?> <configuration xmlns="http://logging.apache.org/log4j/2.0/config" packages="xyz.my.appenders"> <appenders> <file name="file" filename="logfile.log" append="true"> <patternlayout pattern="%d{yyyy-mm-dd hh:mm:ss.sss} [%t] [%p] %c{2} (%f:%l) - %m%n"/> </file> <console