Monday, 15 February 2010

c# - SelectedItem of DataGrid -



c# - SelectedItem of DataGrid -

i developing user interface host monitoring application, beingness monitored on database level. have displayed 2 datagrids on ui populate on run time.these 2 datagrids connected hostid ( hostid foreign key in logdatagrid).

the first datagrid displays list of host status(either running or stopped). display log status of respective hostid when user wants know status in detail. how accomplish when user selects host id in hostdatagrid ? have added xaml , screenshot of ui.

xaml

<datagrid datacontext="{binding path=hostdata,notifyontargetupdated=true,mode=oneway}" autogeneratecolumns="false" name="hostdatagrid" margin="171,32,235,230"> <datagrid.columns> <datagridtextcolumn header="host" width="auto" binding="{binding hostid}" /> <datagridtextcolumn header="status" width="auto" binding="{binding hoststatus}"/> </datagrid.columns> </datagrid> <datagrid datacontext="{binding path=logdata,notifyontargetupdated=true,mode=oneway}" autogeneratecolumns="false" name="logdatagrid" margin="103,108,102,145"> <datagrid.columns> <datagridtextcolumn header="host id" width="auto" binding="{binding hostid}" /> <datagridtextcolumn header="logs" width="auto" binding="{binding logid}" /> <datagridtextcolumn header="log path" width="auto" binding="{binding logpath}"/> <datagridtextcolumn header="date" width="auto" binding="{binding date}"/> <datagridtextcolumn header="last activity" width="auto" binding="{binding lastactivity}"/> </datagrid.columns>

code behind logfile model:

public logfilemodel() { } private int _hostid; public int hostid { { homecoming _hostid; } set { _hostid= value; onpropertychanged("hostid"); } } private string _logid; public string logid { { homecoming _logid; } set { _logid= value; onpropertychanged("logid"); } } private string _logpath; public string logpath { { homecoming _logpath; } set { _logpath = value; onpropertychanged("logpath"); } } private datetime _date; public datetime date; { { homecoming _date; } set { _date= value; onpropertychanged("date"); } } private bool _activity; public bool lastactivity { { homecoming _activity; } set { _activity= value; onpropertychanged("lastactivity"); } }

code behind logfile viewmodel :

logmodel _mymodel = new logmodel(); private observablecollection<logfilemodel> _logfiledata = new observablecollection<logfilemodel>(); public observablecollection<logfilemodel> logfiledata { { homecoming _logfiledata; } set { _logfiledata = value; onpropertychanged("logfiledata"); } } public logfileviewmodel() { initializeload(); timer.tick += new eventhandler(timer_tick); timer.interval = new timespan(0, 0, 3); timer.start(); } ~logfileviewmodel() { dispose(false); } protected virtual void dispose(bool disposing) { if (!disposed) { if (disposing) { timer.stop(); timer.tick -= new eventhandler(timer_tick); } disposed = true; } } private void timer_tick(object sender, eventargs e) { seek { logfiledata.clear(); initializeload(); } grab (exception ex) { timer.stop(); console.writeline(ex.message); } } private void initializeload() { seek { datatable table = _mymodel.getdata(); (int = 0; < table.rows.count; ++i) logfiledata.add(new logfilemodel { hostid= convert.toint32(table.rows[i][0]), logid = table.rows[i][1].tostring(), logpath = table.rows[i][2].tostring(), date = convert.todatetime(table.rows[i][3]), lastacivity= table.rows[i][4].tostring(), }); } grab (exception e) { console.writeline(e.message); } } public event propertychangedeventhandler propertychanged; private void onpropertychanged(string propertyname) { var handler = propertychanged; if (handler != null) handler(this, new propertychangedeventargs(propertyname)); } public class logmodel { public datatable getdata() { datatable ndt = new datatable(); sqlconnection sqlcon = new sqlconnection(configurationmanager.connectionstrings["myconnectionstring"].connectionstring); sqlcon.open(); sqldataadapter da = new sqldataadapter("select * [localdb].[dbo].[logfiles]", sqlcon); da.fill(ndt); da.dispose(); sqlcon.close(); homecoming ndt; } } }

}

i have followed same pattern host model , viewmodel too.

you have have next in code viewmodel

a selecteditem hold selected item in first datagrid. collection hostdata holds of hosts. empty collection log info display logs particular host

//populate hosts , bind first datagrid private observablecollection<hostmodel> _hostdata= new observablecollection<host>(); public observablecollection<hostmodel> hostdata { { homecoming _hostdata; } set { _hostdata= value; onpropertychanged("hostdata"); } } //populate logs selected item , bind sec datagrid private observablecollection<logfilemodel> _logfiledata = new observablecollection<logfilemodel>(); public observablecollection<logfilemodel> logfiledata { { homecoming _logfiledata; } set { _logfiledata = value; onpropertychanged("logfiledata"); } } //when user selects item in first datagrid property hold value //so bind selected item property of first datagrid private host _selectedhost; //initialise avoid null issues public hostmodelselectedhost { get{ homecoming _selecteditem; } set { //call method populate sec collection _selectedhost = value; logfiledata = getlogsforselectedhost(_selectedhost); onpropertychanged("selectedhost"); { } //the method populating sec collection private observablecollection<logfilemodel> getlogsforselectedhost(_selectedhost) { observablecollection<logfilemodel> filteredlogs = new observablecollection<logfilemodel>; filteredlogs = //fill collection logs match host id of //your selected item homecoming filteredlogs ; }

i not sure code class hope code above can show way of doing this.

c# wpf wpf-controls wpfdatagrid

jsf - log statements are not going into mentioned log files -



jsf - log statements are not going into mentioned log files -

i have log4jconfig.xml shown below

<?xml version="1.0" encoding="utf-8" ?> <!doctype log4j:configuration scheme "log4j.dtd"> <log4j:configuration debug="false" xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="abclog4j" class="org.apache.log4j.rollingfileappender"> <param name="file" value="/myapp/app/myserver/myproj/domains/logs/abclog.log"/> <param name="append" value="true"/> <param name="maxfilesize" value="5000kb"/> <param name="maxbackupindex" value="5"/> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> </layout> </appender> <logger name="com.mywhole.mysub.abc" additivity="false"> <level value="info"/> <appender-ref ref="abclog4j"/> </logger> <appender name="xyzlog4j" class="org.apache.log4j.rollingfileappender"> <param name="file" value="/myapp/app/myserver/myproj/domains/logs/xyzlog.log"/> <param name="append" value="true"/> <param name="maxfilesize" value="5000kb"/> <param name="maxbackupindex" value="5"/> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> </layout> </appender> <logger name="com.mywhole.mysub.xyz" additivity="false"> <level value="info"/> <appender-ref ref="xyzlog4j"/> </logger> <appender name="stdout" class="org.apache.log4j.consoleappender"> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> </layout> </appender> ....................... <root> <priority value="error"/> <appender-ref ref="sysoutlog4j"/> </root> </log4j:configuration>

the probelm i'm facing log statements generated classes in com.mywhole.mysub.xyz going abclog.log , vice-versa. can explain me how solve issue

package com.mywhole.mysub.xyz.model; // import .... public class mybeackingbean extends mysuperbb{ public static final loggerinterface log = loggerfactory .getlogger(mybeackingbean.class);

the xml format of log4j should follow pattern

<!element log4j:configuration (renderer*, appender*,(category|logger)*,root?, categoryfactory?)>

all appenders should declared before loggers

so log4j.xml should next

<?xml version="1.0" encoding="utf-8" ?> <!doctype log4j:configuration scheme "log4j.dtd"> <log4j:configuration debug="false" xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="abclog4j" class="org.apache.log4j.rollingfileappender"> <param name="file" value="/myapp/app/myserver/myproj/domains/logs/abclog.log"/> <param name="append" value="true"/> <param name="maxfilesize" value="5000kb"/> <param name="maxbackupindex" value="5"/> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> </layout> </appender> <appender name="stdout" class="org.apache.log4j.consoleappender"> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> </layout> </appender> <appender name="xyzlog4j" class="org.apache.log4j.rollingfileappender"> <param name="file" value="/myapp/app/myserver/myproj/domains/logs/xyzlog.log"/> <param name="append" value="true"/> <param name="maxfilesize" value="5000kb"/> <param name="maxbackupindex" value="5"/> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> </layout> </appender> <logger name="com.mywhole.mysub.xyz" additivity="false"> <level value="info"/> <appender-ref ref="xyzlog4j"/> </logger> <logger name="com.mywhole.mysub.abc" additivity="false"> <level value="info"/> <appender-ref ref="abclog4j"/> </logger> ....................... <root> <priority value="error"/> <appender-ref ref="sysoutlog4j"/> </root>

check link more details here

jsf java-ee logging log4j

random - Avoiding Exact Repeats for Mersenne Twister in Python -



random - Avoiding Exact Repeats for Mersenne Twister in Python -

as many people know, python uses mersenne twister (mt) algorithm handle random numbers. however, despite having long period (~2^19937), well-known can't reach every random permutation when shuffle sequence greater 2080 elements (since !2081 > 2^19937). dealing permutations , statistical properties of import me, i'm trying figure out best way mix or re-seed python generator additional source of randomness avoid repetition.

currently, concept utilize scheme random number generator (systemrandom) add together external source of randomness mt generator. there 2 ways can think of this:

xor systemrandom random number mt random number use systemrandom reseed mt

the first approach used frequency hardware random number generators, cut down bias tendencies. however, it's wildly inefficient. on windows xp machine, systemrandom 50 times slower standard python random function. that's huge performance nail when of function involves shuffling. given that, reseeding mt systemrandom should more efficient.

however, there 2 issues approach also. firstly, reseeding mt during operation might disrupt statistical properties. i'm shouldn't issue if mt runs long enough, each run of mt values should well-formed (regardless of starting point). indicate sizable period between mt reseeding preferred. secondly, there question of efficient way trigger reseeding. simplest way handle counter. however, more efficient ways might possible.

so then, there 3 questions on point:

has read effect reseeding mt random value after every n samples alter desirable statistical properties? does know more efficient way incrementing counter trigger reseed? finally, if knows improve way approach problem, i'm ears.

reseeding not help you. jump somewhere else (very very) long mt sequence. are-you sure shuffling info gives biased result? because never have plenty hours in universe lifetime generate possible sequences. if know sequences can perchance never generated, doesn't mean generated sequences biased. guess best bet utilize shuffle command it.

if @ numpy.random.shuffle source code (line 4376), here algorithm used (i simplified clarity):

i = len(x) - 1 while > 0: j = randint(0, i) x[i], x[j] = x[j], x[i] = - 1

in other words, origin end, swaps value random value taken randomly before in array, until values swapped. final state not depends on random generator, on initial state of array. means in theory, should able visit permutations, if perform plenty shuffles.

python random seeding mersenne-twister

android - Different content for each Spinner item in the same Activity -



android - Different content for each Spinner item in the same Activity -

how can show different content after selecting item spinner? want create spinner locations of chain stores.

i want spinner there on top. thing changes content under spinner

create simple method in activity refresh layout below spinner(which remain untouched). method called onitemselectedlistener set on spinner. this:

private void changeadress(int newselectedadress) { // imageview , textview in layout imageview map = (imageview) findviewbyid(r.id.theidoftheimage); // set image. know current address selected user // (the newselectedaddress int) array/list/database // stored // set image }

called method above onitemselected callback:

yourspinnerrefference.setonitemselectedlistener(new onitemselectedlistener() { @override public void onitemselected(adapterview<?> parent, view view, int position, long id) { changeaddress(position); } @override public void onnothingselected(adapterview<?> parent) { } });

if not want, please explain.

edit: create 2 arrays hold data:

int[] images = {r.drawable.imag1, r.drawable.imag2 ..etc...}; //also text string[] text = {"text1", "text2 ...etc...};

then utilize 2 arrays in method recommended above:

private void changeadress(int newselectedaddress) { ((imageview)findviewbyid(r.id.mapview1)).setimageresource(images[newselectedaddress]); // assing id textview in layout , same above. }

there no need multiple imageview , textviews.

android android-activity spinner

internet explorer 8 - can't get css 'content' property to work in ie8 -



internet explorer 8 - can't get css 'content' property to work in ie8 -

so, i've tried can think of, or have found regarding how create sure ie 8 work 'content' property in page.

no matter seek though, when viewing in ie9 using f12 dev tools view in ie8 standards mode, page won't load @ all. "page error" when viewing in adobe's browser tester well.

as remove "content" property line css, works fine, of course, lose cool drop-shadows i'm wanting utilize in other browsers.

here's page: http://saks-jewelers.com (the featured product section towards bottom).

any thoughts on i'm missing? (this site run using magento ce 1.7)

both people on ie8 going disappointed! did seek checking inspect element in ie8 see if error more specific?

is drop-shadow defined in lastly css loaded?

css internet-explorer-8

php - Trying to remove everything but numbers, but regexes don't seem to work -



php - Trying to remove everything but numbers, but regexes don't seem to work -

i'm trying remove numbers variable in php. tried regexes, , quick google turns kinds of people telling me utilize regexes too, no regex seems work. i'm using preg_replace('/\d/', '', $amount);. tried kinds of different regexes, notably /\d/, /[\d]/, /^\d/, /[^\d]/, , /[^0-9]/, none of them work.

edit: found why didn't work! under impression preg_replace('/\d/', '', $amount); replace $amount, see have $new_amount = preg_replace('/\d/', '', $amount); , utilize $new_amount. stupid, know. anyway!

<?php $amount = '$42,3034534'; // remove chars $str = preg_replace('/[^0-9.,]/', '', $amount); // replace commas periods, because php doesn't commas decimals $str = preg_replace('/,/', '.', $str); // convert float , multiply 100, utilize floor() rid of fractions of cent $cents = floor(floatval($str) * 100); echo $cents; // or echo floor(floatval(preg_replace('/,/', '.', preg_replace('/[^0-9.,]/', '', $amount))) * 100); //output: 4230

also, stop saying "it doesn't work". how not working? result getting not correct?

php regex

php - images how to echo in table -



php - images how to echo in table -

hi how echo in table want 1 row 3 columns image gallery images listing vertical want alter in horizontal how can alter please help me prepare issue

echo '<div class="urbangreymenu"> <ul><li><img src="wallpaper/' .$name . '/1.jpg" width="230" height="148" align="top"><a href="' .$path .'gallery.php?wallpapers=' .$name . '" >' . $name . '</a>'. $imgcount . 'wallpapers</li></ul></div>'; }

if understood needs, want table 1 row , 3 columns;

<table> <tr> <td> <img src="<?php echo $path . '/' . $image1;?>"/> </td> <td> <img src="<?php echo $path . '/' . $image2;?>"/> </td> <td> <img src="<?php echo $path . '/' . $image3;?>"/> </td> </tr> </table>

set img properties wish

php echo

jsf - Primefaces: Exclude column from row selection in p:dataTable -



jsf - Primefaces: Exclude column from row selection in p:dataTable -

i've got problem p:datatable , excluding column single row selection.

i have 4 columns in datatable. first 3 needed display fileid, filename , uploaddate. in 4th column there command button each row start action of file processing. there row selection (with ajax action on event) navigates file details page. now, when click on anywhere on row (including button) navigates me details page.

there's current code:

class="lang-html prettyprint-override"><h:form> <p:datatable id="billingfiles" value="#{billingfiles}" var="billingfile" rowkey="#{billingfile.billingfile.idbillingfile}" filteredvalue="#{billingservice.filteredbillingfiledatamodels}" selectionmode="single" paginator="true" rows="10"> <p:ajax event="rowselect" listener="#{billingservice.selectbillingfilerow}" /> <p:column sortby="#{billingfile.id}" filterby="#{billingfile.id}" id="idfile" headertext="#{msg['billing.file.id']}" filtermatchmode="contains"> <h:outputtext value="#{billingfile.id}" /> </p:column> <p:column sortby="#{billingfile.uploaddate}" filterby="#{billingfile.uploaddate}" id="uploaddate" headertext="#{msg['billing.file.upload_date']}" filtermatchmode="contains"> <h:outputtext value="#{billingfile.uploaddate}" /> </p:column> <p:column sortby="#{billingfile.filename}" filterby="#{billingfile.filename}" id="filename" headertext="#{msg['billing.file.file_name']}" filtermatchmode="contains"> <h:outputtext value="#{billingfile.filename}" /> </p:column> <p:column id="loadbillingfile"> <p:commandbutton id="loadbillingfilebutton" rendered="#{billingfile.filestatus.equals('uploaded')}" value="#{msg['billing.load_billing_file']}" action="#{billingservice.loadbillingfile(billingfile.billingfile)}" update=":form" /> </p:column> </p:datatable> </h:form>

and there method navigates file details page:

public void selectbillingfilerow(selectevent event) { billingfiledatamodel billingfiledatamodel = (billingfiledatamodel) event.getobject(); if (billingfiledatamodel != null) { selectedbillingfile = billingfiledao.findbillingfilebyid(billingfiledatamodel.getbillingfile().getidbillingfile()); facescontext.getcurrentinstance().getexternalcontext() .getrequestmap().put(jsfview.event_key, "viewbillingfile"); } }

is there way exclude column button row selection? need start processing file, without navigating me other page.

i found partial solution problem. prevented rowselect ajax action executing, when onclick event occurs.

i added line p:commandbutton:

onclick="event.stoppropagation();"

i said works partially, because click on column button, not on button itself, still executes rowselect action.

jsf primefaces datatable spring-webflow

event handling - How significant is the order with jQuery's trigger-method? -



event handling - How significant is the order with jQuery's trigger-method? -

i want provide way utilize on-event handler outside of plugin. problem is, trigger not fired if provide them in wrong order.

for example, works:

$(window).on('foo:bar', function(){ alert(true); }); $(window).trigger('foo:bar');

...this, not:

$(window).trigger('foo:bar'); $(window).on('foo:bar', function(){ alert(true); });

any ideas how sec approach can work?

update

here works: http://www.benplum.com/projects/rubberband/

you cannot. want eat cake before baking it.

upd: you're misinterpreting code @ http://www.benplum.com/projects/rubberband/

here jsfiddle proof doesn't work you're thinking: jsfiddle.net/zerkms/z5mya/

note code: i've forked library , added trivial console.log here: https://github.com/zerkms/rubberband/blob/master/jquery.bp.rubberband.js#l77

event-handling jquery jquery-on

sum of nested list in Python -



sum of nested list in Python -

i seek sum list of nested elements

e.g, numbers=[1,3,5,6,[7,8]], sum=30

i wrote next code

def nested_sum(l): sum=0 in range(len(l)): if (len(l[i])>1): sum=sum+nested_sum(l[i]) else: sum=sum+l[i] homecoming sum

the above code gives next error: object of type 'int' has no len() tried len([l[i]]), still not working

anyone can help? btw, python 3.3

you need utilize isinstance check whether element list or not. also, might want iterate on actual list, create things simpler.

def nested_sum(l): total = 0 # don't utilize `sum` variable name in l: if isinstance(i, list): # checks if `i` list total += nested_sum(i) else: total += homecoming total

python list

c# - App.Config Connection String -



c# - App.Config Connection String -

in windows form have connection string in app.config

<configuration> <configsections> </configsections> <connectionstrings> <add name="database" connectionstring="provider=microsoft.ace.oledb.12.0;data source=|datadirectory|\database.accdb" providername="system.data.oledb" /> </connectionstrings> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5" /> </startup> </configuration>

and in classes using next code connect database.

string connstring = configurationmanager.connectionstrings["database"].connectionstring;

but not connected database.

can point out mistake.

but when utilize code without utilize of app.config works fine.

string connstring = "provider=microsoft.ace.oledb.12.0; info source = c:\\users\\amrit\\desktop\\database.accdb; persist security info = false;";

how can create app.config connection string work..

you may

<configuration> <appsettings> <add key="applicationtitle" value="sample console application" /> <add key="connectionstring" value="server=localhost;database=northwind;integrated security=false;user id=sa;password=;" /> </appsettings>

then utilize configurationsettings.appsettings["connectionstring"];

c# winforms database-connection connection-string

visual studio 2012 - Difference between debugger types -



visual studio 2012 - Difference between debugger types -

what difference between native only, managed only, script only , mixed (managed , native) debugger types? can found in project's properties page.

different runtime environments have different debuggers. giving selection of debugger want utilize avoid starting 1 you'll never utilize , cutting overhead. debugger types are:

managed: suitable .net code written in managed language c# or vb.net native: suitable code generated c or c++ compiler mixed: selection you'll create when need debug .net code inter-operates native code, mutual in c++/cli projects or when need debug pinvoke problem script: useful debug scripting code, javascript, runs in browser gpu: used debug c++ amp code runs in graphics card silverlight: used debug silverlight code runs in browser t-sql: used debug stored procedures run on sql server workflow: used debug wf workflows

visual-studio-2012

SQL Server 2008 finding missing rows -



SQL Server 2008 finding missing rows -

this question has reply here:

sql query find missing sequence numbers 14 answers

i have huge db , 1 table in particular missing rows. know true need find gaps , show them. primary key sequence number column. need show actual missing sequence numbers. table has 76,054,525 rows of data.

update, sequence number provided our software , each 1 represents unique "play" record. our software not allow gaps in play sequence numbers. gaps missing data.

that gaps , islands problem , lot of people have written how solve that. example, itzik ben-gan covered in chapter 5 of sql server mvp deep dives book

however, why worried gaps in identity column? naturally occurs , cant prevented. can read more here: http://sqlity.net/en/792/the-gap-in-the-identity-value-sequence/

sql sql-server-2008 gaps-and-islands missing-data

c# - Trying to access style info by StaticResource through ResourceDictionary with x:Key -



c# - Trying to access style info by StaticResource through ResourceDictionary with x:Key -

i'm having problem wpf resources accessing external style info in external resourcedictionary through staticresources.

i have inherited bunch of code uses lot of dynamicresources in wpf style info shared.xaml. rather them staticresources designer view becomes useful. discovered can add together resourcedictionary in .resources of thing, works fine unless there .resources using in wpf. in case told need add together x:key resourcedictionary. except don't know how utilize key find resources statically.

minimal example:

<usercontrol x:class="myclass" ...> <usercontrol.resources> <resourcedictionary x:key="shared.xaml" source="/exteralresource;component/shared.xaml"/> <booleantovisibilityconverst x:key="booltovis"> </usercontrol.resources> <textblock background="{staticresource brushfromsharedxaml}" /> <!-- never finds brushsharedxaml --> </usercontrol>

any ideas?

<usercontrol.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="/exteralresource;component/shared.xaml"/> </resourcedictionary.mergeddictionaries> <booleantovisibilityconverst x:key="booltovis"> </resourcedictionary> </usercontrol.resources>

though, aware doing in each usercontrol going eat lot of ram, because you're creating new instance of shared.xaml resourcedictionary every instance of command @ runtime. should take @ sharedresourcedictionary

c# wpf xaml

spring - NoClassDefFoundError org/apache/poi/xssf/usermodel/XSSFWorkbook -



spring - NoClassDefFoundError org/apache/poi/xssf/usermodel/XSSFWorkbook -

i using spring web framework read excel file , display it. when deploy using tomcat getting exception. have included (poi, ooxml) version 3.9 jar file.

exception

http status 500 - handler processing failed; nested exception java.lang.noclassdeffounderror: org/apache/poi/xssf/usermodel/xssfworkbook

type exception report

message handler processing failed; nested exception java.lang.noclassdeffounderror: org/apache/poi/xssf/usermodel/xssfworkbook

description server encountered internal error prevented fulfilling request.

exception

org.springframework.web.util.nestedservletexception: handler processing failed; nested exception java.lang.noclassdeffounderror: org/apache/poi/xssf/usermodel/xssfworkbook org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:972) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:852) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:882) org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:778) javax.servlet.http.httpservlet.service(httpservlet.java:621) javax.servlet.http.httpservlet.service(httpservlet.java:728)

root cause

java.lang.noclassdeffounderror: org/apache/poi/xssf/usermodel/xssfworkbook excelreader.constructobject(excelreader.java:42) excelreportcontroller.handlerequestinternal(excelreportcontroller.java:32) org.springframework.web.servlet.mvc.abstractcontroller.handlerequest(abstractcontroller.java:153) org.springframework.web.servlet.mvc.simplecontrollerhandleradapter.handle(simplecontrollerhandleradapter.java:48) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:923) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:852) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:882) org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:778) javax.servlet.http.httpservlet.service(httpservlet.java:621) javax.servlet.http.httpservlet.service(httpservlet.java:728)

note total stack trace of root cause available in apache tomcat/7.0.33 logs.

spring

Display custom post types in grid Wordpress -



Display custom post types in grid Wordpress -

i trying display custom post type (cpt) in grid view similar on site:

www.virtualpudding.com

i have thoroughly searched google , stackoverflow no avail. needs have thumbnail site linked above when clicked follows through specific page. portfolio show case work.

currently have custom post type entitled 'portfolio' , have created basic template display these using next code;

<?php /** * template name: recipes page * * selectable dropdown menu on edit page screen. */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php query_posts( 'post_type=portfolio'); ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>

i not php coder , have little knowledge of php coding , help much appreciated.

thanks

first of create sure custom post type supports 'thumbnails'.

the wordpress function "register_post_type" takes array can configure custom post type. 1 of array element "supports" allows specify features custom post type has.'

register_post_type

or add_post_type_support

then, in while loop, can thumbnail using has_post_thumbnail , the_post_thumbnail

wordpress wordpress-theming custom-post-type

c# - ListBox does not use all available space within Grid.Column - WPF -



c# - ListBox does not use all available space within Grid.Column - WPF -

i have listbox command has been assigned grid.column 0 has value of '*' defined it's width, when rendered there sizeable amount of space not beingness used.

i have noticed there border of sorts around listbox command itself, have not added 1 within markup.

my ui (areas of concern marked in red):

my markup:

<window.resources> <datatemplate x:key="gameimagestemplate" > <stackpanel orientation="vertical"> <image source="{binding fileinfo.fullname}" margin="8,8,8,8" height="70" width="70" /> <label content="{binding name}" width="70" /> </stackpanel> </datatemplate> <datatemplate x:key="gametemplate"> <stackpanel> <label content="{binding name}" background="gray" fontsize="16" /> <listbox x:name="imagecontent" itemssource="{binding filelist}" itemtemplate="{staticresource gameimagestemplate}" scrollviewer.horizontalscrollbarvisibility="disabled" > <listbox.itemspanel> <itemspaneltemplate> <wrappanel orientation="horizontal" isitemshost="true" /> </itemspaneltemplate> </listbox.itemspanel> </listbox> </stackpanel> </datatemplate> </window.resources> <grid> <grid.columndefinitions> <columndefinition width="*"/> <columndefinition width="auto"/> </grid.columndefinitions> <listbox x:name="contentlist" itemtemplate="{staticresource gametemplate}" grid.column="0" scrollviewer.horizontalscrollbarvisibility="disabled" /> <stackpanel grid.column="1" background="darkgray"> <button click="onload">_load</button> <button click="onsave">_save</button> <button click="onadd">_add</button> <button click="ondelete">_delete</button> </stackpanel> </grid>

how go resolving both of issues raised. default behaviour of listbox control?

many thanks

yes, default behavior.

in case of alignment looks have wrappanel in each listboxitem doesn't have quite plenty space set item on line 1. remaining space unused because of horizontalcontentalignment setting on listbox defaulting left. setting in turn bound default listboxitem. setting horizontalcontentalignment="stretch" on listbox should prepare that.

the outer border comes default setting borderbrush , borderthickness. setting borderthickness="0" rid of entirely.

there other default padding settings add together spacing in default styles , templates. if want more add together listbox project in blend , create re-create of default template , itemcontainerstyle , check out xaml. consider using base of operations itemscontrol in cases don't need selection behavior, doesn't have of these type of default settings.

c# wpf .net-4.0 listbox grid-layout

ruby on rails - CSS only targetting first line in a comment -



ruby on rails - CSS only targetting first line in a comment -

so have comments in app , issue 1 time content in comment becomes 3 lines wraps below users image instead of starting other lines do. i'm pretty new css seems whatever margins apply moves first line.

css:

#comment_border { border: 1px solid $graylighter; border-radius: 3px; background-color: #d6e5f1; margin-left: 90px; padding: 2px; } .comment_info { display: block; margin-left: -20px; color: #767676; } #comment_content { /* dont know set here */ }

view/comments:

<div class="row" id="comment_border"> <span class="comment_info"> <aside class="span2"> <%= link_to gravatar_for((comment.user), size: 35), comment.user %> <%= link_to comment.user.name, comment.user, id: "feedusername" %> </aside> <span id="comment_content"> <%= comment.content %> </span> </span> </div>

the problem description incomplete (essential css missing etc.), main problem seems setting left margin on inline element. given markup, next css modifications render in way seems meant:

.comment_info { display: block; margin-left: 0px; color: #767676; /* margin-left:-20px; not set here */ } #comment_content { margin-left: 90px; display: block; } .span2 { width: 80px; height: 35px; float: left; border: solid 1px red; }

it more logical utilize div element , not span comment content; doing so, drop display: block declaration.

p.s. shouldn’t utilize aside here; it’s not meant purposes this, , confuses old browsers; utilize div instead.

css ruby-on-rails

android - How to restart activity within TabActivity -



android - How to restart activity within TabActivity -

in app have used next code close , restart current activity. problem is, have used 3 tab activity nested. total 9 activities. while using next code app loading slow. think there smarter way this. if knows please suggest me friends.

localactivitymanager manager = getlocalactivitymanager(); string currenttag = tab.getcurrenttabtag(); class<? extends activity> currentclass = manager.getcurrentactivity().getclass(); manager.removeallactivities(); manager.startactivity(currenttag, new intent(mainactivity.this,currentclass));

thank you.

i suppose "smarter" way here not utilize deprecated class tabactivity , sure not nest several tabhost. should utilize fragments , @ to the lowest degree fragmenttabhost.

android

c++ - Exception class -



c++ - Exception class -

so i'm doing class exception linked list, have no thought set in. example, if user wants delete element not exist in list, print out "sparse exception caught: element not found, delete fail", or "sparse exception caught: sparse matrix empty, printing failed". ok me way? if so, how print out message?

sparseexception::sparseexception () { } sparseexception::sparseexception (char *message) { if (strcmp(message, "delete")) cout << "sparse exception caught: element not found, delete fail"; else cout << "sparse exception caught: sparse matrix empty, printing failed"; } void sparseexception::printmessage () const { }

in sentiment exception should inherit std::exception or 1 of subclasses. give thought of interface should implement. need what methods instance(in fact what returns printmessage print). if want print exception's message, improve overload operator<<.

inheriting std::exception needed know catch(std::exception& ex) grab exception code threw.

c++ exception

asp.net - Navigation menu in umbraco -



asp.net - Navigation menu in umbraco -

i using umbraco cms. here have problem in navigation menu multilingual site. xslt files code given below. renders menu in english. new umbraco. can 1 please tell me have alter in code create work right according different languages. code is

<?xml version="1.0" encoding="utf-8"?> <!doctype xsl:stylesheet [ <!entity nbsp "&#x00a0;"> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:exslt.exsltcommon="urn:exslt.exsltcommon" xmlns:exslt.exsltdatesandtimes="urn:exslt.exsltdatesandtimes" xmlns:exslt.exsltmath="urn:exslt.exsltmath" xmlns:exslt.exsltregularexpressions="urn:exslt.exsltregularexpressions" xmlns:exslt.exsltstrings="urn:exslt.exsltstrings" xmlns:exslt.exsltsets="urn:exslt.exsltsets" exclude-result-prefixes="msxml umbraco.library exslt.exsltcommon exslt.exsltdatesandtimes exslt.exsltmath exslt.exsltregularexpressions exslt.exsltstrings exslt.exsltsets "> <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/> <xsl:param name="currentpage"/> <xsl:variable name="rootpage" select="$currentpage/ancestor-or-self::root"/> <xsl:variable name="siteroot" select="$currentpage/ancestor-or-self::*[@level = 1]" /> <xsl:variable name="propertyalias" select="/macro/propertyalias"/> <xsl:template match="/"> <xsl:variable name="homepage" select="$currentpage/ancestor-or-self::homepage"/> <xsl:variable name="nodeids" select="umbraco.library:split($homepage/*[name()=$propertyalias],',')" /> <ul class="navigation fc"> <xsl:for-each select="$nodeids/value"> <xsl:variable name="linknone" select="$rootpage//*[@isdoc][@id = string(current()/.)]"/> <xsl:if test="string-length($linknone/@id)> 0"> <li> <xsl:attribute name="class"> <xsl:if test="$currentpage/ancestor-or-self::*[@level &gt; 1]/@id = $linknone/@id"> <xsl:text>selected</xsl:text> </xsl:if> <xsl:if test="position() = last()"> <xsl:text> last</xsl:text> </xsl:if> </xsl:attribute> <xsl:choose> <xsl:when test="string-length($linknone/umbracourlalias) > 0"> <a href="{$linknone/umbracourlalias}"> <xsl:value-of select="$linknone/@nodename"/> </a> <xsl:if test="position() != last()"> <xsl:text> | </xsl:text> </xsl:if> </xsl:when> <xsl:otherwise> <a href="{umbraco.library:niceurl($linknone/@id)}"> <xsl:value-of select="$linknone/@nodename"/> </a> <xsl:if test="position() != last()"> <xsl:text> | </xsl:text> </xsl:if> </xsl:otherwise> </xsl:choose> </li> </xsl:if> </xsl:for-each> </ul> </xsl:template> </xsl:stylesheet>​

you shouldn't using $rootpage ever. multilingual or multisite want stop @ home page above current content ($siteroot).

it looks navigation selected picker on home page. reason why don't allow content tree construction determine navigation? may simpler in case.

if doesn't help, please post content tree construction example.

asp.net xslt content-management-system umbraco

html - jquery - Looking for same content -



html - jquery - Looking for same content -

i've trying getting working selectors, while, for, etc i'm not getting close in want.

<div class="product"> <div class="id">569865974598</div> <div class="name">ati radeon sapphire hd 6850</div> <div class="time">2013-02-14 03:13:33</div> </div> <div class="product"> <div class="id">654654654987</div> <div class="name">nvidia geforce 9500gt</div> <div class="time">2013-02-14 00:36:13</div> </div> <div class="product"> <div class="id">2561564898789</div> <div class="name">ati radeon sapphire hd 6850</div> <div class="time">2013-02-14 00:36:13</div> </div>

expected(encapsulate products same time)

<div id="same"> <div class="product"> <div class="id">569865974598</div> <div class="name">ati radeon sapphire hd 6850</div> <div class="time">2013-02-14 03:13:33</div> </div> </div> <div id="same"> <div class="product"> <div class="id">654654654987</div> <div class="name">nvidia geforce 9500gt</div> <div class="time">2013-02-14 00:36:13</div> </div> <div class="product"> <div class="id">2561564898789</div> <div class="name">ati radeon sapphire hd 6850</div> <div class="time">2013-02-14 00:36:13</div> </div> </div>

try this:

$(document).ready(function(){ $('.product').each(function(){ // generate div id based on time e.g. 2013-02-14 00:36:13 -> id=20130214003613 var id = $(this).find('.time').html().replace(/[\s-:]/g,""); var sameelement = $('#' + id); if(sameelement.length == 0){ $('body').append('<div id=' + id + '></div>'); sameelement = $('#' + id); } $(this).appendto(sameelement); }); });

note: having multiple div elements same id not correct, why instead of proposed id='same' there generated id based on time

fiddle: http://jsfiddle.net/zt38s/

jquery html select addclass

c# - Strange InvalidOperationException when updating entity with RIA Services -



c# - Strange InvalidOperationException when updating entity with RIA Services -

i'm working ef4.1, ria services , silverlight. i'm having bizarre problem in update scenario.

the domain model quite simple; deals requests , persons. have 1-to-n relationship. citizen can have multiple requests although in reality never occur since the app not provide functionality so.

request has property called 'urgent', alter true , seek save. goes until actual persisting begins via method:

public void updaterequest(request currentrequest) { request original = changeset.getoriginal(currentrequest); seek { objectcontext.requests.attachasmodified(currentrequest, original); } grab (exception ex) { // weirdness here! } }

which pretty much standard generated method ria services (except try/catch handler added debugging purposes.) next error:

when check changeset, there no requests added, i'm sure didn't add together accident.

an object same key exists in objectstatemanager. objectstatemanager cannot track multiple objects same key.

i don't understand this... there literally no added objects in objectstatemanager, changeset has no added objects; hell coming from? tracked properties beingness changed, i'm sure key not overwritten, nor beingness added or other funkyness.

can shed lite here? driving me crazy several days far...

c# .net silverlight entity-framework wcf-ria-services

facebook - Given URL is not allowed by the Appplication configuration -



facebook - Given URL is not allowed by the Appplication configuration -

i've been testing app using company's domain (which has ssl installed) , works charm.

now, want app have own domain, server , ssl certificate. purchased godaddy ssl certificate(standard (turbo) ssl) , asked hosting install it, did , seems working ok...

now when alter facebook app settings new server, fails load, , console outputs "given url not allowed application configuration.: 1 or more of given urls not allowed app's settings. must match website url or canvas url, or domain must subdomain of 1 of app's domains. "

im lost on do... settings this

im loading fb using facebook-actionscript-api 1.8.1

namespace: myfbapp

app domains: myfbapp.com www.myfbapp.com

sandbox: disabled

canvas url: http://www.myfbapp.com

secure c url:https://www.myfbapp.com

i have no clue whats going on :( help much appretiated

needed dedicated ip game , attach ssl

facebook

javascript - How can I avoid the repetetive code in this jQuery code? ANSWERED -



javascript - How can I avoid the repetetive code in this jQuery code? ANSWERED -

hello making site , code lets me have several pages in 1 .html file. can iterative-ness of code avoided? can simplified?

answered

what mean iterative-ness ?

if want code dry write somthing this:

<script type="text/javascript"> var x = 300; $(function () { $("#indexlink,#betalinglink,#bestemminglink,#leerlinglink").click(function () { $("#content>div").not("#start").hide(x); $("#"+$(this).attr("id").slice(0,-4)).show(x); $('nav>ul>li').removeclass('active'); $('#indexlink').addclass('active'); }); }); </script>

this take selectors, 1 @ time, , create of them run code of yours, same typed, in 1 selector only

edit

fixed div showing

edit2

added jsfiddle show working: http://jsfiddle.net/nicoskaralis/vurjf/

javascript jquery simplify iteration

listview - How to stop list recycling On Scroll of list View, in a custom cursor adapter android -



listview - How to stop list recycling On Scroll of list View, in a custom cursor adapter android -

i creating 1 list divided categories passing view in list view (using simple cursor adapter) using view holder. in custom simple cursor adapter can set visibility of 1 single bar on each items of list. but on scroll visibility of bar not fixed list items, gets changed randomly , down. check code posting here.

when phone call custom cursor list adapter's constructor normal activity passing parameters(the view, cursor) , , i on riding bind view not newview.

please help me on this.

activity is:

catcount = cursorcat.getcount(); int i=0; cursorcat.movetofirst(); { categ = cursorcat.getstring(cursorcat.getcolumnindex("category_name")); cursorcatitems = db.rawquery("select _id, product_code, product_name, product_category, in_stock, cost productdetails _id || ' ' || product_name || product_code ? ", new string[] { "%" +searchvalue+ "%"}); adapter = new mforceadaptercat(this, r.layout.item_details, cursorcatitems, new string[] { "product_code", "product_name","product_category","in_stock","price" }, new int[] { r.id.tvcode, r.id.tvitemname,r.id.tvitemtype,r.id.tvquantity,r.id.tvprice }); listview.setadapter(adapter); i++; } while (cursorcat.movetonext() && i<catcount-1); cursorcat.close(); // downwards here code list view items @suppresslint("newapi") public class mforceadaptercat extends simplecursoradapter { string prevcat=""; int count=0; private final string tag = this.getclass().getsimplename(); protected listadapter adapter; public mforceadaptercat(context context, int layout, cursor c, string[] from, int[] to, int flags) { super(context, layout, c, from, to, flags); // todo auto-generated constructor stub } @suppresswarnings("deprecation") public mforceadaptercat(context context, int layout, cursor c, string[] from, int[] to) { super(context, layout, c, from, to); // todo auto-generated constructor stub } @override public int getitemviewtype(int position) { // todo auto-generated method stub homecoming super.getitemviewtype(position); } @override public void bindview(view view, context context, cursor cursor) { super.bindview(view, context, cursor); viewholder holder = (viewholder) view.gettag(); holder = new viewholder(); holder.tvcode = (textview) view.findviewbyid(r.id.tvcode); holder.tvitemname = (textview) view.findviewbyid(r.id.tvitemname); holder.tvitemtype = (textview) view.findviewbyid(r.id.tvitemtype); holder.tvprice = (textview) view.findviewbyid(r.id.tvprice); holder.tvquantity = (textview) view.findviewbyid(r.id.tvquantity); holder.imgbtnlv=(imagebutton) view.findviewbyid(r.id.imgbtnlv); holder.categbar=(linearlayout) view.findviewbyid(r.id.categbar); holder.tvtitlecateg=(textview) view.findviewbyid(r.id.tvtitlecateg); holder.item_detail_layout=(relativelayout) view.findviewbyid(r.id.item_detail_layout); string currcategory = cursor.getstring(cursor.getcolumnindex("product_category")); holder.tvtitlecateg.settext(currcategory); if(prevcat.equalsignorecase(currcategory)){ holder.categbar.setvisibility(view.gone); }else{ holder.categbar.setvisibility(view.visible); } prevcat= currcategory; onclicklistener monimagebtnclicklistener = new onclicklistener() { @override public void onclick(view v) { final int position = productsactivity.listview.getpositionforview((view) v.getparent()); log.v(tag, "image button in list clicked, row ="+position); listadapter la= productsactivity.listview.getadapter(); system.out.println("list adapter ="+la); int cnt = getpositionfromrowid(la, position, 0, la.getcount()); system.out.println("info new mthod ="+cnt); } }; holder.imgbtnlv.setonclicklistener(monimagebtnclicklistener); view.settag(holder); } static class viewholder { textview tvcode; textview tvitemname,tvitemtype,tvprice,tvquantity; relativelayout item_detail_layout; imagebutton imgbtnlv; linearlayout categbar; textview tvtitlecateg; }

the way using viewholder makes no sense. it's useless imho. see here: http://www.jmanzano.es/blog/?p=166

you not inflating views here don't need it. viewholder should used remove redundant view inflating , reuse view, in cursor adapter reusing view done. can delete it.

android listview scroll

Android set intent class file by variable -



Android set intent class file by variable -

i trying utilize layoutinflater inflate buttons array lists. have 3 array lists: 1 button text, 1 button image, , 1 class file in go when clicked. have text , images working when inflating buttons can not switch class file when clicked. have tried looking solution have not found fit needs. help appreciated.

here code:

viewgroup parent; layoutinflater inflater; textview btext; imageview bimage; parent = (viewgroup) findviewbyid(r.id.container); inflater = (layoutinflater) getapplicationcontext().getsystemservice(context.layout_inflater_service); string[] text = {"news","chat"}; string[] image = {"news","chat"}; string[] link = {"main","chat"}; int size = text.length; for(int = 0; < size; i++) { view view = inflater.inflate(r.drawable.button, null); int imageid = getresources().getidentifier(image[i], "drawable", getpackagename()); bimage = (imageview) view.findviewbyid(r.id.ihome); bimage.setimageresource(imageid); btext = (textview) view.findviewbyid(r.id.thome); btext.settext(text[i]); parent.addview(view); final string theclass = link[i]; btext.setonclicklistener(new onclicklistener() { public void onclick(view v) { // todo auto-generated method stub intent blink = new intent(); blink.setclassname(getapplicationcontext(), theclass); startactivity(blink); } }); }

edit: clarify when click of buttons crashes saying cannot find , asking if has been declared in androidmanifest.xml is.

first parameter of blink.setclassname() bundle context. seek calling this.

blink.setclassname(packagename, fullyqualifiedactivityname); getapplicationcontext().startactivity(blink);

android variables android-intent

c# - Linq: Include a join on the allready joined tables -



c# - Linq: Include a join on the allready joined tables -

i wondering if possible in linq: have 3 tables:

request --id --adress --description nav.properties: -- requeststatus requeststatus --requestid --pubdate --statustypeid nav.properties: -- request -- statustype statustype --id --statustypedescription nav.properties -- requeststatus

in linq, can manage first 2 table joined this:

var requestwithstatus = dbcontext.requests.include("requeststatus").tolist<fullrequest>();

but...what have statustypedescription column included in query (so utilize bring together on 3rd table).

if request instance can have 1 requeststatus, , requeststatus instance can have 1 statustype, do

var requestlist = dbcontext.requests.include("requeststatus.statustype").tolist();

there's "lambda" (expression>) overload include (in system.data.entity) (not sure work mysql)

var requestlist = dbcontext.requests.include(m => m.requeststatus.statustype).tolist();

all info nowadays in list (eager loading).

then can access description

var firstrequest = requestlist.first(); var requestdescription = firstrequest.description; var statustypedescription = firstrequest.requeststatus.statustype.description;

or safer

var statustypedescription = firstrequest.requeststatus != null && firstrequest.requeststatus.statustype != null ? firstrequest.requeststatus.statustype.description : string.empty;

c# mysql linq

How to set ca-bundle path for OpenSSL in ruby -



How to set ca-bundle path for OpenSSL in ruby -

i experiencing problem in ruby, ssl cert not validated openssl. think caused ca-bundle.pem not beingness known script. there possibility configure path of ca-bundle.pem manually?

openssl uses ssl_cert_file environment variable. can set in ruby script using before first require pulls in openssl:

env['ssl_cert_file'] = '/path/to/ca-bundle.pem'

or, if prefer, can set ssl_cert_file environment variable in os environment, web server configuration etc depending on situation.

ruby openssl certificate ca

output a sorted file in C using qsort -



output a sorted file in C using qsort -

to read strings file , print sorted output using qsort. write this:

int main() { int n=0; int size=1; file *fp = fopen(args[0],"r"); int c; char* inputfile; inputfile = char* malloc(size); if(fp==0){ fprintf(stderr, "cannot open file!\n"); homecoming -1; else{ do{ c = fgetc(fp); if(size==1){ inputfile[n]=c; } else{ inputfile = char* realloc(inputfile, size+1); inputfile[n]=c; } n++; size++; }while(c!=eof); qsort(inputfile, 1, size, compare);//i have implement compare function correctly n=0; while(n<size){ while(input[n]!='\0'){ printf ("%d ",inputfile[n]); n++; } n++; } homecoming 0; }

so, if input file '\0vaaa\n\0ba\0\nabc', programme should output print:

abc ba vaaa

however, code isn't working @ all. have check compare method homecoming right result. additionally, wonder if implement malloc-realloc correctly? thx

you want print strings, replace:

printf ("%d ",inputfile[n]);

with

printf ("%s ",inputfile[n]);

but may have other problems in code..

c

sql - Parsing xml file and getting parent names of nodes using stored procedure -



sql - Parsing xml file and getting parent names of nodes using stored procedure -

i have xml file given input stored procedure in sql server. have table has columns element name , parent id. root element parent id 0 first element parent id 1and on. how accomplish this?

i have several complex types in xml

<voyageordermessage xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="voyage.xsd"> <messageheader> <messageid>id</messageid> <messagedate>2009-11-01t11:42:07.414+03:00</messagedate> <messagetypeversion>version</messagetypeversion> <senderid>si</senderid> <receiverdetails> <receivermethod /> <receiverformat /> <receiveraddress></receiveraddress> </receiverdetails> </messageheader> <voyageorder> <voyageid>rg-fuw-001</voyageid> <amendment>4</amendment> <imo>9256200</imo> <vesselname>fuwairit</vesselname> <shipmastername /> <orderdate>2009-11-01t11:41:59.149+03:00</orderdate> <passage> <passagenumber>1</passagenumber> <passagetype>laden</passagetype> <departureportname>ras laffan</departureportname> <departureportcode>rlf</departureportcode> <departuretime>2009-10-06t19:06:00.000+03:00</departuretime> <arrivalportname>suez</arrivalportname> <arrivalportcode>suz</arrivalportcode> <arrivaltime>2009-10-13t03:00:00.000+02:00</arrivaltime> </passage>

example output

elementname parent id column ------------------------------ voyageorder 0 1 messageheader 1 2 messageid 2 3 etc

any help appreciated

looks border table format returned openxml use.

sql fiddle

ms sql server 2012 schema setup:

query 1:

declare @xml xml = ' <voyageordermessage xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="voyage.xsd"> <messageheader> <messageid>id</messageid> <messagedate>2009-11-01t11:42:07.414+03:00</messagedate> </messageheader> <voyageorder> <voyageid>rg-fuw-001</voyageid> <amendment>4</amendment> <orderdate>2009-11-01t11:41:59.149+03:00</orderdate> <passage> <passagenumber>1</passagenumber> <passagetype>laden</passagetype> </passage> </voyageorder> </voyageordermessage>' declare @idoc int exec sp_xml_preparedocument @idoc output, @xml select * openxml(@idoc, '*') exec sp_xml_removedocument @idoc

results:

| id | parentid | nodetype | localname | prefix | namespaceuri | datatype | prev | text | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 0 | (null) | 1 | voyageordermessage | (null) | (null) | (null) | (null) | (null) | | 2 | 0 | 2 | xsi | xmlns | (null) | (null) | (null) | (null) | | 14 | 2 | 3 | #text | (null) | (null) | (null) | (null) | http://www.w3.org/2001/xmlschema-instance | | 3 | 0 | 2 | nonamespaceschemalocation | xsi | http://www.w3.org/2001/xmlschema-instance | (null) | (null) | (null) | | 15 | 3 | 3 | #text | (null) | (null) | (null) | (null) | voyage.xsd | | 4 | 0 | 1 | messageheader | (null) | (null) | (null) | (null) | (null) | | 5 | 4 | 1 | messageid | (null) | (null) | (null) | (null) | (null) | | 16 | 5 | 3 | #text | (null) | (null) | (null) | (null) | id | | 6 | 4 | 1 | messagedate | (null) | (null) | (null) | 5 | (null) | | 17 | 6 | 3 | #text | (null) | (null) | (null) | (null) | 2009-11-01t11:42:07.414+03:00 | | 7 | 0 | 1 | voyageorder | (null) | (null) | (null) | 4 | (null) | | 8 | 7 | 1 | voyageid | (null) | (null) | (null) | (null) | (null) | | 18 | 8 | 3 | #text | (null) | (null) | (null) | (null) | rg-fuw-001 | | 9 | 7 | 1 | amendment | (null) | (null) | (null) | 8 | (null) | | 19 | 9 | 3 | #text | (null) | (null) | (null) | (null) | 4 | | 10 | 7 | 1 | orderdate | (null) | (null) | (null) | 9 | (null) | | 20 | 10 | 3 | #text | (null) | (null) | (null) | (null) | 2009-11-01t11:41:59.149+03:00 | | 11 | 7 | 1 | passage | (null) | (null) | (null) | 10 | (null) | | 12 | 11 | 1 | passagenumber | (null) | (null) | (null) | (null) | (null) | | 21 | 12 | 3 | #text | (null) | (null) | (null) | (null) | 1 | | 13 | 11 | 1 | passagetype | (null) | (null) | (null) | 12 | (null) | | 22 | 13 | 3 | #text | (null) | (null) | (null) | (null) | laden |

sql sql-server xml sql-server-2008

validation - ModelState.IsValid does it work with ajax call ? -



validation - ModelState.IsValid does it work with ajax call ? -

the model :

public class changepasswordmodel { //user profile key public string username { get; set; } [required(errormessage = " please come in current password ")] public string oldpassword { get; set; } [required(errormessage = " please come in new password ")] [stringlength(20, minimumlength = 6, errormessage = "the {0} must @ to the lowest degree {2} , no longer {1} characters long.")] public string newpassword { get; set; } [required(errormessage = " please re-enter new password ")] [mustbevalidator(mustbevalidator.condition.equalto, "newpassword", errormessage = "please, confirm password")] public string renewpassword { get; set; } }

ajax phone call security apicontroller :

[system.web.mvc.httppost] public actionresult changepassword(changepasswordmodel change) { if (!modelstate.isvalid) {

the problem is, when "newpassword" diff "renewpassword" modelstate.isvalid = true

i don't know mustbevalidator may seek using standard attribute in asp.net mvc 3:

[required(errormessage = " please re-enter new password ")] [compare("newpassword", errormessage = "please, confirm password")] public string renewpassword { get; set; }

ajax validation asp.net-mvc-4

Android Poor performance of surfaceview in Listview -



Android Poor performance of surfaceview in Listview -

i have android app having layout containing listview, inflated with

layoutinflater inflater = getlayoutinflater(); row = inflater.inflate(r.layout.disc_row, parent, false);

the "r.layout.disc_row" containing surfaceview drawing canvas. each row within listview containing canvas. while scrolling list canvas staying @ place while other elements of row scrolling. think poor behaviour of device. same app not drawing on emulator until clicking on listitem.

is there improve strategy drawing within listviews (no bitmap, lines) maybe paint? emulator sys doing much work in activity.

thanks in advance

attached class

public class drawdiscinlistview extends surfaceview implements surfaceholder.callback { private static final string tag = "discont surfaceview"; public drawdiscinlistview(context context, attributeset attrs) { super(context, attrs); // todo auto-generated constructor stub } @override public void surfacecreated(surfaceholder holder) { trydrawing(holder); } @override public void surfacechanged(surfaceholder holder, int frmt, int w, int h) { trydrawing(holder); } @override public void surfacedestroyed(surfaceholder holder) { } private void trydrawing(surfaceholder holder) { log.i(tag, "trying draw..."); canvas canvas = holder.lockcanvas(); if (canvas == null) { log.e(tag, "cannot draw onto canvas it's null"); } else { drawmystuff(canvas); holder.unlockcanvasandpost(canvas); } } private void drawmystuff(final canvas canvas) { random random = new random(); log.i(tag, "drawing..."); canvas.drawrgb(255, 128, 128); }

}

i did research, share here:

instead of using surfaceview used imageview: used canvas creating bitmap , used bitmap in listview. works fine , without loss of performance.

android listview surfaceview

html - it keeps navigating me to top of page when clicking on a button -



html - it keeps navigating me to top of page when clicking on a button -

below piece of code styles checkbox create button, problem having though how come when click on checkbox button keeps navigating me top top of page?

html/php:

echo '<div id="ck-button"><label><input type="checkbox" name="options[]" id="option-' . $indivoption . '" value="' . $indivoption . '" /><span>' . $indivoption . '</span></label></div>';

css:

#ck-button { margin:8px; background-color:#efefef; border:1px solid #d0d0d0; overflow:auto; float:left; } #ck-button:hover { background:green; } #ck-button label { float:left; width:4.0em; } #ck-button label span { text-align:center; padding:3px 0px; display:block; } #ck-button label input { position:absolute; top:-20px; } #ck-button input:checked + span { background-color:#911; color:#fff; }

you need add together position: relative; #ck-button selector.

#ck-button { margin:8px; background-color:#efefef; border:1px solid #d0d0d0; overflow:auto; float:left; position: relative; }

here's working illustration on js bin. (scroll downwards see button)

html css

javascript - How to put jQuery :gt() dynamically? -



javascript - How to put jQuery :gt() dynamically? -

there jquery :gt() selector allows select elements @ index greater index within matched set.

i can utilize this:

$(this).find('a:gt(30)');

the problem i'm using var instead:

var opt = $("#div").text();

how set :gt() selector next variable:

var opt = $("#div").text(); $(this).find(opt:gt(30));

this doesn't seem work.

you need utilize string concatenation.

$(this).find(opt + ":gt(30)")

if opt has value of, example, "a". look opt + ":gt(30)" evaluate "a:gt(30)".

you need careful opt valid selector.

javascript jquery

jax rs - How to access Carbon port offset from a webapp in AS -



jax rs - How to access Carbon port offset from a webapp in AS -

is there way access carbon port offset war deployed in programatically?i want generate wsdl url of deploying jax-rs service.

it available scheme property "portoffset".

port jax-rs wso2 offset

servlets - EntityManagerFactory is not been injected - JPA -



servlets - EntityManagerFactory is not been injected - JPA -

i'm begginer jpa, , i'm having problems when utilize @persistenceunit in servlet. entitymanagerfactory not beingness injected, , don't know why.

public class myservlet extends httpservlet { @persistenceunit private entitymanagerfactory emf = null; public myservlet () { super(); } @override public void init(servletconfig config) throws servletexception { super.init(config); } protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { author w = response.getwriter(); w.append("hello hello"); w.close(); } }

i've configured persistence.xml file (inside meta-inf directory) this:

<?xml version="1.0" encoding="utf-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="middlewareexpedelectrmodel" transaction-type="resource_local"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <non-jta-data-source>java:/oracleds</non-jta-data-source> <class>com.ieci.mugeju.middleware.model.entities.fechaultimasolicitudprocesada</class> <properties> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.jbosstransactionmanagerlookup"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.dialect" value="org.hibernate.dialect.oracle10gdialect"/> </properties> </persistence-unit>

why not entitymanagerfactory beingness injected?

i'm working jboss 4.2.3, , have configured datasource oracle-ds.xml file.

update:

if seek entitymanagerfactory programatically, works well:

entitymanagerfactory emf = persistence.createentitymanagerfactory("middlewareexpedelectrmodel");

but entitymanagerfactory instance via injection. thanks!

can seek

public class myservlet extends httpservlet { //this thread-safe @persistenceunit(unitname="middlewareexpedelectrmodel") private entitymanagerfactory emf;

as far know, methods in entitymanager interface not thread-safe, , may not shared among multiple concurrent requests. therefore, not inject entitymanager servlet instance variable.

this not thread-safe, , avoid it

@persistencecontext(unitname="middlewareexpedelectrmodel") private entitymanager em;

you can still inject entitymanager @ servlet class type level, , when needed during request processing.

@persistencecontext(unitname="middlewareexpedelectrmodel", name="persistence/em") public class myservlet extends httpservlet { protected void doget( httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { seek { initialcontext ic = new initialcontext(); entitymanager em = (entitymanager) ic.lookup("java:comp/env/persistence/em"); } grab (namingexception ex) { ... }

servlets jpa

Silverlight Telerik RadCombobox Within RadGridView Binding issue -



Silverlight Telerik RadCombobox Within RadGridView Binding issue -

i'm binding editable (you can type in add together items list of choices) radcombobox in column of radgridview. not throwing binding error, not updating bound property (model.remarks)

here classes

public class notamremarklist : list<string> { public notamremarklist() { add("precision approaches down; higher weather minimums apply."); add("due runway closure, approaches available have higher minimums."); add("all approaches down; weather must vfr."); add("long runway closed; issue if other runways wet."); add("runway shortened; issue if wet."); add("airport closed @ time scheduled in."); add("runway lights inoperative; night flights prohibited."); } } public class notamviewmodel { [datamember] public string newstatus { get; set; } [datamember] public notam model { get; set; } [datamember] public string notamgroup { get; set; } [datamember] public int notamcount { get; set; } [datamember] public datetime? earliestnotamdeparturetime { get; set; } // min_dep_datetime [datamember] public string radiobuttongroupname { get; set; } } public class notam { [datamember] public string remarks { get; set; } [datamember] public string tripnumber { get; set; } [datamember] public string arrivaldeparture { get; set; } }

here's xaml have tried column - first 1 uses cell template, sec attempts in column

<telerik:gridviewdatacolumn header="remarks" isfilterable="false" issortable="false" isreadonly="false" width="430"> <telerik:gridviewdatacolumn.celltemplate> <datatemplate> <telerik:radcombobox selectedvalue="{binding model.remarks, mode=twoway}" itemssource="{staticresource notamremarklist}" iseditable="true"/> </datatemplate> </telerik:gridviewdatacolumn.celltemplate> </telerik:gridviewdatacolumn> <telerik:gridviewcomboboxcolumn selectedvaluememberpath="model.remarks" uniquename="colremarks" iscomboboxeditable="true" isfilterable="false" issortable="false"/>

public class notam:inotifypropertychanged { private string _remarks; [datamember] public string remarks { {return _remarks;} set{ _remarks=value ; if (propertychanged != null) propertychanged(this, new propertychangedeventargs("remarks")); } } [datamember] public string tripnumber { get; set; } [datamember] public string arrivaldeparture { get; set; } public event propertychangedeventhandler propertychanged; } <telerik:radcombobox selectedvalue="{binding model.remarks, mode=twoway}" selectedvaluememberpath="model.remarks" itemssource="{staticresource notamremarklist}" iseditable="true"/>

i hope help.

silverlight telerik

c# - Pass object from one dll to another on the runtime -



c# - Pass object from one dll to another on the runtime -

i have 2 projects, in 1 project have 1 form , class different information, info acquiring during runtime, in project have form, utilize object of first class info , set within form.

basically did research , tried using reflection that, of examples found didn't work (actually didn't work @ all).

assembly = assembly.loadfile("server.gui.localgui.dll"); object o = a.createinstance("servermanager"); type t = o.gettype();

this code tried, not sure if it's correct...

i using .net 2.0

is have working illustration of how utilize info of 1 object in dll on runtime?

i have 2 projects : myform1 , myform2. take reference of project myform1 in myform2. fill myform1. create instance of myform1 in myform2 , access method , value.

or create library project. expose static variable in it. take reference of library in both forms projects. assign value myform1 , access same property in myform2.

but if want code managed code, seek learning , implementing mvp. may give new way @ solutions problems.

you can create both forms in same project. process info in separate library.

c# runtime .net-2.0

c - Reading CVPoint from File -



c - Reading CVPoint from File -

i interested in reading points of type cvpoint* file, have tried standard notation (x,y). gives wrong values when seek verify output. format reading cvpoint in file.

point.txt

(1,1)

main.cpp

points = (cvpoint*)malloc(length*sizeof(cvpoint*)); points1 = (cvpoint*)malloc(length*sizeof(cvpoint*)); points2 = (cvpoint*)malloc(length*sizeof(cvpoint*)); fp = fopen(points.txt, "r"); fscanf(fp, "%d", &(length)); printf("%d \n", length); = 1; while(i <= length) { fscanf(fp, "%d", &(points[i].x)); fscanf(fp, "%d", &(points[i].y)); printf("%d %d \n",points[i].x, points[i].y); i++; }

it prints:

1 12 0

here different approach using same format text file:

#include <iostream> #include <fstream> #include <opencv2/core/core.hpp> using namespace std; using namespace cv; int main(int argc, char* argv[]) { ifstream file("points.txt"); string line; size_t start, end; point2f point; while (getline(file, line)) { start = line.find_first_of("("); end = line.find_first_of(","); point.x = atoi(line.substr(start + 1, end).c_str()); start = end; end = line.find_first_of(")"); point.y = atoi(line.substr(start + 1, end - 1).c_str()); cout << "x, y: " << point.x << ", " << point.y << endl; } homecoming 0; }

c opencv

java - Failure initializing default SSL context -



java - Failure initializing default SSL context -

i making phone call rest url , trying measure how much time taking response back.

i using defaulthttpclient response rest url.

in below programme , each thread working on particular range. each thread work between 1 - 100 , sec thread work between 101 - 200 etc.

so in below code, working sometime me after sometime throws me exception as

failure initializing default ssl context

and error well-

i/o exception (java.net.socketexception) caught when connecting target host: no buffer space available (maximum connections reached?): connect

is there wrong doing here?- or can utilize improve clients apart defaulthttpclient create restful call.

below code-

class task implements runnable { private defaulthttpclient httpclient; private httpresponse response; @override public void run() { seek { (int userid = id; userid < id + nooftasks; userid++) { httpclient = new defaulthttpclient(); httpget httpget = new httpget("http://localhost:8080/service/beservice/v1/get/userid=10000/profile.account.service"); long start = system.nanotime(); response = httpclient.execute(httpget); long end = system.nanotime() - start; httpentity entity = response.getentity(); entityutils.consume(entity); } } grab (exception e) { log.error("threw exception in " + getclass().getsimplename(), e); } { httpclient.getconnectionmanager().shutdown(); } } }

if there wrong code. how can improve it?

i don't see wrong code error message you're seeing sounds more os level error.

there article might reply you: http://support.microsoft.com/kb/2577795

java json rest ssl apache-httpclient-4.x

c# - Moved a class to a different namespace, is it possible to add an implicit using to my files? -



c# - Moved a class to a different namespace, is it possible to add an implicit using to my files? -

i moved class 1 namespace another, , have on 2000 errors go through.

all errors related class moved, possible implicitly or globally add together namespace files somehow?

or way manually go , prepare each error?

i have resharper, weary of making global alter , not sure if resharper go prepare 1 issue in files?

with resharper can right-click class name, select refactor popup menu , select move... select move type namespace. resharper alter namespace , right files referencing new namespace, alternative if can rollback move.

c# visual-studio-2010 refactoring resharper

RegEx to parse stored procedure and object names from DDL in a .sql file C# -



RegEx to parse stored procedure and object names from DDL in a .sql file C# -

i have .sql file may contain ddl definitions of several stored procedures, alter statements tables, triggers, views etc

it have statements these :

create proc / create procedure alter proc / alter procedure drop proc / drop procedure create table/trigger/view alter table/trigger/view drop table/trigger/view etc

what best way parse .sql file , list of objects(proc/table/view names) , action beingness taken on them (alter/create/drop)? thinking instead of using stuff microsoft.data.schema.scriptdom or antlr or other parsers, easiest way utilize regex. not sure kind of regex should write covers scenarios.

so far, look able match above rules. how name of object in front end of it. eg. matches

(create|alter|drop)\s+(procedure|proc|table|trigger|view|function|constraint)

how name advisorgroups question. regex imperfect because have [dbo]. in front end of or not. alter table advisorgroups too. not trying take care of possibilites. bare minimum.

alter table [dbo].[advisorgroups] add together constraint [xxx]

-thanks in advance

regex won't job done - definitely... need real parser - this one (commercial).

c# regex parsing sql-parser tsql-parser

How to split a string using values from variables? (Batch) -



How to split a string using values from variables? (Batch) -

i have variable acts line print, need edit individual characters in line via position in line. need utilize variables specify location each time, , cmd interprets variables wrong way.

@echo off set fv=0 set fh=1 set /a fh1=%fh%+1 set linev=line%fv% set line%fv%=%linev:~0,%fh%%%newcharacter%%linev:~%fh1%%

sorry code messy, hope understood. want cmd interpret code as: %fv% %fh% %newcharacter% %fh1% , turn 2 string manipulators substrings.

i'm not sure understand order of evaluation in lastly line of script sample, verbal explanation. however, think can @ to the lowest degree show you, using simple examples, how can accomplish want, , you'll work out how apply technique in situation.

basically, need utilize 2 kinds of expansion here: immediate (or % expansion) , delayed.

there's delayed expansion proper in batch files, must first enabled (typically using command setlocal enabledelayedexpansion) , utilize ! instead of % variable evaluation. consider next example:

set ind=1 set line%ind%=abc setlocal enabledelayedexpansion echo !line%ind%! endlocal

in above example, 2 variables created, ind , line1. sec name partly constructed using first variable. when setting value such variable, delayed expansion not needed, because name, left part of assignment, doesn't need evaluated. when need evaluated, need utilize delayed expansion. echo command in above script works this:

%ind% evaluated first;

as result of %ind% evaluation, command becomes echo !line1!;

since delayed expansion has been enabled, ! has special meaning, i.e. (delayed) variable evaluation, , !line1! evaluates abc;

echo prints abc.

although kind of delayed expansion preferred one, in above illustration can accomplish same using call-expansion. here's same illustration script rewritten utilize call-expansion:

set ind=1 set line%ind%=abc phone call echo %%line%ind%%%

basically, there's % expansion way, different parts evaluated @ different times. here's how sec example's delayed evaluation works:

the first %% turns %;

%ind% evaluated 1;

the remaining %% turns %;

call receives command execute: echo %line1%;

%line1% evaluates abc;

echo prints abc.

the call expansion slower, may manifest in loops. ! expansion, on other hand, has implications stemming particularly fact setlocal command used enable syntax. there's more on topic in my reply different question.

string batch-file

Better way to use cmake commands directly as custom command instead of wrapper scripts? -



Better way to use cmake commands directly as custom command instead of wrapper scripts? -

currently have ~4 scripts wrap around simple cmake commands "file(copy ...)" or "configure_file(...)" can utilize them -p flag in custom commands like:

add_custom_target( ${target}_tmp_resources command ${cmake_command} -dfiles_list="${${target}_resources}" -ddestination="${build_intermediate_dir}/${target}/bin/assets" -dexclude_ext=".svn .git cvs .ds_store" -p ${root_dir}/cmake/scripts/copyfiles.cmake depends "${target}_tmp_bin_dir" comment "collecting resource files..." )

the -e flag looks want, unfortunately supports few platform commands according documentation.

so, there improve way utilize cmake commands in custom commands without running cmake in script mode , having write these simple scripts?

cmake

How to I declare and initialize a multidimensional array in VB.NET? -



How to I declare and initialize a multidimensional array in VB.NET? -

i want this:

dim numbers integer()() = {{1}, {2}, {3}, {4, 5, 6, 7}}

the ide's underlining 4, 5, 6, 7 , saying array initializer has 3 many elements. doing wrong?

the next should work:

dim numbers integer()() = {({1}), ({2}), ({3}), ({4, 5, 6, 7})}

as documents in arrays in visual basic:

you can avoid error when supply nested array literals of different dimensions enclosing inner array literals in parentheses. parentheses forcefulness array literal look evaluated, , resulting values used outer array literal

vb.net multidimensional-array

Vb.Net Writing a sub in the parameter when calling a method -



Vb.Net Writing a sub in the parameter when calling a method -

i have written code perform action in method's parameter:

_myservice.mymethod(userid, profileid, sub(message eventargs) _eventaggregator.sendmessage(message))

this method thats beingness called:

public sub mymethod(userid guid, profileid guid, byval action action(of eventargs)) dim proxy = buildproxy() addhandler proxy.mymethodcompleted, sub(o, e) action(e) using new operationcontextscope(proxy.innerchannel) dim request = new mymethodrequest() {.gebruikerid = userid, .omgevingsid = omgevingid} proxy.mymethodasync(request) end using end sub

now want extend sub passed service method include:

_myservice.mymethod(userid, profileid, sub(message eventargs) _eventaggregator.sendmessage(message) _localvariable = e.result end sub)

this doens't work. possible?

found allready. switching c# vb.net isn't easy ;)

_myservice.mymethod(userid, profileid, sub(message eventargs) _eventaggregator.sendmessage(message) _localvariable = e.result end sub)

just had nail next line after sub ....

vb.net

cordova - About PhoneGap inappbrowser video play stop -



cordova - About PhoneGap inappbrowser video play stop -

i utilize phonegap 2.4.0. android app.

when open external webpage(contain youtube video) inappbrowser, video play good. after closing webpage done button, sound playing not stop. stop video sound, had turn off phone.

it big problem me. lastly week tried prepare it.

can help?

this code.

....................... function chamgae(juso) { var ref = window.open(juso, '_blank', 'location=yes'); ref.close(); } .......................... <a href="#" onclick="chamgae('http://m.youtube.com')"> ..........................

or

....................... function chamgae(juso) { window.open(juso, '_blank', 'location=yes'); } .......................... <a href="#" onclick="chamgae('http://m.youtube.com')"> ..........................

did .close() after opening inappbrowser.

var ref = window.open(url, '_blank', 'location=no'); ref.close();

i removed .close() code , got same problem of continued playback. should solve problem.

cordova

Image Hover isn't appearing in CSS but it does in HEAD -



Image Hover isn't appearing in CSS but it does in HEAD -

.cssnav { position:relative; font-family: arial, helvetica, sans-serif; background-image: url(img/twitter.jpg)no- repeat center center; background-repeat: no-repeat; white-space: nowrap; display: block; width: 211px; height: 44px; margin: 0; padding: 0; } .cssnav { display: block; color: #000000; font-size: 11px; width: 211px; height: 44px; display: block; float: left; color: black; text-decoration: none; } .cssnav img {width: 211px; height: 44px; border: 0; } * html a:hover {visibility:visible} .cssnav a:hover img{visibility:hidden} .cssnav span { position: absolute; left: 30px; top: 15px; margin: 0px; padding: 0px; cursor: pointer; width: 149px; height: 14px; text-align: center; } /* end of navigation */ } <html> <head> <title>the history of aeronautics</title> <meta charset="utf-8" /> <meta name="description" content="a parallax scrolling experiment using jquery" /> <link rel="stylesheet" media="all" href="css/test.css" /> </head> <body> <!--main navigation start--> <div class="cssnav"><a href="http://www.search-this.com/" title="search engine submission"><img src="img/twitter.png" alt="search engine submission" /><span>search engine submission</span></a></div> <div class="cssnav"><a href="http://www.search-this.com/website-design/" title="website design"><img src="img/twitter.jpg" alt="website design" /><span>website design</span></a></div> </body> </html>

i've included css , html. i've been @ awhile trying figure out why it's not working... i'm using trifecta rollover buttons code here: http://www.webcredible.co.uk/user-friendly-resources/css/rollover-buttons.shtml

it works when set code in area of html not when set in css

okay, first of all, mat said, either need linked style sheet adding:

<link href="/filename.css" rel="stylesheet" type="text/css" media="screen" />

in head tag. or can add together style tags (also within head tag):

<style> body { background-color: #f00; } </style>

other that, if still having trouble, here:

http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/

for rules of specificity on css, general rule of thumb (that have used) on occasion can't seem pinpoint why have specified render doesn't render in external css file, utilize inline, this:

<p style="background-color: #f00;">paragraph contents...</p>

this because inline css has higher specificity (inherently) external file's css.

css hover hyperlink