Sunday, 15 April 2012

Use PHP class between 2 subdomains -



Use PHP class between 2 subdomains -

this question has reply here:

including remote file in php 2 answers

i have php class on subdomain want utilize in subdomain. can include on sec subdomain when phone call class, have "class not found" error.

on subdomain (http://a.mydomain.com), file: myclass.php:

class myclass { public function gettest() { homecoming 'hello world !'; } }

on subdomain b (http://d.mydomain.com):

include 'http://a.mydomain.com/myclass.php'; $class = new myclass(); echo $class->gettest();

error displayed: fatal error: class 'myclass' not found in /var/www/subdomainb/index.php on line 3

anyone has idee ?

you must include files using paths not urls. not sure file construction this:

include '/var/www/subdomaina/myclass.php';

also consider using namespaces.

php class subdomain

c - How to get Cilk working with Cygwin? -



c - How to get Cilk working with Cygwin? -

i have downloaded both programs, see no instructions on google getting cilk work on cygwin. there cygwin bundle work? i'm programming in c , have gcc installed.

build source.

that link cygwin32.dll binaries essential work cygwin.

here guide: http://groups.csail.mit.edu/sct/wiki/index.php?title=cilk_plus_installation_guide build source gcc.

c cygwin cilk cilk-plus

Difficulty disabling magento extension -



Difficulty disabling magento extension -

i trying disable magento cache extension called m-turbo keeps appearing in menu. have gone file artic_mturbo.xml in app/etc/modules , changed <active>true</active> <active>false</active>. there else need to/should/could do. thought "way" disable extension.

magento ver. 1.7.0.0

if edit xml's need clear cache in admin menu, flush cache (button in cache menu right top).

if doesn't work seek renaming app/etc/modules/artic_mturbo.xml artic_mturbo.xml.old or magento doesn't load it, , repeat above, clearing cache.

magento magento-1.7

iphone - child buttons of Reusable UITableViewCells not allowing me to update tag -



iphone - child buttons of Reusable UITableViewCells not allowing me to update tag -

i attempting update tag of buttons within reusable uitableviewcell. first 5-8 cells there no issue setting tag these cells have not been "reused" yet understanding. 1 time ui have reuse cell, no longer allows me alter tag or set tag of button. missing?

uitableviewcell *cell =[tblplaces dequeuereusablecellwithidentifier:@"maintableviewcell"]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"maintableviewcell"]; } [[cell viewwithtag:107] settag:indexpath.section];

that isn't working because you're changing tag of button first cells created. when dequeue cell reused, it's button's tag has been changed before, no longer 107, it's whatever old index was.

i consider subclassing uitableviewcell , adding button property of subclass. way have direct access , wouldn't need utilize tags.

edit:

here's simple illustration of need do:

@interface mytableviewcell : uitableviewcell @property (nonatomic, retain) uibutton *mybutton; @end @implementation mytableviewcell -(id)initwithstyle:(uitableviewcellstyle)style reuseidentifier:(nsstring *)reuseidentifier { self = [super initwithstyle:style reuseidentifier:reuseidentifier]; if (self) { // create , add together button in here, or set equal 1 create in interface builder } homecoming self; } @end

iphone objective-c xcode

android - In app billing v3 sample application -



android - In app billing v3 sample application -

i'm trying implement in app billing in application next training section on developer.android.com here can't find trivialdrive sample eclipse import under samples , though see in sdk can't import. help great.

this screenshot of happens when seek import eclipse manually

assuming have installed google play billing library through android sdk manager, if click file -> new -> other -> android project existing code -> navigate sdk folder -> extras -> google -> play_billing -> select in-app-billing-v03 , click ok , finish.

just tried myself, , works perfectly! if you're still having problems, please tell

android

java - Producing media type conflict error in Jersey resolution -



java - Producing media type conflict error in Jersey resolution -

i have these 2 methods below defined in restful resource class. i'm using jersey. when seek run unit says error, have same media type. missing ?

severe: next errors , warnings have been detected resource and/or provider classes: severe: producing media type conflict. resource methods public javax.ws.rs.core.response com.thomsonreuters.codes.sourcedocweb.resource.documentsresource.finddocumentmetadatabycorid(java.lang.string) , public javax.ws.rs.core.response com.thomsonreuters.codes.sourcedocweb.resource.documentsresource.finddocumentmetadata(java.lang.string) can produce same media type feb 11, 2013 5:43:56 pm com.sun.jersey.test.framework.spi.container.inmemory.inmemorytestcontainerfactory$inmemorytestcontainer stop info: stopping low level inmemory test container

@get @path("/{docid}/metadata") @produces(mediatype.application_xml) public response finddocumentmetadata(@pathparam("docid") final string docid) { response response = findmetadatafordocument(docid); homecoming response; } @get @path("/{corid}/metadata") @produces(mediatype.application_xml) public response finddocumentmetadatabycorid(@pathparam("corid") final string corid) { response response = findmetadatafordocument(corid); homecoming response; }

the first thing notice 2 paths conflict. bailiwick of jersey doesn't have frame of reference know if /1/metadata should routed first or sec method. might seek defining paths /doc/metadata/{docid} , /cor/metadata/{corid}. hope helps.

java jersey

java - Radio Group as Circular Page Indicator -



java - Radio Group as Circular Page Indicator -

i trying utilize radiogroup circularpageindicator. problem radiogroup.oncheckedchangelistener. seems phone call self when onpageselected called. want work vice versa i.e. when select radiobutton should alter view based on location of array index beingness provided. seems if oncheckedchange never called when alter check on radio button , oncheckedchange never triggers.

public class mainactivity extends activity implements radiogroup.oncheckedchangelistener, onpagechangelistener { viewpager mimagepager; imagepageradapter mpageradapter; radiogroup mpageindicator; boolean swipechange = false; int[] mradiobuttonids = new int[] { r.id.radio0, r.id.radio1, r.id.radio2, r.id.radio3, r.id.radio4 }; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); initcomponents(); mpageindicator.setoncheckedchangelistener(this); mimagepager.setadapter(mpageradapter); mimagepager.setonpagechangelistener(this); } /** * */ private void initcomponents() { mpageindicator = (radiogroup) findviewbyid(r.id.radiogroup1); mimagepager = (viewpager) findviewbyid(r.id.imgpager); mpageradapter = new imagepageradapter(); } @override public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.menu.activity_main, menu); homecoming true; } @override public void onpagescrollstatechanged(int arg0) { } @override public void onpagescrolled(int arg0, float arg1, int arg2) { } @override public void onpageselected(int pselectedpageposition) { swipechange = true; mpageindicator.check(mradiobuttonids[pselectedpageposition]); } @override public void oncheckedchanged(radiogroup group, int checkedid) { if (!swipechange) { int itemposition = arrays.aslist(mradiobuttonids).indexof(checkedid); mimagepager.setcurrentitem(itemposition, true); swipechange = false; } } }

note : don't want utilize 3rd party code/lib create custom circular page indicator.

can 1 please point error here. there reason radiogroup not work?

i forgot take @ documentation!

http://developer.android.com/guide/topics/ui/controls/radiobutton.html

java android android-viewpager radio-group viewpagerindicator

yii - Authentication with SMTP transport using Swiftmailer -



yii - Authentication with SMTP transport using Swiftmailer -

i'm using swiftmailer send emails in yii based application , works great, there no problems swiftmailer extension wrapper. want utilize smpt transport authenticate users in application against mail service server. code i'm using:

$sm = yii::app()->swiftmailer; $mailhost = 'xxx'; $mailport = xxx; // new transport $transport = $sm->smtptransport($mailhost, $mailport); $transport->setusername($username); $transport->setpassword($password); $transport->start(); if($transport->isstarted()){ // authenticated; }else{ // error; } $transport->stop();

this isn't working. when set real login credentials instantly logs in. when type wrong ones, spends time @ lastly logs in too. don't know why happens because when using real credentials swiftmailer can send emails. i'm using right api functions? i'm doing wrong?

looking @ the source, when phone call start(), started set true.

i'm not familiar switfmailer, looks you'll want check results of authenticate()

authentication yii smtp swiftmailer

php - confusion with the term openssl_private_encrypt -



php - confusion with the term openssl_private_encrypt -

in encryption, utilize public key of receiver, why "private" term in function? seems contradictory or confused me.

when utilize private key, signing something. looks function give same result openssl_sign(), tried both , gave me different output.

because function openssl_private_encrypt has "private" , "encrypt", don't know if encrypting or signing. function for?

generally openssl encrypt private key method used provide specific ssl method of signature generation:

concatenating outputs multiple hash functions provides collision resistance strongest of algorithms included in concatenated result. example, older versions of tls/ssl utilize concatenated md5 , sha-1 sums; ensures method find collisions in 1 of functions doesn't allow forging traffic protected both functions.

source: see wikipedia page cryptographic hash function , concatenation of cryptographic hash functions.

as libraries don't provide signature format (and since ssl version of signature not utilize embedded asn.1 construction around hashes) implemented of time using encrypt function instead. difference experiencing missing asn.1 construction (see pkcs#1 v2.1 standard see asn.1 construction i'm talking about).

you can place pretty bet on uses pkcs#1 padding signatures instead of padding used encryption. and, indicated, won't contain asn.1 construction or hash, instead utilize given set given info in place of asn.1 structure.

it not recommended utilize function outside back upwards existing (deprecated) protocols. if utilize encryption purposes will create vulnerable kinds of attacks, please don't create mistake.

php encryption sign

javascript - How to wait until the completion of asynchronous steps? -



javascript - How to wait until the completion of asynchronous steps? -

i have form need run number of validation actions before submitting. these actions involve asynchronous steps ajax calls.

how can tell form wait until validation actions have been completed before submitting?

my validation function looks (pseudo-code):

function presubmit() { // validate field 1 ajax({ ... onsuccess:... }); // validate field 2 ajax({ ... onsuccess:... }); // fields 3, 4, etc. }

my current issue form gets submitted before onsuccess callbacks completed.

i of course of study create ajax calls synchronous, trying avoid because of performance impact.

if you're using jquery, might want consider jquery.deferred or promise

you phone call each ajax request (or function contains request), when previous phone call finish (successfully or failed).

if utilize $.when can manage failed request .then callback. if utilize promises can create utilize .done .fail , .always callbacks in various scenarios.

$.when($.ajax("...."), $.ajax("....")) .then(...);

resources:

http://joseoncode.com/2011/09/26/a-walkthrough-jquery-deferred-and-promise/ http://api.jquery.com/jquery.when/ http://api.jquery.com/promise/

javascript forms validation submit

java - jface/swt Tree refresh issue on Windows XP -



java - jface/swt Tree refresh issue on Windows XP -

i have desktop application built on swt. have tree enclosed in scrolledcomposite. piece of code in application supposed refresh ui component.

atreeviewer.setinput(this.items) //items array list of relevant objects

but behaves weirdly on windows xp , windows 7. in win xp, returns hard arrayindexoutofbounds exception affects behavior of application.

java.lang.arrayindexoutofboundsexception: 46 @ org.eclipse.swt.widgets.tree._getitem(tree.java:254) @ org.eclipse.swt.widgets.tree._getitem(tree.java:248) @ org.eclipse.swt.widgets.tree.findcell(tree.java:2703) @ org.eclipse.swt.widgets.tree.wm_mousemove(tree.java:6806) @ org.eclipse.swt.widgets.control.windowproc(control.java:4575) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4989) @ org.eclipse.swt.internal.win32.os.dispatchmessagew(native method) @ org.eclipse.swt.internal.win32.os.dispatchmessage(os.java:2546) @ org.eclipse.swt.widgets.display.readanddispatch(display.java:3756)

whereas on win 7, appears homecoming swt layer message seems runtimeexception prints on eclipse console in no way effects behavior of application. meaning, application working fine.

ignored reentrant phone call while viewer busy. logged 1 time per viewer instance, similar calls still ignored. java.lang.runtimeexception @ org.eclipse.jface.viewers.columnviewer.checkbusy(columnviewer.java:763) @ org.eclipse.jface.viewers.columnviewer.refresh(columnviewer.java:541) @ org.eclipse.jface.viewers.structuredviewer.refresh(structuredviewer.java:1490) @ com.sxsy.smtj.ui.cw.widgets.ewlist.basicrefresh(ewlist.java:86) @ com.sxsy.smtj.ui.cw.widgets.ewtablelist.basicrefresh(ewtablelist.java:75) @ com.sxsy.smtj.ui.cw.widgets.ewlist.refresh(ewlist.java:402) @ com.sxsy.smtj.ui.cw.widgets.ewtablelist.columnschanged(ewtablelist.java:115) @ com.sxsy.smtj.ui.cw.widgets.ewtablecolumn.updatewidget(ewtablecolumn.java:377) @ com.sxsy.smtj.ui.cw.widgets.ewtablecolumn.width(ewtablecolumn.java:407) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.doautosizecolumns(wktablewidget.java:244) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.autosizecolumns(wktablewidget.java:87) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.processresizedevent(wktablewidget.java:437) @ com.sxsy.smtj.ui.cw.widgets.ewlist$3.controlresized(ewlist.java:449) @ org.eclipse.swt.widgets.typedlistener.handleevent(typedlistener.java:235) @ org.eclipse.swt.widgets.eventtable.sendevent(eventtable.java:84) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1053) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1077) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1058) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5795) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.defwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.defwindowproc(os.java:2541) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1442) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5859) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.setscrollinfo(native method) @ org.eclipse.swt.widgets.tree.updatescrollbar(tree.java:5660) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1589) @ org.eclipse.swt.widgets.scrollable.wm_size(scrollable.java:316) @ org.eclipse.swt.widgets.composite.wm_size(composite.java:1662) @ org.eclipse.swt.widgets.tree.wm_size(tree.java:7137) @ org.eclipse.swt.widgets.control.windowproc(control.java:4603) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.callwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.callwindowproc(os.java:2440) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1534) @ org.eclipse.swt.widgets.control.wm_windowposchanged(control.java:5408) @ org.eclipse.swt.widgets.control.windowproc(control.java:4616) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.showscrollbar(native method) @ org.eclipse.swt.widgets.tree.wm_size(tree.java:7124) @ org.eclipse.swt.widgets.control.windowproc(control.java:4603) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.callwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.callwindowproc(os.java:2440) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1534) @ org.eclipse.swt.widgets.control.wm_windowposchanged(control.java:5408) @ org.eclipse.swt.widgets.control.windowproc(control.java:4616) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.callwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.callwindowproc(os.java:2440) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1534) @ org.eclipse.swt.widgets.control.windowproc(control.java:4623) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.sendmessagew(native method) @ org.eclipse.swt.internal.win32.os.sendmessage(os.java:3385) @ org.eclipse.swt.widgets.tree.createitem(tree.java:2104) @ org.eclipse.swt.widgets.treeitem.<init>(treeitem.java:203) @ org.eclipse.swt.widgets.treeitem.<init>(treeitem.java:91) @ org.eclipse.jface.viewers.treeviewer.createnewrowpart(treeviewer.java:809) @ org.eclipse.jface.viewers.treeviewer.newitem(treeviewer.java:315) @ org.eclipse.jface.viewers.abstracttreeviewer.createtreeitem(abstracttreeviewer.java:847) @ org.eclipse.jface.viewers.abstracttreeviewer$1.run(abstracttreeviewer.java:823) @ org.eclipse.swt.custom.busyindicator.showwhile(busyindicator.java:70) @ org.eclipse.jface.viewers.abstracttreeviewer.createchildren(abstracttreeviewer.java:797) @ org.eclipse.jface.viewers.treeviewer.createchildren(treeviewer.java:644) @ org.eclipse.jface.viewers.abstracttreeviewer.createchildren(abstracttreeviewer.java:768) @ org.eclipse.jface.viewers.abstracttreeviewer.internalinitializetree(abstracttreeviewer.java:1548) @ org.eclipse.jface.viewers.treeviewer.internalinitializetree(treeviewer.java:833) @ org.eclipse.jface.viewers.abstracttreeviewer$5.run(abstracttreeviewer.java:1532) @ org.eclipse.jface.viewers.structuredviewer.preservingselection(structuredviewer.java:1443) @ org.eclipse.jface.viewers.treeviewer.preservingselection(treeviewer.java:403) @ org.eclipse.jface.viewers.structuredviewer.preservingselection(structuredviewer.java:1404) @ org.eclipse.jface.viewers.abstracttreeviewer.inputchanged(abstracttreeviewer.java:1525) @ org.eclipse.jface.viewers.contentviewer.setinput(contentviewer.java:280) @ org.eclipse.jface.viewers.structuredviewer.setinput(structuredviewer.java:1690) @ com.sxsy.smtj.ui.cw.widgets.ewlist.refreshitems(ewlist.java:439) @ com.sxsy.smtj.ui.cw.widgets.ewtablelist.refreshitems(ewtablelist.java:514) @ com.sxsy.smtj.ui.cw.widgets.ewtabletree.refreshitems(ewtabletree.java:275) @ com.sxsy.smtj.ui.cw.widgets.ewlist.itemshavechanged(ewlist.java:345) @ com.sxsy.smtj.ui.cw.widgets.ewlinearlist.itemshavechanged(ewlinearlist.java:200) @ com.sxsy.smtj.ui.cw.widgets.ewlist.setitems(ewlist.java:549) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.setitems(wktablewidget.java:467) @ com.sxsy.smtj.ui.abt.widgets.compatibility.extendedlist.widgetsetitems(extendedlist.java:574) @ com.sxsy.smtj.ui.abt.widgets.compatibility.extendedlist.setitems(extendedlist.java:479) @ com.sxsy.smtj.ui.wk.table.compatibility.wktablewidgetview.setitems(wktablewidgetview.java:645) @ com.misys.liq.ui.collateral.liqcollateralagreementtypedefinitioncontroller.updateattributegrid(liqcollateralagreementtypedefinitioncontroller.java:1712) @ com.misys.liq.ui.collateral.liqcollateralagreementtypedefinitioncontroller.showcoreattributes(liqcollateralagreementtypedefinitioncontroller.java:1730) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ com.sxsy.smtj.utilities.reflectionutility.invoke(reflectionutility.java:754) @ com.sxsy.smtj.utilities.reflectionutility.directperform(reflectionutility.java:740) @ com.sxsy.smtj.utilities.reflectionutility.perform(reflectionutility.java:605) @ com.sxsy.smtj.compatibility.va.kernel.core.directedmessage.performaction(directedmessage.java:106) @ com.misys.liq.infrastructure.eventobservablesupport.signalevent(eventobservablesupport.java:21) @ com.sxsy.smtj.ui.abt.observableobject.primsignalevent(observableobject.java:324) @ com.sxsy.smtj.ui.abt.observableobject.signalevent(observableobject.java:398) @ com.sxsy.smtj.ui.abt.widgets.compatibility.basicview.signalevent(basicview.java:1879) @ com.sxsy.smtj.ui.abt.widgets.compatibility.togglebuttonview$2.widgetselected(togglebuttonview.java:316) @ org.eclipse.swt.widgets.typedlistener.handleevent(typedlistener.java:248) @ org.eclipse.swt.widgets.eventtable.sendevent(eventtable.java:84) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1053) @ org.eclipse.swt.widgets.display.rundeferredevents(display.java:4169) @ org.eclipse.swt.widgets.display.readanddispatch(display.java:3758) @ com.misys.liq.loaniq$13.value(loaniq.java:676) @ com.sxsy.smtj.exceptions.exceptionutility.whendo(exceptionutility.java:99) @ com.misys.liq.loaniq.standardliqeventloop(loaniq.java:693) @ com.misys.liq.loaniq.desktoptestmanuallogin(loaniq.java:924) @ com.misys.liq.loaniq.mainclassic(loaniq.java:589) @ com.misys.liq.loaniq.main(loaniq.java:309)

the first thing struck mind wrap ui logic within display.asyncexec's runnable , thereby able prepare weird behavior in win xp.

although, have no clue has happened within internals or if prepare right. nice if had experienced kind of swt weirdness throw lite on this.

this swt/jface bug. workaround issue set items null before setting actual object.

atreeviewer.setinput(null); atreeviewer.setinput(this.items);

java swt jface

android - Custom ListView doesn't save it's state -



android - Custom ListView doesn't save it's state -

i using standart android listview simle_list_item_multiple_choice item layout , custom adapter. saved it's stated on pause , restored on resume. after few days of working on i've implemented sectionindexer, stickylistheadersadapter interface within adapter , changed listview stickylistheaderslistview this library. there other changes in application these attached listview. when application resumes working listview coming scrolled begining , items unchecked. i've tryed remove sectionindexer interface , sticky headers back upwards had no effect. maybe there hidden options of listview need enable?

(tried savestate property - no effect)

public class wordadapter extends arrayadapter<word> implements sectionindexer, stickylistheadersadapter{ // ----------------------------------------------------------------------- // // fields // // ----------------------------------------------------------------------- private int mresid; private list<word> mlist; private string[] msectionnames; private stickylistheaderslistview mlistview; private int[] msectionindexes; private boolean mheadersenabled; // ----------------------------------------------------------------------- // // constructor // // ----------------------------------------------------------------------- public wordadapter(context context, stickylistheaderslistview listview, int resid, list<word> list, string[] sectionnames, int[] sectionindexes, boolean enableheaders) { super(context, resid, list); mresid = resid; mlist = list; mlistview = listview; msectionindexes = sectionindexes; msectionnames = sectionnames; mheadersenabled = enableheaders; } @override public view getview(int position, view convertview, viewgroup parent) { viewholder holder; if (convertview == null) { convertview = layoutinflater.from(getcontext()).inflate(mresid, parent, false); holder = new viewholder(); holder.root = convertview; holder.textview = (textview) convertview.findviewbyid(android.r.id.text1); holder.checkbox = (checkbox) convertview.findviewbyid(android.r.id.checkbox); convertview.settag(holder); } holder = (viewholder) convertview.gettag(); holder.textview.settext(getitem(position).getvalue()); if(mlistview.isitemchecked(position)) holder.root.setbackgroundcolor(getcontext().getresources().getcolor(r.color.highlight)); else holder.root.setbackgroundcolor(getcontext().getresources().getcolor(android.r.color.transparent)); homecoming convertview; } @override public view getheaderview(int position, view convertview, viewgroup parent) { if(!mheadersenabled) homecoming new view(getcontext()); headerviewholder holder; if (convertview == null) { holder = new headerviewholder(); convertview = layoutinflater.from(getcontext()).inflate(r.layout.list_item_header, parent, false); holder.labelview = (textview) convertview.findviewbyid(r.id.list_item_header_label); convertview.settag(holder); } else { holder = (headerviewholder) convertview.gettag(); } string label; if(msectionnames != null){ label = msectionnames[getsectionforposition(position)]; holder.labelview.settext(label); } homecoming convertview; } @override public long getheaderid(int position) { long result = getsectionforposition(position); homecoming result; } @override public int getpositionforsection(int section) { homecoming (msectionindexes == null || section < 0 ) ? 0 : (section == msectionindexes.length ? mlist.size():msectionindexes[section]); } @override public int getsectionforposition(int position) { if(msectionindexes != null && position >= msectionindexes[0]) { for(int = 0; < msectionindexes.length; ++i) if(position < msectionindexes[i]) homecoming i-1; homecoming (msectionindexes.length - 1); } homecoming 0; } @override public object[] getsections() { homecoming msectionnames == null ? new object[0] : msectionnames; } // ------------------------------------------------------------------------------- // // internal classes // // ------------------------------------------------------------------------------- private static class viewholder { public view root; public textview textview; public checkbox checkbox; } private static class headerviewholder { public textview labelview; }

here adapter code.

android listview savestate custom-adapter custom-lists

c# - How convert some value to json by Newtonsoft? -



c# - How convert some value to json by Newtonsoft? -

i have code homecoming "datatable ","datatable" content idstudent , avg , firstname ,namecourse , date, "datatable" content more row .

datatable row = mn.selectprogram("programstudent", attributes); jsontrans responce = new jsontrans(); responce.convert(row); //if (row.rows.count != 0) //{ // foreach (datarow result in row.rows) // { // string idstudent = result["id"].tostring(); // string avgstudent = result["avg"].tostring(); // string firstname = result["fname"].tostring(); // string date = result["date"].tostring(); // string namecourse = result["name"].tostring(); // } //}

i seek :

public string convert(datatable row) { stringbuilder sb = new stringbuilder(); stringwriter sw = new stringwriter(sb); jsonwriter jsonwriter = new jsontextwriter(sw); jsonwriter.formatting = formatting.indented; jsonwriter.writestartarray(); if (row.rows.count != 0) { foreach (datarow result in row.rows) { jsonwriter.writestartobject(); string idstudent = result["id"].tostring(); jsonwriter.writepropertyname("id"); jsonwriter.writevalue(idstudent); jsonwriter.writeendobject(); } } jsonwriter.writeendarray(); jsonwriter.close(); sw.close();

how can convert row json :

[ {idstudent:"value" ,avg :"value" , avg : "value",firstname :"value"} {idstudent:"value" ,avg :"value" , avg : "value",firstname :"value"} {idstudent:"value" ,avg :"value" , avg : "value",firstname :"value"} ]

it looks code close you're trying accomplish. if want every column nowadays in datarows, foreach loop should iterate through of table's columns. (note have changed datatable name here table clarity, , datarow name row.)

foreach (datarow row in table.rows) { jsonwriter.writestartobject(); foreach (datacolumn col in table.columns) { jsonwriter.writepropertyname(col.columnname); jsonwriter.writevalue((row[col.columnname] == null) ? string.empty : row[col.columnname].tostring()); } jsonwriter.writeendobject(); }

note illustration write out empty strings source info null. if want leave null values out entirely, perform check (row[col.columnname] == null) prior writing property name , value.

c# json

jquery - open new window to print element -



jquery - open new window to print element -

try open new window include element print only. did not work in ie8.

function printelement(elementid) { var printwindow = window.open('', '_blank', 'status=0,toolbar=0,location=0,menubar=1,resizable=1,scrollbars=1'); printwindow.document.write("<html><head></head><body></body></html>"); var head = jquery('head').clone(); var printelement = jquery('#' + elementid).clone(); jquery(printwindow.document).find('head').replacewith(head); // not work in ie8 var body = jquery(printwindow.document).find('body'); body.empty(); body.append(printelement); // not work in ie8 homecoming false; }

thanks help.

how this? if understand you're wanting correctly, should work you. tested in ie 8.

working illustration on jsbin.

html:

<a href="#" id="one" class="trigger">print one</a> <a href="#" id="two" class="trigger">print two</a>

javascript:

var $trigger = $(".trigger"), printelement = function(id) { var printwindow = window.open('','_blank','status=0,toolbar=0,location=0,menubar=1,resizable=1,scrollbars=1'), html = $('html').clone(), printelement = $('#' + id).clone(), body; printwindow.document.write("<!doctype html><head></head><body></body></html>"); $(printwindow.document).find('html') .replacewith(html); body = $(printwindow.document).find('body') .html(printelement); }; $trigger.on("click", function(e) { var id = $(this).attr("id"); e.preventdefault(); printelement(id); });

jquery printing replace append

web deployment - MSBuild Web Deploy not updating connection strings -



web deployment - MSBuild Web Deploy not updating connection strings -

i trying deployment process , running on production server. using web deploy , publish profiles accomplish this, , have working correctly, apart updating of connection strings suit production server.

i using:

msbuild myproj.csproj /p:deployonbuild=true;publishprofile=myprofile;configuration=release

to create publish package, , the:

call myproj.deploy.cmd /y /m:http://myserver/msdeployagentservice -allowuntrusted /u:user /:password

so working, packages , sends server fine, , configures iis correctly, points wrong database.

my publishing profile looks like:

<?xml version="1.0" encoding="utf-8"?> <project toolsversion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <propertygroup> <webpublishmethod>msdeploy</webpublishmethod> <siteurltolaunchafterpublish /> <msdeployserviceurl>http://myserver</msdeployserviceurl> <deployiisapppath>website</deployiisapppath> <remotesitephysicalpath /> <skipextrafilesonserver>true</skipextrafilesonserver> <msdeploypublishmethod>remoteagent</msdeploypublishmethod> <username>user</username> <_savepwd>true</_savepwd> <publishdatabasesettings> <objects xmlns=""> <objectgroup name="dbcontext" order="1" enabled="false"> <destination path="data source=server;initial catalog=productiondb;user id=user;password=&quot;password&quot;" name="" /> <object type="dbcodefirst"> <source path="dbmigration" dbcontext="myproj.repositories.dbcontext, myproj.repositories" migrationconfiguration="myproj.repositories.migrations.configuration, myproj.repositories" origin="configuration" /> </object> </objectgroup> <objectgroup name="defaultconnection" order="2" enabled="false"> <destination path="data source=server;initial catalog=productiondb;user id=user;password=&quot;password&quot;" name="" /> <object type="dbdacfx"> <presource path="data source=localhost;initial catalog=devdb;user id=user;password=&quot;password&quot;" includedata="false" /> <source path="$(intermediateoutputpath)autoscripts\defaultconnection_incrementalschemaonly.dacpac" dacpacaction="deploy" /> </object> <updatefrom type="web.config"> <source matchvalue="data source=localhost;initial catalog=devdb;user id=user;password=password" matchattributes="$(updatefromconnectionstringattributes)" /> </updatefrom> </objectgroup> </objects> </publishdatabasesettings> </propertygroup> <itemgroup> <msdeployparametervalue include="$(deployparameterprefix)dbcontext-web.config connection string"> <parametervalue> info source=server;initial catalog=productiondb;user id=user;password="password"</parametervalue> </msdeployparametervalue> <msdeployparametervalue include="$(deployparameterprefix)defaultconnection-web.config connection string"> <parametervalue>data source=server;initial catalog=productiondb;user id=user;password="password"</parametervalue> </msdeployparametervalue> </itemgroup> </project>

annoyingly works fine when publishing straight vs2012, not via command line. there switch or alternative missing msbuild phone call maybe?

it not working correctly in myproj.setparameters.xml file, connection strings shown in there wrong. if manually alter these right connection strings, web.xml file right on production server 1 time deployed. how right string setparameters file? help appreciated.

in end around this, in visual studio created parameters.xml file in root of project holds values of connection strings used on production server. these picked , used instead of default values.

the parameters.xml file looks like:

<?xml version="1.0" encoding="utf-8" ?> <parameters> <parameter name="defaultconnection-web.config connection string" description="" defaultvalue=""tags="" />

just add together many require , populate attributes required

msbuild web-deployment publishing msdeploy webdeploy

php - Save file location on upload -



php - Save file location on upload -

i having problem uploading file in php. need save file's location in db, won't work. also, want rename file equal timestamp + user's name. have users name stored in variable.

most importantly though, how post file's location db?

edit

right now, i'm getting file upload folder on server, can't save file's location string on db. want able reference file later, don't know how save file's location later use.

$ext_img_2 = end(explode(".", $_files["img_2"]["name"])); if ((($_files["img_2"]["type"] == "image/gif") || ($_files["img_2"]["type"] == "image/jpeg") || ($_files["img_2"]["type"] == "image/png") || ($_files["img_2"]["type"] == "image/pjpeg")) && ($_files["img_2"]["size"] < 6291456) && in_array($ext_img_2, $allowedexts)) { if ($_files["img_2"]["error"] > 0) { echo "return code: " . $_files["img_2"]["error"] . "<br>"; } else { if (file_exists("adimg2/" . $_files["img_2"]["name"])) { echo $_files["img_2"]["name"] . " exists. " . "<br>"; } else { move_uploaded_file($_files["img_2"]["tmp_name"], "adimg2/" . $_files["img_2"]["name"]); mysql_query("insert info (img_2) values ('adimg1/".$_files['img_1']['name']."')"; echo "stored in: " . "adimg2/" . $_files["img_2"]["name"] . "<br>"; } } } else { echo "invalid file" . "<br>"; }

i recommend utilize unique name uploaded file (with function uniqid http://php.net/manual/fr/function.uniqid.php ) , utilize original file extention if needed. illustration :

$name = uniqid() . '.' . pathinfo($filename, pathinfo_extension); $name = time() . '.' . pathinfo($filename, pathinfo_extension); // timestamp

then, perform tour tests , :

$path = 'uploadedfilesdir/' . $name; move_uploaded_file($_files["img_2"]["tmp_name"], $path); mysql_query('insert data(...) values ("' . $path . '")');

simple (pay attending directory rights, php may not able write in directory).

php post upload

"Error generating the Discovery document for this api" when trying to build a drive service, starting 2/14/2013 -



"Error generating the Discovery document for this api" when trying to build a drive service, starting 2/14/2013 -

i intermittently getting error when calling build on drive service. able reproduce simple programme has json credentials stored file.

#!/usr/bin/python import httplib2 import sys apiclient.discovery import build oauth2client.client import credentials json_creds = open('creds.txt', 'r').read() creds = credentials.new_from_json(json_creds) http = httplib2.http() http = creds.authorize(http) try: drive_service = build('drive', 'v2', http=http) except exception: sys.exit(-1)

when run in loop, seeing rather high number of errors, code in loop fails 15-25% of time me.

i=0; while [ $i -lt 100 ]; python jsoncred.py || echo fail ; i=$(( $i + 1 )); done | grep fail | wc -l

now when take same code, , replace 'drive' 'oauth2', code runs without problems

i have confirmed oauth token using valid , have right scopes:

"expires_in": 2258,

"scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/userinfo.email",

looking @ app logs, seems have started 2/14/2013 1pm pst. did not force new code, wonder if problem api. there bug in api causing ?

google seeing reports of increased error rates discovery document. please retry on 500 error now, , should successful.

one argue should have retry logic phone call anyway, since practice, current levels high, so, sorry that.

update: should fixed.

google-drive-sdk

java - Null pointer exception when changing int in another class -



java - Null pointer exception when changing int in another class -

ive looked , looked , cant find answer. here issue. wanting alter int in class based on ticks in main game class. here code:

trace:

02-16 02:10:58.605: w/dalvikvm(1578): threadid=13: thread exiting uncaught exception (group=0x40c5ca68) 02-16 02:10:58.615: e/androidruntime(1578): fatal exception: thread-16720 02-16 02:10:58.615: e/androidruntime(1578): java.lang.nullpointerexception 02-16 02:10:58.615: e/androidruntime(1578): @ com.mojang.ld22.game.tick(game.java:374) 02-16 02:10:58.615: e/androidruntime(1578): @ com.mojang.ld22.game.iterate(game.java:300) 02-16 02:10:58.615: e/androidruntime(1578): @ com.mojang.ld22.gameactivity$4.run(gameactivity.java:136) 02-16 02:10:58.615: e/androidruntime(1578): @ java.lang.thread.run(thread.java:856)

game.java snippet

public void tick() { tickcount++; ... ... ... if (tickcount % 1000 == 0) { if (rising) { lightlvl++; error here clock.time++; <----------- if (lightlvl >= 8) { rising = false; } } else { lightlvl--; line 374 ----------> clock.time--; <------------ if (lightlvl <= -2) rising = true; } } } }

and clock.java

bundle com.mojang.ld22.entity; import com.mojang.ld22.crafting.crafting; import com.mojang.ld22.entity.particle.textparticle; import com.mojang.ld22.entity.particle.timeclock; import com.mojang.ld22.gfx.color; import com.mojang.ld22.gfx.screen; import com.mojang.ld22.screen.craftingmenu; import com.mojang.ld22.item.furnitureitem; public class clock extends piece of furniture { /** * */ private static final long serialversionuid = 3146189783597003582l; player player; public int time = 0; public int clock = 1; public boolean rising = false; public clock() { super("clock"); col = color.get(-1, 100, 321, 431); sprite = 10; xr = 3; yr = 2; } @override public void tick(){ if (time <= 0) clock = 1; if (time == 1) clock = 1; if (time == 2) clock = 2; if (time == 3) clock = 3; if (time == 4) clock = 4; if (time == 5) clock = 5; if (time == 6) clock = 6; if (time == 7) clock = 7; if (time == 8); clock = 8; } @override public void render(screen screen){ int col = color.get(-1, 531, 000, 534); //incorrect times todo if (clock == 8) screen.render(x - 8, y - 8, 7 + 11 * 32, col, 0); if (clock == 6) screen.render(x - 8, y - 8, 8 + 11 * 32, col, 0); //noon midnight if (clock == 5) screen.render(x - 8, y - 8, 9 + 11 * 32, col, 0); if (clock == 4) screen.render(x - 8, y - 8, 10 + 11 * 32, col, 0); //before noon after noon if (clock == 3) screen.render(x - 8, y - 8, 11 + 11 * 32, col, 0); if (clock == 2) screen.render(x - 8, y - 8, 12 + 11 * 32, col, 0); //730pm 530pm if (clock == 1) screen.render(x - 8, y - 8, 13 + 11 * 32, col, 0); if (clock == -1) screen.render(x - 8, y - 8, 14 + 11 * 32, col, 0); } }

and yes isn't pretty. tried when couldn't pull int game.java clock.java test sending it. cant utilize separate ticks because clock.java isn't created until player pulls his/her inventory.

i hope makes since. can supply more code if need it.

rising false, else branch executed , clock null, throws nullpointerexception.

by way, write tick method this:

public void tick(){ if (time <= 0) clock = 1; else if (time <= 8) clock = time; }

java android nullpointerexception int

c# - Data Source setting in Connection String -



c# - Data Source setting in Connection String -

consider these 2 connection strings different info source settings:

data source=oem-pc\sqlexpress;initial catalog=<databasename>; integrated security=false;persist security info=false; user id=<userid>;password=<password>;connect timeout=30 info source=.;initial catalog=<databasename>; integrated security=false;persist security info=false; user id=<userid>;password=<password>;connect timeout=30

why when utilize first, thrown error

login failed user reason: effort login using sql authentication failed. server configured windows authentication only. [client: ]

i'm using sql server 2008 express , server configured mixed authentication , i've tripled check using

(a) master.dbo.xp_instance_regread, (b) serverproperty() and (c) master.sys.xp_loginconfig.

also, enabling sa login doesn't create difference.

let me know if additional info required. thanks.

sounds have several different instances of sql server installed.

the default 1 (also accessed using .) has sql authentication setup , enabled, sqlexpress instance doesn't.

use sql server configuration manager find out instances have , configure them correctly.

c# sql-server-2008 connection-string

Android Alert Dialog help to customize for API >=8 -



Android Alert Dialog help to customize for API >=8 -

hiee guys, need create alertdialog :

for api >=8.

please allow me know how go it. , possible create android versions>=8

help appreciated. give thanks you.

here how can want using dialog.

dialog dialog = new dialog(fingerpaintactivity.this, android.r.style.theme_light_panel); dialog.requestwindowfeature(window.feature_no_title); // no title dialog.getwindow().getattributes().windowanimations = r.style.pausedialoganimation; // used custom animation when dialog showing , hiding dialog.setcontentview(getlayoutinflater().inflate(r.layout.mycustomlayout, null)); // here custom layout dialog.getwindow().setlayout(width-50, (height-100)); // set height / width dialog.show();

the layout have add together r.layout.mycustomlayout , after can views declared in layout shown below (for illustration button):

button myokbtn = (button) dialog.findviewbyid(r.id.myokbtn); myokbtn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { } });

and that's all.

p.s. can see have things added custom animations while dialog opening , closed , width , height.

android api android-alertdialog

javascript - Why is jQuery not seting my select to the selected value -



javascript - Why is jQuery not seting my select to the selected value -

i have standard select turned combobox using jquery.

<select name="searchby" id="searchby"> <option value="all" >all departments</option> <option value="music" >music</option> <option value="dvd" >dvd</option> <option value="bluray" >bluray</option> <option value="artist" >artist</option> </select>

then have input has jquery's autocomplete on categories. when person types input, returns options take in different categories. if click on alternative want alter selected in select above. here code tried.

$("#search").catcomplete({ delay: 1000, source: "drop_down_search.php", select: function(event, ui) { if (ui.item.category = 'artist') { $('#searchby').val('artist'); console.log(ui.item.category); } } });

the console logging working , posts correctly search results page doesn't alter before move off page. stays 'all departments'. need alter person searching can see search 'artist' or 'blu-rays' before move search results page.

edit:

ok turns out without jquery combobox set on select alter value, when utilize jquery's combobox doesn't change.

what should using alter value 1 time select has been changed combobox?

here combobox code:

(function( $ ) { $.widget( "ui.combobox", { _create: function() { var input, = this, wasopen = false, select = this.element.hide(), selected = select.children( ":selected" ), value = selected.val() ? selected.text() : "", wrapper = this.wrapper = $( "<span>" ) .addclass( "ui-combobox" ) .insertafter( select ); function removeifinvalid( element ) { var value = $( element ).val(), matcher = new regexp( "^" + $.ui.autocomplete.escaperegex( value ) + "$", "i" ), valid = false; select.children( "option" ).each(function() { if ( $( ).text().match( matcher ) ) { this.selected = valid = true; homecoming false; } }); if ( !valid ) { // remove invalid value, didn't match $( element ) .val( "" ) .attr( "title", value + " didn't match item" ) .tooltip( "open" ); select.val( "" ); settimeout(function() { input.tooltip( "close" ).attr( "title", "" ); }, 2500 ); input.data( "ui-autocomplete" ).term = ""; } } input = $( "<input>" ) .appendto( wrapper ) .val( value ) .attr( "title", "" ) .addclass( "ui-state-default ui-combobox-input" ) .autocomplete({ delay: 0, minlength: 0, source: function( request, response ) { var matcher = new regexp( $.ui.autocomplete.escaperegex(request.term), "i" ); response( select.children( "option" ).map(function() { var text = $( ).text(); if ( this.value && ( !request.term || matcher.test(text) ) ) homecoming { label: text.replace( new regexp( "(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escaperegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi" ), "<strong>$1</strong>" ), value: text, option: }; }) ); }, select: function( event, ui ) { ui.item.option.selected = true; that._trigger( "selected", event, { item: ui.item.option }); }, change: function( event, ui ) { if ( !ui.item ) { removeifinvalid( ); } } }) .addclass( "ui-widget ui-widget-content ui-corner-left" ); input.data( "ui-autocomplete" )._renderitem = function( ul, item ) { homecoming $( "<li>" ) .append( "<a>" + item.label + "</a>" ) .appendto( ul ); }; $( "<a>" ) .attr( "tabindex", -1 ) .attr( "title", "select critera search in " ) .appendto( wrapper ) .button({ icons: { primary: "ui-icon-triangle-1-s" }, text: false }) .removeclass( "ui-corner-all" ) .addclass( "ui-corner-right ui-combobox-toggle" ) .mousedown(function() { wasopen = input.autocomplete( "widget" ).is( ":visible" ); }) .click(function() { input.focus(); // close if visible if ( wasopen ) { return; } // pass empty string value search for, displaying results input.autocomplete( "search", "" ); }); }, _destroy: function() { this.wrapper.remove(); this.element.show(); } }); })( jquery ); $(function() { $( "#searchby" ).combobox(); $( "#toggle" ).click(function() { $( "#searchby" ).toggle(); }); });

mistake found..

$( "#search" ).catcomplete({ delay: 1000, source: "drop_down_search.php", select: function( event, ui ) { if (ui.item.category == 'artist') { -----^^-- missing `=` in if since comparing $('#searchby').val('artist'); console.log(ui.item.category); } } }); //}); brakets..

javascript jquery jquery-ui jquery-autocomplete html-select

Browser cache effect on coldfusion login -



Browser cache effect on coldfusion login -

i have code has been in production environment past 2 years no issues, lastly week our hosting company downwards 2 days, , when server got online, our application started having particular issue.

this issue when seek login, bring login page no errors. submitted troble ticket , asked clear browser cache. cleared cache , application started working again.

is there no other way resolve issue without clearing browser cache?

i have tried several method, have used

<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" />

and used

<cflocation url="index.cfm" addtoken="yes">

please see code application.cfc

<cfcomponent> <cfset this.name = "some_app"> <cfset this.applicationtimeout = createtimespan(0,9,0,0)> <cfset this.clientmanagement= "yes"> <cfset this.clientstorage = "registry"><!--- formally cookie, changed registry, no alter ---> <cfset this.loginstorage = "session" > <cfset this.sessionmanagement = "yes"> <cfset this.sessiontimeout = createtimespan(0,4,0,0)> <cfset this.setclientcookies = "yes"> <cfset this.setdomaincookies = "yes"> <cfset this.scriptprotect = "all"> <cfset this.datasource = "some_dsn"> <cffunction name="onapplicationstart" output="false"> <cfset application.scriptprotect = "all"> <cfset application.sessions = 0> <cfset application.surportmail = "support@some_app.com"> <cfset application.site.url = "http://some_app.com/"/> <cfset application.com.employee = createobject("component","com.user.employee").init()/> <cfset application.com.appraisal = createobject("component","com.appraisal").init()/> <cfset application.com.security = createobject("component","com.system.login").init()/> <cfset application.com.log = createobject("component","com.adexfe.portal.system.log").init()/> <cfset application.com.temp = createobject("component","com.adexfe.portal.temp").init()/> <cfset application.com.util.security = createobject("component","com.adexfe.util.security").init()/> <cfset application.com.security.url = application.site.url/> </cffunction> <cffunction name="onapplicationend" output="false"> <cfargument name="applicationscope" required="true"> </cffunction> <cffunction name="onrequeststart"> <cfargument name="requestname" required=true/> <cflock type="exclusive" scope="session" timeout="10"> <cfparam name="session.islogin" default="false" type="boolean" /> <cfparam name="session.userinfo" default="" /> </cflock> <cflock type="readonly" scope="session" timeout="40"> <cfset request.islogin = session.islogin> <cfset request.userinfo = session.userinfo> </cflock> <!--- check login here ---> <cfif not request.islogin , listlast(cgi.script_name,'/') neq "login.cfm" , listlast(cgi.script_name,'/') neq "forget.cfm"> <cflocation url="login.cfm" addtoken="no"> </cfif> <cfset application.com.security.url = application.site.url/> <cfset request.security = application.com.util.security/> <cfparam name="url.bp" default="#request.security.urlencrypt('bp=home')#"/> <cfset url.bpr = url.bp/> <cfif listfirst(url.bp,'=') eq 'h'> <cfset request.aurl = request.security.urldecrypt(listlast(url.bp,'='))/> <cfelse> <cfset request.aurl.bp = url.bp/> </cfif> <cfset request.aurl.bp = replace(request.aurl.bp,'.','/','all')> </cffunction> </cfcomponent>

login.cfm code:

<html> <head> <title>login</title> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link href="assets/css/reset.css" rel="stylesheet" type="text/css" /> <link href="assets/css/login.css" rel="stylesheet" type="text/css" /> <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td width="50%" align="right"><br /> <img src="assets/img/logo-b.jpg" width="445" height="164" /></td> <td><span class="label"> <img src="assets/img/comp_logo.gif" vspace="100" hspace="50" /></span></td></tr> </table> <cfform name="login"> <table width="300" border="0" align="center" > <tr><td nowrap class="label"> email:</td> <td><cfinput class="in" name="username" message="valid email address required please" type="text" required="yes" /></td></tr> <tr><td height="41" class="label">password:</td> <td><cfinput class="in" name="password" style="color:red;" required="yes" type="password"/></td></tr> <tr><td height="41">&nbsp;</td> <td><input type="submit" value="login" class="sub"/><input name="captcha" value="" type="hidden"></td></tr> <tr><td>&nbsp;</td> <td><a href="forget.cfm">forget password?</a></td></tr> </table> </cfform> <cfoutput> <cfif structkeyexists(form,'captcha')> <!---login user info ---> <cfset s = createobject("component","com.system.security").init(false,false)/> <cfset l = createobject("component","com.system.login").init()/> <cfset l.url = application.site.url/> <cfset l.signin(form,s)/> <cfif not l.islogin> <div align="center" style="color:##f00; font-weight:bold; text-align:center;">#l.errmsg#</div> <cfset application.com.log.writeloginattempt(form.username)/> <cfelse> <!--- set session ---> <cflock type="exclusive" scope="session" timeout="30" throwontimeout="yes"> <cfset session.islogin = true> <cfset session.userinfo = application.com.employee.getemployee(l.userinfo.employeeid)/> </cflock> <cfset application.com.log.writeloginsuccess(form.username,l.userinfo.employeeid)/> <cflocation url="index.cfm" addtoken="no"> </cfif> </cfif> </cfoutput> </body> </html>

thank you

you can clear application variables on server if utilize these commands, can utilize structclear() if want reset of variables , restart application. speaking 1 time application variables set remain persistent in memory until application restarted.

these commands restart application.

<cfscript> applicationstop(); </cfscript> or <cfset applicationstop()>

after variables have been cleared can remove line of code , should resolve caching issue.

coldfusion browser-cache coldfusion-9

Java is using volatile keyword memory efficient? -



Java is using volatile keyword memory efficient? -

if using 1 volatile variable, turn off cpu caching in other related non volatile variables well?

no, prevents variable beingness loaded cpu cache , modified there. more precisely, forces cpu flush cache after accessing volatile field. see here more complate details

java memory volatile memory-efficient

iphone - How can I hide bottom separator in some UITableViewCell -



iphone - How can I hide bottom separator in some UITableViewCell -

i'm developing app using uitableview grouped style , want hide cells bottomseparator don't know how.

this result want : result want

i've tried :

[self.tableview setseparatorstyle:uitableviewcellseparatorstylenone]; [self.tableview setseparatorcolor:[uicolor clearcolor]];

and :

uiimageview *line = [[uiimageview alloc] initwithframe:cgrectmake(12, height_row_header, 320-(12*2), 1)]; line.backgroundcolor = [uicolor blackcolor]; [cell addsubview:line];

but don't have borders around uitableview

i have thing : result have

someone can help me ?

thank lot

first of need remove separatorcolor , setseparatorstyle.

[self.tableview setseparatorstyle:uitableviewcellseparatorstylenone]; [self.tableview setseparatorcolor:[uicolor clearcolor]];

then check if cell lastly cell of section need add together image in cell.

viewnormal=[[uiview alloc] initwithframe:cgrectmake(0, 59, cell.frame.size.width, 1)]; uibutton *btn = [uibutton buttonwithtype:uibuttontypecustom]; btn.frame = viewnormal.bounds; btn.enabled = no; [btn setbackgroundimage:[uiimage imagenamed:@"linebgimage.png"] forstate:uicontrolstatenormal]; [viewnormal addsubview:btn]; [cell addsubview:viewnormal];

and remove viewnormal other cell. adding separator way , working fine for. hope help you.

iphone objective-c uitableview separator

c# - How can I fit my HTML page to the Web Browser in win Form? -



c# - How can I fit my HTML page to the Web Browser in win Form? -

i can navigate google in simple web browser (with doc in parent control), resolution bi component size.

i hope can help me.

please give screenshot. made new winforms-application next code-behind (nothing in designer)

public partial class form1 : form { webbrowser wb = new webbrowser(); public form1() { initializecomponent(); this.controls.add(wb); wb.dock = dockstyle.fill; load += onload; } private void onload(object sender, eventargs eventargs) { wb.navigate("http://www.google.de"); } }

and works fine

c# winforms webbrowser-control

jquery - Cycle: do something when the first image appear -



jquery - Cycle: do something when the first image appear -

i need show phrase when first image appear. i'm using solution not accurate:

settimeout(function(){ $('.frasehome').fadeout('slow'); }, 3000);

how can improve this?

jquery jquery-cycle

Is it acceptable to put code to load an image into an Image control in the code behind file of a View in WPF MVVM? -



Is it acceptable to put code to load an image into an Image control in the code behind file of a View in WPF MVVM? -

i unclear conventions should follow in regards code behind file of view in wpf mvvm.

in specific scenario, want know whether considered practice place code in code behind, linked click event of button on view, locate image hard drive , load image command on view. code this:

var ofd = new openfiledialog { filter = "bitmap files(*.bmp)|*.bmp" }; ofd.showdialog(); if (ofd.filename != null) { var image = bitmapfactory.converttopbgra32format(new writeablebitmap(new bitmapimage(new uri(ofd.filename, urikind.absolute)))); myimagecontrol.width = image.width; myimagecontrol.height = image.height; myimagecontrol.source = image; }

is much logic code-behind of view? if should place in viewmodel or in different class , phone call method view?

also, on broader scale, great if provide link definitive guidelines regarding considered acceptable set in code-behind of view, , not.

thanks

first of all, it's of import remember mvvm is, said, set of guidelines not rules. , can little sketchy should where...

that said, in illustration have quite lot of logic not ui-specific logic.

loading image hard drive should done in viewmodel. image should set on property in viewmodel. then, image command in view should bind imagesource said property.

about dialog (e.g. openfiledialog) - there 3 valid (imho) ways can done.

first create 'filechoosingservice' called viewmodel and, in turn, raises openfiledialog , returns filename.

second alternative open dialog view, , set result property in viewmodel. viewmodel see property has changed , in turn load image harddrive.

third alternative second, instead of setting property, have view invoke loadimagecommand in viewmodel , pass commandparameter filename.

wpf mvvm standards

cordova - Phonegap push notification android, need opinion -



cordova - Phonegap push notification android, need opinion -

i'm developing android apps using phonegap + jquery mobile. need add together notification bar in application. currently, i'm using notification phonegap plugin handle notification. didn't send notification when application closed. there solution maintain user recieve notification application closed? can utilize google cloud messanging solve it?

thank , sorry bad english

you can utilize force notifications. next plugin handles both android , iphone notifications:

https://github.com/phonegap-build/pushplugin

a notification shown whenever force message received , contains message attribute.

android cordova notifications

Lazarus - How to change the order of a start up form -



Lazarus - How to change the order of a start up form -

my project started form named form1. have many forms. need create new form (i.e., login form- frmlogin) start form.

i went project options , under forms, used arrow (on side of forms list) , moved login form top.

now login form starts fine. before can input username, message box utilize on next form (i.e., form1) gets shown. messagebox in formcreate procedure of form1.

i'm confused this. missing something? how can prevent formcreate's code running. form1 called frmlogin after user has clicked login , entered password.

in project settings: check forms auto-created. when create new form auto-created. think don't want in app.

forms lazarus

java - Android Soft Keyboard Overlapping Buttons (Screenshot) -



java - Android Soft Keyboard Overlapping Buttons (Screenshot) -

i using sherlock action tabs , consequently have fragment activity tab. unfortunately, when keyboard appears next happens:

the keyboard overlaps 2 buttons straight below 3rd text box. however, want 2 buttons in view when keyboard open.

i have tried couple of things:

added android:windowsoftinputmode="adjustresize" android:windowsoftinputmode="adjustpan" activity houses these 3 tabs wrapped illustrated tab fragment in scroll view partially works allowing screen scrollable view 2 buttons

this xml fragment:

<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ebebeb" android:orientation="vertical" > <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:layout_margintop="20dp" android:layout_weight="1" android:gravity="right" > <edittext android:id="@+id/textbox" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#ffffff" android:height="50dp" android:hint="@string/boxhint" android:paddingleft="15dp" > </edittext> <textview android:id="@+id/locboxhint" android:layout_width="50dp" android:layout_height="50dp" android:layout_below="@+id/textbox" android:background="#ffffff" android:gravity="center" android:padding="10dp" android:text="\@" android:textsize="22dp" /> <edittext android:id="@+id/locbox" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_below="@+id/textbox" android:layout_torightof="@+id/locboxhint" android:background="#ffffff" android:hint="joey&apos;s pizza" > </edittext> <textview android:id="@+id/datetimeboxhint" android:layout_width="50dp" android:layout_height="50dp" android:layout_below="@+id/locboxhint" android:background="#ffffff" android:gravity="center" android:padding="10dp" android:text="#" android:textsize="22dp" /> <edittext android:id="@+id/datetimebox" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_below="@+id/locbox" android:layout_torightof="@+id/datetimeboxhint" android:background="#ffffff" android:hint="friday 8pm" android:paddingright="60dp" android:layout_marginbottom="50dp" /> <imagebutton android:id="@+id/datetimepicker" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignparentright="true" android:layout_below="@+id/locbox" android:onclick="datetimebutton" android:src="@drawable/ic_menu_today" android:background="#ffffff" /> <linearlayout android:layout_width="fill_parent" android:layout_height="50dp" android:layout_below="@+id/datetimebox" android:orientation="horizontal" android:layout_margintop="-50dp" > <button android:id="@+id/infobutton" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_weight="5" android:onclick="infobutton" android:text="i" android:textcolor="#ffffff" /> <button android:id="@+id/button" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_weight="2" android:onclick="planbutton" android:text="@string/button" android:textcolor="#ffffff" /> </linearlayout> </relativelayout> </linearlayout>

any thoughts?

your parent layout linear alter in relative layout next code

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/theme_black_bg" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/bottom_bar" android:layout_below="@+id/top_bar" android:layout_margintop="15dip" android:gravity="center_horizontal" android:orientation="vertical" > <linearlayout android:id="@+id/linearlayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/email_edit_bg" android:gravity="center_horizontal" android:orientation="vertical" > <edittext android:id="@+id/loginemailaddressedittextview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/edit_text_bg" android:ems="2" android:hint="please come in email" android:paddingleft="5dip" android:paddingright="5dip" android:focusable="true" android:focusableintouchmode="true" android:singleline="true" android:textcolor="@color/label_color_white" android:textcolorhint="#ffffffff" android:textsize="12sp" /> </linearlayout> <imageview android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginbottom="10dip" android:layout_margintop="10dip" android:background="@drawable/separator_bg" /> <edittext android:id="@+id/loginpasswordedittextview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/edit_text_bg" android:ems="2" android:hint="@string/hint_password" android:inputtype="textpassword" android:paddingleft="5dip" android:paddingright="5dip" android:singleline="true" android:textcolor="@color/label_color_white" android:textcolorhint="#ffffffff" android:textsize="12sp" /> <button android:id="@+id/loginscreenloginbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="10dip" android:background="@drawable/login_btn_selector" /> <imageview android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginbottom="10dip" android:layout_margintop="10dip" android:background="@drawable/separator_bg" /> <button android:id="@+id/loginscreenforgotpasswordbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="10dip" android:background="@drawable/forgot_password_btn_selector" /> </linearlayout> <include android:id="@+id/bottom_bar" android:layout_alignparentbottom="true" layout="@layout/bottom_advertisement_merge_layout" /> </relativelayout>

java android xml android-layout actionbarsherlock

visual c++ - Getting error passing char array pointer into a function in C -



visual c++ - Getting error passing char array pointer into a function in C -

getting error passing char array pointer function in c. using vc++ editor build this.

error c3861: 'decodedata': identifier not found

decoder.h

int decodeaudiobytes(); int decodedata(int argc, char* argv[]);

decoder.c

int decodeaudiobytes() { char* argv[] = { "test", "test1" }; homecoming decodedata(2, argv); } int decodedata( int argc, char* argv[] ) { char speechoutfilename[ 150 ], bitinfilename[ 150 ]; int args = 0; strcpy( bitinfilename, argv[ args ] ); args++; strcpy( speechoutfilename, argv[ args ] ); args++; }

put definition of decodedata before decodeaudiobytes

visual-c++

listview - kendoui: Displaying foreign key value not ID -



listview - kendoui: Displaying foreign key value not ID -

i have kendo ui listview , in edit mode im using dropdownlist handle foreign keys, these work fine in displaying foreign key value , not id, in normal view mode loads first foreign key id displayed instead of value.

im wondering best practice when wanting display foreign key value. ive tried solving problem @ sql level using 'inner join' statement in datasource read call, causes fields conflicts when doing , update/create foreign key value field doesnt exist in original table.

heres code lenders dropdown

var dslenders = new kendo.data.datasource({ transport: { read: { url: "../data/lenders/", datatype: "jsonp" }, parametermap: function(options, operation) { if (operation === "read") { homecoming options; } } } });

heres code list view

var claimlistview = $("#formclaim").kendolistview({ datasource: remotedatasource, template: kendo.template($("#viewtemplate").html()), edittemplate: kendo.template($("#formtemplate").html()), databound: function(e) { this.edit(this.element.children().first()); } }).data("kendolistview");

heres dropdownlist in edittemplate loads list of lenders works fine

<input name="idldr_clm" data-bind="value:idldr_clm" data-value-field="id_ldr" data-text-field="name_ldr" data-option-label="select" data-source="dslenders" data-role="dropdownlist" />

now here im using in normal view template view display lender. showing id , not lender name. want pull lenders name.

<input value="#= idldr_clm #" class="k-input k-textbox" readonly />

listview foreign-keys kendo-ui

Making client-server instance messenger on the internet with c# -



Making client-server instance messenger on the internet with c# -

my friend , want utilize client/server messenger on internet.

so far have working on local network, there way work on net without having require user alter network configuration

if coding c# link might seeking for. http://pietschsoft.com/post/2009/02/net-framework-communicate-through-nat-router-via-upnp.aspx

c#

How to handle MySQL slave failover in python? -



How to handle MySQL slave failover in python? -

is there accepted way handle mysql slave db failover in python code?

are there wrappers sqlalchemy connection pools (or other approaches) aware of replicas , can switch them automatically? there standard wrapper db-api cursors can this?

i remember using memcached library in php implemented sort of behavior (you gave list of memcached hosts , maintain track of hosts down). there accepted ways of doing python , mysql missing?

python mysql failover

.net - File.GetAttributes syntax -



.net - File.GetAttributes syntax -

i trying debug application i'm not familiar with.

somewhere in code, see :

file.getattributes(filename) _ .equals(fileattributes.archive | fileattributes.readonly)

what fileattributes.archive | fileattributes.readonly (with single pipe) tests ? guessed see if file either archived or readonly, file archived, , test returns false.

thanks

that code flat-out wrong. whoever wrote messed around until got working. fileattributes enum type has [flags] attribute. means combination of flags can set. or operator does, combines both archive , readonly attributes.

which works accident, file has archive attribute turned on. code fail miserably 1 time user backs-up file. turns off archive attribute , equals() method no longer works, though file still readonly.

you must prepare bug. create instead:

if (file.getattributes(filename) , fileattributes.readonly) = fileattributes.readonly '' read-only ''... end if

.net file-io

cordova - How to use collapse_key with GCM and Phonegap PushPlugin -



cordova - How to use collapse_key with GCM and Phonegap PushPlugin -

i'm able send gcm notifications payload using pushplugin phonegap. need send-to-sync message. read , understand, messages without payload , collapse_key way go. however, couldn't figure out how implement , utilize pushplugin.

if don't alter plugin's code, i'm able property message, in device, payload. expecting not utilize property , able property collapse_key in device, looks doesn't work way or not implemented pushplugin.

am right or there's way go?

thank you.

cordova push-notification phonegap-plugins google-cloud-messaging

c - Why my code crashes if I call push function more than 8 times? -



c - Why my code crashes if I call push function more than 8 times? -

// whenever increasing function phone call times of force more 8, crashed before working good. help required. in below code have created programme stack using dynamic array keeping in mind there should not stack overflow using realloc function doubling values whenever stack gets filled.

#include<stdio.h> #include<stdlib.h> #include<memory.h> typedef struct arraystack { int top; int capacity; int *arr; }*stack; stack creation() { stack s; s=(stack)malloc(sizeof(struct arraystack)); if(!s)return null; s->top=-1; s->capacity=1; s->arr=(int*)malloc(s->capacity*sizeof(int)); if(!s->arr)return null; homecoming s; } int is_full(stack s) { homecoming s->top==s->capacity-1; } int is_empty(stack s) { homecoming s->top==-1; } void doubling(stack s) { s->capacity*=2; s->arr=realloc(s->arr,s->capacity); } void push(stack s,int data) { if(is_full(s)) doubling(s); s->arr[++s->top]=data; } int pop(stack s) { if(is_empty(s)) printf("\nstack underflow"); else homecoming s->arr[s->top--]; } int main() { stack s; int i=0,size=9; s=creation(); **for(i=0;i<size;i++) push(s,19+1);** // in case homecoming 0; }

s->arr = malloc(s->capacity * sizeof(int)); s->arr = realloc(s->arr, s->capacity);

you reallocate plenty space s->capacity / sizeof(int) items.

c stack stack-overflow

how to use jquery mobile asp.net mvc 4 to download and display pdf memory stream data -



how to use jquery mobile asp.net mvc 4 to download and display pdf memory stream data -

i have desktop/mobile web app needs display pdf stream on target device. have working on desktop using jquery dialog. mobile tho...my html view page has next link:

<a href="@url.action("pdfview", new { id = @paystub.paystub_id})">view pdf</a>

and correctly takes me controller action:

public actionresult pdfview(string id = "") { paystubdataentity ps = paystubaccess.getpaystubbyid(new guid(id), new guid(session["session_application_userid"].tostring())); webhelper.setheadersfordownload(system.web.httpcontext.current.response, "application/pdf", "paystub.pdf", false); memorystream pdfmemorystream = sendpaystubtobrowseraspdf(ps); //webhelper.sendfile(system.web.httpcontext.current.response, "application/pdf", "paystub.pdf", false, pdfmemorystream); homecoming file(pdfmemorystream, "application/pdf"); }

but nil ever shows on iphone emulator (electric plum). no error messages. not sure output s/b going or how view it? ideas appreciated.

we have same issue android phones , there can 2 issues going on. if website uses ssl , phone on not take valid ssl, downloading pdf in manager, never completes download. sec issue file sending phone needs named in order download phone.

ex: homecoming file(pdfmemorystream, "application/pdf", filedownloadname:"paystub.pdf");

i suggest using google chrome phone emulation. when alter settings, behave phone , can debug easily. example, when set google chrome mobile phone user agent android 4.0.2, download pdf, instead of displaying within web browser. when that, know working locally. has iphone emulation.

asp.net-mvc jquery-mobile pdf-generation

php - functions outside of loop not updating -



php - functions outside of loop not updating -

i'm trying loop display few conditions based on load average , cpus/memory etc. however, seems pull usage info 1 time entire loop. want update on each loop: here's got, kind of help on great appreciated!

<?php exec("cat /proc/cpuinfo | grep processor | wc -l",$processors); $totalc=$processors[0]; function sys_getloadavg_hack() { $str = substr(strrchr(shell_exec("uptime"),":"),1); $avs = array_map("trim",explode(",",$str)); homecoming $avs; } $load = sys_getloadavg_hack(); function get_memory() { foreach(file('/proc/meminfo') $ri) $m[strtok($ri, ':')] = strtok(''); homecoming 100 - round(($m['memfree'] + $m['buffers'] + $m['cached']) / $m['memtotal'] * 100); } function print_exec(){ $out_arr=array(); $last_line=exec("mpstat",$out_arr); homecoming $last_line; } ($i=1; $i<=50; $i++) { $memory = get_memory(); $cpu = substr(print_exec(),-5); if($memory>"10" && $cpu>"10" && $load[0]<$totalc) { echo "everything good!"; } else { } echo "memory: $memory || cpu: $cpu || load avg: $load[0] || #cpu's: $totalc<br> || #runtime: $i\n\n"; usleep(800000); } ?>

you have create calculations every loop. example: phone call sys_getloadavg_hack() 1 time before loop.

try add together sys_getloadavg_hack() phone call in loop.

for(...) { $load = sys_getloadavg_hack(); ... }

php function loops while-loop

certificate - Signing Click Once Aplication Assymbly with Visual Studio 2012 -



certificate - Signing Click Once Aplication Assymbly with Visual Studio 2012 -

i'd deploy visual studio 2012 project click-once technology microsoft. developing utilize windows 7 machine , run visual studio normal user (not root). deploying utilize visual studio 2012 well. problem when users execute click 1 time deployment file, security software on pc mark software unknown , inquire user stopping execution. avoid have ordered trustcenter cerificate , used signing click 1 time deployment file, worked quite well. until point during installing process downloads assemblies. visual studio has alternative signing assembly, @ first has given import error. after had fixed gave me during compiling process error, not sign assemblies. hence used post-build-option. there inserted signtool command, worked pretty well. when comes deploying, signature got lost. i've called trustcenter back upwards 3 times , said me after analysis of certificate looks quite good. when want import visual studio due assembly signing option, visual studio alerts, not able find certificate. have idea, how possible deploy click 1 time applications signed assemblies? (best case visual studio 2012) best greetings,clemens

well sovled problem after few more hours of try-error-methode. "export certificates in path" alternative shouldn't set(like trustcenter back upwards told me). without alternative i've got error visual studio, solved openssl commands: openssl pkcs12 -in cert.pfx -out backup.key openssl pkcs12 -export -out out.pfx -keysig -in backup.key out.pfx used without problems.

visual-studio-2012 certificate code-signing assembly-signing

c++ - Eclipse CDT poor indexing and code completion/analysis -



c++ - Eclipse CDT poor indexing and code completion/analysis -

i'm having several headaches trying work in eclipse c++ development.

the ide persistently shows errors , warnings in problems pane, after have been solved - right-click->"delete" seems clear them. then, few pop after compile, related sec issue...

my codebase rather little (two projects, 1 unit tests, 1 little library i'm developing), though create utilize of basic c++ templating. however, eclipse largely fails code finish included libraries, files in own workspace separate projects, , files within same project.

i've tried rebuilding index on projects , fiddled few settings, no avail. in past have used visual c++, it's wonderful intellisense, i'm running linux @ moment , want ide can (eventually) handle multiple languages , toolchains - eclipse excels.

i've tried googling found no real help. out there have hints tweaking eclipse cdt improve code completion/analysis? or nature of non-visual studio development?

c++ eclipse intellisense code-analysis cdt

windows - Application pane keeps crashing on startup in Domino Designer -



windows - Application pane keeps crashing on startup in Domino Designer -

anyone know how can reset it? short of re-install is.

i've removed offending database.

cache.ndk, desktop8.ndk, bookmarks.nsf

domino designer 9 windows 8

thanks!

/j

i had source command enabled. 1 time removed on disk construction open application pane fine.

windows lotus-domino

c# - ComboBox for enumeration System.IO.Ports.Parity in WPF -



c# - ComboBox for enumeration System.IO.Ports.Parity in WPF -

i want (in c#) populate list of admissible values combobox admissible values of enumeration system.io.ports.parity. end created collection:

public class theparitysource : observablecollection<parity> { public theparitysource() { array parities = system.enum.getvalues( typeof( parity ) ); foreach (parity p in parities) this.add(p); } }

(btw: there oneliner initialization?) , made datacontext of combobox:

... xmlns:local="clr-namespace:mynamespace" ... <combobox ...> <combobox.datacontext> <local:theparitysource /> </combobox.datacontext> </combobox>

the combobox, however, remains empty (it shown empty, seems have right length), though can see in debugger how theparitysource gets populated. approach work in combobox (even in same class) baudrate. initialize integer values, guess somehow related fact i'm using enum here, i'm clueluess might reason. pointers? need write converter?

(of course of study can work around creating list of strings enum, kind of unpleasant...)

edit: i'd prefer of in xaml. there simple way that?

you can in xaml using objectdataprovider

in window.resources (or whatever resources using) setup objectdataprovider.

to setup objectdataprovider enums set objecttype {x:type sys:enum} , methodname getvalues fill combobox actual enums or can utilize getnames fill combobox string representaion of enum

xmlns:sys="clr-namespace:system;assembly=mscorlib" xmlns:io="clr-namespace:system.io.ports;assembly=system" <window.resources> <objectdataprovider methodname="getvalues" objecttype="{x:type sys:enum}" x:key="parityvalues"> <objectdataprovider.methodparameters> <x:type typename="io:parity" /> </objectdataprovider.methodparameters> </objectdataprovider> </window.resources>

then bind combobox

<combobox itemssource="{binding source={staticresource parityvalues}}" />

result:

c# .net wpf combobox

java - Register another receiver in OnReceive() android -



java - Register another receiver in OnReceive() android -

i m sending message using smsmanager in onreceive() method, want add together sent , delivery study intent smsmanager, when registering receiver in receiver programmatically , in manifest, not calling sent sms receiver.

is possible in onreceive() or else help me how accomplish this?

the reply intentreceiver components not allowed register receive intents. can't register new broadcastreceiver in existing broadcastreceiver.

java android

sqlite3 - Android how to add more than one ContentProvider in Android? -



sqlite3 - Android how to add more than one ContentProvider in Android? -

is possible utilize more 1 contentprovider?

if possible how declare in manifest? tried using next way getcontentresolver() getting first provider.

<provider android:name=".bean.itembean" android:authorities="com.waveletandroid.bean" > </provider> <provider android:name=".bean.customerbean" android:authorities="com.waveletandroid.bean" > </provider>

is possible utilize more 1 contentprovider?

yes. or, can have 1 contentprovider provides multiple info sets, based upon path portion of uri or via different authorities.

if possible how declare in manifest?

what have correct. cannot both have same authority, though. alter 1 else (e.g., com.waveletandroid.bean2).

android sqlite3 android-contentprovider

html - Cannot Get Hover to Work over a Wrapper Div -



html - Cannot Get Hover to Work over a Wrapper Div -

i need help.

i can't seem able hover working on wrapper/container div

css:

#myhover:hover { border: 1px solid red; }

html:

<div id="myhover" style="background: #ffffff; width: 177px; height: 20px; border: 1px solid #808080;"> <div style="float: left;"> <input id="refdocs" style="padding-left: 4px; padding-right: 3px; height: 15px; width: 158px; border: none;" type="text"> </div> <div style="line-height:18px; font-size: 11pt; color: #779297;">+</div> </div>

because inline styles specific in cascade, can over-ride things didn't intend them to. move #myhover styles style sheet should work fine.

for example:

#myhover { background: #ffffff; width: 177px; height: 20px; border: 1px solid #808080; }

jsfiddle: http://jsfiddle.net/va8bz/

html css html5 css3

cdn - How to remove subdomain from google index, which links to the main domain -



cdn - How to remove subdomain from google index, which links to the main domain -

can tell me how can remove subdomain google index, links main domain.

lets domain www.myweb.com , subdomain cdn.myweb.com. here document root of subdomain same main domain. not utilize robot.txt stop google indexing, remove indexing main domain links too.

i search on google, bing , stackoverflow too, not find perfect reply question. solve yours side?

you can utilize dynamic robots.txt purpose. this...

httpd.conf (.htaccess):

rewriterule /robots\.txt$ /var/www/myweb/robots.php

robots.php:

<?php header('content-type: text/plain'); if($_server['http_host']=='cdn.myweb.com'){ echo "user-agent: *\n"; echo "disallow: /\n"; }else{ include("./robots.txt"); }

subdomain cdn google-index

MySQL 2 Tables, query before insert -



MySQL 2 Tables, query before insert -

i'm perplexed, here have.

two tables, 1 temporary, 1 permanent.

table temptable: city , state //- has list of 20 citys , states table permtable: city , state //- has hundreds of citys , states

i want 2 things:

i want utilize city , state temptable , query permtable see if contains city , state. if doesn't want add together it.

if has match in city , state, want play c:\sound.wav , want add together

permtable.

i lost how this.

this tell records exist or don't exist temptable:

select t.city, t.state, case when p.state null 'does not exist' else 'does exist' end temptable t left bring together permtable p on t.city = p.city , t.state = p.state

you can insert records don't exists in permtable such:

insert permtable select t.city, t.state temptable t left bring together permtable p on t.city = p.city , t.state = p.state p.state null

not sure requirement play sound , doesn't create sense add together (since exists).

mysql