Posts

Showing posts from February, 2010

rcp - EMF: Find the Image to an EClass with only the EPackage? -

i have epackage , package 1 eclass. want image associated eclass, how can that? okay found out myself: have adapterfactory on gloabl registry , there can access label provider. there should easy

printing - print matrix with indicies python -

i have matrix in python defined this: matrix = [['a']*4 in range(4)] how print in following format: 0 1 2 3 0 1 2 3 this function matches exact output. >>> def printmatrix(testmatrix): print ' ', in range(len(testmatrix[1])): # make work non square matrices. print i, print i, element in enumerate(testmatrix): print i, ' '.join(element) >>> matrix = [['a']*4 in range(4)] >>> printmatrix(matrix) 0 1 2 3 0 a a 1 a a 2 a a 3 a a >>> matrix = [['a']*6 in range(4)] >>> printmatrix(matrix) 0 1 2 3 4 5 0 a a a 1 a a a 2 a a a 3 a a a to check single length elements , put & in place of elements length > 1, put check in list comprehension, code change follows. >>> def printmatrix2(testmatrix): print ' ', in range(len(testmatrix[1])): print i, print i, el

eclipse - Source for midpapi20.jar -

where can find midpapi20.jar source files? i started j2me applications development using eclipse , i'm not able view javadoc of classes. tried netbeans , asks me attach sources midpapi20.jar can't find them. it's annoying not being able find such informations on google, couldn't find anything. use (if licence attached midpapi20.jar permits you) jd-gui.exe java decompiler. yield approximation original source files although enums, string switches , <> messed up.

python - regex to strict check numbers in string -

example strings: i numeric string 75698 i alphanumeric string a14-b32-c7d so far regex works: (\s+)$ i want add way (probably ahead) check if result generated above regex contains digit (0-9) 1 or more times? this not working: (\s+(?=\s*\d\s*))$ how should it? look ahead not necessary this, : (\s*\d+\s*) here test case : http://regexr.com?34s7v

Trying to replace content zones in typo3 -

what i'm aiming do! i'm creating template site in typo3, , i'd rid of typo3's default content zones, , replace them own. i.e. on page menu. to remove left, content, border and keep/add. header. main. right. the problem! i've found snippets around web, , bluntly, i'm expecting happen, isn't happening. every post seems "thank you, great success! ++", code paste isn't throwing errors, , isn't doing anything, well, @ all. my attempt via typo3 documentation http://typo3.org/documentation/snippets/sd/24/ i call mod.shared.colpos_list in order choose 3 sections display t3lib_extmgm::addpagetsconfig(' mod.shared.colpos_list = 0,1,3 '); and edit tca in exttables.php set them specs. $tca["tt_content"]["columns"]["colpos"]["config"]["items"] = array ( "1" => array ("header||header||||||||","1"), "0" => array (&qu

css - Middle div 100% width -

how make middle div take remaining space left in width, still staying in place beside 2 other divs? if remove either of 2 divs on sides, main div should take space there left? code: <div class="row-fluid"> <div class="span12"> <div class="sidebar">1</div> <div class="content-box">2</div> <div class="sidebar">3</div> </div> </div> http://jsfiddle.net/u3hr5/2/ my suggestion using table since want of them on same row own heights. html: <div class="row-fluid"> <table style="width: 100%"> <tr> <td class="sidebar">1</td> <td class="content-box">2</td> <td class="sidebar">3</td> </tr> </table> css: .sidebar { width:225px; background-color:blue; } .content-box { background-color:red; } he

Declare list elements as symbols sympy python -

i've got function returns list elements under conditions : m1= [[1, 0], [0, 1]] m2= [[2, 0], [0, 2]] and declare m1 , m2 symbols containing indices, i.e m1[0] symbol [1,0], using sympy, unsuccesful in attempts far. does have idea how this? any appreciated!! i guess want use symarray . from sympy import symarray m1 = symarray('', 2) m1[0] = [1, 0]

Converting arm code to use NEON intrinsics -

i have been trying modify code beneath work neon intrinsics, thereby creating speedup. unfortunately nothing seems work correctly. have idea going wrong? updated doubles single floating point elements. typedef float real; typedef real vec3[3]; typedef struct driehoek { vec3 norm; /* face normal. */ real d; /* plane equation d. */ vec3 *vptr; /* global vertex list pointer. */ vec3 *nptr; /* global normal list pointer. */ int vindex[3]; /* index of vertices. */ int indx; /* normal component max flag. */ bool norminterp; /* normal interpolation? */ bool vorder; /* vertex order orientation. */ }driehoek; typedef struct element { int index; struct object *parent; /* ptr parent object. */ char

java - JMS Broker Options for CloudBees? -

does cloudbees offer jms hosting or 3rd party jms hosting (like ironmq)? after perusing partner ecosystem pages , developers docs, don't see of sort. i'd deploy web app cloudbees need messaging, , rabbitmq or activemq. i know ship war embedded instance of activemq running inside of it, kind of defeats purpose of scalability in mind: harder queues working, slower app going become, , nice delegate messaging work broker residing on machine. also, most sweet if such messaging service had free tier many of other cloudbees tech partners offer... any ideas? in advance! there no official partner (yet) provide messaging service, sure can use saas mq service cloudbees application, not being official partner, sample http://www.cloudamqp.com/ rabbitmq -as-a-service, iron.io or amazon sqs. consideration ensure service hosted on amazon, application won't suffer network latencies access mq broker - saas run on aws anyway free tier option consideration, depends on p

KVM Debian - Disabling ICMP Redirect Acceptance makes SSH and ping impossible -

i setting vpn lt2p/ipsec on debian kvm following tutorial : http://bailey.st/blog/2011/07/06/secure-ipsecl2tp-vpn-for-on-the-road-android-devices/ issuing command : root@localhost:~# ipsec verify i got following output checking system see if ipsec got installed , started correctly: version check , ipsec on-path [ok] linux openswan u2.6.28/k2.6.32-5-686 (netkey) checking ipsec support in kernel [ok] netkey detected, testing disabled icmp send_redirects [failed] please disable /proc/sys/net/ipv4/conf/*/send_redirects or netkey cause sending of bogus icmp redirects! netkey detected, testing disabled icmp accept_redirects [failed] please disable /proc/sys/net/ipv4/conf/*/accept_redirects or netkey accept bogus icmp redirects! checking pluto running [ok] pluto listening ike on udp 500 [failed] cannot execute command "lsof -i udp:500": no

ios - JASidePanel Swipe doesn't work after push new controller on navigation stack -

Image
i use jasidepanel achieve effect in facebook app. have problem it. (1) subclass of jasidepanelcontroller, navigation controller added center panel. works fine, after push new view controller navigation controller i'm not able make swip gesture show table view (4 - left panel). there way around or i'm doing wrong. [edit] ok found why did occur, jasidepanel has property panninglimitedtotopviewcontroller has set no in order allow swipe gesture on diffrent view controller 1 on top. jasidepanelcontroller.panninglimitedtotopviewcontroller = no;

How to integrate drupal with sugarcrm -

i have drupal 7 , sugar crm 6.5.12 on system. want integration between these 2 system.can me. drupal7 , sugarcrm integration 1) sso integration 2) ldap 3) soap 4) rest 5) oauth what type of requirment there module webform2sugar capture lead

Store file on file system or as varbinary(MAX) in SQL Server -

i understand there lot of controversy on whether bad practice store files blob's in database, want understand whether make sense in case. i creating asp.net application, used internally @ large company, users needs able attach files 'job' in system. these files pdf's or word documents, never exceeding couple of mb. i creating new table so: id (int) jobid (int) filedescription (nvarchar(250)) filedata (varbinary(max) is use of varbinary(max) here ideal, or should storing path file , storing file on file system somewhere? there's paper microsoft research called to blob or not blob . their conclusion after large number of performance tests , analysis this: if pictures or document typically below 256k in size, storing them in database varbinary column more efficient if pictures or document typically on 1 mb in size, storing them in filesystem more efficient (and sql server 2008's filestream attribute, they're still under transaction

ios - Is it safe trying to get an object for a key that doesn't exist? -

i'm new objective c , there's seems work makes me uneasy, , that's this. pfobject *templateobject = [templateobjectid objectforkey:@"gameunittemplate"]; if(templateobject != nil ) { the point being in versions of templateobjectid object there no gameunittemplate, it's class altogether, safe way of checking whether gameunittemplate exists or not? it safe, assuming templateobjectid nsdictionary (or sub-class). you'll nil back. documented : parameters : akey : key return corresponding value. return value : value associated akey , or nil if no value associated akey .

android - Returning _id from SQLite update using SQLiteCursorLoader -

i'm refactoring android work-in-progress app use loader framework, , since data stored in sqlite database i'm using commonsware loaderex package , sqlitecursorloader rather contentprovider layer. the insert(..), update(..) etc methods in sqlitecursorloader have void return type. make life easier , code neater if returned long, being autoincremented row id of row in table had been amended. i hack sqlitecursorloader this, wondered if there design reason doesn't @ moment? in case stuck in , hit big gotcha. i wondered if there design reason doesn't @ moment? sure. methods actual work in asynctask , , therefore cannot return value seek. you welcome own asynctask perform operations , deal values, assuming underlying sqlite apis support (i don't think can value want update, since there multiple rows might affected). have call oncontentchanged() on sqlitecursorloader yourself, trigger logic re-query database , deliver fresh cursor .

windows - Why won't my python subprocess code work? -

this question has answer here: using subprocess run python script on windows 7 answers from subprocess import * test = subprocess.popen('ls') print test when try run simple code, error window saying: windowserror: [error 2] system cannot find file specified i have no clue why can't simple code work , it's frustrating, appreciated! it looks want store output subprocess.popen() call. more information see subprocess - popen.communicate(input=none) . >>> import subprocess >>> test = subprocess.popen('ls', stdout=subprocess.pipe) >>> out, err = test.communicate() >>> print out fizzbuzz.py foo.py [..] however windows shell (cmd.exe) doesn't have ls command, there's 2 other alternatives: use os.listdir() - should preffered method since it's easier work with: >>> imp

syntax - What is the difference between "-%>" and "%>" in Rails 3? -

this question has answer here: '-%>' (minus sign) @ end of erb sequence 2 answers what difference between : <% @posts.each |p| -%> <%= p.title %> <% end -%> and <% @posts.each |p| %> <%= p.title %> <% end %> and there ? -%> means not insert '\n' , whitespaces after command.

vba - How to concatenate 2 cells at the top of a filtered list? (EXCEL macros) -

so i've searched hours now, , can't seem find solution problem. have list of 13000+ rows, have auto filtered down 200, want that, lets assume, top of list shows a1 straight a28 because of filter. want text in cell a28 , b28 concatenated , put in cell j28. able manually easily, when record actions macro code comes up sub concat() ' ' concat macro ' ' activecell.formular1c1 = "=rc[-9]&rc[-8]" range("j28").select selection.filldown end sub now i'm not sure "=rc[-9]&rc[-8]" means when run macro not result in want. if unclear on problem, apologize in advance need help. thanks! varun this work, have turn off filter first: sub filldown() dim ws excel.worksheet dim lastrow long set ws = activesheet ws lastrow = ws.range("a" & .rows.count).end(xlup).row .range("j2:j" & lastrow).formular1c1 = "=rc[-9]&rc[-8]" end end sub i'm not

scroll edit texts inside android app issue -

i have xml layout here , issue might have more 15 edittexts, now, tried add said app stopped, maybe put wrong way... need scroll screen , see edittexts.. here xml file <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <edittext android:id="@+id/edittext1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="emer" /> <edittext android:id="@+id/msgmbiemer" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="mbiemer" /> <edittext android:id="@+id/msgtelefon" android:layout_width="fill_parent" android:layout_height=&qu

ios - Drawing in another thread with CGImage / CGLayer -

i have custom uicollectionviewcell subclass draw clipping, stroking , transparency. works pretty on simulator , iphone 5, on older devices there noticeable performance problems. so want move time-consuming drawing background thread. since -drawrect method called on main thread, ended saving drawn context cgimage (original question contained code using cglayer, sort of obsolete matt long pointed out). here implementation of drawrect method inside class: -(void)drawrect:(cgrect)rect { cgcontextref ctx = uigraphicsgetcurrentcontext(); if (self.renderedsymbol != nil) { cgcontextdrawimage(ctx, self.bounds, self.renderedsymbol); } } rendering method defines renderedsymbol property: - (void) rendercurrentsymbol { [self.queue addoperationwithblock:^{ // creating custom context draw there (contexts not thread safe) cgcolorspaceref space = cgcolorspacecreatedevicergb(); cgcontextref ctx = cgbitmapcontextcreate(nil, self.bounds.size.width,

c# - Is there a way to convert a DateTimeOffset into minutes since midnight? -

is there way convert datetimeoffset minutes since midnight? i want offset part reflected in answer gives. datetimeoffset.utcdatetime.timeofday.totalminutes returns number of minutes since midnight original date/time offset subtracted so if date/time = jan 2 2013 , offset =8 hours, return 16 hours (since jan 1 midnight)

algorithm - Running trend or no trend Twitter rumor project -

i'm learning algorithms "trending topic", have read article stanislav nikolov, trend or no trend: novel nonparametric method classifying time series. i tried downloading project in here . when tried run, error occurs: hduser@master:~/rumor$ ./test_detection.py traceback (most recent call last): file "./test_detection.py", line 6, in <module> ts_viral = rumor.parsing.parse_timeseries('data/' + sys.argv[1]) indexerror: list index out of range i intend run on hadoop cluster. do? it means program needs command line parameters. sys.argv contains list of parameters, , since did not give any, there "index out of range" error. read manual carefully.

asp.net - jsdebug Web Service method name is not valid -

i migrated multiple websites in our development area x86 windows 2003 (iis6) x64 windows 2008 r2 (iis7). used "msdeploy" migration. migrated entire server had issues ended migrating iis configurations minus script maps. after few configuration changes able .net 3.5 site serving pages in integrated mode. however, having issue section of main master page: <asp:scriptmanager id="scriptmanager1" runat="server" enablepagemethods="true"> <services> <asp:servicereference path="~/ajaxservices/formsubmissionservice.asmx" /> <asp:servicereference path="~/ajaxservices/gmapdataservice.asmx" /> <asp:servicereference path="~/ajaxservices/imagegalleryservice.asmx" /> <asp:servicereference path="~/ajaxservices/myfavoritesservice.asmx" /> </services> each of these generates script tag like: <script src="../ajaxservices/formsubmissionservice.asmx/jsdebu

regex - Perl regular expression not responding to $ -

i have following code: #!/usr/bin/perl use test::simple tests => 2; $file = "lalaletc"; $file2 = "lalal"; ok($file =~ m/^lala/); ok($file2 =~ m/^lala$/); the output following: 1..2 ok 1 not ok 2 # failed test @ ./test.pl line 7. # looks failed 1 test of 2. but $file2 has no more characters, expected succeed test 2. why not? your variable $file2 set lalal . 5 characters. regex /^lala$/ , means: beginning of line/string lala end of line/string that's 4 characters because last l missing. regex not match , test fails. correct behaviour. try here: http://rubular.com/r/o0gheiivaz add missing l @ end , match. here's additional explanation taken this site : node explanation -------------------------------------------------------------------------------- ^ beginning of string -------------------------------------------------------------------------------- lala

Reading a file in python issues -

i trying read csv file in python using following code: with open(self.filename, 'r') openfile: datareading = openfile.read() openfile.close() splitdata = datareading.split("\n") print splitdat a don't understand why not getting output. self.filename meant represent file location on computer, , attempting open , split there new lines. can please assist me problem? you storing read line in datareading , doing read_data.split() you might intending this: def convert(self): datareading = [] open(self.filename, 'r') openfile: datareading = openfile.readlines() data in datareading: print data

arrays - Multi level menu with PHP -

i have subject table this: id title parent_id full_path full_path finding parent recursive. this: +----+-----------+-----------+-----------+ | id | title | full_path | parent_id | +----+-----------+-----------+-----------+ | 40 | home | 40 | 0 | | 41 | myhome1 | 41 | 0 | | 42 | **** | 40-42 | 40 | | 43 | ***** | 41-43 | 41 | | 44 | *** | 44 | 0 | | 45 | **** | 45 | 0 | | 46 | ***** | 46 | 0 | | 49 | ****** | 49 | 0 | | 50 | **** ** | 40-42-50 | 42 | | 51 | **** ** | 40-42-51 | 42 | | 52 | **** ** | 40-42-52 | 42 | | 53 | ******* | 40-53 | 40 | | 54 | **** | 40-54 | 40 | | 55 | *** | 41-55 | 41 | | 56 | **** **** | 40-42-56 | 42 | | 57 | ******* | 44-57 | 44 | +----+-----------+-----------+-----------+ how can recursive array this:

security - WCF service certificate is not in the trusted people store -

i created wcf service should work using certificates. test i’m using self signed certificates works perfect, changes when i’m trying run on server, certificates generates ca. generated client , server certificates using ca, , after exported server certificate “trusted people” folder. (both certificates placed localmachine directory). have granted necessary permissions certificate. the problem appears when i’m running client program i'm getting exception: the x.509 certificate cn=xxxx not in trusted people store. here server config <services> <service behaviorconfiguration="myservicebehavior" name="poswsservice"> <endpoint address="http://xxxx/poswsservice.svc" binding="wshttpbinding" bindingconfiguration="myservicebinding" contract="iposwsservice" /> <endpoint address="http://xxxx/mex" binding="mexhttpbinding" name="metadatabinding"

playframework 2.0 - Play Global object (GlobalSettings) not being executed -

i ran application on server, custom config file specified on command line using: -dconfig.file=app.conf but when tried copy custom config file local machine , use there, passing -dconfig.file run , strange errors started appear. traced global object's onstart method not being executed @ all. why happening? for reason, typesafe config library silently failing load line in custom config file include "application" but sbt run - worked when running application standalone on server. therefore application.global=global.global line wasn't being read in file, play couldn't find global object, , silently fell empty global object nothing. changing include line specify absolute file path application.conf fixed problem.

integer validation in django not working -

forms.py class usercreateprofileform(forms.modelform): fields = ['phone_daytime', 'phone_mobile'] def clean(self): cd=self.cleaned_data validate_integer(cd.get('phone_daytime', none)) validate_integer(cd.get('phone_mobile', none)) return cd def validate_integer(phone_daytime,phone_mobile): try: int(phone_daytime,phone_mobile) except (valueerror, typeerror): raise validationerror('phone number must number') i want validate form 2 phone number field. the above 1 not working,not throwing error not functioning. the field should not accept alphabet,special character , blank allowed.how validation. thanks for validation of phone number approach should take. class usercreateprofileform(forms.modelform): fields = ['phone_daytime', 'phone_mobile'] def clean(self): cd = self.cleaned_data validate_phonenumber(cd.get('p

ms access 2007 - How do I add Error message if my me.combo box is not selected for the following code? -

add error message if me.combo box not selected following code? private sub command1_click() dim recipient string dim recipientcc string recipient = me.combo10.column(2) recipientcc = me.combo10.column(3) dim datetext string datetext = format(date - iif(weekday(date) < 3, 1 + weekday(date), 1), "mm-dd-yyyy") docmd.transfertext acexportdelim, , "watchdog", "g:\common\auto finance\watchdog\watchdog_" & [datetext] & ".csv", true 'send email dim olapp outlook.application dim olmail outlook.mailitem 'get application on error resume next set olapp = getobject(, "outlook.application") if olapp nothing set olapp = new outlook.application on error goto 0 set olmail = olapp.createitem(olmailitem) olmail .subject = "indirect auto watchdog file" .recipients.add [recipient] .cc = [recipientcc] .attachments.add "g:\common\auto finance\

ibm mobilefirst - Issue with Worklight authentication on Android and isUserAuthenticated -

i experiencing problem authentication within android application, using worklight version 5.0.6. i have created secure app using authentication configuration: <securitytests> <mobilesecuritytest name="sencha22-mobile-securitytest"> <testdeviceid provisioningtype="none"/> <testuser realm="sampleapprealm"/> </mobilesecuritytest> </securitytests> <realms> <realm loginmodule="strongdummy" name="sampleapprealm"> <classname>com.worklight.core.auth.ext.formbasedauthenticator</classname> </realm> </realms> <loginmodules> <loginmodule name="strongdummy"> <classname>com.worklight.core.auth.ext.nonvalidatingloginmodule</classname> </loginmodule> </loginmodules> i have challengehandler following: challengehandler.submitloginformcallback = function(response) { var islo

Transforming an XML element based on its sibling, using scala.xml.transform.RuleTransformer -

given xml: <root> <item> <discriminator>d1</discriminator> <target>t1</target> <subitem> <incomplete></incomplete> </subitem> <subitem> <incomplete></incomplete> </subitem> </item> <item> <discriminator>d2</discriminator> <target>t2</target> <subitem> <incomplete></incomplete> </subitem> </item> </root> i need transform such that: 1) each <item> , text of <target> modified based on text in <discriminator> . 2) each <incomplete> , add text content. based on other posts, far i've come solution 2), using rewriterule , ruletransformer . goes this: object completeincomplete extends rewriterule { override def transform(n: node): seq[node] = n match { case elem(_, "incomplete", _, _, _*) => <incomple

javascript - JSON object call params as variables -

this question has answer here: dynamically access object property using variable 10 answers access json value using javascript object notation 4 answers okay here's problem have bunch of price ranges made using json object want dynamically change json object call in example: json object : ranges = { "range0" : { "olive" : {"price": 5}, "ebony" : {"price": 8}, "tigerebony" : {"price": 8}, "zebrawood" : {"price": 7}, "mahagony" : {"price": 7}, "pinkivory " : {"price": 7} }

python - require minimum length of a variable in a django url -

this bit urls.py requires 9 character value... (r'^launch/(?p<app_id>[0-9a-za-z]{9})/*', 'mysite.views.launch_app'), how change requires minimum 9 character value? changing regex to {9,} should it. (r'^launch/(?p<app_id>[0-9a-za-z]{9,})/*', 'mysite.views.launch_app'),

ios - Testing changes in static library? -

we have static libraries , main app. can ship each bit separately if need to. i'm coming across frustrating problem however. everytime make change library , want test it/run have compile (+ lipo etc make fat binary) copy , paste other project (app) , use app test it. is way can test want test? know unit tests, we're using build server tests. want test new functionality i'm building in static library. how guys it? possible or way i've described best way? thanks create "test" app uses library, , include library(s) project(s) in that. able change library code, , run test app immediately. i'm doing exact thing now, i'm developing static library companies customers. or, easier, include library projects in apps. downside won't have exact same process others distribute to.

sql - Error on C# when trying to fetch multiple data from database -

i have code in c#: private void sqlconnlabel() { noidpenghuni = new sqlparameter(); sqlconnection con = new sqlconnection(strcon); com2 = new sqlcommand(); com2.connection = con; con.open(); com2.commandtype = commandtype.storedprocedure; com2.commandtext = "label"; noidpenghuni.sqldbtype = sqldbtype.varchar; noidpenghuni.size = 50; noidpenghuni.parametername = "@noidpenghuni"; noidpenghuni.value = noidpenghunic; noidpenghuni.direction = parameterdirection.input; com2.parameters.add(noidpenghuni); string namapenghuni; string jkpenghuni; string notelppenghuni; string alamatpenghuni; string nokamar; namapenghuni = convert.tostring(com2.executescalar()); jkpenghuni = convert.tostring(com2.executescalar()); notelppenghuni = convert.tostring(com2.executescalar()); alamatpenghuni = co

ios - Why does this not dot the line correctly? -

cgcontextref currentcontext = uigraphicsgetcurrentcontext(); cgcontextsetstrokecolorwithcolor(currentcontext, hh2darkgray.cgcolor); cgfloat lengths[] = {0, 8}; cgcontextsetlinecap(currentcontext, kcglinecapround); cgcontextsetlinewidth(currentcontext, 1); cgcontextsetlinedash(currentcontext, 0.0f, lengths, 2); cgcontextbeginpath(currentcontext); cgcontextmovetopoint(currentcontext, x1, y1); cgcontextaddlinetopoint(currentcontext, x2, y2); cgcontextclosepath(currentcontext); cgcontextdrawpath(currentcontext, kcgpathstroke); what doing wrong in above code makes dots not evenly spaced? looks this. . .. .. .. .. .. .. .. .. .. . when need . . . . . . . . . . . . . . . i lost , other posts can find don't point out kind of issue. please help? the problem you're closing path – implicitly draws line first point. if path consists of straight line between 2 points, 2 lines drawn directly on top of each other, causes additional dots appear (those second line offset

java - Getting custom object on click from ListView -

i'm displaying listview filled custom listadapter, called lazyadapter, code comes here : http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ . lazyadapter uses custom objects "eventdata". managed display list wanted, i'd clicked object. found on other questions ( here , here , , there ), , wrote code: private onitemclicklistener meventclicklistener = new onitemclicklistener() { @override public void onitemclick(adapterview<?> av, view v, int arg2, long arg3) { eventdata selectedevent = (eventdata) eventslistview.getitematposition(arg2); }; however, cast error @ execution. 05-14 17:10:46.718: e/androidruntime(3863): java.lang.classcastexception: java.lang.integer i tried similar solution: eventdata selectedevent = (eventdata) av.getitematposition(arg2); i got same cast error. don't know how can object eventdata in other way. thanks help! in custom list adapter return integer in getitem(

what is the values() that I have seen in various CDI qualifiers in java? -

good day. i have seen various references values() inside @qualifier definitions. understand @qualifier tagging system, yet define them interface. an interface can allow enums, don't understand word 'values()' i've seen in 2 unrelated examples i've listed below. could please explain me word values() means? @qualifier @retention(runtime) @target({field, type, method}) public @interface numberofdigits { digits value(); } public enum digits { two, eight, ten, thirteen } package com.byteslounge.bean; import static java.lang.annotation.elementtype.field; import static java.lang.annotation.elementtype.type; import static java.lang.annotation.elementtype.method; import static java.lang.annotation.retentionpolicy.runtime; import java.lang.annotation.retention; import java.lang.annotation.target; import javax.inject.qualifier; @qualifier @retention(runtime) @target({field, type, method}) public @interface messagetransport { messagetr

How can I add hyperlinks to certain elements of the WTP XML editor? -

i have implement editor language. language uses xml-files organisation of various elements. i link xml-representation of element real element in respective file. <ml name="abc"> <configfilepath name="%mlpath%\mls\ml\abc.ml"/> </ml> so element "abc" should hyperlink. if click it, should open path within eclipse own editor. do have ideas how achieve this? contribute hyperlink detector: http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_workbench_texteditor_hyperlinkdetectors.html

java - Hibernate and Spring - Dao ,Services -

i've been reading tutorials , see of mvc implementations are based on: 1) dao interface example "iuserdao" 2) dao impl of interface - "mysimpleuserdaoimpl" 3) service interface persistance : "iuserservice" 4) , impl - "userserviceimpl" is best practice? mean reason ask question because seem redundant have 30 services getxbyid(), deletex(x), createx(x) methods doing more or less same. please take account i'm using spring 3 , hibernate 4, , decided ask question before start slamming keyboard code thanks. if starting development, spring jpa . service should one-to-many repositories (dao). not create of boilerplate code hand anymore. spring jpa eliminates basic crud , search functions pagination. here video walks through of configuration spring, jpa, hibernate, , finishes spring data jpa showing of boilerplate code eliminated. to use spring data jpa, repository interface ends being: package com.mysampl

android - Google in app purchasing get products list -

i found following code here products list google play store arraylist skulist = new arraylist(); skulist.add("premiumupgrade"); skulist.add("gas"); bundle queryskus = new bundle(); queryskus.putstringarraylist(“item_id_list”, skulist); is there way dynamic products list? here hard coded.what happens when add new products after app launch? this not possible using google api. create json file contains current skus , place on server. in app, first load file server url , use list of skus retrieve product details via google api. to google: provide function this, shame on you!

windows installer - WIX Continues Uninstall After Failing To Close Application Causing Application to Crash -

when closing application prompts users save unsaved information. when installing new version of application while running following occurs: start application. install new version wix msi. application prompts save unsaved information. wix msi ignores fact application not closed , continues uninstalling old version , installing new version. the still running application crashes badly. how can wix abandon installation if application not close? as per understanding, want stop installation , inform customer close application if application running. you can using custom action. check application running or not using process , create property based on in custom action. schedule custom action after appsearch or before launch condition in both installui , installexecute (for silent installation) sequences. check property using condition element. <condition message="please close xxxx application continue installation." >application_running</conditi

c++ - 'long long long' is too long for GCC using log4cpp -

i developing qt application use logging library log4cpp. now, headerfiles of log4pp included, compiling error: 'long long long' long gcc when go source of error, headerfile stdint.h opened @ line: __mingw_extension typedef long long int64_t; can tell me how handle this? okay, solved it, needet include stdint.h @ first oo

c# - Navigate between pages in windows 8 apps -

i new building windows 8 apps using c#. whenever navigate page pop-up saying "no apps installed open type of link ms-resource". however, app runs fine. the code use navigate scenariopage mainpage is: private void hyperlinkbutton_click_1(object sender, routedeventargs e)//code msdn { this.frame.navigate(typeof(scenariopage)); } can please me or provide pointers on how remove pop-up. instead of passing type, need pass object . linked msdn page example: // navigate object using navigate method this.navigate(new homepage()); so in case be this.frame.navigate(new scenariopage()); or, can use override takes an uri parameter . this.frame.navigate(new uri("scenariopage.xaml", urikind.relative));

change the color of a php generated div using javascript -

i'm trying build small list users can indicate favorite theme. so, basically, when user clicks on div background color (currently gray) changes color (green). when clicks time background color has change gray. able change color of divs, changed color of divs in front of him. indicated divs (green) should saved in database. my php code: <?php while($keuzescherm= $allgenres->fetch_assoc()) {echo "<div class='keuzediv' id='".$keuzescherm['genrenaam'] ."'>" . $keuzescherm['genrenaam']."</>";} ?> i'm not sure javascript. i'm guessing need use getelementbyid() . @ moment i'm using this: $(".keuzediv").on("click", function () { $(this).toggleclass("green"); }); and css: .keuzediv { background-color:#dddddd; padding-top:5%; color: black; } so question is: how can change background color of indicated div , save divs in dat

PHP call zend call controller method in view file -

my controller: class croncontroller extends zend_controller_action { public function init(){ } public function indexaction(){ die(); } public function reportaboutexpiringpaymentaction(){ } } how can call reportaboutexpiringpaymentaction() file.phtml the way need, doesn't work @ all. way call function on phtml this: url like: http://www.yoursite.com/cron/report-about-expiring-payment , code is: class croncontroller extends zend_controller_action { public function init(){ } public function indexaction(){ die(); } public function reportaboutexpiringpaymentaction(){ /* code here */ $this->render('file.phtml'); } }

python - Pyglet not running properly on AMD HD4250 -

Image
i building python program using pyglet. source code runs fine on computer exept laptop. laptop 1 amd graphics card: hd4250. xubuntu 13.04 amd64, , graphics drivers x11 open source ones. how looks: when adding clear statement in constructor screen gets build properly, incredebly slow. refresh @ max 2 times per 30 seconds , barely respond input. how can fix this? it not seem opengl problem: when using qt opengl (c++ also) there no problems @ all. some (hopefully relevant) code: def draw(self): pyglet.text.label('start screen', font_name='arial', font_size=16, x=self.window.get_size()[0]/2, y=self.window.get_size()[1]-20, anchor_x='center', anchor_y='center').draw() pyglet.text.label('this side looking @ enemy', font_name='arial', font_size=16,

r - Dichotomize data by factor -

i need create dichtomized variable based on 2 factors (one hopes it's possible). let's have data: d <- data.frame ( agegroup = c(2,1,1,2,3,2,1,3,3,3,3,3,1,1,2,3,2,1,1,2,1,2,2,3) , gender = c(2,2,2,2,2,2,1,2,1,1,1,2,1,1,2,2,1,1,1,1,2,1,1,1) , hourwalking = c(0.3,0.5,1.1,1.1,1.1,1.2,1.2,1.2,1.3,1.5,1.7,1.8,2.1,2.1,2.2,2.2,2.3,2.4,2.4,3,3.1,3.1,4.3,5) ) i create binary (lowwalkhrs) using gender- , agegroup-specific median (e.g., when agegroup = 1 , gender = 1, median = 2.1 (median found using excel)). lowwalkhrs added variable in dataset, output be: agegroup gender hourwalk lowwalkhrs 2 2 0.3 1 1 2 0.5 1 1 2 1.1 0 2 2 1.1 1 3 2 1.1 1 2 2 1.2 0 1 1 1.2 1 .... 3 1 5 0 i have rather large dataset (~10k observations),

iphone - Resume AVPlayer video playback after app become active -

i write custom player avplayer video playback. according apple docs set video layer: self.player = [iplplayer new]; self.player.playerlayer = (avplayerlayer *)self.playerview.layer; where self.playerview usual class docs: @implementation playerview + (class) layerclass { return [avplayerlayer class]; } - (avplayer *)player { return [(avplayerlayer *)[self layer] player]; } - (void)setplayer:(avplayer *) player { [(avplayerlayer *) [self layer] setplayer:player]; } the problem is: when close app (home button), or block screen, video playback stopped, , when resume audio playback resumed, image on screen still before block screen - it's static , note change frames. how resume video playing after screen blocked? seems must register notifications, , after app become active resume video layer: -(void)registernotification { [[nsnotificationcenter defaultcenter] addobserver:self selector:@sel

html - Response.Write with an iframe -

i have inherited application uses cybersource credit card processing company. uses cybersource api , trying convert use hosted order page - silent order post method. example cybersource gives run follows: <form action="https://orderpagetest.ic3.com/hop/processorder.do" method="post"> <% insertsignature3("10", "usd", "sale"); %> <h2>payment information</h2> card type: <select name="card_cardtype"><br> <option value=""> <option value="001">visa <option value="002">mastercard <option value="003">american express </select><br> card number: <input type="text" name="card_accountnumber"><br> expiration m

eclipse - WindowBuilder encountered unexpected internal error; Cannot cast? -

Image
i'm trying run windowbuilder build swt apps. however, when click design tab, error: the code i'm using produces above error basic default code when starting new project. same error occurs when try run actual swt project run when executed within java: here's code: package ch2; import org.eclipse.swt.*; public class helloswt { public static void main(string[] args) { // todo auto-generated method stub display display = new display(); shell shell = new shell(display); shell.settext("hello world"); shell.setbounds(100, 100, 200, 50); //layout rowlayout rowlay = new rowlayout(swt.horizontal); rowlay.justify = true; rowlay.margintop = 20; rowlay.marginbottom = 20; //form layout formdata formdata = new formdata(); formdata.right = new formattachment(100, -5); formdata.bottom = new formattachment(100, -5); //shell.setlayout(new filll