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