Posts

Showing posts from August, 2014

php - basic question about adding data to string -

the following string contains serialize data of form. want include session_id() in same string, how can include session_id=session_id(); in it? thanks. string = '&' + $('#new_form').serialize(); inside form tag u can add hidden input element. <form> <input type='hidden' name='session_id' value=<?=session_id()?> > <!-- other form elements --> </form> now jquery automatically add session_id i hope :)

objective c - iPhone: Multiple call for viewWillAppear -

in iphone app viewwillappear: gets called. then wiewwilldisappear: gets called. and viewwillappear: gets called again. so reason viewwillappear: called after viewwilldisappear: ? here in case problem setting value flag in "nsuser defaults" before page loads , checking value flag on current screen appears and resetting value flag on viewwilldisappear during execution of viewwillappear of current page cuntrol reaches anther page , returns same page , flag resets what should maintain flag value reset once on final viewwilldisappear ? please , suggest thanks many reasons. don't rely on order / number of calls viewdidload/viewwillappear/viewdidappear. it's bad idea abuse "view...disappear" clean-up/destructor method because not called in circumstances. it safe assume viewdidappear gets called after viewwillappear.

.net - Child Objects Filter In EF -

how can filter child objects entity framework criteria? example: have object company childobjects, companychilds. companychilds have property active. want company exact id , child objects active equals true. i tried this: dbcontext.company.include("childcompany").where(x => x.id == id && x.childcompany.any(y => y.active == true)); any welcome :) there way filter child records in code first api -- see post: http://blogs.msdn.com/b/adonet/archive/2011/01/31/using-dbcontext-in-ef-feature-ctp5-part-6-loading-related-entities.aspx see "applying filters when explicitly loading related entities"

android - white theme not showing the text -

i making app (android 1.6) can change between 2 different themes. made custom theme takes android light theme parent! trouble when switch white theme text not drawn if select can see text. furthermore when switch themes titletext, previous , next same in dark theme. here code use theme: <style name="theme.white" parent="android:theme.light"> <item name="android:colorbackground">@color/text_color_dark</item> <item name="android:textcolor">@color/text_color_dark</item> <item name="textprev">@style/text_prev</item> <item name="textregular">@style/text_regular</item> <item name="texttitle">@style/text_title</item> <item name="textnext">@style/text_next</item> <item name="pageback">@style/page_back</item> <item name="whiteback"...

php - How can I use the Zend library, specifically the twitter class with codeigniter? -

i'm trying use zend twitter service in codeigniter. i have used following method integrate zend http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/ i can complete oauth authentication , receive valid access token twitter, , callback page works fine, when try make request following error: message: undefined offset: 0 filename: client/result.php line number: 232 i'm loading twitter class this: $this->load->library('zend'); $this->zend->load('zend/service/twitter'); i'm not sure if there's else should loading, or i'm doing wrong. i'm using codeigniter 2.0.2 , zendframework 1.11.4 any appreciated. this error doesn't seem related directly codeigniter , zend. looking @ code on line 232 can see this return (string) $result[0]; this within following function /** * tostring overload * * sure call when result single value! * * @return string */ public function __tostring()...

flash - How can i invoke my own javascript API on my SWF dynamically embeded using swfOject? -

i using swfobject library dynamically embed mp3 player i've made in flash cs5. in .fla file, i've declared list of methods can called via javascript (using flash.external.externalinterface flash class). that's not problem since these function work when called google chrome's console. however, swfobject provides way invoke javascript api if .swf has been statically included (i.e. using swfobject.registerobject() ) can't find way achieve same goal when .swf dynamically included (i.e. using swfobject.embedswf() ). thanks in advance , contibutions :) when using swfobject.embedswf , can specify id of swf object in attributes parameters : swfobject.embedswf(swfurl, id, width, height, version, expressinstallswfurl, flashvars, params, attributes , callbackfn) example : swfobject.embedswf( "yourflash.swf", "wheretoplacethis", "0px", "0px", "10.0.0", "expressinstall.swf", ...

c# - Why aren't data repositories static? -

i looking @ repository method asp.net mvc app , noticed static class wasn't used. since repo crud, why not make static? 1) it's difficult unit testing static classes (if testing class depends on repository, want test work against fake 'mocked' repository object instead of real one) 2) want have 1 repository instance per-request make easier ensure uncommited changes 1 user don't mess things user.

Disable war overlays in maven -

when have dependency of type 'war' in maven project, automatically uses overlay merge project building. i disable overlay. to make development process simpler want rather use symlinks maven-junction-plugin when i'm building local tomcat, , overlay when i'm building test , prod servers. any other suggestions on how can work war dependencies need modify without having long build cycle welcome. you can't disable set of overlays maven-war-plugin:2.1.1 can exclude files overlay. exclude overlay files: <dependentwarincludes></dependentwarincludes> <dependentwarexcludes>**</dependentwarexcludes> exclude files specific overlays: <overlays> <overlay> <groupid>com.gentics</groupid> <artifactid>portalnode-webapp</artifactid> <excludes> <exclude>**/*</exclude> </excludes> </overlay> </overlays> please note not reduce amount of o...

multithreading - hwnd thread affinity painting from a different thread -

i've dgrect::draw(hwnd hwnd) draws blank hbitmap on hwnd window handle. works fine if call main() . works correctly if called dgrdpserver::dgrdpserver() constructor qtcpserver derived. works dgrdpserver::listen(qint64 port) . hwnd passed in dgrdpserver constructor. problem appears when call dgrdpserver::incomingconnection(int socketdescriptor) i've qdebug() ed value of hwnd , okay. whats causing draw failing. ?? here goes code dgrect::draw(hwnd hwnd) qbytearray ba; hdc hdc = getwindowdc(hwnd); hbitmap scrn = createcompatiblebitmap(hdc,/*width*/200,/*height*/200); setbitmapbits(scrn, /*size()*/200*200*4, ba.data()); bitmap bm; paintstruct ps; hdc whdc = beginpaint(hwnd, &ps); hdc hdcmem = createcompatibledc(whdc); hbitmap hbmold = (hbitmap)selectobject(hdcmem, scrn); getobject(scrn, sizeof(bm), &bm); bitblt(whdc, 0, 0, bm.bmwidth, bm.bmheight, hdcmem, 0, 0, srccopy); selectobject(hdcmem, hbmold); deletedc(hdcmem); endpaint(hwnd, &ps); showwindow(hwnd...

svn-externals with own svn-externals: how to recursively checkout? -

so i'm using svn:externals checkout external repo. external repo has own svn-externals set up. now, when updating working copy of project, files external repo being updated, externals not. behavior designed, can extended update external dependencies? recursive checkout supported since subversion1.5, thread illustrates . the "version control subversion" book mention svn checkout , svn update , svn switch , , svn export commands able recurse in externals repos, but: if external set particular revision, no amount of ' update ' change file in it, though external repo has had new revisions. the update must initiated parent repo, not directly sub-repo: be careful, though, don't inadvertently modify external working copy in subtle ways cause problems. example, while externals definition might specify external working copy should held @ particular revision number, if run svn update directly on external working copy, subversion oblige, ...

php - Which facebook API's? -

is possible me post message on given users facebook wall, if perform action on website? basically, looking step step guide achieve this, have not been able figure out how via facebook documentation. step 1: set new application @ facebook. enter details website address , domain name. note down api key, application id, , application secret. can set new facebook application here . note: able access facebook developers dashboard need verified developer, i.e. should either have mobile number or credit card verified it. step 2: set authentication method check if user logged facebook , if facebook session exists ask basic permissions user. can using php sdk: $fb_sdk_path = facebook_sdk_path; require_once($fb_sdk_path); //initialize fb object $facebook = new facebook(array( 'appid' => fb_app_id, 'secret' => fb_app_secret, 'cookie' => true, 'domain' => 'example.com' )); //try session. if fails means us...

Whats NHibernate like for querying xml -

i'm using nhibernate (n-hib-er-nate) query usual tables. wondering if can query xml. bob. if looking query xmlcolumn using nhibernate, link shows on how can create usertype handle xmlcolumn.

I need my image to remain after the image changes -

i have created app has multiple image changes. after original image1 changed pushed button switches new image2. if go out of app , in, image2 image1. how can image2 stay? is persisting data, can please me? you need create init method , load image according value save upon quitting app. if target iphone can save value in nsuserdefaults or can create .plist , write , read it. option xml, works many programming languages. if want know more suggest language/platform programming in/for. hope helps.

How to stop a Delphi 6 COM server application re-registering with COM at startup -

i have set of legacy delphi 6 aplications out of process com servers. in attempting run these programs normal domain user on windows see them when running (without command line arguments or switches) attempting update chunks of hkey_current_classes. fails due lac of permission hkcr hive. appears act of running delphi 6 com server causes attempt register embedded com types system registry. i not want behavior normally. once during install under , adminatrative account initalise com registry, not want under normal running conditions of non adminastrative account. (if moniroy system sys internals process monitor can see failed registry key access attempts). is there command line switch can pass delphi 6 com server prevent automatic com registrtion logic? i don't think you're seeing think are... delphi tries install com servers if haven't been installed. suspect you're seeing application checking see if it's registered yet or not. reason you'...

c# - Telerik Grid Client-Side Row Selection -

i've researched these questions thoroughly on stackoverflow , on telerik still have not figured out solution these questions. here's trying do. have radgrid control databound using linq. based on user's row selection i'd query additional information database , drop control (let's assume other control rad listview moment). i'd clientside without having post whole page server. separately i'm trying put button on page send row selection server trigger action in code-behind. i'd love if show me how following: get user row selection using javascript , populate key values selection in control (using telerik client-side row selection, not usual asp.net select link) make ajax request using key value(s) previous question retrieve additional information database. i'm assuming using linq on server side handle request. refresh control display info. put button on page post key value first question server caught , stored in variable. i realize ...

database - Understanding COMPATIBILITY_LEVEL in SQL Server -

i understood setting database compatibility_level prior native 1 prevented features being used. doesn't seem case. witness following sql script: create database foo go use foo go alter database foo set compatibility_level = 80 go create table bar ( id uniqueidentifier not null, testnvcmax nvarchar (max) not null, -- arrived in sql 2005 testdatetime2 datetime2 (7) not null -- arrived in sql 2008 ) go but table creates - ideas? have thought kind of error message or warning have been appropriate here can read differences between compatibility level 80, 90 , 100. alter database compatibility level apparently new data types not affected. think compatibility level there make sql server "behave" older version, not prevent doing new fancy stuff.

elevation - Why is SOLR's QueryElevation component not working? -

i have configured queryelevation component here: http://wiki.apache.org/solr/queryelevationcomponent and can see doing something... in debug (formatted json) output: "debug":{ "queryboosting":{ "q":"bar", "match":["id:test"]}, however, having no effects on query results whatsoever can tell me i'm going wrong? thanks! ok, bad. i had set wrong field uniquekey: http://wiki.apache.org/solr/schemaxml#the_unique_key_field

is this possible in mySQL -

i want add 100 rows in single insert, populating each field next in series of numbers (and string equivalents). in other words, along these lines (mynumber varchar, myorder int): insert mytable (mynumber, myorder) select "0"-"99", select 1-100 i have feeling can't done, thought i'd ask. you should able without creating whole new table... long have table many records hope add, if there no bearing on content... can mysql query variables.. insert yourtable ( yoursequence, yourstringversion, field3 ) ( select @seq:= @seq+1 yoursequence, convert( @seq, char(8) ) yourstringversion, "other defaults" field3 (select @seq := 1) vars, sometablewithatleast100records limit 100 ) justtoadd

java - Differences when running Tomcat from within Intellij IDEA? -

i have bizarre problem spring 3.5, webflow 2.2 application, running in tomcat (6.0.32) part of webflow calls retrieve list of objects. list placed in viewscope object use jsp view. each object in list inherits base class contains common fields. the webflow forwards jsp view displays contents of list, writing out objects. when run stand-alone tomcat, fields on base class somehow set null. have debugged , confirmed list built correctly code called webflow . somewhere between putting list webflow view scope, , later being retrieved jsp, base class fields being reset null. the bizarre part of problem app runs if start , run tomcat within intellij idea. i've tried various jdks , tomcat versions, , have same issue. it appears webflow problem (improper serialization maybe?) that's sensitive whether tomcat has been started within intellij. what intellij doing cause java serialization misbehave? well, haven't found exact underlying cause, have work-around. ...

.htaccess - Removing the index.php is not working -

i have site , when click on go in center have going url http://dev.posnation.com/welcome/redirect which not proper page welcome controller , redirect action. proper url http://dev.posnation.com/index.php/welcome/redirect my codeigniter structure this -rw-r--r--@ 1 tamer staff 225 apr 11 13:09 .htaccess drwxr-xr-x@ 18 tamer staff 612 apr 8 17:26 application drwxr-xr-x 11 tamer staff 374 apr 11 09:46 css drwxr-xr-x@ 6 tamer staff 204 mar 24 14:20 graphics drwxr-xr-x 17 tamer staff 578 apr 11 09:54 js drwxr-xr-x@ 10 tamer staff 340 apr 7 12:20 system drwxr-xr-x@ 16 tamer staff 544 apr 7 12:20 user_guide with index.php out 1 directory my .htaccess consists of this directoryindex index.php rewriteengine on rewritecond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d any ideas you missed 1 rewrite rule line after rewritecond. try directoryindex index...

php - How to prevent gaming a voting system where people can vote once per day? -

i've implemented voting system videos online, wherein visitors can cast vote once in given day. use combination of email address , timestamp ensure each vote unique day. as might guess, lead people gaming system registering throwaway email addresses @ mailinator.com , like, i'm wondering if anyone's tried implementing other voting algorithms allow multiple votes same person. in addition, setup means if video #1 has more people associated video #2, video #1 @ unfair advantage. i'm thinking ranked system, i'm not totally sure how prevent gaming system fake email addresses. problem i'm trying solve this: given 3 videos, a, b , x. has 5 people in it, b has 2, , x has 4. assuming x best video of three, , people can vote every day, there voting system "b" rise top? like said, proposed ranked system, posit if amount of #2's outnumber #1's, it's safe assume that should winner, seems incomplete. has tackled before? keep in mind...

Java / Android Read large text file (~2.5 MB) -

i trying read in large text file (~2.5 mb) android application, using following code: private static string readfile(string path) throws ioexception { fileinputstream stream = new fileinputstream(new file(path)); try { filechannel fc = stream.getchannel(); mappedbytebuffer bb = fc.map(filechannel.mapmode.read_only, 0, fc.size()); /* instead of using default, pass in decoder. */ return charset.defaultcharset().decode(bb).tostring(); } { stream.close(); } } i read here effective way read file in java, app crashes force close, believe because of out of memory problem, have code wrapped around try-catch block. how can read in , not make app crash? have tried several things, result in same, large files. cannot split file up, not acceptable in final application. update: here section read file: try { string str = readfile(filepath); et.settext(str); et.setselection(str.length()); } catch (exception ex) { ...

flex - how to identify a selected object in tilelist? -

i have tilelist, dynamically loaded xml file pictures, how do when click on picture in label gave name? <mx:tilelist id="tilelist" alternatingitemcolors="[#ffffff,#eeeeee]" dataprovider="{xmllistcoll}" itemrenderer="tilelistitemrenderer" columncount="3" columnwidth="100" rowcount="2" rowheight="100" direction="horizontal" verticalscrollpolicy="on"/> in tilelist call function itemclick="somthingselected();" public function somthingselected():void{ trace( this.tilelist.selecteditem.@id ) } "id" attribute in xml dataprovider or whatever want be

xquery sql - SQL Server Query XML in Nvarchar(max) Field? -

i have xml stored in nvarchar(max) field. realize there xml data type, in case not stored way. let's xml structured following: <root> <hdr> <name>aj</name> </hdr> <dtls> <dtl> <price>1</price> </dtl> <dtl> <price>7</price> </dtl> <dtl> <price>3</price> </dtl> </dtls> </root> what trying count of detail (dtl) nodes exist record. sure possible xpath/xquery, not sure how. try this: select cast(<your_xml_column> xml).query('count(//dtl)') <your_table> e.g: declare @x nvarchar(max) set @x = '<root> <hdr> <name>aj</name> </hdr> <dtls> <dtl> <price>1</price> </dtl> <dtl> <price>7</price> </dtl> <dtl> <price>3</price> </dtl> </dtls> </root>' select ...

javascript - Why is the variable inside this function global? -

i thought variable defined in function local can access variable 'e' outside of function. function change() { var d = 6; e = 7; } change(); alert(e); //> alerts 7 because new variables enter global scope default. var prevents happening constraining variable's existence within current scope.

php - Search inside serialize data with MYSQL -

i'd search inside serialized array, data : a:7:{i:0;s:2:"34";i:1;s:1:"0";i:2;s:2:"42";i:3;s:2:"33";i:4;s:2:"48";i:5;s:2:"62";i:6;s:2:"47";} i tried this: $id_serialize = '"'.$id.'"'; $req = requette("select id table col '%$id_serialize%'"); but it's not working, solution? thanks. your query formatted little wrong. if trying pass $id_serialize query, needs formatted this: $id_serialize = $id; $req = requette("select id table col '%" . $id_serialize . "%'");

c# - Email subject problem -

i using mailmessage class in program. when subject long subject like. subject: =?utf-8?b?w0vudgvychjpc2uguhjpb3jpdhldic0gq3vzdg9tzxigsw5jawrlbnqgnjkxnzigzm9yiehhcmlkagfyyw4gkdezmjm5oskgagfyawroyxjhbnjac3luy2z1c2lvbi5jb20goibuzxn0aw5nifrlc3rpbmcgvgvzdgluzybuzxnpbmcgvgvzdgluzybuzxn0aw5nifrlc3rpbmcgvgvzdgluzybuzxn0aw5nifrlc3rpbmcg4o" this problem occurred in server only. while debugging have used same subject content in "local" but, got correct subject. program: protected mailmessage msg; msg.subject = subject; got same (error) subject in webmail.ihostexchange.net also. what problem? update: this part of coding. public emailsenderthread(string emailaddresses, string ccemailaddress, string from, string subject, string body) : base() { msgthread = new thread(new threadstart(mailsender)); this.mailaddress = emailaddresses; this.ccmailaddress = ccemailaddress; msg.from = new mailaddre...

Using Java's Regex to extract a word from a path name -

i have directory , trying extract word "photon" before "photon.exe". c:\workspace\photon\output\i686\diagnostic\photon.exe(suspended) thread(running) my code looks this: string path = "c:\workspace\photon\output\i686\diagnostic\photon.exe(suspended) thread(running)"; pattern pattern = pattern.compile(".+\\\\(.+).exe"); matcher matcher = pattern.matcher(path); system.out.println(matcher.group(1)); no matter permutations try keep getting illegalstateexceptions etc, despite regular expression working on http://www.regexplanet.com/simple/index.html . thanks in advance help. super frustrated @ point >.< you can use following regular expression: ^.*\\(.*)\.exe.*$ , file name in first match group. here example . import java.util.regex.matcher; import java.util.regex.pattern; public class main { public static void main(final string[] args) { final string input = args[0]; final pattern pattern = ...

iphone - Receiving payment for apps on the App Store -

could here tell me process apple follows once app put on app store? does credit card developers program bought credited amount made on app? does apple allow create/setup separate account receive income app? any direction helpful. as part of developer program need set bank account details - it's on itunes connect website. they'll pay monthly. hence separate credit card. of course if use bank's debit card same account.

php - Pros and cons of whole project as a module? -

i in process of learning kohana 3. curious: kohana 3 projects have looked at, kohanut cms implemented 1 big module , located in /modules instead of /application (which empty). why that? make easier drag 1 folder if upgrade kohana later? all depends doing. split different sections of application multiple modules. organization or if want use piece on application.

CakePHP session data cleared on paginator sort -

my session data being saved in form expected. however, when run sort on column of results, form session values cleared. i calling in search form through en element it's used on specific locations of site. does know why pagination clearing out session? standard cake? the paginator sort elements link generated paginator , won't consider of form data. first thing need make sure you're doing tell paginator include url paramters current page in url generates. put anywhere in view before call of $paginator functions. $paginator->options(array('url' => $this->passedargs)); secondly, make sure search parameters being included in url. sounds aren't. answered question on best practices of search result urls here: cakephp search results best practices

insertions into c++ map STL container is failing -

please see following code understand question better. class comparebyvalue { public: bool operator()(const string* s1, const string* s2) const { if (s1 == s2) return true; if ((s1==null) || (s2==null)) return false; return (0 == s1->compare(s2->c_str())); } ...

Resizing only one part of the Java Swing components -

on java swing application have 2 components. on left side navigation (jlist) , on right side jtable. leave possibility increase size of window, without increasing size of both components. the proportion of 50/50 kept, through ought whole sizing. use gridlayout. behavior rooted layoutmanager or property has set? gridbaglayout allow achieve this. however, have considered using jsplitpane left-hand side contains navigation panel , right hand side contains table? configure additional space allocated right hand side calling setresizeweight(0.0) . however, still retain flexibility of allowing user manually resize navigation area if required. have option hide navigation panel calling setonetouchexpandable(true) on split pane.

database design - Append data from an existing mdb into another existing mdb -

i'm upgrading existing front-end , back-end set of mdbs. back-end getting bloated , impacting performance. data more 2 years old still needs retained, unlikely ever accessed again. thinking appropriate have active back-end (i.e., current , previous year's worth of data) , archived back-end (i.e., @ beginning of each year, append data active back-end existing, archived back-end). what other approaches should considering? if appropriate approach, how append data active back-end mdb archive back-end, preferably front-end (e.g., start-up function)? the method i've been able identify, go archive back-end, import every table active back-end, append. there way of front-end? you mentioned bloating. run compact , repair on bloated back-end mdb, if haven't already. in addition shrinking file size, update index statistics can allow query optimizer make better decisions query plans. you didn't provide details existing databases , tables, made seve...

css - Background color on input type=button :hover state sticks in IE -

i have input type=button background color set , different 1 on :hover - see http://jsfiddle.net/hc2eu/3/ in ie (all versions) - when mouse down on button, move off button, mouseup - background color stays in :hover setting until mouse on again. is there workaround this? preferably not js? (ie6 not necessary) there might fix <input type="button"> - if there is, don't know it. otherwise, option seems to replace styled a element. example: http://jsfiddle.net/uka5v/ .button { background-color: #e3e1b8; padding: 2px 4px; font: 13px sans-serif; text-decoration: none; border: 1px solid #000; border-color: #aaa #444 #444 #aaa; color: #000 } upsides include a element style consistently between different (older) versions of internet explorer without work, , think link looks nicer button :)

c - Using histogram to find the most common letter in an array -

this came with, run-time check failure #2 - stack around variable 'h' corrupted. int mostcommonletter(char s[]) { int i=0, h[26],k=0, max=0, number=0; while ( k < 26){ h[k] = '0'; k++; } while(s[i] != '\0'){ h[whichletter(s[i])] = h[whichletter(s[i])]+1; i++; } h[26] = '\0'; for(i=0;h[i]!='\0';i++){ if(h[i] > max) number=i; } return number; } you cannot h[26] = '\0'; - h has 26 elements indexed 0..25. know length of h don't need 0-terminate it, for (i=0; < 26; ++i) also, whichletter returns value in 0..25 range? if e.g. encounters space?

c# - Reading rich text from an Excel cell -

i attempting read excel spreadsheet in cells contain rich text. convert plain text format encodes formatting in way. example, given text: "here's text with italics in middle of it." i convert to: "here's text [i]with italics in middle[/i] of it". the problem haven't found way extract rich text excel cell. interop.office.excel allows me range , examine style property, tells me whether cell italicized; doesn't give me information of individual characters. best "solution" i've found involves copying contents of cell clipboard , calling clipboard.getdata(system.windows.dataformats.rtf) , , it's slow practical. is there smart way access rich text contained in excel cell i'm missing? the way access format of individual characters in string use range.characters object to demonstrate here simple udf in vba italic format describe. can extend detect other formats need function decodetext(r range) vari...

vba - Reset Ignored Spellcheck Words in VSTO for Word 2010 -

in older versions of word, following reset words user had chosen ignore: application.resetignoreall(); activedocument.spellingchecked = false; activedocument.checkspelling(); i'm trying same function in vsto word 2010 , while rechecks words 'ignore once'd, won't recheck words 'ignore all'd. i've tried recording macro while going options->proofing , clicking on 'recheck document,' , while reset ignore list correctly, macro generates same code above. does know if bug in word 2010/vsto, or if there different way reset 'ignore all' list? this bug, there workaround in vba, may able adapt vsto. correctly identified, activedocument.spellingchecked broken in word object model, in backstage view under options|proofing recheck document button works correctly. although macro recorder not reveal commands so, 1 can use combination of word built-in macro , sendkeys navigate button "manually" execute command: application...

silverlight - Why Don't DomainService Constructor Overloads Show Up as DomainContext Constructor Overloads? -

i wrote overload domainservice class. problem is, when recompile, it's not showing overload domaincontext. what's wrong? here code sample: [enableclientaccess] public class fooddomainservice : linqtoentitiesdomainservice<foodentities> { public fooddomainservice(cultureinfo cultureinfo) { thread.currentthread.currentculture = cultureinfo; } } and doesn't work: fooddomaincontext _foodcontext = new fooddomaincontext(thread.currentthread.currentculture); i error there no overload matching that. not allowed this? need attribute of kind? you not allowed this. when newing context silverlight client, not directly intantiating service. instead, instantiate proxy class generated ria services, , proxy class call service. why don't see constructor: because ria did not generate in proxy. doing you're trying implicate there round-trip server @ time of newing fooddomaincontext class, not going happen, because need complete ini...

Converting a mySQL table with id's to a MongoDB table with _id's -

i'm transferring mysql table mongodb. there primary key id in mysql table , want id converted _id in mongodb. i use php's mongocollection::insert( $mysql_array ); however doesn't work because if set $mysql_array['_id'] seen mongo string instead of mongoid. tried $mysql_array['_id'] = new mongoid( $id ) doesn't allow me override default _id value. saw mysql's integer columns converted string mongocollection::insert() . if set mongocollection::insert() correctly transfer integer maybe work. typecast _id integer value this... (int) $mysql_array['_id'] you'll find doing lot in mongodb

asp.net - How to change cell background color on click cell in table? -

i need change color of cells on сlick (only 2 colors: black , white), , analyze colors of cells form array values​​: 1 - black, 0 - white? try code toggle color onclick="this.style.backgroundcolor=='black' ? this.style.backgroundcolor='white' : this.style.backgroundcolor='black';" and colors using function var tds = document.getelementsbytagname("td"); for(var i=0; i<tds.length; i++) { alert(tds[i].style.backgroundcolor); } }

asp.net - How to implement bulk mailing using windows service on a schedule basis? -

i've requirement in need send 10000+ mails on quarterly basis . purpose used windows service triggers every day , executes mailing functionality after third month. i've fetch last 3 months records database , need send 1 mail each record. the problem faced mail server used not allow bulk mailing. how can providing delay between each sent (20 mails per minute)? there many way archieve this. once had similar requirement , solved via home grown service, fetch items special database table (mail queue) , sent each mail individially. queue filled on time regular business logic. necessary locking can done via db: schedule column stores expected scheduled time of sending mail. way service collects mails wich 'ready' sending. after successfull send, column (sent_timestamp) used mark success. we implemented whole service in asp , triggered via regular windows task planner jobs. in case, service start every minute , queue provide next 20 mails. easier way utili...

iphone - when is the dealloc method called? -

when dealloc method called? i've found (in lot of examples) of ns variables released in method it's instantiated in, when synthesizing component place release in dealloc method. the apple reference document states subsequent messages receiver may generate error indicating message sent deallocated object (provided deallocated memory hasn’t been reused yet). you never send dealloc message directly. instead, object’s dealloc method invoked indirectly through release nsobject protocol method (if release message results in receiver's retain count becoming 0). see memory management programming guide more details on use of these methods. subclasses must implement own versions of dealloc allow release of additional memory consumed object—such dynamically allocated storage data or object instance variables owned deallocated object. after performing class-specific deallocation, subclass method should incorporate superclass versions of dealloc through message super:...

HTML5 video elements audio attribute question -

can 1 explain video elements audio attribute me in laymans terms? what do? and values can have? specification of video tag here: http://www.w3schools.com/html5/tag_video.asp audio valid values: muted specifies default state of the audio. currently, "muted" allowed

c#.net function -

namespace csfunction { class program { static void main(string[] args) { public int addnumbers(int number1, int number2) { int result = addnumbers(10, 5); console.writeline(result); } } } } is code...am getting error like.....error type or namespace definition, or end-of-file expected ..hw can on come error you defining method inside method, , not allowed in c#. change this: namespace csfunction { class program { static void main(string[] args) { } public static int addnumbers(int number1, int number2) { int result = addnumbers(10, 5); console.writeline(result); } } } then if want call addnumbers main, add following line inside main addnumbers( 10, 5); also note not using parameters inside addnumbers anything. method should this: public int addnumbers(int number1, int ...

Security for ASP.NET application -

i developing .net based application financial institution , has multiple roles not using built in role provider. now want when create user assign role , when user logs in assigned role he/she cannot open form on he/she has no rights. how come role based security system application ? appreciate if can me , guide me come strong , secure application. thanks i think need take @ membership api. this blog post scott guthrie has links several resources started. http://weblogs.asp.net/scottgu/archive/2006/02/24/asp.net-2.0-membership_2c00_-roles_2c00_-forms-authentication_2c00_-and-security-resources-.aspx

I want to rotate simple 3D object in iPhone -

i want rotate simple 3d object (lets animal) in iphone application. don't have experience 3d programing or game engines. since have finish task asap can can find simple code task? thanks in advance use following link load 3d obj file , rotate it. http://iphonedevelopment.blogspot.com/2009/03/wavefront-obj-loader-open-sourced-to.html

asp.net - Regarding to retrieve values inside the array -

hi creating online quiz in asp.net c#. have 1 form displays testlist in dropdownlist & start button. after clicking 2nd form appears, 2nd form shows 1 label question, radiobuttonlist answers ,next & checkbox review. creating array of random question ids in start button click event of 1stform. when click next button in 2nd form next random question appears, want array of questions checked review. used code arrays of values ( eg.10101) 1 true & 0 false follows want array of question ids checked: int[] = (int[])session["values"];//this array of random question ids created in 1st form int g; if (chkmark.checked == true) { g = 1; } else { g = 0; } int[] chkarray = new int[convert.toint32(session["counter"]) - 1]; int[] temp1 = (int[])session["arrofchk"]; int k, no; if (temp1 == null) no = 0; else ...

Is XMPP peer to peer connection without server possible? -

i using libjingle xmpp connection. can connect 2 xmpp clients without having server in between. if yes how can if no why not possible? xmpp client1 <---------direct audio/video/im----------> xmpp client2 you may not able directly libjingle, protocol specification exists in form of xep-0174 . gist publish presence , connection information on multicast dns (e.g. bonjour ), connect directly when want chat. apple's ichat implements approach peer-to-peer mode.

c# - ASP.NET MVC Forms authentication against external web service -

i trying write asp.net mvc application frontend our crm has soap web service. user log in web application using crm username , password, , authenticate against crm, make web service calls on pages etc. i started @ using forms authentication , implementing custom membership provider - can implement methods need validateuser() , problem have after logging in crm web service given token has passed every subsequent web service call, , not sure can store this. so questions are: is forms authentication way go here, or going more straightforward handle of authentication myself , store token in session. if forms authentication way go, , how should store additional information this. seems likes using forms authentication ramming load of additional information (which related authentication) cookie or session outside bit of mess? any advice appreciated you can store authentication token in userdata part of forms authentication cookie. way available on each request. so ex...

ios - Dataprotection - iPhone -

have 1 worked on data protection in iphone - ios. can share details me regarding that? for anti-piracy measures, should redirect following stackoverflow question: reducing piracy of iphone applications though of techniques described there outdated. instance, no longer useful check signeridentity key in info.plist. if want more advanced stuff, take @ thread: http://www.iphonedevsdk.com/forum/iphone-sdk-tutorials/36330-iphone-piracy-protection-code-2-another-tutorial.html

eclipse - How to develop an basic application in mheg technology? -

i new mheg technology.is there tutorials or sample code available develop basic app using mheg in eclipse. how set mheg working environment in windows 7? here few links might mheg+ toolkit has compiler , mheg 5 player has sample code. check doc

button - getting back to folder in asp.net -

protected void button1_click(object sender, eventargs e) { response.redirect("page2.aspx"); } code go on .aspx if want go in folder in solution explorer, tried location dont work knows post it. this location > website\admin -news.aspx -project.aspx , created in news.aspx button go admin, , when hit button location next > website\admin\admin why duplicate admin ? if have admin folder in application redirect response.redirect("admin/page.aspx"); or response.redirect("~/admin/page.aspx"); if don't have admin folder in application redirect it response.redirect("page.aspx"); try ...

Jquery plugin with api -

how can retrieve api variables plugin. per jquery authoring documentation, here plugin structure: (function( $ ){ var methods = { init : function( options ) { return this.each(function() { var settings = { 'height' : 10, 'width' : 10 }; if ( options ) { $.extend( settings, options ); } $('<div>', { css : { height : settings.height, width : settings.width, } }).appendto(this); }); } }; $.fn.myplugin = function( method ) { if ( methods[method] ) { return methods[method].apply( this, array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else ...

Overcome git svn caveats -

i reading caveats of git-svn . via this question . what understand that: if mirroring svn trunk, branches etc on git repo, don't merge or rebase locally on branches. master points trunk . my point that, make git-svn crippled. what's point of git, if can't branch master , merge changed branch master? perhaps missing caveat in caveat says ok merge branches have same parent without rebases. can point me needs avoided , allowed. i'd want local branches, if necessary, need mirrored , merged , importantly git should merges svn. if using git branches mirror svn branches , cannot merge git branches, whats point of git-svn anyway? you can merge git branches, ones aren't directly mirrored svn. i have own set of git branches, made "git-svn" branches, , rebased regularly on top of said "git-svn" branches. way, merges need locally in git repo, cherry-pick need in order update "git-svn" branches, can safely dcommit withou...

delphi - type casting to a dynamic array -

given following: type tsometypearray = array of sometype; var anarray: array of sometype; function getsometypearray: tsometypearray; i want write anarray = getsometypearray(); compiler not it. without changing type of anarray or return type of getsometypearray how can typecast tsometypearray array of sometype ? you can't. need declare anarray of type tsometypearray , should work. alternatively, store result array of type tsometypearray call setlength on anarray length of returned array. , loop through 2 arrays setting elements of anarray elements of returned array.

xpath - JAXB bindings file: namespace-aware node selection -

i tend use external jaxb bindings files schema-to-java compilation. works fine, did notice 1 thing i've started wondering about. it's not jaxb-specific, more xpath question, context helps. suppose have schema: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:test="www.acme.com" targetnamespace="www.acme.com" elementformdefault="qualified" attributeformdefault="unqualified"> <xs:element name="el1"/> <xs:complextype name="testtype"> <xs:sequence> <xs:element ref="test:el1"/> </xs:sequence> </xs:complextype> </xs:schema> the element reference in complex type requires prefix "test", bound our target namespace, find element definition. if omitted prefix, schema processor complain can't find element refers. reference qualified name ...

optimization - speed up mysql query with multiple subqueries -

i'm wondering if there's way speed mysql query ordered multiple subqueries. on music related site users can different things artists, songs, albums etc. these "likes" stored in same table. want show list of artists ordered number of "likes" users friends , users. want show artists, have no likes @ all. i have following query: select `artists`.*, // friend likes (select count(*) `likes` like_type = 'artist' , like_id = artists.id , user_id in (1,2,3,4, etc) // ids of friends group like_id ) `friend_likes`, // likes (select count(*) `likes` like_type = 'artist' , like_id = artists.id group like_id ) `all_likes` artists order friend_likes desc, all_likes desc, artists.name asc the query takes ± 1.5 seconds on artist table 2000 rows. i'm afraid takes longer , longer table gets bigger , bigger. tried using joins can't seem working because s...

xhtml - rel properties in html tags -

i reading google seo suggestions , had question: can write many rel in rel property?? how can write many rel in it?with blank space example follows?? for example, ok?: <a rel="noindex nofollow" href="/mysite.com" target="_blank"></a> thanks in advance!! the w3c @ http://www.w3.org/tr/html401/struct/links.html#adef-rel : this attribute describes relationship current document anchor specified href attribute. value of attribute space-separated list of link types. so, yes, can.

PHP/MySQL - Multiple Selects For Query -

i'm writing simple musicians database has search function e-mail details of musicians people when search specific instrument in database. have people play more 1 instrument therefore have 5 tables, instrument, instrument2, instrument3, instrument4, instrument5. i have mysql query on e-mail function cannot search more 1 table. here code: $query = "select * instruments (instrument, instrument2, instrument3, instrument4, instrument5) = '$search'"; am being stupid syntax or going wrong way this. many thanks. have tried: select * instruments '$search' in (instrument, instrument2, instrument3, instrument4, instrument5) ? assume want. but real solution create separate table instruments , not keep multiple columns same information. you should have table musicians , 1 instruments hold general instruments , info. , 3rd 1 (used resolve many many relationship between instruments , musicians) holds musician id , instrument id. here...

c# - Escape fullstop before slash in URL string -

i've found oddity i'm trying around c# sanitizing / interfering specified url, , giving 404 result. it happens there's forward slash after full-stop - c# , visual studio determined remove fullstop. for visual studio , control-click string linking mal-formed url in compiled c# string transformed, before getting new uri(). the link is: http://www.mattmulholland.co.nz/matt_mulholland/matt_mulholland_-_official_website._boom./rss.xml (it's './' @ end causes issue) i've tried escaping both fullstop + slash in ascii, , 'dontescape' option in uri() constructor, no luck far... and other thoughts how can string allow correct url? thanks. this use: // call line once in application lifetime (when app starts) applyfixenddoturl(); // -------------------------- uri testurl = new uri("http://www.mattmulholland.co.nz/matt_mulholland/matt_mulholland_-_official_website._boom./rss.xml"); string strurl...