Thursday, 15 January 2015

android - DialogFragment remove black border -



android - DialogFragment remove black border -

i saw this question , this one , others, nil helped me.

i'm building quick action dialogfragment list view , trying set custom view according android dev guide.

view_quick_action.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/white" > <imageview android:id="@+id/quick_action_image" android:layout_width="50dp" android:layout_height="50dp" android:layout_margin="20dp" android:scaletype="fitxy" android:src="@drawable/windows1" /> <textview android:id="@+id/quick_action_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_aligntop="@+id/quick_action_image" android:layout_torightof="@+id/quick_action_image" android:ellipsize="end" android:singleline="true" android:text="lilly" android:textcolor="#585858" android:textsize="16sp" /> <textview android:id="@+id/quick_action_activity" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbottom="@+id/quick_action_image" android:layout_torightof="@+id/quick_action_image" android:text="updated 4 minutes ago" android:textcolor="#a3a3a3" android:textsize="15sp" /> <imagebutton android:id="@+id/popup_grid_leave" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignparentleft="true" android:layout_below="@+id/quick_action_activity" android:layout_margin="20dp" android:layout_margintop="30dp" android:background="@color/transperent" android:src="@drawable/ic_action_leave" /> <imagebutton android:id="@+id/popup_grid_silence" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignbottom="@+id/popup_grid_leave" android:layout_aligntop="@+id/popup_grid_leave" android:layout_centerhorizontal="true" android:background="@color/transperent" android:src="@drawable/ic_action_silence" /> <imagebutton android:id="@+id/popup_grid_mark_as_read" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignbottom="@+id/popup_grid_leave" android:layout_alignparentright="true" android:layout_aligntop="@+id/popup_grid_leave" android:layout_marginright="15dp" android:background="@color/transperent" android:src="@drawable/ic_action_mark_as_read" /> </relativelayout> quickactionfragment.java public class quickactionfragment extends dialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder builder = new alertdialog.builder(mcontext); view v = layoutinflater.from(mcontext).inflate( r.layout.view_quick_action, null, false); // set views builder.settitle(null); alertdialog dialog = builder.create(); dialog.setview(v, 0, 0, 0, 0); // line didn't alter // dialog.getwindow().setbackgrounddrawable(new colordrawable(0)); homecoming dialog; } }

after this, when run dialogfragment.show(getsupportedfragmentmanager()) still black border shown in image:

any thoughts on how prepare this?

try out below code:

public class quickactionfragment extends dialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) { dialog m_dialog = new dialog(quickactionfragment.this, r.style.dialog_no_border); layoutinflater m_inflater = layoutinflater.from(customdialogactivity.this); view v = layoutinflater.from(mcontext).inflate(r.layout.view_quick_action, null, false); // set views m_dialog.settitle(null); m_dialog.setcontentview(m_view); m_dialog.show(); homecoming dialog; } }

add dialog_no_border style in res/value/style.xml file.

<style name="dialog_no_border"> <item name="android:windowisfloating">true</item> <item name="android:windowbackground">@android:color/transparent</item> </style>

this style causes r deleted after clean

android background android-dialogfragment

Insert current timestamp using javascript in database using php -



Insert current timestamp using javascript in database using php -

i trying insert local time database using javascript. can 1 help me? please have on file named member.class.php , please allow me know have set javascript code... https://www.dropbox.com/sh/lfef67brewx7rub/wyrp72bdh7

its simple man...try this

var milliseconds = new date().gettime();

it give time in milli seconds or can utilize like

new date().gettime();

if want in unix(linux) timestamp utilize this

var unix = math.round(+new date()/1000); give in seconds

php javascript mysql

python - Get package root and full module name from .py file for importing -



python - Get package root and full module name from .py file for importing -

i'm looking simple , fast way find root of bundle , total module name path .py file.

i want user take .py , import without breaking. importing module if it's part of bundle break. want automatically append directory wherein root of bundle resides sys.path (if not in there) , import module total module name.

i'm not running anywhere same directory or script, can't utilize __file__ , kind of thing. don't have module imported yet, can't (as far know) inspect module object, because there none.

this working version, yet i'm interested in finding easier/faster solutions.

def splitpathfull(path): folders=[] while 1: path,folder=os.path.split(path) if folder!="": folders.append(folder) else: if path!="": folders.append(path) break folders.reverse() homecoming folders def getpackagerootandmodulenamefromfilepath(filepath): """ recursively looks until finds folder without __init__.py , uses root of bundle root of package. """ folder = os.path.dirname(filepath) if not os.path.exists( folder ): raise runtimeerror( "location not exist: {0}".format(folder) ) if not filepath.endswith(".py"): homecoming none modulename = os.path.splitext( os.path.basename(filepath) )[0] # filename without extension # # if there's __init__.py in folder: # find root module folder recursively going until there's no more __init__.py # else: # it's standalone module/python script. # foundscriptroot = false fullmodulename = none rootpackagepath = none if not os.path.exists( os.path.join(folder, "__init__.py" ) ): rootpackagepath = folder fullmodulename = modulename foundscriptroot = true # it's not in python bundle seperate ".py" script # append it's directory name sys path (if not in there) , import .py module else: startfolder = folder modulelist = [] if modulename != "__init__": modulelist.append(modulename) amountup = 0 while os.path.exists( folder ) , foundscriptroot == false: modulelist.append ( os.path.basename(folder) ) folder = os.path.dirname(folder) amountup += 1 if not os.path.exists( os.path.join(folder, "__init__.py" ) ): foundscriptroot = true splitpath = splitpathfull(startfolder) rootpackagepath = os.path.join( *splitpath[:-amountup] ) modulelist.reverse() fullmodulename = ".".join(modulelist) if fullmodulename == none or rootpackagepath == none or foundscriptroot == false: raise runtimeerror( "couldn't resolve python bundle root python path , total module name for: {0}".format(filepath) ) homecoming [rootpackagepath, fullmodulename] def importmodulefromfilepath(filepath, reloadmodule=true): """ imports module it's filepath. adds root folder sys.path if it's not in there. imports module total package/module name , returns imported module object. """ rootpythonpath, fullmodulename = getpackagerootandmodulenamefromfilepath(filepath) # append rootpythonpath sys.path if not in sys.path if rootpythonpath not in sys.path: sys.path.append(rootpythonpath) # import total (module.module.package) name mod = __import__( fullmodulename, {}, {}, [fullmodulename] ) if reloadmodule: reload(mod) homecoming mod

this impossible due namespace packages - there no way decide whether right bundle baz.py foo.bar or bar next file structure:

foo/ bar/ __init__.py baz.py

python import module package

pdf - Coldfusion : How to include HTML table headers on new page when using cfdocument? -



pdf - Coldfusion : How to include HTML table headers on new page when using cfdocument? -

i have table on page info generated query. makes unpredictable how many rows generated.

when using cfdocument output page pdf table cutting in 2 on page break.

is there easy way include table labels on new page purpose of clarity?

i've had work cfdocument quite bit , making usable in situations can real bear.

i believe reply question can found on page since know how many records on each page (static row height): coldfusion: cfdocument , forcing pagebreak

here other questions i've posted , worked through concerning cfdocument, hope help.

scale pdf single page

cfdocument prevent page breaks mid-row

cfdocument still cutting off tops of text on pages

pdf coldfusion page-break

c# - Why won't my method work unless called from a button click? -



c# - Why won't my method work unless called from a button click? -

i posted question yesterday, don't think gave plenty info definate answer. here 1 time again additional code create things clearer.

i have form listview, populated calling showcheckedinfiles() method. method works fine when add together simple button form , press it, calls method, when phone call method elsewhere not populate listview.

please help it's driving me insane. first method below called class , shown underneath this, , i've included button method reference, say, button works perfectly, need able phone call method without clicking button!!:

public void openproject(string projectname) { projectname = projectname; string userdir = csdbpath + projectname + "\\checkedout\\" + username; if (!directory.exists(userdir)) //does user's directory exist, if not, create { directory.createdirectory(userdir); } showcheckedinfiles(); } private void button3_click(object sender, eventargs e) { showcheckedinfiles(); }

the method calls above:

private void buttonopenproject_click(object sender, eventargs e) { listview.selectedlistviewitemcollection myselecteditems; myselecteditems = listview1.selecteditems; form1 mainform = new form1(); string myproject = ""; foreach (listviewitem item in myselecteditems) { myproject = item.text; } mainform.openproject(myproject); //mainform.showcheckedinfiles(); this.close(); }

and actual showcheckedinfiles() method won't build listview unless called button_3_click method .... don't want!

public void showcheckedinfiles() // listview1 - load dms listview create list { listview1.items.clear(); // clears list of files each time method called preventing list beingness duplicated on , on - (refreshes it) !! string[] checkedinfilelist = directory.getfiles(csdbpath + projectname, "*.sgm", searchoption.alldirectories); //jake i've added arguments here , removed \\checkedin, may need delete .sgm etc foreach (string file in checkedinfilelist) { listviewitem itemname = list1.getname(file); // info files in array long itemsize = list1.getsize(file); datetime itemmodified = list1.getdate(file); listview1.items.add(itemname); // utilize info populate listview itemname.subitems.add(itemsize.tostring() + " kb"); itemname.subitems.add(itemmodified.tostring()); // readfromcsv(); //reads info csv file using method // // stringbuilder sb = readinglistview(); //writes info csv file // // filewrite.writetocsv(sb); showstatus(itemname); } showmycheckedoutfiles(); }

it reason showcheckedinfiles fails not due it's not beingness called from, due beingness called from. tell more that.

in meantime, guess you're calling before listview's handle has been created (so list doesn't exist yet), or maybe you're calling on different thread (but you'd see exception in case).

c#

winapi - OwnerDraw with WS_EX_COMPOSITED under XP -



winapi - OwnerDraw with WS_EX_COMPOSITED under XP -

i have static command has ss_ownerdraw , ss_notify flag when crated. parent window has ws_ex_composited flag.

under windows xp, not drawn correctly, image below showed (the right-top rectangle):

but under windows 7, drawn correctly, image below showed (the corss "x" on right-top):

how prepare problem in xp? furthermore, causes problem (in xp)?

msdn createwindowex() says this:

with ws_ex_composited set, descendants of window bottom-to-top painting order using double-buffering. bottom-to-top painting order allows descendent window have translucency (alpha) , transparency (color-key) effects, if descendent window has ws_ex_transparent bit set. double-buffering allows window , descendents painted without flicker.

i.e. kid static command should have ws_ex_transparent set.

winapi doublebuffered ownerdraw

objective c - View not visible until multitasking bar is opened - iPhone -



objective c - View not visible until multitasking bar is opened - iPhone -

i first got auto layout crash when running on iphone 3.5 inch display ios 5.1 - fixed turning off auto layout. but, now, when run app, screen black. view visible when double tap home button evoke multitasking bar. weird, right?

on app startup:

when evoking multitasking.

code snippet:

if(screensize.height == 480) { // iphone classic welcomeviewcontroller = [welcomeviewcontroller initwithnibname:@"welcomeviewcontroller~iphone3.5" bundle:nil]; viewcontroller = [viewcontroller initwithnibname:@"selectzone~iphone3.5" bundle:nil]; fixtureviewcontroller = [fixtureviewcontroller initwithnibname:@"fixture~iphone3.5" bundle:nil]; [windowoldiphone addsubview:fixtureviewcontroller.view]; [windowoldiphone addsubview:viewcontroller.view]; [windowoldiphone addsubview:welcomeviewcontroller.view]; [windowoldiphone makekeyandvisible]; [windowoldiphone bringsubviewtofront:welcomeviewcontroller.view]; }

note: doesn't happen on iphone/ipad running ios 6.

call bringsubviewtofront before calling makekeyandvisible. below

if(screensize.height == 480) { // iphone classic welcomeviewcontroller = [welcomeviewcontroller initwithnibname:@"welcomeviewcontroller~iphone3.5" bundle:nil]; viewcontroller = [viewcontroller initwithnibname:@"selectzone~iphone3.5" bundle:nil]; fixtureviewcontroller = [fixtureviewcontroller initwithnibname:@"fixture~iphone3.5" bundle:nil]; [windowoldiphone addsubview:fixtureviewcontroller.view]; [windowoldiphone addsubview:viewcontroller.view]; [windowoldiphone addsubview:welcomeviewcontroller.view]; [windowoldiphone bringsubviewtofront:welcomeviewcontroller.view]; [windowoldiphone makekeyandvisible]; }

iphone objective-c

php - How to configure CodeIgniter pagination? -



php - How to configure CodeIgniter pagination? -

here's code:

$config['base_url'] = base_url() . 'settings/profile/'; $config['total_rows'] = $data['count_user_posts']; $config['per_page'] = 3; $offset = ($this->uri->segment('3') * $config['per_page']) / 2; $this->pagination->initialize($config); $config['use_page_numbers'] = true; $data['user_posts'] = $this->post_model->get_user_posts($_session['user_id'], $config['per_page'], $config['offset']);

problem when click on 2 or other link, shows info previous page also. solution - doing wrong?

here example, how had implemented

in controller

function index() { $this->load->library('pagination'); $config = array(); $config["base_url"] = base_url() . "city/index"; $config["total_rows"] = $this->city_model->record_count(); $config["per_page"] = 20; $config["uri_segment"] = 4; $this->pagination->initialize($config); $page = ($this->uri->segment(4)) ? $this->uri->segment(4) : 0; $data["city"] = $this->city_model->get_cities($config["per_page"], $page); $data["links"] = $this->pagination->create_links(); }

in model

function record_count() { homecoming $this->db->count_all("city"); } function get_cities($limit,$start) { $this->db->limit($limit,$start); $this->db->select('*'); $this->db->from('city'); $this->db->order_by('city_name'); $query = $this->db->get(); if ($query->num_rows() > 0) { foreach ($query->result() $row) { $data[] = $row; } homecoming $data; } homecoming false; }

php codeigniter

c# - Changing cursor after task is complete -



c# - Changing cursor after task is complete -

i attempting alter mouse cursor wait before task begins, , arrow when it's completed. however, cursor seems alter 1 other straight away. code:

this.cursor = cursors.wait; dtresults.writexml(savefiledialog.filename); this.cursor = cursors.arrow; messagebox.show("exporting complete!", "complete!", messageboxbutton.ok, messageboximage.information);

any ideas i'm doing wrong?

you performing tasks synchronously. so, message pump never gets wait cursor phone call far user see.

to prepare should asynchronously. can utilize task parallel librarysince on .net 4.0:

this.cursor = cursors.wait //avoid closure problems string filename = savefiledialog.filename //start task of writing xml (it run on next availabled thread) var writexmltask = task.factory.startnew(()=>dtresults.writexml(filename)); //use created task attach action whenever task returns. //making sure utilize current ui thread perform processing writexmltask.continuewith( (previoustask)=>{this.cursor = cursors.arrow;messagebox.show....}, taskscheduler.fromcurrentsynchronizationcontext());

c# .net wpf user-interface cursor

java - NullPointerException when run executeQuery(sql) -



java - NullPointerException when run executeQuery(sql) -

i have simple query in java run in sql server 2008. when reaches to

rs = stmt.executequery(sql); gives me java.lang.nullpointerexception

1-i utilize jtds driver connect code database.

2-when execute query straight in database works.

3-to create code short , easy understand omitted try-catch

public class databases { private connection link; private java.sql.statement stmt; public resultset rs; public databases() { class.forname("net.sourceforge.jtds.jdbc.driver"); string connectionurl = "jdbc:jtds:sqlserver://localhost:1433;databasename=db;integratedsecurity=true"; connection link = drivermanager.getconnection(connectionurl); } public resultset select(string sql) { rs = stmt.executequery(sql); homecoming rs; } } public static void main(string[] args) { databases s=new databases(); string sql="select * [db].[dbo].[quantities] "; resultset rs=s.select(sql); }

you need instantiate stmt somewhere (in constructor or within select function)

you can move stmt field variable of select function.

public resultset select(string sql) { statement stmt = link.createstatement(); rs = stmt.executequery(sql); homecoming rs; }

java sql-server-2008 nullpointerexception jtds executequery

How to apply "first" and "last" functions to columns while using group by in pandas? -



How to apply "first" and "last" functions to columns while using group by in pandas? -

i have info frame , grouping particular column (or, in other words, values particular column). can in next way: grouped = df.groupby(['columnname']).

i imagine result of operation table in cells can contain sets of values instead of single values. usual table (i.e. table in every cell contains 1 single value) need indicate function want utilize transform sets of values in cells single values.

for illustration can replace sets of values sum, or minimal or maximal value. can in next way: grouped.sum() or grouped.min() , on.

now want utilize different functions different columns. figured out can in next way: grouped.agg({'columnname1':sum, 'columnname2':min}).

however, because of reasons cannot utilize first. in more details, grouped.first() works, grouped.agg({'columnname1':first, 'columnname2':first}) not work. result nameerror: nameerror: name 'first' not defined. so, question is: why happen , how resolve problem.

added

here found next example:

grouped['d'].agg({'result1' : np.sum, 'result2' : np.mean})

may need utilize np? in case python not recognize "np". should import it?

i think issue there 2 different first methods share name deed differently, 1 groupby objects , another series/dataframe (to timeseries).

to replicate behaviour of groupby first method on dataframe using agg utilize iloc[0] (which gets first row in each grouping (dataframe/series) index):

grouped.agg(lambda x: x.iloc[0])

for example:

in [1]: df = pd.dataframe([[1, 2], [3, 4]]) in [2]: g = df.groupby(0) in [3]: g.first() out[3]: 1 0 1 2 3 4 in [4]: g.agg(lambda x: x.iloc[0]) out[4]: 1 0 1 2 3 4

analogously can replicate last using iloc[-1].

note: works column-wise, et al:

g.agg({1: lambda x: x.iloc[0]})

in older version of pandas utilize irow method (e.g. x.irow(0), see previous edits.

a couple of updated notes:

this improve done using nth groupby method, much faster >=0.13:

g.nth(0) # first g.nth(-1) # lastly

you have take care little, default behaviour first , last ignores nan rows... , iirc dataframe groupbys broken pre-0.13... there's dropna alternative nth.

you can utilize strings rather built-ins (though iirc pandas spots it's sum builtin , applies np.sum):

grouped['d'].agg({'result1' : "sum", 'result2' : "mean"})

group-by pandas

java - how to make a route/navigation on google-maps from where user location to an itemoverlay that user pick? -



java - how to make a route/navigation on google-maps from where user location to an itemoverlay that user pick? -

i'm confuse, how create action create route/navigation user location pin overlay(google places) user pick/tap pin overlay. this's map activity show map.

public class placesmapactivity extends mapactivity { // nearest places placeslist nearplaces; // map view mapview mapview; // map overlay items list<overlay> mapoverlays; additemizedoverlay itemizedoverlay; geopoint geopoint; // map controllers mapcontroller mc; double latitude; double longitude; overlayitem overlayitem; private context context; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.map_places); // getting intent info intent = getintent(); // users current geo location string user_latitude = i.getstringextra("user_latitude"); string user_longitude = i.getstringextra("user_longitude"); // nearplaces list nearplaces = (placeslist) i.getserializableextra("near_places"); mapview = (mapview) findviewbyid(r.id.mapview); mapview.setbuiltinzoomcontrols(true); mapoverlays = mapview.getoverlays(); // geopoint place on map geopoint = new geopoint((int) (double.parsedouble(user_latitude) * 1e6), (int) (double.parsedouble(user_longitude) * 1e6)); // drawable marker icon drawable drawable_user = this.getresources() .getdrawable(r.drawable.mark_red); itemizedoverlay = new additemizedoverlay(drawable_user, this); // map overlay item overlayitem = new overlayitem(geopoint, "your location", "that you!"); itemizedoverlay.addoverlay(overlayitem); mapoverlays.add(itemizedoverlay); itemizedoverlay.populatenow(); // drawable marker icon drawable drawable = this.getresources() .getdrawable(r.drawable.mark_blue); itemizedoverlay = new additemizedoverlay(drawable, this); mc = mapview.getcontroller(); // these values used map boundary area // area can see markers on screen int minlat = integer.max_value; int minlong = integer.max_value; int maxlat = integer.min_value; int maxlong = integer.min_value; // check null in case null if (nearplaces.results != null) { // loop through places (place place : nearplaces.results) { latitude = place.geometry.location.lat; // latitude longitude = place.geometry.location.lng; // longitude // geopoint place on map geopoint = new geopoint((int) (latitude * 1e6), (int) (longitude * 1e6)); // map overlay item overlayitem = new overlayitem(geopoint, place.name, place.vicinity); itemizedoverlay.addoverlay(overlayitem); // calculating map boundary area minlat = (int) math.min( geopoint.getlatitudee6(), minlat ); minlong = (int) math.min( geopoint.getlongitudee6(), minlong); maxlat = (int) math.max( geopoint.getlatitudee6(), maxlat ); maxlong = (int) math.max( geopoint.getlongitudee6(), maxlong ); } mapoverlays.add(itemizedoverlay); // showing overlay items itemizedoverlay.populatenow(); } // adjusting zoom level can see markers on map mapview.getcontroller().zoomtospan(math.abs( minlat - maxlat ), math.abs( minlong - maxlong )); // showing center of map mc.animateto(new geopoint((maxlat + minlat)/2, (maxlong + minlong)/2 )); mapview.postinvalidate(); } @override protected boolean isroutedisplayed() { homecoming false; }

}

and this's itemoverlay show pin on map.

public class additemizedoverlay extends itemizedoverlay<overlayitem> { private arraylist<overlayitem> mapoverlays = new arraylist<overlayitem>(); private context context; public additemizedoverlay(drawable defaultmarker) { super(boundcenterbottom(defaultmarker)); } public additemizedoverlay(drawable defaultmarker, context context) { this(defaultmarker); this.context = context; } @override public boolean ontouchevent(motionevent event, mapview mapview) { if (event.getaction() == 1) { geopoint geopoint = mapview.getprojection().frompixels( (int) event.getx(), (int) event.gety()); // latitude double lat = geopoint.getlatitudee6() / 1e6; // longitude double lon = geopoint.getlongitudee6() / 1e6; //toast.maketext(context, "lat: " + lat + ", lon: "+lon, toast.length_short).show(); } homecoming false; } @override protected overlayitem createitem(int i) { homecoming mapoverlays.get(i); } @override public int size() { homecoming mapoverlays.size(); } @override protected boolean ontap(int index) { overlayitem item = mapoverlays.get(index); alertdialog.builder dialog = new alertdialog.builder(this.context); dialog.settitle(item.gettitle()); dialog.setmessage(item.getsnippet()); dialog.setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { } }); dialog.show(); homecoming true; } public void addoverlay(overlayitem overlay) { mapoverlays.add(overlay); } public void populatenow(){ this.populate(); } }

please give me opinion.

use "mapcontroller" class's function animateto(your_desired_point). utilize in additemizedoverlay class in ontap().

java android google-maps routes overlay

How to resolve this java.lang.ExceptionInInitializerError in android? -



How to resolve this java.lang.ExceptionInInitializerError in android? -

i have issue java.lang.exceptionininitializererror when seek create plugin cordova in android. please can 1 help me solve issue? error occurs in these 2 lines:

m_loadeddoc = new pdfdocument(new filepdfsource((string) path[0]), pdfviewer.this); m_loadeddoc = new pdfdocument(new inputstreampdfsource((inputstream) path[0]), pdfviewer.this);

cordova.getactivity().runonuithread(new runnable() { public void run() { // runs on ui thread

cordova.getactivity().setcontentview(r.layout.main); m_pdfviewer = new pdfviewer(cordova.getactivity()); log.i("log_tag", "yes me phone call else"); urlvalidate = url.startswith("http://") || url.startswith("ftp://") || url.startswith("https://"); string pdfext = url.substring(url.lastindexof(".") + 1); log.i("log_tag", "ext:::" + pdfext); if (urlvalidate == true && pdfext.equals("pdf")) { seek { inputstream input = new url(url).openstream(); m_pdfviewer.loaddocument(input); } grab (ioexception e) { // todo auto-generated grab block e.printstacktrace(); } } else if ((urlvalidate == false) && (pdfext.equals("pdf"))) { m_pdfviewer.loaddocument(url); } } }); public pdfviewer(activity parentactivity) { m_parentactivity = parentactivity; standardfonttf.massetmgr = m_parentactivity.getassets(); llpagepane = (linearlayout) parentactivity.findviewbyid(r.id.pagepane); svscroll = (qscrollview) parentactivity.findviewbyid(r.id.scrollview); svscroll.setpdfviewer(this); m_pagecontentscache = new lrucache(20); m_pageviews = new vector<pdfpageview>(); m_touchhandler = new touchhandlerview(this); } @override protected void doinbackground(object... path) { seek { // release current document if (path[0] instanceof string) { log.i("log_tag", "do in string ::::"+path[0]+"" ); m_loadeddoc = new pdfdocument(new filepdfsource((string) path[0]), pdfviewer.this); } else if (path[0] instanceof inputstream) { log.i("log_tag", "do in stream ::::"+path[0]+"" ); m_loadeddoc = new pdfdocument(new inputstreampdfsource((inputstream) path[0]), pdfviewer.this); } } grab (throwable t) { log.e("error", log.getstacktracestring(t)); log.i("log_tag", "its error;:::::"); m_exception = t; } homecoming null; }

java android phonegap-plugins

iphone - Adding padding to an UIView -



iphone - Adding padding to an UIView -

i'm looking way add together padding property uiview. ideally, avoid subclassing , putting in category. usage like:

myview.padding = uiedgeinsetsmake(10, 10, 10, 10);

and maybe have paddingbox property homecoming cgrect describing size , position of inner padding box.

now, how 1 implement in category that. though of using bounds, unfortunately size of bounds linked size of frame (always same) coordinates can differ.

this done setting bounds within view. if wanted inset of 10 round do:

view.bounds = cgrectinset(view.frame, 10.0f, 10.0f);

the bounds defines drawable area of view, relative frame. should give in effect padding. can 'paddingbox' bounds.

hope helps! :)

iphone ios cocoa uiview uikit

video.js - Autosize or access video dimensions from metadata in Videojs -



video.js - Autosize or access video dimensions from metadata in Videojs -

i'm using videojs flash fallback display mp4 videos. omit video dimensions html5 video area can autosized width , height of video using jquery $.find("#video_html5_api").width(), flash fallback has no attributes , stays @ default size (300 x 150).

is there way create flash fallback autosize, or there way width/height metadata , pass player.width() etc.

it seems "loadedmetadata" event contains no actual metadata information, , published api has no method metadata information.

after trawling through swf fallback source found way it.

$("#video_flash_api").get(0).vjs_getproperty("videowidth")

html5-video video.js

python - How to find out the required window size? -



python - How to find out the required window size? -

i have window containing label w text can of given variety (in case "hello world! " once, twice , thrice):

from tkinter import * import time root = tk() text = "hello, world! " w = label(root) in range(1, 4): w["text"] = text*i w.update_idletasks() w.grid() w.update_idletasks() time.sleep(1) root.mainloop()

i set size of window fixed width. width should 1 required longest text w can get. how can easily? have cycle through possible texts, read respective window width , set final width maximum of these values? if best way, how can without window appearing on screen?

how can know size of largest text if don't cycle through them ? possibility knowing size of each 1 earlier, have solved problem already. hence have set label , check required width window, check whether width larger current maximum , update if needed. if window happens show during process, can phone call withdraw, need, , phone call deiconify.

import time import random import tkinter root = tkinter.tk() root.withdraw() text = "hello, world! " w = tkinter.label() w.grid() maxwidth = 0 _ in range(10): = random.randint(1, 5) w["text"] = text*i print w.update_idletasks() maxwidth = max(maxwidth, root.winfo_reqwidth()) root.wm_minsize(maxwidth, root.winfo_reqheight()) root.wm_maxsize(maxwidth, int(1e6)) root.deiconify() root.mainloop()

python tkinter

javascript - failed to add flash to HTML with swfobject -



javascript - failed to add flash to HTML with swfobject -

help me plz,i'm mad... critical code below,it doesn't work,there nil in "object":

var obj=document.createelement('object'); obj.id="flashformulaeditor"; obj.width="520"; obj.height="500"; document.body.appendchild(obj); table.appendchild(obj); var swfversionstr = "9.0.0"; // utilize express install, set playerproductinstall.swf, otherwise empty string. var xiswfurlstr = ""; var flashvars = {}; var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "samedomain"; params.allowfullscreen = "true"; var attributes = {}; attributes.id = "flashformulaeditor"; attributes.name = "flashformulaeditor"; attributes.align = "middle"; swfobject.embedswf("./flashformulaeditor.swf", "flashformulaeditor", "475", "552", swfversionstr, xiswfurlstr, flashvars, params, attributes);

give try:

function initflash(){ var flashvars = {}; var params = {}; var attributes = {}; params.quality = "high"; params.play = "true"; params.loop = "true"; params.wmode = "transparent"; params.scale = "showall"; params.menu = "false"; params.devicefont = "true"; params.salign = ""; params.allowscriptaccess = "always"; params.allowfullscreen = "true"; attributes.id = "swfloader"; attributes.name = "swfloader"; swfobject.embedswf("your.domain/flash.swf", "flashcontent", "100%", "100%", "11", false, flashvars, params, attributes); }

just add together id('flashcontent') div. hope helps.

javascript flash swfobject

Unix TCP recv(), and C# -



Unix TCP recv(), and C# -

i new unix, , need help recv() used in tcp code. can see 2 recv() used receive response server, 1 after different string length (call them 10 , 20).

questions: mean response server 2 strings of 10 , 20 because 2 recv() used? or mean server respond using 2 tcp strings of 10 , 20 consecutively?

i read somewhere tcp layer not know delimiter of application protocol is, header must inserted server delimiter. reason using 2 recv()? if case, mean recv() can utilize section out tcp response string?

does sectioning applies c#? or c# receive whole string , have split it? moment, talking tcpclient.read().

thanks.

c# unix tcp tcpclient recv

javascript - Testacular error: Cannot start chrome -



javascript - Testacular error: Cannot start chrome -

i going through angularjs tutorials, , stuck on tutorial running testacular tests. next error:

starting testacular server (http://vojtajina.github.com/testacular) ------------------------------------------------------------------- info: testacular server started @ http://localhost:9876/ info (launcher): starting browser chrome error (launcher): cannot start chrome execvp(): no such file or directory info (launcher): trying start chrome again. error (launcher): cannot start chrome execvp(): no such file or directory info (launcher): trying start chrome again. error (launcher): cannot start chrome execvp(): no such file or directory

when search problem, there similar users have problem using windows. using linux mint.

it little problem in config files' list of browsers. should alter name of browser in configuration files under config/ directory: config/testacular.conf.js , testacular-e2e.conf.js. if using chromium browser set list of browsers 'chromium-browse', instead of 'chrome' this.:

browsers = ['chromium-browser'];

here ss of testacular.conf.js file: .

if include more 1 browser tests can add together name of other browsers installed in system:

browsers = ['chromium-browser', 'firefox'];

if not sure name of chrome browser should help in terminal:

ls /usr/bin/ | grep -i chrom

javascript jasmine karma-runner

libpng - Display image file using C programming -



libpng - Display image file using C programming -

i want read , display png image using c programming. please suggest ways. possible utilize libpng library displaying image ?

libpng decode image rgba-array you. display image utilize opengl or os-dependendent graphics-library.

edit: since using windows:

on windows have many library choices: suggest start sdl, can start showing image this: http://www.sdltutorials.com/data/posts/105/ss1.jpg , go on building application there. there many tutorials on sdl (see here: http://www.sdltutorials.com/tutorials). jpg one: http://www.sdltutorials.com/sdl-coordinates-and-blitting

c libpng

iphone - saving NSMutableArray of object to pList -



iphone - saving NSMutableArray of object to pList -

i'm trying save array of objects plist when home button or programme exited, nil happen , file never seems created.

what doing wrong????

//viewcontroller.h

@interface viewcontroller : uiviewcontroller <uitableviewdatasource, uitableviewdelegate, uialertviewdelegate> @property (weak, nonatomic) iboutlet uitableview *mytableview; @property (strong, nonatomic) nsmutablearray *fieldbooks; - (nsstring *)pathoffile; - (void)applicationwillterminate:(nsnotification *)notification; @end

//viewcontroller.m

#import "viewcontroller.h" @interface viewcontroller () - (void)viewdidload { nsstring *filepath = [self pathoffile]; if ([[nsfilemanager defaultmanager]fileexistsatpath:filepath]) { nsarray *array = [[nsarray alloc]initwithcontentsoffile:filepath]; fieldbooks = [array objectatindex:0]; } uiapplication *app = [uiapplication sharedapplication]; [[nsnotificationcenter defaultcenter]addobserver:self selector:@selector(applicationwillterminate:) name:uiapplicationwillterminatenotification object:app]; [super viewdidload]; //instantiate our nsmutablearray //set title self.title = @"fieldbooks"; //add edit button self.navigationitem.leftbarbuttonitem = self.editbuttonitem; //add add together button uibarbuttonitem *addbutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemadd target:self action:@selector(insertnewobject)]; self.navigationitem.rightbarbuttonitem = addbutton; } - (void)setediting:(bool)editing animated:(bool)animated { [super setediting:editing animated:animated]; [mytableview setediting:editing animated:animated]; } - (void)insertnewobject { uialertview * alert = [[uialertview alloc] initwithtitle:@"enter name" message:@"" delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:@"ok", nil]; alert.alertviewstyle = uialertviewstyleplaintextinput; [alert show]; } - (nsstring *)pathoffile { nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentationdirectory, nsuserdomainmask, yes); nsstring *documentsfolder = [paths objectatindex:0]; homecoming [documentsfolder stringbyappendingformat:@"myfile.plist"]; } - (void)applicationwillterminate:(nsnotification *)notification { nsmutablearray *array = [[nsmutablearray alloc]init]; [array addobject:fieldbooks]; [array writetofile:[self pathoffile] atomically:yes]; }

nsdocumentationdirectory

hm. i'm sure meant

nsdocumentdirectory

instead.

iphone nsmutablearray plist

c# - Rotation over time in 3D -



c# - Rotation over time in 3D -

im working xna 4, doing game have game object (spaceship) moves in 3d world on y axis = 0 plane.. aka 2.5d..

until used complex angle calculation create rotation between 2 vectors, yet algorithm lacks ability take business relationship object rotated. results funkey.. hence hoping someone, show me smart , implementable way utilize matrices , vector math, such rotation on time thingy.

what noticed in previous searches, people have next variables in object classes: - position vector3 - right vector3 - vector3 - rotation matrix - transformmatrix matrix - velocity vector3 - etc..

often inquire myself why needed have many variables simple current position.. or maybe im not understanding.. anyways..

i have position, rotation , transformsmatrix currently, , know else need , how calculate it, , how implement rotation on time.

the method called right-click motion command trig sends vector3 position on y = 0 plane of click happened.

public void movecommand(vector3 pos){ }

ive tested this, , "pos" given accurate. help apreciated ..

you should check matrix.createrotationx y or z acording rotation want. x,y or z axis of rotation, if take y see "2d" rotation (yaw) because axis using depth. if take x or z axis see "3d" rotations (pitch , roll)

the code should this:

worldmatrix = rotations * translation

where rotations = matrix.createrotationx(angleradians) , translation = matrix.createtranslation(position);

the world matrix matrix affecting model, view , projection depends on camera

now if want know angle between vectors should check dot product or atan2 function because in 2d

c# xna rotation

javascript - Including third party header and footer -



javascript - Including third party header and footer -

i have little web app. clients utilize on site. create seamless (a part of own site), set app within iframe on website. way don't have worry header , footer (branding/styling etc). reason, specs have changed , app not within iframe. leads problem have maintain consistent header , footer branding/styling each client. have many clients , not possible me maintain each 1 of them , maintain updated time.

so, trying come solutions allow me inherit header , footer client , utilize on site. thinking telling client maintain header , footer html file (and maintain per branding). create ajax phone call , phone call html content on page. way never have worry header , footer.

what other ways can suggest can solve problem? experiences such situations? how did deal it?

i know not specific programming question thought best place answer. thanks

instead of placing web app within iframe can place header , footer within frame in web app.

javascript html

sql server - Cube Processing Error - CREATE DATABASE permission denied in database 'master'.; 42000 -



sql server - Cube Processing Error - CREATE DATABASE permission denied in database 'master'.; 42000 -

these errors (repeated few times) when processing cube in sql server 2008 (on windows 8 x64 on vmware).

ole db error: ole db or odbc error: cannot attach file '\\vmware-host\shared folders\downloads\adventureworks2008r2_database\adventureworks2008r2_data.mdf' database 'adventure works'.; 42000; create database permission denied in database 'master'.; 42000. errors in high-level relational engine. connection not made info source datasourceid of 'adventure works', name of 'adventure works'. errors in olap storage engine: error occurred while dimension, id of 'address', name of 'address' beingness processed. errors in olap storage engine: error occurred while 'territory id' attribute of 'address' dimension 'multidimensionalproject1' database beingness processed.

any suggestions appreciated!

i figured out. double clicked info source, went impersonation info tab , changed utilize service business relationship utilize specific windows user name , password.

credit to: http://www.sqlservercentral.com/forums/topic1032175-17-1.aspx

sql-server odbc oledb cube olap-cube

security - Why doesn't unlockedActions override requireAuth in CakePHP? -



security - Why doesn't unlockedActions override requireAuth in CakePHP? -

in cake 2.3 app, have action that's called via ajax. since i'm using security component, had utilize $this->security->unlockedactions, otherwise action fail.

however, unlockactions doesn't work when $this->security->requireauth() called. bug? have misunderstanding of how cakephp handles security?

why doesn't unlockactions override requireauth?

securitycomponent::requireauth() adds action array of required actions, stored in securitycomponent::$requireauth.

if take @ security component's startup code, you'll find securitycomponent::_authrequired(), method checks $requireauth array, called before unlocked actions checked. imagine if require action authorized, should take precedence on telling app doesn't.

i still consider bug (or incorrectly documented), states in documentation:

there may cases want disable security checks action (ex. ajax request). may "unlock" these actions listing them in $this->security->unlockedactions in beforefilter.

this new feature might open ticket explaining confusion , see core team thinks it.

i should note here disabling security component ajax requests isn't necessary. have several apps utilize security component, along csrf checks, side-by-side ajax.

security cakephp

c++ - Read a list of signed shorts from a binary file using the >> operator -



c++ - Read a list of signed shorts from a binary file using the >> operator -

isn't possible through >> operator ?

sources :

http://en.cppreference.com/w/cpp/io/basic_istream/operator_gtgt http://www.cplusplus.com/reference/istream/istream/operator%3e%3e/

the value of 's' remains same : doesn't seem grab number input stream.

vector<signed short> creadfiletest::readintegersfromfile( const char * filename ) { ifstream ifs(filename, ifstream::in, ifstream::binary); vector<signed short> vec ; if (ifs) { signed short s ; while (!ifs.eof()) { ifs >> s; vec.push_back(s); } ifs.close(); } homecoming vec; }

when open binary file have utilize read.

c++ stream short

html - Scrollable row of images -



html - Scrollable row of images -

i have little image need repeat along x direction, specific number of times. 'row' of images should scrollable, , want avoid tables if possible.

is possible html + css? html code dynamic generated using php. extra-ideas?

thanks!

i wonder if ajax has best looking solutions you, haven't explained scenario well, why repeating same image , making scrollable? doesn't sound valid functionality anything. trying scale background image or something? if so, what's scroll bar???

anyways here go: http://wowslider.com/rq/ajax-image-scroller/

html css image scrollbar

Json encoding with PHP 5.3 -



Json encoding with PHP 5.3 -

i trying info json, can hardcode output code needs generated dynamically using mysql info , code calculate results. json output in format:

{ "inits": { "version": "18.05.04_ep1", "source": "live", "lowid": "265067", "highid": "265068", "ql": "300", "name": "ofab shark mk 1", "inits": [ { "-init": "430", "-percent": "100", "-slider": "def>===========][<agg" }, { "-init": "530", "-percent": "90", "-slider": "def>==========][=<agg" }, { "-init": "630", "-percent": "81", "-slider": "def>=========][==<agg" }, { "-init": "730", "-percent": "72", "-slider": "def>========][===<agg" }, { "-init": "830", "-percent": "63", "-slider": "def>=======][====<agg" }, { "-init": "930", "-percent": "54", "-slider": "def>======][=====<agg" }, { "-init": "1030", "-percent": "45", "-slider": "def>=====][======<agg" }, { "-init": "1130", "-percent": "36", "-slider": "def>====][=======<agg" }, { "-init": "1290", "-percent": "27", "-slider": "def>===][========<agg" }, { "-init": "1590", "-percent": "18", "-slider": "def>==][=========<agg" }, { "-init": "1890", "-percent": "9", "-slider": "def>=][==========<agg" }, { "-init": "2190", "-percent": "0", "-slider": "def>][===========<agg" } ]

} }

the "inits": [init, percent, slider] needs within loop generate results. can statically using:

array ( 'inits' => array ( 'version' => '18.05.04_ep1', 'source' => 'live', 'lowid' => '265067', 'highid' => '265068', 'ql' => '300', 'name' => 'ofab shark mk 1', 'inits' => array ( 0 => array ( '-init' => '430', '-percent' => '100', '-slider' => 'def>===========][<agg', ), 1 => array ( '-init' => '530', '-percent' => '90', '-slider' => 'def>==========][=<agg', ), 2 => array ( '-init' => '630', '-percent' => '81', '-slider' => 'def>=========][==<agg', ), 3 => array ( '-init' => '730', '-percent' => '72', '-slider' => 'def>========][===<agg', ), 4 => array ( '-init' => '830', '-percent' => '63', '-slider' => 'def>=======][====<agg', ), 5 => array ( '-init' => '930', '-percent' => '54', '-slider' => 'def>======][=====<agg', ), 6 => array ( '-init' => '1030', '-percent' => '45', '-slider' => 'def>=====][======<agg', ), 7 => array ( '-init' => '1130', '-percent' => '36', '-slider' => 'def>====][=======<agg', ), 8 => array ( '-init' => '1290', '-percent' => '27', '-slider' => 'def>===][========<agg', ), 9 => array ( '-init' => '1590', '-percent' => '18', '-slider' => 'def>==][=========<agg', ), 10 => array ( '-init' => '1890', '-percent' => '9', '-slider' => 'def>=][==========<agg', ), 11 => array ( '-init' => '2190', '-percent' => '0', '-slider' => 'def>][===========<agg', ), ),

), )

however, have no thought how phone call methods fill in array info each array (init,percent,slider). new php, , having hard time finding right usage of php, c# developer. if can help appreciate it!

you should utilize for. don't know want fo fill, code aso folowing:

//let $ar array have posted for($i=0;$i<count($ar["inits"]["inits"]); $i++) { $ar["inits"]["inits"][$i]["-slider"]="something"; }

php json encode

html - Javascript not working with adding variables together -



html - Javascript not working with adding variables together -

right have values in 3 dropdown boxes , there more (looking @ adding 20 dropdown boxes add together give final cost item. here code html.

<form id="myform1> <p>testing 1</p> <select id="test1"> <option value="24">item one</option> <option value="29">item two<option> <!--i have first box going 20 items--> </select> <p>testing 2</p> <select id="test2"> <option value="25">item one</option> <option value="100">item two<option> <!--i have sec box going 10 items--> </select> <p>testing 3</p> <select id="test3"> <option value="24">item one</option> <option value="100">item two<option> <!--i have 3rd box going 10 items--> </select> </form> <button onclick="myfunction()">update</button> <p id="demo"></p>

then have javascript

function myfunction() { var = document.getelementbyid("list1"); var = a.options[a.selectedindex].value; var b = document.getelementbyid("list2"); var b = b.options[a.selectedindex].value; var c = document.getelementbyid("list3"); var c = c.options[a.selectedindex].value; var inta = parseint(a); var intb = parseint(b); var intc = parseint(c); var x=intb + inta; var y=x + intc; var demop=document.getelementbyid("demo") demop.innerhtml= y; }

my problem works if take var c our , take var y out , have calculate x. have tryed many ways , @ loss. cheers

p.s. java script in script tag @ bottom

you've used a.selectedindex selected item 3 elements. alter utilize b.selectedindex , c.selectedindex in appropriate spots. or can a.value, b.value , c.value straight rather going via options collection.

also id attributes in html don't match you're using in js.

fix problems , works, can see here: http://jsfiddle.net/6wwdc/

p.s. it's thought in habit of passing radix sec parameter parseint(), inta = parseint(a, 10); - otherwise if input string has leading 0 or leading 0x might (depending on browser, , presense of "use strict"; directive) interpreted octal or hexadecimal.

javascript html

multithreading - how to write a future that wait for an event -



multithreading - how to write a future that wait for an event -

i have client/server socket rpc things. know bit finagle , find isolation future elegant. question how write future in scala wait event (the server reply of client request). implementation utilize identified request lack way inquire future wait event without busy wait.

create promise instead of future , add together listener event fulfills promise. homecoming promise's future client (in twitter util future library it's promise itself, in scala 2.10 it's p.future).

multithreading events scala rpc future

image - how to keep aspect ratio with different android devices -



image - how to keep aspect ratio with different android devices -

so i'm trying set image within scrollview , have image stretch fit different sized screens, it'll stretch horizontally, vertically comes out messed up. i've read many pages of people similar problems, solutions never work me. i've tried every different combination possible using different "scaletype","layout_width" , "layout_height", along trying changing other things around. closest i've gotten getting work shown in code below, using scaletype="centercrop", 1 stretches image vertically in ratio, cuts off big chunk of image top , bottom, it'll scroll , downwards image, middle part shows. image 480x5500 jpeg, if matters. before started messing that, app worked fine on phone, later realized image crunched when tried on tablet. there's gotta way in xml right? don't want have things image in java code part. hoping able using 1 image, don't want have utilize different image different screen sizes. please help, thanks.

<?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview1" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:layout_width="fill_parent" android:layout_height="wrap_content" android:adjustviewbounds="true" android:scaletype="centercrop" android:src="@drawable/paper" /> </scrollview>

may help you, create both height , width wrap_content of imageview

android:layout_width="wrap_content" android:layout_height="wrap_content"

and no need scrollview here.

android image ratio aspect

jquery - Extract data from Json return object -



jquery - Extract data from Json return object -

in controller calling webservice

metadata.client.service.client returnclient = new metadata.client.service.client(); returnclient = client.updateclient(updateclient); homecoming json(new { returnclient }, jsonrequestbehavior.allowget);

in .cshtml ajax phone call below

$.ajax( { type: "get", contenttype: "application/json; charset=utf-8", url: '@url.action("updaterecord", "client")', data: { "id": id, "name": clientname, "code": clientcode, "typeid": clienttypeid, "clientstatuscode": clientstatuscode }, datatype: "json", beforesend: function () {//alert(id); }, error: function (request) { alert('error'); alert(request.responsetext); }, success: function (data) { alert('success'); console.log(data); //var parsed = json.parse(data); //alert(parsed); //var k = json.stringify(data); //alert(parsed); }

i tried several ways extract data. in console.log showing below

[09:27:07.989] ({returnclient:{extensiondata:{}, clientcode:"c09091", clientid:39, clientname:"test1", clientstatus:[{extensiondata:{}, statuscode:{extensiondata:{}, name:"active", statuscodeid:5}, statustype:{extensiondata:{}, name:"oe", statustypeid:1}}], clienttype:{extensiondata:{}, clienttypeid:7, clienttypename:"fdfd"}}})

please can help out extract info

ie, clientname, clientcode, clientid, clientstatus.statuscode, clientstatus.name, clientstatus.statuscodeid, statustype.name

success: function (data) { var ccode = data.returnclient.clientcode; var cid = data.returnclient.clientid; var cname = data.returnclient.clientname; var ctypeid = data.returnclient.clienttype.clienttypeid; var ctypename = data.returnclient.clienttype.clienttypename; (var = 0; < data.returnclient.clientstatus.length; i++) { var codename = data.returnclient.clientstatus[i].statuscode.name; var codeid = data.returnclient.clientstatus[i].statuscode.statuscodeid; var typename = data.returnclient.clientstatus[i].statustype.name; var typeid = data.returnclient.clientstatus[i].statustype.statustypeid; } }

jquery asp.net-mvc-4

vb.net - Variable background colors for different scopes? -



vb.net - Variable background colors for different scopes? -

i wondering if there sort of add-in or feature vs (2008 preferably) vb.net / c# highlight variables differently based on scope, i.e. method scope, inner scope (i.e. within if...else), class scope, global scope, on , forth.

it looks resharper might have functionality, free software preferable. if think resharper great though, i'm ears.

i.h.,

maybe can see reply question , think find want

vb.net visual-studio-2008 syntax-highlighting scope

maven tomcat7 plugin authentication fail, 403 Forbidden -



maven tomcat7 plugin authentication fail, 403 Forbidden -

i'm posting after weeks of effort. seek , seek because felt guilty of posting because there thread similar this. still i'm getting different error. have simple spring(no need spring of course of study bcz problem maven) application maven.

this plugins section pom.

<plugins> <plugin> <groupid>org.apache.tomcat.maven</groupid> <artifactid>tomcat7-maven-plugin</artifactid> <version>2.0</version> <configuration> <url>http://localhost:8080/manager</url> <username>tomcat</username> <password>s3cret</password> <path>/test</path> <port>8080</port> </configuration> </plugin> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins>

earlier have problems maven tomcat plugin not working tomcat 7 etc etc "tomcat7-maven-plugin" there solved. i'm using 'http://localhost:8080/manager' url. threads maven tomcat compiler plugin build failure. build succeed(i run tomcat7:deploy). problem tomcat replying

tomcatmanager status code:403, reasonphrase:forbidden

along html see when got authentication failure on browser. same code works fine under linux box. seek different scenarios of using server element in settings.xml within .m2 , within maven_home/conf etc. still not working.

as figure out maven cannot authenticate tomcat. username , password find , can log in using gui. expecting help here.

p.s - tomcat-users.xml fiel

<role rolename="manager-gui" /> <user username="tomcat" password="s3cret" roles="manager-gui"/>

url not right seek :

<url>http://localhost:8080/manager/text</url>

what content of tomcat-users.xml file. did correctly set permissions ? see http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html

maven tomcat7 maven-tomcat-plugin

python - MessageDialog doesn't close -



python - MessageDialog doesn't close -

i have python application wx.dirpicker command can manually changed , need sure chosen path exists before running code. i'm using this:

def m_dirpicker1onupdateui( self, event ): src_directory = self.m_dirpicker1.gettextctrlvalue() if os.path.exists(src_directory)==false: dlg = wx.messagedialog( self, "the specified path doesn't exist", "warning", wx.icon_error | wx.icon_exclamation ) dlg.showmodal() #print(dlg.getreturncode()) if dlg.getreturncode() == 0: self.destroy()

it works fine, detecting if path exists.

however, when path doesn't exist message dialog appears can't close after pressing ok button, , don't understand why.

thank you.

i think should phone call "dlg.destroy()" before "self.destroy()":

result = dlg.showmodal() dlg.destroy() if result == 0: self.destroy()

python messagedialog

sql - Insert only new or edited values to rows -



sql - Insert only new or edited values to rows -

i have got attendance table follows.

id date time == ==== ==== 1 01/01/2013 17:00:00 1 01/01/2013 22:00:00

these table process stored procedure calculate total hours, deduction, rates etc..etc.. stored in table next result example.

id date timein timeout thours salary == ==== ====== ======= ====== ====== 1 01/01/2013 17:00 22:00 5 $50

what have done run select if exist. delete table. in order update edited entries in first table, ie, miss punches..

the sec table process through stored procedure time rounding, add together tag depending on results etc.. , stored in bigger tables contain fields incentive, overtime, advance etc.. etc.. table utilize final insertion of additional info through windows form.

now, we're stuck situation when we're trying add together new rows 3rd table. 2nd table get's deleted , recreated on update, , doing exist update etc don't seem work, , don't seem able depend on unique key 2nd table recreated on update.

appreciate suggestion on how can maintain 3rd table user edit..

just add together id 1st table 2nd table , client or whoever attendance doing sec table u should not delte sec table entries while updating

just check id of person in sec table matching id of first table

then 3rd have sec table id

sql

maven - eclipse linked resource not found by jsp -



maven - eclipse linked resource not found by jsp -

i have eclipse (juno) workspace maven projects, source directories appeared under folder called "java resources".

because of migration @ office, had create new workspace , reimport projects. "java resources" folder gone , source directories appear straight under project root.

this messing linked resources in jsp files have. there jsp file in project imported in many other files, in other projects. there link in projects file can found. link found ok, instead of looking file starting in root of source directory, looking in root of project:

<%@include file="/common/includes/global.jsp"%> , i'm getting fragment "/common/includes/global.jsp" not found @ expected path /myproject/common/includes/global.jsp

update- thought problem linked resource caused configuration. solved java resources issues , jsp still doesnt find file

i looked configuration files in old workspace , found org.eclipse.wst.common.component file under .settings different. tag defaultrootsoruce incorrect, since jsps in project not under standard maven layout.

this fixed it:

eclipse maven

regex - PHP preg_match_all returns empty arrays -



regex - PHP preg_match_all returns empty arrays -

i have preg_match_all:

$cash = "hi £240"; preg_match_all("/^£?(([1-9]{1,3}(,\d{3})*(\.\d{2})?)|(0\.[1-9]\d)|(0\.0[1-9]))$/", $cash, $matches); print_r($matches);

and print_r returns:

array ( [0] => array ( ) [1] => array ( ) [2] => array ( ) [3] => array ( ) [4] => array ( ) [5] => array ( ) [6] => array ( ) )

when tried preg_match, didnt work @ all, did miss something?

i searching string gb monetary values.

$cash = "hi £240"; preg_match_all("/£(?p<amount>\d*,?\d*\.?\d*)/",$cash,$match); print_r($match['amount']);

php regex

android - Custom components on different versions -



android - Custom components on different versions -

i'm using actionbarsherlock actionbar on older versions of android. however, buttons , text field still different below ics. if made custom button or edittext, same on android 2.x 4.x? edit: , there good, simple tutorials?

use asset studio tools create harmonic 4.x ui design

android android-layout android-button

mysql - Sum Qty by date on date-time field -



mysql - Sum Qty by date on date-time field -

i'm trying sum qty built (partnum), grouped date, lot & partnum.

date partnum lot qty e.g. 2/15/13 1003 56 21 2/15/13 1007 23 12 select `product_trans`.`ptid` `id`, `product_trans`.`ptlot` `lot`, `product_trans`.`ptrole` `role`, `product_trans`.`ptposted` `posted`, `product_trans`.`ptstamp` `stamped`, `product_trans`.`ptline` `line`, sum(`product_trans`.`ptqty`) `qty`, `product_trans`.`ptpart` `part`, `product_trans`.`ptpartnum` `partnum` `product_trans` grouping `product_trans`.`ptstamp`, `product_trans`.`ptpartnum`, `product_trans`.`ptlot` order `product_trans`.`ptstamp`, `product_trans`.`ptpartnum`

the problem ptstamp date-time field. need grouped date, not date-time.

i tried this:

group curdate(`product_trans`.`ptstamp`), `product_trans`.`ptpartnum`, `product_trans`.`ptlot`

but no joy.

i know simple, can't see it.

try

date(`product_trans`.`ptstamp`)

mysql date function

mysql

left outer join issue in mysql -



left outer join issue in mysql -

i seek rows in parts_keywords not included in parts_questions. unfortunately, getting rows of both tables.

select *from parts_keywords left outer bring together parts_questions on parts_keywords.id = parts_questions.question_id parts_questions.question_id null , parts_keywords.term '%where%' || parts_keywords.term '%how%' || parts_keywords.term '%who%' || parts_keywords.term '%what%' order parts_keywords.id desc limit 15

i have tried using or instead of ||. have tried using match instead of no avail.

when utilize 1 element, such 'who' right results. however, of import me result elements together.

please help

try using paranthesis

select * parts_keywords pk left outer bring together parts_questions pq on pk.id = pq.question_id pq.question_id null , ( pk.term '%where%' or pk.term '%how%' or pk.term '%who%' or pk.term '%what%' ) order parts_keywords.id desc limit 15

mysql join like outer-join

python - Retrieving number of subscriptions and subscribers of specific set of users -



python - Retrieving number of subscriptions and subscribers of specific set of users -

i'm trying retrieve number of subscriptions , subscribers of specific set of users. i'm using youtube api python.

i wrote next code number of subscriptions. code reads users' ids list 1 one, counts number of subscriptions , writes id , number in csv file. doesn't work properly. after few first user's stops writing numbers in file, , numbers not right anyhow. think there should simpler mess.

thanks,i appreciate suggestions , comments.

import os import gdata.youtube import gdata.youtube.service import time def getuserurl (username): yt_service = gdata.youtube.service.youtubeservice() uri = 'https://gdata.youtube.com/feeds/api/users/%s/subscriptions?max-results=50&start-index=1' % username subscription_feed = yt_service.getyoutubesubscriptionfeed(uri) t1 = getusersub(subscription_feed) final = 0 j = 1 total = 0 while j<800: j = j + 50 sj = str(j) uri = 'https://gdata.youtube.com/feeds/api/users/%s/subscriptions?max-results=50&start-index=' % username+sj subscription_feed = yt_service.getyoutubesubscriptionfeed(uri) t2 = getusersub(subscription_feed) total = total + t2 final = total + t1 usersub.writelines([str(username),',',str(final),'\n']) def getusersub (subscription_feed): = 0 entry in subscription_feed.entry: = +1 homecoming usersub = open ('usersubscribtions.csv','w') users=[] userlist = open("user_ids_noduplicates1.txt","r") text1 = userlist.readlines() l in text1: users.append(l.strip().split()[0]) x = 0 while (x<len(users)): try: getuserurl(users[x]) time.sleep(0.4) x = x+1 except: usersub.writelines([str(users[x]),'\n']) x = x+1 pass usersub.close()

if trying total number of subscribers, don't need count items in feed - supplied value in v3 of info api.

you need create phone call channels resource channelid of user looking up: https://www.googleapis.com/youtube/v3/channels?part=statistics&id=ucdso-0yo5zpjk575nkxgmva&key={your_api_key}

response:

{ "kind": "youtube#channellistresponse", "etag": "\"o7gzuruiunq-grpzm3hckv3vx7o/wc5otbvm5z2-skaqmtfh4ydq-gw\"", "pageinfo": { "totalresults": 1, "resultsperpage": 1 }, "items": [ { "id": "ucdso-0yo5zpjk575nkxgmva", "kind": "youtube#channel", "etag": "\"o7gzuruiunq-grpzm3hckv3vx7o/xrjata5yth9wro8uq6vq4d45vfq\"", "statistics": { "viewcount": "80667849", "commentcount": "122605", "subscribercount": "4716360", "videocount": "163" } } ] }

as can see, subscribercount included in response.

python youtube-api

java - Exception is only thrown in debug+breakpoint -



java - Exception is only thrown in debug+breakpoint -

so i've got thread receive info client. there objectinputreader read data. if objectinputreader couldn't initialized in try-catch, happens if client disconnected without notifying server, try-catch should phone call exception.

so i've got "disconnect client" handling in catch-statement. never happens.

but if i'm running server on debug , set breakpoint in catch-statement exception occurs , handled want it. breakpoint, never without (debug or release).

i'm using eclipse, think newest version.

did ever happen have "bug"? or doing wrong?

private static runnable receive = new runnable(){ @override public void run() { // todo auto-generated method stub objectinputstream ois; while(true) { for(int = 0; < listsockets.size();i++){ seek { ois = new objectinputstream(listsockets.get(i).getinputstream()); int receivestate = (integer)ois.readobject(); datapackage dp = (datapackage)ois.readobject(); listdata.set(i,dp); if(receivestate == 1){ //client disconnected user disconnectclient(i); i--; } ois.close(); } grab (ioexception | classnotfoundexception e) { disconnectclient(i); i--; } } } } };

allways maintain in mind debugging might influence program. when inspect variables jvm causes lot's of tostring() methods called. if 1 tostring() method changes state of 1 of objects, result change. seek

} grab (ioexception | classnotfoundexception e) { system.out.println("i here"); disconnectclient(i); i--; }

to see if programme jumps grab block or disconnectclient method has flaw. if add together few more system.out. might see programm stops.

java network-programming

linker - shared linking against libB.so, libB.so.3, or libB.so.3.0? -



linker - shared linking against libB.so, libB.so.3, or libB.so.3.0? -

suppose create library links against (system) library b of next files installed:

$ ll /usr/lib/libb* libb.so -> libb.so.3 libb.so.3 -> libb.so.3.0 libb.so.3.0

when creating own liba.so*, suppose it'd practice include of libb.so* on link line. in fact, linker flag -wl,--no-undefined enforces this.

it doesn't seem create difference of above libb files used linking since point same file libb.so.3.0, i'm guessing there best practices this, too.

what's recommended , why?

what's recommended , why?

only linking against libb.so officially supported. linking against libb.so.3 or libb.so.3.0 works more or less accident; don't it.

you can read external library versioning here.

linker dynamic-linking abi

python - What would a Cheetah template binding for Pyramid look like? -



python - What would a Cheetah template binding for Pyramid look like? -

i've found this topic, talks pystache, , i've seen few bindings on github other engines i'm confused on how cheetah work pyramid. pointers or code might like?

python pyramid cheetah

inheritance - Rails: ActiveRecord::AssociationTypeMismatch: Superclass expected, got Subclass -



inheritance - Rails: ActiveRecord::AssociationTypeMismatch: Superclass expected, got Subclass -

i trying create class model application has next key features:

inheritance (the class place acts superclass farm , depot). added gem multiple_table_inheritance implement this. relationship place (can have many places)

i using rails 3.2.11 , ruby 1.9.3.p194.

here rough class model of trying implement.

you can find relationship definition in place model:

class place < activerecord::base acts_as_superclass attr_accessible :location, :name, :subtype has_many :place_connections, foreign_key: :place_a_id, dependent: :destroy has_many :places, through: :place_connections, source: :place_b has_many :reverse_place_connections, class_name: :placeconnection, \ foreign_key: :place_b_id, dependent: :destroy end

the farm model can seen in following. depot model looks same.

class farm < activerecord::base inherits_from :place end

however, when check relationship model in rails console experience following:

> farm = place.first => #<farm place_id: 1, created_at: "2013-02-08 12:19:16", \ updated_at: "2013-02-08 12:19:16"> > depot = place.last => #<depot place_id: 6, created_at: "2013-02-08 12:19:44", \ updated_at: "2013-02-08 12:19:44"> > farm.places = [depot] activerecord::associationtypemismatch: place(#42600420) expected, \ got depot(#42518820) ...

can tell whether configured relationship correctly? doing wrong? maybe mixed singular , plural names models , associations.

problem identified

i think (a friend of mine , me) found out problem is: whenever database contains relation of 2 places , trying replace pair of ids exact same pair type mismatch error raised. error not pop if replace existing pair another pair.

failing example:

before:

placeconnection ----------------- place_a | place_b ----------------- 1 6 -----------------

action:

> farm = place.first => #<farm place_id: 1, created_at: "2013-02-08 12:19:16", \ updated_at: "2013-02-08 12:19:16"> > depot = place.last => #<depot place_id: 6, created_at: "2013-02-08 12:19:44", \ updated_at: "2013-02-08 12:19:44"> > farm.places = [depot.place] activerecord::associationtypemismatch: place(#42600420) expected, \ got depot(#42518820) ... working example:

before:

placeconnection ----------------- place_a | place_b ----------------- 3 2 -----------------

action:

> farm = place.first => #<farm place_id: 1, created_at: "2013-02-08 12:19:16", \ updated_at: "2013-02-08 12:19:16"> > depot = place.last => #<depot place_id: 6, created_at: "2013-02-08 12:19:44", \ updated_at: "2013-02-08 12:19:44"> > farm.places = [depot.place] => [#<place id: 6, name: "some depot", location: "somewhere", subtype: "depot", \ created_at: "2013-02-09 12:51:01", updated_at: "2013-02-09 12:51:01">] please note

another thing realized is , time possible extend array of relations follows: farm.places << depot.place. want utilize anyways. nevertheless, assignment problem might bug?!

on lastly line, seek replacing this:

farm.places = [depot]

with this:

farm.places = [depot.place]

the .place method should homecoming superclass instance of place, (which technically placeconnection referencing) instead of subclass instance of depot.

ruby-on-rails inheritance has-many type-mismatch

python - Writing my own Linux distro -



python - Writing my own Linux distro -

i had thought write own linux distribution. thought came wanting expand programming knowledge, know bit of python , starting larn c project. wondering start? don't know how begin write distro , appreciate help deciding first.

try linux scratch:

linux scratch (lfs) project provides step-by-step instructions building own custom linux system, exclusively source code.

python c linux

excel - How to set pie chart label format as a cellformat programmatically in VBA -



excel - How to set pie chart label format as a cellformat programmatically in VBA -

i'm generating pie chart set of data.

the chart labels have value , percentage. i want format value 1 in cell using vba

i don't know start.....

you can link number format of labels number format of cell. via ui you'd formatting labels , on number tab select "link source".

if run macro recorder during that, respective vba, i.e. link

activechart.seriescollection(1).datalabels.numberformatlinked = -1

and unlink

activechart.seriescollection(1).datalabels.numberformatlinked = 0

excel excel-vba

sql - vb2008 insert and update record using one button -



sql - vb2008 insert and update record using one button -

i trying create glossary. have form listbox, 2 textboxes, , save button.

the listbox populated words database, , when word selected, definition display in textbox2.

the user can add together record filling textbox1 new word , textbox2 definition,and clicking save button. if new word existed not allow save new record, if there's null value between 2 textboxes. if doesn't exist inserted on table , new word added listbox.

the user can update record selecting first word on list edit word and/or definition , clicking save button.

i got updating part work have problem in inserting new record. can't properly. glossary table has 2 fields: word, definition. here's code:

dim mycmd new mysqlcommand dim myreader mysqldatareader dim myadptr new mysqldataadapter dim mydatatable new datatable private sub btnsave_click(byval sender system.object, byval e system.eventargs) handles btnsave.click phone call connect() me if blank() = false if duplicate() = false strsql = "insert glossary values (@word, @def)" mycmd.connection = myconn mycmd.commandtext = strsql mycmd.parameters.addwithvalue("word", txtnew.text) mycmd.parameters.addwithvalue("def", txtdefine.text) mycmd.executenonquery() mycmd.dispose() msgbox("record added") dim word string word = txtnew.text lstword.items.add(word) 'myconn.close() 'me.filllistbox() else myconn.open() strsql = "update glossary set word = @term, definition = @mean word = @term" mycmd.connection = myconn mycmd.commandtext = strsql mycmd.parameters.addwithvalue("term", txtnew.text) mycmd.parameters.addwithvalue("mean", txtdefine.text) mycmd.executenonquery() mycmd.dispose() msgbox("record updated", msgboxstyle.information, "new word added") end if end if end end sub public function blank() boolean phone call connect() me if .txtnew.text = "" or .txtdefine.text = "" blank = true msgbox("cannot save! term , definition should not contain null value", msgboxstyle.critical, "unable save") else blank = false end if end end function public function duplicate() boolean phone call connect() me strsql = "select * glossary word = '" & txtnew.text & "'" mycmd.connection = myconn mycmd.commandtext = strsql if mydatatable.rows.count <> 0 duplicate = true 'msgbox("word exist. please check word.", msgboxstyle.critical, "duplicate.") else duplicate = false end if myconn.close() end end function

this connection module:

public myconnectionstring string public strsql string public myconn new mysqlconnection public sub connect() myconn seek if .state = connectionstate.open .close() end if myconnectionstring = "database=firstaidcqs;server=localhost;uid=root;password=" .connectionstring = myconnectionstring .open() 'msgbox("successful connection") grab ex exception msgbox(ex.message, msgboxstyle.critical, "connection error") .close() end seek end end sub public sub disconnect() myconn .close() .dispose() end end sub

help me create work properly. have finish tomorrow. thought much appreciated.

you using global variables in code above.

myconn , mycmd

in particular, phone call dispose on mycmd can't see anywhere reinitialization of object new. also, forgetting moment mycmd.dispose problem, don't reset mycmd parameters collection. in way end wrong parameter collection command executed, don't forget open connection insert part. (and close both parts)

you avoid utilize of unnecessary global variables

.... if duplicate() = false strsql = "insert glossary values (@word, @def)" using mycmd = new mysqlcommand(strsql, myconn) myconn.open() mycmd.parameters.addwithvalue("word", txtnew.text) mycmd.parameters.addwithvalue("def", txtdefine.text) mycmd.executenonquery() end using myconn.close() ..... else strsql = "update glossary set word = @term, definition = @mean word = @term" using mycmd = new mysqlcommand(strsql, myconn) myconn.open() mycmd.parameters.addwithvalue("term", txtnew.text) mycmd.parameters.addwithvalue("mean", txtdefine.text) mycmd.executenonquery() end using myconn.close() .....

a improve solution changing connect() method homecoming initialized connection instead of using global variable. in way enclose creation , destruction of connection in using statement

using myconn mysqlconnection = connect() ....... end using

for work need alter code of connect in way

public function connect() mysqlconnection dim myconn mysqlconnection myconnectionstring = "database=firstaidcqs;server=localhost;uid=root;password=" myconn = new mysqlconnection(myconnectionstring) myconn.open() homecoming myconn end sub

no need of disconnect function because utilize using statement close connection you, no need have global variable maintain connection because reopen connection every time need , close afterward. don't think not performant because ado.net implements connection pooling (it msdn article sqlserver, concept applies mysql)

sql vb.net

javascript - Using Marionette to group items in a collection view -



javascript - Using Marionette to group items in a collection view -

i'm building application using backbone , marionette.js. i'm planning on using collection view nowadays items , allow them filtered, sorted , grouped.

i wondering if there design ideas appending html in grouped fashion. have few ideas wondering if might have input on improve design.

my first thought alter appendhtml method on collection view, , if grouping enabled, can have appendhtml function either find or create kid group's bin , place kid view in it.

appendhtml: function(collectionview, itemview, index){ var $container = this.getitemviewcontainer(collectionview); // grouping model var groupname = itemview.model.get("group"); // seek find grouping in kid container var groupcontainer = $container.find("." + groupname); if(groupcontainer.length === 0){ // create grouping container var groupcontainer = $('<div class="' + groupname + '">') $container.append(groupcontainer); } // append childview grouping groupcontainer.append(itemview); }

my sec thought break apart collection groups first , maybe render multiple views... 1 seems might more work, might bit improve far code construction concerned.

any suggestions or thought eliciting comments great!

thanks

maybe not you're looking for, here's related question:

backbone.marionette, collection items in grid (no table)

my solution issue -- 1 fetched collection rendered list or grid ("items grouped in rows") utilize _.groupby() in "wrapper" compositeview , pass modified info downwards chain compositeview (row) , downwards itemview.

views.grid = backbone.marionette.compositeview.extend({ template: "#grid-template", itemview: views.gridrow, itemviewcontainer: "section", initialize: function() { var grid = this.collection.groupby(function(list, iterator) { homecoming math.floor(iterator / 4); // 4 == number of columns }); this.collection = new backbone.collection(_.toarray(grid)); } });

here's demo:

http://jsfiddle.net/bryanbuchs/c72vg/

javascript backbone.js marionette

date - Difference between UNIX_TIMESTAMP and NOW() in MySQL -



date - Difference between UNIX_TIMESTAMP and NOW() in MySQL -

i have blog users can comment. insert time @ posted comment using now() , utilize date('j m y', stored timestamp) show time @ posted.

i want know now() homecoming locatime of end user or localtime @ server. improve suited utilize unix_timestamp now() calculate localtime @ users posted comment.

the function now() generates formatted date-time string, determined time zone of mysql server.

however, improve store times using unix_timestamp(), expressed in gmt. doing makes easier format according country of visitor (e.g. using javascript).

if still want utilize datetime columns, can store times using utc_timestamp() (it formats date now() expresses in utc); should more or less work same in other aspects.

mysql date unix-timestamp

Android application only for 10" tablets not latest phones -



Android application only for 10" tablets not latest phones -

how can limit app tablets? e.g. how back upwards galaxy tab not galaxy siii ? both have same resolution , density.

will code sufficient:

<supports-screens android:largescreens="false" android:normalscreens="false" android:requiressmallestwidthdp="720" android:smallscreens="false" android:xlargescreens="true" />

after reading docs again, having below section:

<compatible-screens> <screen android:screensize="xlarge" android:screendensity="mdpi" /> <screen android:screensize="xlarge" android:screendensity="hdpi" /> <screen android:screensize="xlarge" android:screendensity="xhdpi" /> </compatible-screens>

makes whole setup right one?

first of create above provisions in manifest

go console (developer's console)

https://play.google.com/apps/publish/ select app app listing. go apk tab (left side in page)

you able see 'see supported devices' hyperlink open it,

you can see list of supported devices there. manually exclude devices not want.

android android-screen-support

c# - Is it possible to take over just one screen of multiple screens completely with .NET on Windows? -



c# - Is it possible to take over just one screen of multiple screens completely with .NET on Windows? -

with .net (any version) running on windows xp/vista/7/8 - possible reserve 1 screen full-screen application , display data/graphics/whatever on whilst keeping other screens available windows ui user interaction such desktop or other apps?

the usage scenario / rules here following:

the pc must able run programs as-is.

no interactivity required on .net contents (i.e. no keypresses, mouse clicks etc).

no other uis or dialogs other applications can penetrate 1 predefined screen reserved showing output .net executable.

the predefined screen .net contents must not have visible mouse cursor , other screens must have cursor boundaries if there no screen @ (i.e. cursor must stop @ edges of 1 or multiple desktops).

the content must visible if pc locked (i.e. user logged in workstation locked explorer).

i know accomplish external usb controller drives secondary monitor or other display device , manually build contents/graphics pushed interface i'm asking can normal wddm drivers w/ normal monitors?

edit: farther clarify - understand there multiple approaches accomplish similar result question here can 1 comply all of specifications/rules above.

it sounds me designing .net application used purely output (i.e display graph/chart, video etc). application must have dedicated monitor, , no other application (or cursor should able come in bounds of monitor).

my gut feeling whilst can forcefulness application particular monitor (xbmc has functionality), uncertainty can prevent of other applications entering monitor's display region.

when read question, in head clicked , thought "maybe want similar cpu affinity, can set in windows, , forcefulness application utilize particular cpu cores...maybe there similar monitors/display regions?"

sure enough, windows provides these functions:

http://msdn.microsoft.com/en-gb/library/windows/desktop/dd375340(v=vs.85).aspx

http://msdn.microsoft.com/en-gb/library/windows/desktop/dd375338(v=vs.85).aspx

you should able pinvoke these without much trouble. solve beingness able forcefulness application particular monitor. every other application in system, uncertainty able command display affinity easily.

at rough guess, need utilize win32 api phone call references window handles in system, , check display affinity, , if displaying in dedicated monitor, move them elsewhere.

this might help getting window handles:

how list or enumerate handles of unmanaged windows same class , name

http://msdn.microsoft.com/en-us/library/ms633497%28vs.85%29.aspx

just thought throw in there, may not helpful, should give more direction.

edit: found too...might of use

reserve screen area in windows 7

c# .net directx

entity framework - EF Code First Muliple Inheritance is exclusive? -



entity framework - EF Code First Muliple Inheritance is exclusive? -

let's have model have person entity general info (names, date of birth, etc.), , 2 additional entities (customer, worker) inherit person. see there alternative of having client can play role of worker in model. there way design in ef (i saw tph, tpt , tpc) see there utilize of discriminator doesn't allow person table include values worker , client "simultaneously".

i don't know if maybe i'm getting wrong general oop concept of inheritance :s.

thanks in advance help.

you cant have multiple inheritance in .net, not supported (and same applies entity framework). can implement multiple interfaces, different notion - i.e. 'worker' interface implemented objects, such customer

in entity framework, believe discriminator implemented when using table-per-hierarchy. both kid entities stored in same table, , discriminator identifies which.

table-per-type entities (person, customer, worker) stored in different tables, accessible single entities in code (i.e. client inheritance person)

it may need create interface (maybe iworker), , create class (maybe workercustomer??) inherits customer, , implements iworker.

edit: 15/02/2013 19:00

ok, below might you're looking in terms of representing info in single table:

public class mydbcontext : dbcontext { public mydbcontext() : base("testdb") { } public dbset<person> people { get; set; } public dbset<customer> customers { get; set; } public dbset<worker> workers { get; set; } public dbset<workercustomer> workercustomers { get; set; } } public class person { public int id { get; set; } public string name { get; set; } } public class client : person { public string customernumber { get; set; } } public interface iworker { string workernumber { get; set; } } public class worker : person, iworker { public string workernumber { get; set; } } public class workercustomer : client { public string workernumber { get; set; } }

entity-framework inheritance ef-code-first