Posts

Showing posts from September, 2015

html - Auto resizing centre div using css? -

Image
i having difficulty getting 3 divs automatically resize when resizing browser window/page. i have 2 divs of fixed size , want centre div automatically resize fill remaining space , not have third div wrap newline when page size shrinks. i set min-width property on div wraps 3 divs prevent wrapping of third div once middle div 65px wide. does have done javascript because trying achieve css having no luck. the javascript or css expression width = page.width - div1.width -div3.width avoid using js if possible. thanks help! mike you can see expected behavior in attached image. 1) want 2) experiencing on shrinkage i have div re-sizing , textbox inside set @ 100% re-sizes div. however right side div can either 267px shown below or 192px (discrete) should set margin-right code behind on pages? or there way make margin-right dynamic based on size of the div right? eg. html <div id="wrapper"> <div id="left"></div> <div i

IE7, ckeditor and jQuery adapter not working -

i unable open ckeditor instance in ie7 jquery dialog box. works in firefox, in ie following error in web console: script1002: syntax error config.js?t=b8dj5m3, line 1 character 1 script1002: syntax error en.js?t=b8dj5m3, line 1 character 1 script5007: unable value of property 'options': object null or undefined ckeditor.js, line 49 character 943 any ideas or there way purely not supported? to fix this, created entire instance in jquery, predefining properties , assigned ckeditor each element wanted have editor var properties = {properties in here}; $("#textareaid").ckeditor(properties); i dont think solution entirely helped me editor working :)

Get gateway address in C/C++ -

i use ioctl() set gateway address ( siocaddrt rtf_gateway in flags). what's standard ioctl routine retrieve it? my understanding there no 'standard ioctl routine' gateway address in cross-platform-friendly fashion. on linux might consider looking @ using netlink sockets, described in this post .

.NET Workflow issue -

i calling wf: workflow1 wf = new workflow1() { childrenoption = true, market = "english", server = new uri("http://mysite"), sptags = datatoupdate, }; workflowinvoker.invoke(new workflow1()); but reason getting exception, why? other way how can invoke wf avoid problem? values must bound non-null expression before parallelforeach activity 'parallelforeach<keyvaluepair<tuple<string,string,string>,zalupatag>>' can used. it appears workflow1 has parallelforeach activity in did not provide collection values property.

javascript - "PrimeFaces is not defined" error -

i trying print using primefaces printer functionality. have created new glassfish 3 java ee project , added primefaces 3.1.1 .jar file. the code using follows: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>facelet title</title> </h:head> <h:body> <h:form> <h:outputtext id="a" value="aa" /> <h:commandlink id="btn" value="print"> <p:printer target="a" /> </h:commandlink> </h:form> </h:body> </html> unfortunately, print function isn't working. instead, firebug console shows me following error: primefaces not defined if didnt have head tag error. primefaces requires head tag work. see #2 on faq http://primefaces.org/faq.html

c# - Finding a position in a word document to insert a table -

i working on writing results of database query tables in word. have done code accessing/creating objects results of query , find myself little stuck on writing these word template given me. summary document in have insert tables of data pulled db in correct position in document. instance, document has 4 section headers , under each header, there text after have insert table. 1 such header can like: school records below find table in school records listed: so when go print school record data object, need way somehow insert data in table format right below above line in word document. can tell me how can first find correct position in doc , how create table in word c#? there article how insert images @ specific position in word document. maybe it's useful insert table either.

javascript - Trouble with word-boundary (\b) -

i have array of keywords, , want know whether @ least 1 of keywords found within string has been submitted. further want absolutely sure keyword has been matched, , not similar word. say, example, our keywords [english, eng, en] because looking variation of english. now, input user i h8 eng class , or equally provocative , illiterate - eng should matched. should fail match word england or odd thing chen , though it's got en bit. so, in infinite lack of wisdom believed along lines of in order match 1 of array items input: .match(regexp('\b('+array.join('|')+')\b','i')) with thinking regular expression matches array, presented (english|eng|en) , see whether there zero-width word bounds on either side. you need double backslashes. when create regex regexp() constructor, you're passing in string. javascript string constant syntax also treats backslash meta-character, quoting quotes etc. thus, backslashes stripped out

makefile - GNU Make using $(eval ...) not working -

here makefile: libdirs += ./librelease libdirs += ./sharedarcgis/depfileslinux64/libreleaselinux64/skia libdirs += ./sharedarcgis/depfileslinux64/libreleaselinux64/libtess libdirs += ./sharedarcgis/depfileslinux64/libreleaselinux64/sqlite statics = $(wildcard $(libdirs:=/*.a)) targeta = libruntimecorejava.a targetd = libruntimecorejava.so targetd1 = $(targetd).1 targetd2 = $(targetd).1.0 targetd3 = $(targetd).1.0.0 ar = ar cqs ar_extract = ar -x link = g++ symlink = ln -f -s ldflags = -shared -wl,-soname,libruntimecorejava.so extract = : $(targetd) $(targeta) $(targetd) : clean mkdir -p ./obj ./librelease $(foreach lib, $(statics), cp $(lib) ./obj;) $(eval extract := $(wildcard ./obj/*.a)) echo $(extract) $(foreach lib, $(extract), $(ar_extract) $(lib);) $(foreach lib, $(extract), rm -f $(lib);) #$(cxx) $(ldflags) $(objs)

javascript - creating image tag in html and adding css -

i creating image in jquery border attribute doesn't seem work... syntax wrong? var img = $('<img>', { 'title': 'event (event '+wavy_counter+')', 'class': 'listed_event', 'id': 'wavy_event_'+wavy_counter+'', 'data-count': ''+wavy_counter+'', 'src': 'final_tutorial_buttons/wavy.png', 'height': '50', 'width': '50', 'border': 'solid', 'border': '2px', 'border': 'red', 'onclick': 'highlight.call(this);', 'data-start': '', 'data-end': '' }); i border black instead of red. i think should be: 'style': 'border: 2px solid red', it'

c - how to convert "0xbff18c08" to 0xbff18c08 int? -

i looking native function c libraries or code example implement it: have string contains byte values want convert int value. how this? tried using atoi() , atol() 0 0xbff18c08 . thanks. then looking strtoul(str, null, 16) .

apache - mod_rewrite writing local routes -

you see, want redirect [r] http://www.domain.com/dir1/ http://www.domain.com/ . i want accept http://www.domain.com/dir1/([0-9]+) , [l] requests dir1.php?query=$1. , [l] http://www.domain.com/dir1/(.+ ) root. so these rules: rewriterule dir1/([0-9]+) dir1.php?query=$1 [l] rewriterule dir1/(.+) $1 [l] rewriterule dir1/ . [r,l] the problem last 1 (and tried many variations of it) redirects http://www.domain.com/home/domain/www/ . mean, inserts local directory. want redirect http://www.domain.com/ thanks, use path slash redirect client absolute path. rewriterule dir1/ / [r,l] the mistake using . instead of / . this comes straight rewriterule examples: inside per-directory configuration /somepath (/physical/path/to/somepath/.htacccess, rewritebase /somepath) request ``get /somepath/localpath/pathinfo'': given rule resulting substitution ---------------------------------------------- ---------------------------

c# - MonoTouch.Dialog search filter not working properly for MessageElement cells -

i have following code example demonstrate simple monotouch.dialog table using messageelement cells. issue having when enable automatic search feature in dialogviewcontroller . whenever doing search displays blank table. if replace messageelement cells stingelements cells search works fine. does there need additional code search messageelement cells properly? any issue appreciated. using system; using monotouch.uikit; using monotouch.dialog; using monotouch.foundation; namespace messageelementsearch { public class messagetable : dialogviewcontroller { public messagetable(rootelement root) : base(root) { section sec = new section(); root.add(sec); (int = 0; < 10; i++) { messageelement me = new messageelement(); me.sender = "sender " + i.tostring(); me.subject = "subject " + i.tostring(); me.body = "body &qu

caching - Issue Displaying Updated Webpage -

i using adobe dreamweaver web develop. have uploaded files via ftp web server, went on web sever confirm files uploading. when going view webpage in browsers, changes aren't there. possibly wrong? know it's not uploading files files updating , uploading on web server. i found solution! issue aname under domain settings. works perfect now.

windows phone 7 - Update live tile when exiting app - any restrictions/best practices -

i have app update live tile when user leaves app. first question if bad idea? if user starts app 20 times per day bad idea or in way affect background service? second question if there limit how long or resource intensive might be. guess put code in onnavigatedfrom, os kill app if updating of live tile takes long? need create image, save isolated storage, read image , update tile. really looking forward thoughts on this. edit 1: reason me asking if above works fine. if exit app when starts black tile instead of tile background image. impression code doesn't finish. how can avoid that? edit 2: since i'm creating live tile dynamically think problem loading of background image. load background image , add text it. when tile goes black can still see text there must loading of background image used background tile. edit 3:here complete code creation of image used background image. tried simplify little reduce code. grid grid = new grid(); stackpanel sp = new stackpa

.htaccess - 301 redirect with custom conditions -

i want redirect url .htaccess file. some examples better understanding, 1) http://www.mydomain.com/salary/account-manager-salary-jobs http://www.mydomain.com/salary/account-manager-salaries 2) http://www.mydomain.com/salary/software-enginner-salary-jobs http://www.mydomain.com/salary/software-enginner-salaries i want rewrite rule condition pattern matching. create .htaccess file in $document_root , put code: options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / rewriterule ^(salary/.*-salary)-jobs$ $1 [l,nc]

asp.net - ObservableArray not notifying when item changed -

i try bind observablearray div on page , ok. array contains simple json objects, not observable, obtained webservice . after that, want able modify objects in array , view refreshed each modification. example, when checkbox gets clicked change flag on json object (this seems work automatically right) , @ same time ui should updated, not happen. provide me reason (is because objects simple, not observable?) , solution? var documentcontentmodel = function () { var self = this; self.content = ko.observablearray(); self.elementapprovalchanged = function (element) { documentservice.dosomething( element.id, function (result) { if (!result) { var negatedapproved = !element.approved; element.approved = negatedapproved; } }, function (error) { alert(error); }

android - Dynamic Button Onclick Listener -

i trying create dynamic buttons. when clicking button should go specified url assigned text of button. for testing, first tried id, if equal prints value of i . whenever clicked 1 button, instead of telling particular i value, enters whole loop, , prints values of i starting 1 19 (the number of buttons dynamically created) and after printing values 1 19, program getting force closed saying null pointer exception . i tried placing handler code outside oncreate() , i'm still getting same error. for ( = 0; <itemlist.gettitle().size()-1; i++) { title[i] = new textview(this); title[i].settextcolor( -16711936 ); title[i].settextsize(18); title[i].settext("title = "+itemlist.gettitle().get(i)); description[i] = new textview(this); description[i].settextcolor(-16776961); description[i].settext("description = "+itemlist.getdescription().get(i)+"......"); more[i]=new button(this); more[i].settext(itemlist.getl

Apache HTTP Server Location directive - exclude url -

i've apache http server used proxy (over https) jboss-deployed webapp. i've following entry in conf file: <location "/app"> proxypass http://localhost:8080/app proxypassreverse http://localhost:8080/app authtype basic authname "private documentation repository" authuserfile <path-to-file> require valid-user </location> as can see, valid user required access /app. question is: how write directive exclude 1 particular file jboss webapp, access file won't require valid user e.g.: <location "/app/some-file.xyz"> proxypass http://localhost:8080/app/some-file.xyz proxypassreverse http://localhost:8080/app/some-file.xyz </location> i mean: when user requests (app/) /app/some-file.xyz he/she prompted password, otherwise apache enable user download some-file.xyz. appreciated. <location "/app/*.xyz"> allow satisfy pro

java - SQL - how to return multiple rows with one SQL query? -

i have managed bean makes sql queries oracle database. simple example how make sql queries. table structure: globalsettings --------------------------------- sessionttl varchar2(40 byte) maxactiveusers number activeusers varchar2(20 byte) i use table store application settings. in example listed below can fetch 1 string 1 sql statement. want sql query fetch content of 3 rows - sessionttl, maxactiveusers, activeusers. possible? public string checkuserdb(string usertocheck) throws sqlexception { string storedpassword = null; string sql_statement = null; if (ds == null) throw new sqlexception(); connection conn = ds.getconnection(); if (conn == null) throw new sqlexception(); try { conn.setautocommit(false); boolean committed = false; try { sql_statement = "select passwd users username = ?"; preparedstatement passwordquery

jquery - ajax request per div -

i have 10 divs on page , each div render own ajax request when page loads. know can make max 2 ajax requests , have wait (based on browser) before next request gets fired. wondering best way design such page. should create ajax request inside divs can pass div context ajax reponse? this: <div id="request1"> make ajax request </div> <div id="request2"> make ajax request </div> , on...... is there chance result may mixed , wrong div render result different request? --edit-- i cannot make single call make calls separate service , service may or may not available. ajax asynchronous, way, if call 10 ajax requests using either $.get , $.post or $.ajax , requests fire independently without waiting previous ones. unless have special requirements need avoid that, go ahead

iphone - How to implement the scrolling required in a weekly calendar -

i need implement weekly calendar , have not found did day calendar (gccalendar). unless can point me similar roll own. need work weekly calendar in iphone's calendar app. i wondering best approach might scrolling functionality required. when user drags horizontally days including headers (mon, tues, etc.) scroll. when user drags vertically, hours scroll , down. headers remain stationary , in view. is somehow done in single scrollview, or there 2 scroll views. seems me easiest approach have 2 scroll views. header view scroll horizontally , somehow synch header , hours view when scrolling horizontally. is there better way this? thanks, john

petapoco - Parameter '@home' specified but none of the passed arguments...Error message -

i having sql statement follows: select [user].[id], [user].[name], [user].[email] [user] email = 'user@home.com'' and it's firing error follows petapoco: parameter '@home' specified none of passed arguments have property name (in 'select [user].[id], [user].[name], [user].[email] [user] email = 'user@home.com'') what error message implies? wrong sql statement? petapoco not accept '@' in sql statement?i need search email address. you need put 2 @ symbols escape character since used prefix parameters normally. so value need 'user@@home.com '.

java - Check if readLine is blank, but don't read a line -

i have while loop performs while readline != "". problem is, reads line , moves on next one, not want. need either test whether line blank without moving on next line, or go before reading it. thanks in advance. while (filereader.readline() != "") { string readline = filereader.readline(); } you provided little information, guess problem don't have actual string inside loop body. correct me if i'm wrong. to address problem, do: string line; while(((line = reader.readline()) != null) && !("".equals(line))) { system.out.println("line: "+line); }

c++ - load QPixmap doesn't work on vista -

i need help, created application has image browser in it. i'm using qt version 4.7.1 along visual studio 2010 c++. application works on computer; when try on computer (windows vista) - using vs deployment - isn't loaded. after googling lot seems plugin should included in setup project. please me out guys. you have copy %qtdir%\plugins\imageformats\qjpeg4.dll %yourapplicationdir%\imageformats\qjpeg4.dll .

java - JUnit Test error -

i trying run junit test program, getting error message *incompatible types required: int[]; found: int * here code shows error myqsarray = qs.quicksort(sortedarray2,0, sortedarray2.length - 1); and here call quicksort method public static int quicksort( int a[], int p, int r){ int q; if (p<r) { q = partition(a,p,r); quicksort(a, p, q-1); quicksort(a,q+1,r); } return qs1.quicksort(a, p, r); } help please, in advance i see couple of problems code: the method declared return int value try assign int int[] . causes actual compiletime error. change method signature public static int[] quicksort( int a[], int p, int r) for quick fix. then , recursive function quicksort misses exit criteria. run indefinitely (or @ least until virtual machine gives , throws stackoverflowexception after couple of milliseconds). need add criteria check, if array sorted , return sorted array (see "new" method signat

datetime - Get date and time in .NET -

currently trying hour , minute using code: datetime currentdate = datetime.now.date; int currenthour = datetime.now.date.hour; int currentmin = datetime.now.date.minute; but getting 0 instead current hour , minute. how can fix problem? you're using date property gives midnight @ given datetime. want now: datetime = datetime.now; int hour = now.hour; int minute = now.minute; datetime date = now.date; // if need note code calls datetime.now once , instead of once hours , once minutes 1 . means if call close (say) 8 a.m., might 7:59 or might 8:00 - won't either 7:00 or 8:59, if had either of these: // bad option 1 (could 7:00) int hour = datetime.now.hour; // imagine clock rolls on now... int minute = datetime.now.minute; // bad option 1 (could 8:59) int minute = datetime.now.minute; // imagine clock rolls on now... int hour = datetime.now.hour; you should also consider not using datetime.now directly @ all. has 2 problems: it returns time in loca

Does LoadRunner measure UI response time? -

i know loadrunner used system responses wonder whether measures e.g. rendering time (thousands of items in large lists etc.). guess done verifying particular object appeared in ui then, think loadrunner not run browsers , sends recorded data. greateful input. thanks! loadrunner has many ways measure rendering time. starting @ top of stack , going down citrix/rdp virtual user. sync on bitmap type bitmap has rendered client gui virtual user. has been part of loadrunner since version 1. first xrunner, became winrunner , in current product quicktest professional. gui virtual users quite popular in thick client server era , web clients getting thicker , richer making return. going run handful of these while remainder transport level users truclient (loadrunner 11 on). runs full firefox stack, including rendering. as move stack run full client there tradeoffs. first resource cost per virtual user becomes larger have run full client instead of reproducing co

One database or many for multicountry web application -

let's different points of view situation have. i'm creating (asp.net) web application database (sql server express, max 10gb db size). this application manages entities entities related countries, 1 country - many entities. before anything, can't predict how db going grow. personal/hobby project i'm doing in free time. my concerns if should create specific copy of database per country. reasons think are: size of databases smaller, won't have problems of size starting sql server express. again, db size. smaller per country, performance better. can maintenance tasks (backups, deployments) @ low peak time every country. in case of different laws protecting data per country can adapt each db specific law. customized text search per country. not problem because think create view per different country , text search of view. then, if have 1 database countries there advantages: maintenance going simpler. 1 database means doing things once. no redun

xcode - There have some strange thing with Admob on my app -

now develop app tool xcode xib. fount admob can't run in app. if put admob view upon other views. other views can't touch event. scrollview, tabbar... if put admob view bottom of others. admob can't touch again. code here : controller = [[uiviewcontroller alloc]init]; controller.view.frame=cgrectmake(0, 0, rect.size.width, rect.size.height); banner = [[gadbannerview alloc]initwithframe:cgrectmake( rect.origin.x, rect.origin.y, gad_size_320x50.width, gad_size_320x50.height )]; banner.adunitid = gad_banner_unit_id; banner.rootviewcontroller = controller; gadrequest *request; if (self._isdebuged) { request=[[gadrequest alloc]init]; request.testing=true; }else { request=[gadreque

eclipse - Spring MVC Abstract Controller::How to get exact method signature when implementing an abstract controller interface -

i using sts 2.8.1 , spring 3.1.1.release. i have abstract controller below public abstract class supercontroller { @requestmapping(value = "/entity", method = requestmethod.post, headers = "accept=application/xml,application/json") public abstract @responsebody oauthentity setoauthentity(@requestbody oauthentity oauthentity); @requestmapping(value = "/entity/{id}", method = requestmethod.get, headers = "accept=application/xml,application/json") public abstract @responsebody oauthentity getoauthentity(@pathvariable("id") long id); } when extend controller in sts gives me method signature below @override public oauthentity setoauthentity(oauthentity oauthentity) { // todo auto-generated method stub return null; } @override public oauthentity getoauthentity(long id) { // todo auto-generated method stub return null; } i understand @requestmapping inherited fine , have tested code (it works!!). w

android - Java gson generic array/list deserialization -

i'm trying deserialize generic list using gson. i'm able deserialize following json: [{"updated_at":"2012-03-09t11:13:31z","id":1,"title":"moda","position":0,"short_name":"md"}, {"updated_at":"2012-03-09t11:13:40z","id":2,"title":"sissi","position":1,"short_name":"si"}, {"updated_at":"2012-03-09t11:13:47z","id":3,"title":"levis","position":2,"short_name":"lv"}, {"updated_at":"2012-03-09t11:14:03z","id":4,"title":"dolce&gabanna","position":3,"short_name":"dg"}] with following code: t[] array = (t[])java.lang.reflect.array.newinstance(p_class, 0); gson.fromjson(content, array.getclass()); but now, have following json can't figure out how deserial

visual studio - Accessing a resource file from a different project with ResourceManager C# -

i have visual studio solution consisting of multiple projects. in 1 of projects, have languagelocalization resource file. access file in code in different project using resourcemanager. when accessing resource file in same project use: resourcemanager rm = new resourcemanager("namespace.languagelocalization", assembly.getexecutingassembly()); however when use same code in different project, can't find resource file. double checked make sure project referenced project resource file , declared in using statement @ top of class. any suggestions? the second argument resourcemanager constructor specifies assembly contains resources. assembly.getexecutingassembly() won't work because returns assembly other project. instead, pass typeof(apublicclassintheresourceassembly).assembly ; class in resource assembly do.

ruby - Rails / Heroku - How to anti-virus scan uploaded file? -

how possible scan uploaded file viruses, trojans etc.? just thinking preventing users upload nasty stuff. i using heroku , amazon s3. check out this it's support rest/json antivirus web service here post - https://stackoverflow.com/questions/4104985/antivirus-scanning-service

c# - Does it make sense to unit test for a not existing Id -

does make sense pass not existing unique id getxx method expect created list without count? mean, when test existing id list created independent of number of items holds. why should list null or have no count == 0 if pass not existing id? not sure sense of test. [test] public void get_teststeps_by_unitid_not_existing() { // arrange iteststepdataprovider provider = new teststepdataprovider(_connectionstring); int unitid = 100; // act list<teststep> units = provider.getteststepsbyunitid(unitid); // assert assert.isnotnull(units); assert.count(0, units); } this depend on system under test, supposed , how defined. example if defined method testing should never return null values empty collections given input (such non existing ids - whatever means) makes perfect sense test case , correct behavior of method.

ios - css3 size transform for iphone -

i have div needs re-sized determined value, let's has pass width of 320px width of 60px. i used css -webkit-transform , apply new value div working smoothly. problem here have make run on iphone. aware of 3d transform issue, , know should use 3dscale instead, in order make work smooth, using scale doesn't me pixel accuracy i'd need. so, wondering if there other method. i recommend instead used mootools' tools animation. not smooth accelerated transforms, @ least work in modern browsers , exact. you should fx.tween or fx.morph .

css - Floating images to their own "column" without divs -

i recreate of following page on existing blog: http://jeff.klukas.net/bio/ the hallmark here have 2 columns, images on left , text on right without text wrapping underneath images. also, images appear @ vertical positions place them in context text. the current design uses blueprint css pairs of divs each section of image , text. i'd create adaptive design crunches down single column smaller browser widths, source (generated markdown) like: <img src=img1.png> <p>first paragraph...</p> <img> src=img2.png> <p>second paragraph...</p> which display on narrow screen as: ------------ |img1 | ------------ first paragraph ------------ |img2 | ------------ second paragraph or on wide screen as: ------------ first paragraph... |img1 | more text more text ------------ more text more text more text more text more text more text more text more text. ------------ second paragra

ruby on rails - Why do I get a undefined method `join' for nil:NilClass error? -

i have code in "index.html.erb" file in project: <h1>listing businesses</h1> <table> <tr> <th>index</th> <th>name</th> <th>phone number</th> <th>suite</th> <th>address</th> <th>city</th> <th>province</th> <th>postal code</th> <th>fax</th> <th>latitude</th> <th>longitude</th> <th>website</th> </tr> <% count = 0 %> <% @businesses.each |business| %> <!--<%=business.inspect %> <br> <br>--> <%count = count.to_i + 1 %> <tr> <td><%= count %></td> <td><%= business.name %></td> <td><%= business.phone %></td> <td><%= business.suite %></td> <td><%= business.address %></td> <td><%= business.city %>

dfa - How can I prove if this language is regular or not? -

how can prove if language regular or not? l = {a n b n : n≥1} union {a n b n+2 : n≥1} i'll give approach , sketch of prove, there might holes in believe can fill yourself. the idea use nerode's theorem - show there infinte number of equivalence groups r l - , theorem can derive language irregular . define 2 types of sets: g_j = {a n b k | n-k = j , k≥1} each j in [-2,-1,0,1,...] h_j = {a j } each j in [0,1,...] g_illegal = {0,1} * / (g_j u h_j) [for each j in specified range] it easy see each x in g_illegal , , each z in {a,b} * : xz not in l . so, every x,y in g_illegal , each z in {a,b} * : xz in l <-> yz in l . also, each z in {a,b} * - , each x , y in g_j [same j both]: if z contains a , both xz , yz not in l if z = b j , xz = a n b k b j , , since k+j = n - xz in l . same applies y , yz in l . if z = b j+2 , xz = a n b k b j+2 , , since k+j+2 = n+2 - xz in l . same applies y , yz in l . ot

django - AttributeError: 'NoneType' object has no attribute 'str' in suds -

i using suds client wsdl in our project. i have code . sudsclient = sudsclient(settings.wsdl_url) values = { "merchantcode": settings.yp_merchant_code, "merchantreference": str(reference_id), "transactiontype":settings.yp_transaction_type, "amount":int(charged), "currencycode":client.currency, "cardholdername":str(form.cleaned_data['name_on_card']), "cardnumber": str(form.cleaned_data['card_number']), "expirymonth":int(form.cleaned_data['exp_month']), "expiryyear":int(form.cleaned_data['exp_year']),

iphone - Assigning values to an object in core data -

below code snippet: nsfetchrequest *request= [[nsfetchrequest alloc] init]; nsentitydescription *entity = [nsentitydescription entityforname:@"login" inmanagedobjectcontext:self.managedobjectcontext]; nspredicate *predicate =[nspredicate predicatewithformat:@"userid==%@ , password==%@",useridentered, passwordentered]; [request setentity:entity]; [request setpredicate:predicate]; nserror *anyerror=nil; nsarray *fetchedobjects = [self.managedobjectcontext executefetchrequest:request error:&anyerror]; login *login = [fetchedobjects objectatindex:0]; information *information = [nsentitydescription insertnewobjectforentityforname:@"information" inmanagedobjectcontext:self.managedobjectcontext]; login.information = information; login.information.title = informationtitletextview.text; login.information.info_1 = information1textview.text; login.information.info_2 = information2textview.text; [self.managedobjectcontext save:nil]; // write database nslo

wpf - Unable to drag drop items between bound itemscontrols -

Image
iv'e got several bound itemscontrols play role of of drop target need able drag drop items between these items controls . the problem items control's not recognized drop targets drag drop framework the itemscontrol panel : <itemspaneltemplate x:key="toppipepaneltemplate"> <stackpanel></stackpanel> </itemspaneltemplate> the datatemplate : <datatemplate x:key="pipedataitem" > <ellipse width="45" height="45" fill="{binding ismine,converter={staticresource mycheckerownertocolorconverter}}"></ellipse> </datatemplate> the itemscontrol style : <style targettype="{x:type itemscontrol}" x:key="itemscontrolstyle"> <setter property="itemtemplate" value="{staticresource pipedataitem}"></setter> <setter property="allowdrop" value="true"

Stuck on Unpivot / Pivot Combo SQL Server 2008 -

i can't seem head around problem think need combination of pivot , unpivot in sql server 2008: i have table follows: sale | month | count | budgeted | actual ------------------------------------------------ newsale | 1 | 120 | 45.23 | 50.10 newsale | 2 | 30 | 3.10 | 1.2 newsale | 3 | 70 | 45.00 | 100.32 i need pivot months columns, unpivot count, budgeted, actual rows, so... type | 1 | 2 | 3 ----------------------------------- count | 120 | 30 | 70 budgeted | 45.23 | 3.10 | 45.00 actual | 50.10 | 1.2 | 100.32 i've tried far, can't work out how put pivot in there: select * ytd pivot ( sum([count]), sum([budgeted]), sum([actual]) [month] in ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]) ) figures this gives me syntax error can't have more 1 calculation in pivot (as far understood error. help!!! declare @t table ( sale varchar(10), [month] int,

objective c - Checking for multiple variable value in Xcode -

i creating iphone app taking many values user , assigning them variables. i want display alert message if more 2 of variables' values equal zero. basically, if user has 2 empty fields, should show alert stating there insufficient data. any idea how this? your question bit vague about find errors display alert somewhere alone lines of pseudo code: int errorcount = 0; if(var1 == 0) { errorcount++; } if(var2 == 0) { errorcount++; } // check variables... // show alert if there errors if(errorcount > 0) { uialertview *alert = [[uialertview alloc] initwithtitle:@"title" message:[nsstring stringwithformat:@"you have %d errors", errorcount] delegate:nil cancelbuttontitle:@"gofightwin" otherbuttontitles: nil, nil]; [alert show]; [alert release]; }

camera - Android App only working One time, then crashes -

okay having problem getting app work. have game needs few pictures , strings user. have opening screen (openingscreen) acts splash screen opens menu (menuscreen). there user can pick go game or go activity shows current pictures (pickscreen). user can go activity , there open activity gives larger version of picture have picked or default picture (picone). here user has option take new picture , change current strings. part of works great. problem occurs when: after user picks picture , backs out of app. next time open it, force close either when go pickscreen or after press done after taking new picture , when go picone activity. not same thing everytime, crashes @ 1 of points. the other issue happens when change 3 string names. after pressing save , going pickscreen, app crashes when going picone or if out of app crashes when going menuscreen pickscreen. i know lot of code at, have spent lot of time looking around , getting code different places app , @ point cann