Posts

Showing posts from 2013

knockout.js - Knockout binding works in text attribute but throws undefined error when used in href -

i have following binding within foreach binding: <h5>id: <span data-bind="text: ($root.link + id)"/></h5> and displays fine. if change out <a data-bind="attr: { href: $root.link}"/> the anchor navigates fine (except id isn't appended end). if add in id <a data-bind="attr: { href: $root.link +id}"/> i 'unable parse binding ... id undefined'. why exact same binding syntax work text not attr binding? thanks help. update: using breezejs uses metadata create observablearray . i've have done more testing , discovered binding fails when field of type integer . passed in name field , binding works fine. tried id.tostring() still id undefined error. suggested below, considering using computed solve problem. if solution, think better extend breeze entity flows through downstream view model. you need computed observable called linkurl. self.linkurl = ko.computed(function(){ ...

c++ - Does a tlb file have an associated architecture? -

i have 32bit dll designed accessed through com model , associated tlb file. the dll appears x86. is there way access kind of dll x64 program? tlb files x86/x64 agnostic? i asking because functions appear work, others crash, , o̶t̶h̶e̶r̶s̶ ̶a̶r̶e̶ ̶m̶i̶s̶s̶i̶n̶g̶ ̶c̶o̶m̶p̶a̶r̶e̶d̶ ̶t̶o̶ ̶t̶h̶e̶ ̶.̶n̶e̶t̶ ̶a̶s̶s̶e̶m̶b̶l̶i̶e̶s̶ . --edit-- missing assemblies appear due error on part of oem. type libraries intended platform agnostic in cases. 1 you'd encounter in windows programming shipped microsoft are. visible in .net makes simple write code can run in either 32-bit or 64-bit mode, exposed anycpu platform target. nothing special needed either use interop classes in microsoft.office.interop or write extensions run inside office program, use exact same type libraries. but doesn't work out when use type library created programmer never considered work on 64-bit code. typical trouble caused method arguments pointers under hood flattened integral type, lon...

security - Data Encryption With breeze -

make quick: going publish our web site soon, our task provide live scores, , paying money live result fast possible. we not force user log-in see latest result, don't calling url , result our web site currently using breeze , happy , it's functionality ((hello ward)) want encrypt data on server , decrypt on client. know it's not efficient it's enough (just makes hard) , know can use hand made js handle situation, lost breeze + knockout functionality if encrypt server response (json) , other thing can encrypt data (column column) not killing me encrypt on server , decrypt on client (i hope not in bio-direction) i'm looking cleaner hide complication , allow me not think it. (in nutshell: not bank, when hit url: xxxxx/breeze/api/soccer not human readable result (and 1 step head of base64, don't call encryption or security)) if understand correctly, want hits raw api believe data encrypted. client app know better , "decrypt" readable ...

asp.net - compare 2 string to get result different -

i doing method able return me different between data before , data after dim databefore string = "name:alice,age:30,sex:male" dim dataafter string = "name:alice,age:20,sex:female" mtdcompare2string(databefore,dataafter) public shared function mtdcompare2string(byval sbefore string, byval safter string) string //what try before, supposing loop should start on here failed, //so removed loop, need correct me =( dim intbefore integer = sbefore.indexof(",") dim intafter integer = safter.indexof(",") dim sbefore string = sbefore.substring(0,intbefore) dim safter string = safter.substring(safter.indexof(":"),intafter) dim sb stringbuilder sb.append(sbefore,safter) return sb.tostring end function expected result age:30>20,sex:male>female something should work: public shared function mtdcompare2string(byval sbefore string, byval safter string) string 'what try before, supposing loop should sta...

ruby on rails - Archiving Data in Different Application -

how can make archive system of app separate app , database? app1 app 2 (archive system, same app different database) passing database give more space app1. app2 viewing. this answer has suggestions: rails, how migrate data development sqlite3 database production mysql database? rake db:schema:dump / db:schema:load allow re-use current schema, , yamldb gem discussed in above link should migrate data.

php - node.js sending POST requests not working -

i'm trying send post request not sending. dont output in console log of browser. my node server.js running in x.x.x.x:8000 connect client.html. x.x.x.x:8000/client.html here node.js server. function handler (req, res) { var filepath = '.' + req.url; if (filepath == './') filepath = './client.html'; var extname = path.extname(filepath); var contenttype = 'text/html'; switch(extname){ case '.js': contenttype = 'text/javascript'; break; case '.css': contenttype = 'text/css'; break; } path.exists(filepath, function (exists){ if (exists){ fs.readfile(filepath, function(error, content){ if(error){ res.writehead(500); res.end(); } else{ res.writehead(200, { 'content-type': contenttype }); ...

ios - Why won't MFMailComposeViewController dismiss during in-app email? -

i working on ipad app creates pdf user emails in app. have been able setup email attach pdf, cannot mfmailcomposeviewcontroller dismiss. have read through several other questions on issue , attempted mimic doing, mail composer still not dismiss. need change in code dismiss? - (ibaction)submitdailyreportbutton:(id)sender { mfmailcomposeviewcontroller *mail = [[mfmailcomposeviewcontroller alloc]init]; [mail setmailcomposedelegate:self]; if ([mfmailcomposeviewcontroller cansendmail]) { nsstring *email =@"admin@domain.com"; nsarray *emailarray = [[nsarray alloc]initwithobjects:email,nil]; [mail settorecipients:emailarray]; [mail setsubject:@"daily report"]; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *newfilepath = [[paths objectatindex:0]stringbyappendingpathcomponent:@"report.pdf"]; nsdata *pdfdata = [nsdata datawithcontentsoffile:newfilepath]; [ma...

sql server 2008 - how fiter the values when joining 4 tables? -

tbl_category pk_int_category_id, vchr_category_name tbl_projects fk_int_category_id, pk_int_project_id, vchr_project_name, vchr_project_description, bln_project_status tbl_project_album pk_int_album_id fk_int_project_id vchr_album_name vchr_album_description tbl_picture fk_int_album_id, pk_int_picture_id, vchr_picture_name, vchr_picture_description, vchr_picture_path insert data tables 2 categories c1 , c2, enter 2 or 3 projects, corresponding each category. c1p1, c1p2, c2p1, c2p2 , on. there should minimum 2 albums per project , minimum 2 pictures per album create result set containing: pk_category_id, category_name, pk_project_id, project_name, pk_picture_id, picture_name, pk_album_id, album_name filter result set in such way projects and, albums , 1 picture corresponding album displayed filter result set in such way projects and, 1 picture , 1 album corresponding project displayed select c.pk_int_category_id ,c.vchr_category_name,p.pk_i...

mysql - PHP dynamic list pick values in next page -

am trying insert values php generated option list mysql database. error getting in "notice error". error reads: notice: undefined index: fixture_id in c:\xampp\htdocs\project\insert.php on line 177 notice: undefined index: goalkeeper in c:\xampp\htdocs\project\insert.php on line 178 notice: undefined index: defender in c:\xampp\htdocs\project\insert.php on line 179 notice: undefined index: fullback in c:\xampp\htdocs\project\insert.php on line 180 notice: undefined index: midfielder in c:\xampp\htdocs\project\insert.php on line 181 notice: undefined index: wing in c:\xampp\htdocs\project\insert.php on line 182 notice: undefined index: striker in c:\xampp\htdocs\project\insert.php on line 183 my code given below. intermediate developer , developing team management system. elseif(isset($_get['selection_id'])){ // check if form submitted echo "<table><form name=\"insertselectionform\...

objective c - Creating a Button to Make Buttons -

i have setup create ui button when button clicked. seemed straightforward @ first, until decided create own ui button class. of works, except fact button not show on screen. have few ideas on might causing it, helpful have pair of eyes @ code. custombutton.m - (id)initwithframe:(cgrect)frame //this function provided { self = [super initwithframe:frame]; if (self) { //this stuff wrote, wrong. uibutton* button = [uibutton buttonwithtype:uibuttontyperoundedrect]; button.frame = cgrectmake(1,2,100,50); [button settitle:@"test!" forstate:uicontrolstatenormal]; } return self; nslog(@"worked?"); //this log outputted! however, if put before "return self", doesn't work. i'm guessing problem "return self" not being caught. } view.m -(ibaction)createdrawer:(id)sender { custombutton* newbutton = [custombutton alloc]; [newbutton initwithframe:newbutton.frame]; [self.c...

export - exporting archive file from android studio -

it appear if android studio has no "export project" command... can possibly true? i'm kind of freaking out because class requires archive file, , almsot appear if android studio has different build structure eclipse. highly appreciated! android studio using new build structure (with gradle). in preview stage. believe when studio come stable version, eclipse updated to new structure too. until if want use projects in old project format with, have create new projects old tools (aka eclipse, intellij, console tools etc) , use android studio.

web applications - How to make session in Java? -

Image
i need make sessions in java web application. found sesstion makes in servlet calass method getsession() . have question session parameters. example send server login/pass , save session atributes. okey. next time on client , send new params server. gonna send it? in or same , gonna use if else handle params this? question: how use params put in session(login/pass) in classes? update i read sessions . , have new question. how use session params in enother class. mean after login send new params on server, read in servlet , want take login/pass session , send new params class. as part of request handling in doget or dopost method, here how can session , use , set variables. //obtain session object, create new session if doesn't exist httpsession session = request.getsession(true); //set string session attribute session.setattribute("mysessionvariable", "mysessionatrvalue"); //get string sessson attribute string strparam = session.getat...

c++ - Pthreads and dynamic memory -

my thread routine looks this void * dowork(void * args) { char* ptr = new char[25]; memset(ptr, 0, sizeof(ptr)); // operations ptr // if call delete[] ptr } i've initialized 5 threads. questions, is thread safe? which thread owns memory? will ptr re-initialize every time new thread processes dowork ? if yes, happen memory allocated earlier? what if delete[] ptr used @ end of dowork ? the ptr local pointer no other thread interfere long not communicate pointer thread. two threads running function allocate 1 char[25] array each. thread not owner rather process owns it. ptr re initialize , old memory not deleted on thread join. if no delete used leak memory. delete[] use yes. to explain ptr is allocated operative system , every call of new allocate new pointer operative system. value of ptr ie points, local stack variable hence local thread , no other threads can value long not communicated.

.net - Restrict multiple edits on any objects, c# 2012 -

i have many objects pg, layout, sitepart etc., multiple users can edit these objects , can save them data base. @ time 1 user can save changes db, , let other users wait until member completes job if both updating same objects. i have functionality building objects , saving them db. how implement locking, how other user know when object released. please shed thoughts on how proceed. thank in advance.. the type of behaviour describing called pessimistic concurrency . haven't said if need lock locked within single web request or across multiple requests. rather reinventing wheel, should use standard concurrency techniques, , read on how implement .net. typically web applications use optimistic concurrency; if need pessimistic concurrency gets hard quickly. asp.net not offer out of box support pessimistic concurrency. you haven't said how access database (e.g. if using ado.net, or ef), ef also has concurrency control . comes down using transaction objects ...

asp.net - what is entity framework ? why should i use it ? can i use it without linq? -

i have read documents entity framework, came know makes entities our database(orm). i tried go deeper don't satisfactory answer. i want know why , when entity framework used? linq necessary framework? and silly question what difference in "use" between 3-tier architecture , entityfrmaework ? any related document helpful thanks in advance. i came know makes entities our database(orm). :-/ actually ef make entities db model if decide start call db first approach. doing so, ef somehow reverse engineer db model , create entities in edmx file become business model. best practice change generated entities , modify them in order make them real business model. from point of view, db model , business model 2 different things they’re not designed same goal: db model designed able persist , fetch db data efficiently , business model’s goal conceptualize business needs , must fit how application manipulate it. nice thing edmx 3 parts file 1 distinc...

VB5 to VB6 Migration -

what best way of migrating vb5 vb6. version of visual studio helps , precautions/considerations need take care before migration. there approach notes available anywhere in internet for part can think of vb6 superset of vb5, there nothing upgrade, taking advantage of new functionality. open project in vs6, , should go. i instead try sell customer on vb.net upgrade. not opening project , done, allow have more powerful tools/environment.

php - Iterate through multiple arrays and check if all elements are non-empty (or strlen is at least 1) -

for example have 3 arrays. $_post arrays looks $_post['row_id'] - $_post['row_id'][0] , $_post['row_id'][1] , etc. $_post['date_day'] - $_post['date_day'][0] , $_post['date_day'][1] , etc. $_post['date_month'] - $_post['date_month'][0] , $_post['date_month'][1] , etc. want iterate through $_post['row_id'] , if $_post['date_day'] , $_post['date_month'] non-empty create new array $if_non_empty value 1. data these: $_post['row_id'][0] 1 $_post['row_id'][1] 2 $_post['date_day'][0] 1 $_post['date_day'][1] blank/empty $_post['date_month'][0] 4 $_post['date_month'][1] 4 created code foreach ($_post['row_id'] $i => $row_id) { if ( (strlen($_post['date_day']) >= 1) , (strlen($_post['date_month']) >= 1) ) { $if_non_empty = 1; print_r ($if_non_empty); echo ' $if_non_empty...

ios - Events are not getting displayed after reloaddata in Timelineview of Tapku Calendar -

can 1 me issue experiencing? i using tapku calendar library day view in order display events. events getting displayed when calendar loads first time. if change date lets either yesterday or tomorrow, calendar not displaying events. i have implemented following events. - (void)calendardaytimelineview:(tkcalendardayview *)calendarday didmovetodate:(nsdate *)date { //here logic pull data db server. //after calling method below. [self.dayview reloaddata]; } - (nsarray *) calendardaytimelineview:(tkcalendardayview*)calendardaytimeline eventsfordate:(nsdate *)eventdate{ self.myappointments = nil; nsfetchrequest *fetchrequest = [[[nsfetchrequest alloc] init] autorelease]; nsentitydescription *entity = [nsentitydescription entityforname:@"tasks" inmanagedobjectcontext:self.managedobjectcontext]; [fetchrequest setentity:entity]; nserror *error; self.myappointments = [self.managedobjectcontext executefetchreques...

mongodb - ReactiveMongo 0.9: Joda Datetime Implicit Conversion for Macros.handler -

i have case class joda datetime field: case domainpositiondata(domain: string, position: int, change: option[int], date:datetime) trying use macro generate reader&writer: implicit val domposformat = macros.handler[domainpositiondata] i got: implicit org.joda.time.datetime 'value date' not found but haven't found info how implement own implicit convertor. looking @ source code existing handlers , try create implicit conversion (not tested): import org.joda.time.datetime implicit object bsondatetimehandler extends bsonhandler[bsondatetime, datetime] { def read(time: bsondatetime) = new datetime(time.value) def write(jdtime: datetime) = bsondatetime(jdtime.getmillis) }

android - How to scroll up a child of a scroll view when softinputkeyboard is shown -

is possible scroll scroll view when scroll view's display height less physical display height of device? i tried few methods, unable make content up,when input keyboard shown. i want to scroll edittext child of scrollview ,when softinputkeyboard shown. please help. in advance. android:windowsoftinputmode="adjustpan"

asp.net - Link to Sql Update Row -

ok need update field active true code public static bool firstlogin(guid activationcode) { using (infinitynightdatacontext data = new infinitynightdatacontext()) { user user = data.users.single(user => user.emailactivation == activationcode); if (user != null) { user.active = true; user.exp = "i has here"; data.submitchanges(); installmembershipcookie(user.userid, user.email, user.password, user.usertype, user.firstname, user.userimg, "", true); return true; } else { return false; } } } and after data.submitchanges() ; can see changes on object user not in database in other function works in case it's don't work .. any 1 know problem? one possible option (as haven't said setup): using local database, or user instance, i.e. conne...

html - Xslt size of token array (tokenize, number of tokens) -

is there way getting size of token array after having run tokenize($text, '\s+') ? without running loop. i miss java in these cases can run list.size() . cheers answer <xsl:variable name="tokens" select="tokenize($text, '\s+')"></xsl:variable> <xsl:value-of select="count($tokens)"></xsl:value-of> you should put count() around tokenize. in case count(tokenize($text, '\s+'))

bash - Misbehaving head with redirection -

in reply piping file through tail , head via tee , strange behaviour of head has been observed in following construct when working huge files: #! /bin/bash in {1..1000000} ; echo $i ; done > /tmp/n ( tee >(sed -n '1,3p' >&3 ) < /tmp/n | tail -n2 ) 3>&1 # correct ( tee >(tac | tail -n3 | tac >&3 ) < /tmp/n | tail -n2 ) 3>&1 # correct ( tee >(head -n3 >&3 ) < /tmp/n | tail -n2 ) 3>&1 # not correct!? output: 1 2 3 999999 1000000 1 2 3 999999 1000000 1 2 3 15504 15 question: why not last line output same lines previous 2 lines? this because head exits transfers 3 first lines. subsequently, tee gets killed sigpipe because reading end of "file" pipe writing closed, not until manages output lines stdout. if execute this: tee >(head -n3 >/dev/null) < /tmp/n you see happens better. otoh, tac reads whole file has reverse it, sed , consistent.

Matlab convex optimisation toolbox. Optimisation variable not shown -

i'm using convex optimisation toolbox in matlab , objective function gets minimized , value shown. optimisation variable minima achieved, cannot find. tell me how find it? you didn't function using perform optimization, or of them return location of minimum first argument. see fmincon example.

ruby - Rails query WHERE clause using OR -

i have 2 individual rails queries both work fine on own: @charts = chart.where(:patient_id => @emailpatient.id) @charts = chart.where(:patient_id => @sharepatient.id) that want combine single 'or' query. tried: @charts = chart.where(:patient_id => @sharepatient.id or :patient_id => @emailpatient.id) and @charts = chart.where("patient_id => @sharepatient.id or patient_id => @emailpatient.id") and various other variations , cant work. going astray? you can do @charts = chart.where(:patient_id => [@emailpatient.id, @sharepatient.id])

asp.net - How to get IMG tag's source from given HTML string using c# -

i getting html string db :- <p>lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex</p><img class="classname" alt="alttext" src="http://www.domain.com/uploads/myimage.jpg" width="612" height="612" /><p>going the itinerary, @ official launch on 22nd may.</p><img class="classname" alt="alttext" src="http://www.domain.com/uploads/myimage1.jpg" width="612" height="612" /> as can see in string there 2 image tags. want first image tag's source eg :- http://www.domain.com/uploads/myimage.jpg can suggest me how can text html string. thanks in advance you can use html parser htmlagilitypack this string html = ....... htmlagilitypack.htmldocument doc = new htmlagilitypack.htmldocu...

Cannot uninstall NetBeans 7.3 -

i'm not able uninstall netbeans ide 7.3 pc. it's showing "instance of program still running" after close background processes of ide. can me?? for ubuntu users, go /home/.netbeans/.your_ide_version there find .lock file , remove it.

sql - display words from one ID in one line in mysql -

i have table so: id | word ___________ 1 | hello 1 | goodbye 1 | goodnight 2 | 2 | why 3 | yes 3 | no is there way collect words same id , display in 1 line so: id | word _______________________________ 1 | hello, goodbye, goodnight 2 | what, why 3 | yes, no use group_concat() select id, group_concat(word separator ', ') word tablename group id sqlfiddle demo mysql group_concat() output ╔════╦═══════════════════════════╗ ║ id ║ word ║ ╠════╬═══════════════════════════╣ ║ 1 ║ hello, goodbye, goodnight ║ ║ 2 ║ what, why ║ ║ 3 ║ yes, no ║ ╚════╩═══════════════════════════╝

audio - Play sound in Android notifications although phone silent mode is set -

my app showing notifications, , when notification shown, sound played. when phone on "silent mode" notification not played. want "override" volume settings, , play sound although silent mode set. there way it? hi can use mediaplayer notification sound, starting service play's mediaplayer when notification shown. to make sound stop, stop service in broadcastreceiver of notification's pendingintent. also, don't forget stop sound when notification cancels.

c# - Membase logical cache sections -

does membase has notion of cache sections? such as: users cache, news cahce, item cache etc. when storing users, want able store , read cache section. likewise items store , read item cache. is supported? does .net client supports this? membase supports idea of bucket , can create user bucket, news bucket, , item bucket. client have connect each bucket separate connection.

Exchange ItemID differs from GlobalAppointmentID for Outlook AddIn -

the problem i'm having globalappointmentid of outlook appointement created using outlook formregion differs of itemid when using ews managed api. i'm creating outlook addin allows users add customer , project information meeting. addin stores appointment id , meeting data in database , service periodically check id update appointment data. ok here how use addin: outlook.appointmentitem appointement = (outlook.appointmentitem)this.outlookitem; appointement.save(); string exchangeid = appointement.globalappointmentid; here globalappointmentid is: 040000008200e00074c5b7101a82e0080000000060cadc517255ce01000000000000000010000000847a9cd89052dc49ba28dc8aafbbb4ba but ews managed api expects like: aamkadvintjlztg5ltiwywmtngy3my1howziltziotm3otk3nzk1yqbgaaaaaaaefbmehamsrzur9avsphpmbwcysaa5hwpmransowsnkrckaaaaxal/aacysaa5hwpmransowsnkrckaaaaxcxwaaa= to bind appointmentitem service. there option solve using auto-generated proxies , not managed api link proxy solution s...

pointers - C array = array faster than memcpy() -

i have piece of c code trying optimise involves setting array b. using memcpy achieve this, , works, it's not fast enough. i.e. double a[4] = {1.0, 2.0, 3.0, 4.0}; double b[4]; memcpy(b, a, sizeof(a)); this basic example, program similar uses 9000 doubles. know use of pointers can save lot of time, i'm not sure how it. you're appreciated. edit: don't need keep array, can discarded. need transfer b. i use values in b determine new values a. goes through while loop checking convergence in data. in case may able avoid copying, if switch arrays , forth, (which backwards wrote; adjust needed): double array1[size], array2[size]; double* = array1, double* b = array2; generate_initial_values(array1); (;;) { // either memcpy(b, a, sizeof array1); // sizeof either array do; *don't* use sizeof or b, size of pointer, not of array update_values_in_b(b); // or, better: produce_modified_values_in_b_from_a(a, b); if (converged(...

c# - How to assign index of the collection to property -

i have following linq query productionmachines.orderby(x => x.timedone).tolist(); want assign property x , index of it's location in collection. first productionmachines receive x equals 1 secound 2 , etc... example productionmachines have 5 entries. productionmachine[0].x have 1 .. .. .. productionmachine[4].x have 5 use other form of select productionsmachines.orderby(x => x.timedone) .select( (x,i) => { x.property = i+1; return x; });

java - When "if else"/"instance of" are inevitable, how do we improve the design apart from using visitor pattern? -

when have object hierarchy purely inheritance of semantic , not of behaviors,then inevitably need write "instanceof" or "if/else" everywhere run time type checking. e.g. if have object hierarchy has class function class average extends function class sum extends function class max extends function if there method called calculate() in these classes, not have problem, can take advantage of polymorphism , design satisfies lsp. however if not want add calculate() method hierarchy reason, these objects purely plain object stateless objects represent semantic. then forced write following code everywhere : if (function instanceof average) //perform average else if(function instanceof sum) //perform sum else if(function instanceof max) //perform max the code above indicates bad design, because write code everywhere , design fragile , hard change later on. guess if number functions limited , calculation of function in single place perhaps ok depends o...

android - Imageview doesn't load the image programatically -

i have layout imageview component want load image programatically i tried load image file , drawable resource, in oncreate() event , when button pressed no image loaded , no error thrown. i'm using .invalidate() method without results example drawable resource ( monodroid code ) imageview ivstock = view.findviewbyid<imageview>(resource.id.iv01); way 1: ivstock.setimageresource(resource.drawable.circle_green); way 2: ivstock.setbackgroundresource(resource.drawable.circle_green); way 3: ivstock.setimagedrawable(resources.getdrawable(resource.drawable.circle_green)); and ever ivstock.invalidate(); i tried task in thread , in task. think i'm missing , don't know what. edit 1: tried in same activity/layout , works fine btnok.setbackgrounddrawable(resources.getdrawable(resource.drawable.circle_green)); could bug? any appreciated in advance solved sorry folks, defining ivstock inside view view view = layoutinflater.infla...

c# - I have created a class for executing actions, but which extendable design pattern should I actually use here? -

i have created class can execute methods string code (this want actually, since ( already existing ) database contains these codes. want more extendible add more database records. have create method each code, want use interface , class can created without editing class. guys have suggestions? public class specificaction { public actiontoperform actiontoperform { get; private set; } public string action { { return actiontoperform.action.code; } } public specificaction(actiontoperform actiontoperform) { actiontoperform = actiontoperform; } public dynamic execute(object[] parametersarray = null) { type type = typeof (specificaction); methodinfo methodinfo = type.getmethod(action); dynamic result = null; if (methodinfo != null) { parameterinfo[] parameters = methodinfo.getparameters(); result = methodinfo.invoke(this, parameters.length == 0 ? null : parametersarray...

Pass a PHP variable in a link to a Modal box -

hi have html link modal box works perfectly, trying pass variable form in modal box, how ever link shows nothing happens once clicked. here normal code: <a href="#accsettings1" role="button" class="btn btn-small btn-primary hidden-tablet hidden-phone" data-toggle="modal" data-original-title=""> add </a> here php code echo "<a href=\"#accsettings1?ip_address={$ip_address}\" class='btn btn-small btn-primary hidden-tablet hidden-phone' data-toggle='modal' data-original-title=''>add</a>"; use normal code , add php when need php variable: <a href="#accsettings1?ip_address=<?=$ip_address?>" role="button" class="btn btn-small btn-primary hidden-tablet hidden-phone" data-toggle="modal" data-original-title=""> add </a> if it's application doesn't work - debug first. use h...

drupal - How to translate views exposed filter -

i have taxonomy term field in acount fields list. translated term (using translation mode: "localize. terms common languages, name , description may localized." ). have view displays , filters registered users. problem me . exposed filter term in 1 language. pls help. download , enable internationalization views module, able localized taxonomy term names.

Can we add flowchart in eclipse rcp -

i add flowchart in eclispe rcp. wanted know there free plugin purpose? if yes, can please send link. thanks in advance if need graphical editor best choice using emf , gef . basic tutorial here . if want present flowchart can use available chart library java , integrate eclipse rcp application.

android - Draw on achartengine on touch -

Image
i'm trying compare 2 values 2 series @ same x value chart below: i can values .getcurrentseriesandpoint() not usable possible current achartengine api detect touch on blue area , draw black rectangle around 2 values?

Java virtual Machine implementation iadd microcommand improvization -

wanna ask question of our computer structure exam here sure. below add command of mic-1 ijvm. asked write new iaddtriple command add 3 top words of stack , store on stack again. iadd1 mar = sp = sp − 1; rd read in next-to-top word on stack iadd2 h = tos h = top of stack iadd3 mdr = tos = mdr + h;wr;go main1 add 2 top words, write top of stack my answer ; iaddtriple1 mar = sp = sp − 1; rd iaddtriple2 h = tos h = iaddtriple3 h = mdr = tos = mdr + h iaddtriple4 mar = sp = sp − 1; iaddtriple5 mdr = tos = mdr + h ; wr;go main1 i want ask if iaddtriple3 step legal. 1 of friends told me h=blabla +h assignment should illegal shouldn't used. time diagram of data path cycle proves me right. in advance. iaddtriple3 h = mdr = tos = mdr + h it possible perform h = h + mdr since h can specified in c-bus bits, alu operation + b, b register mdr. actual microinstruction 0003c8000 the first 2 hex digits numbers, third hex digit 0 or 8.

html - Misplaced list elements due to CSS in firefox and chrome -

i have list of names rendered inside <ul> . applied css code facing browser specific issues. chrome : list element getting displaced 1 row. firefox : list items collapsing 1 item. code snippet ( js bin editor ) html <div id='container'> <ul class='list'> <li> <div class='rel'> <div class='abs'> item 1 </div> </div> </li> ... more items similar above 1 css #container { height: 100px; overflow-y:scroll; width: 200px } .list { background-color: skyblue; } .rel { position: relative; } div.abs { position: absolute; left: 20px; } i want know reason of misbehavior in both browsers. have written wrong css ? update: in <div class='abs'> have lot of code have not added here not necessary , content of abs div positioned respect parent i.e. <div class='rel'> the problem indeed div.abs { position: absolute; left: 20...

How can I temporarily disable StyleCop on my machine? -

i'm being 'forced' use stylecop on external project find invasive style of working interrupts flow of work making progression slow. i'm having document before i'm close finishing it. i'm being forced stylecop write valid documentation code know i'm going delete or refactor in half hour once i've run once or twice in order test something. how can temporarily turn off can on work? (i can re-enable , sort out documentation , formatting issues before commit source source control) how "forcing" being accomplished? if stylecop being invoked via msbuild @ compile-time , warnings being treated errors, it's quite possible it's being executed after compilation, in case assembly presumably available, , nothing blocked. if being run via msbuild, regardless of whether it's triggered before or after compiler, simplest fix solution owner provide build configuration (e.g.: "debug compile only") in forms of static analy...

Form of object created from another object in c# -

i have form containing flowlayoutpanel, , user control added panel. in constructor of user control a, pointer same flowlayoutpanel passed, user control creates user control b in same flowlayoutpanel. problem user control b first added, a. form1.cs public partial class form1 : form { public form1() { initializecomponent(); } private void addbtn_click(object sender, eventargs e) { flowlayoutpanel1.controls.add(new graphic1(this.flowlayoutpanel1)); } } graphic1.cs public partial class graphic1 : usercontrol { public graphic1(flowlayoutpanel flowpointer) { initializecomponent(); flowpointer.controls.add(new graphic2()); } } graphic2.cs label problem graphic2.cs added before graphic1.cs in panel i see 3 possible solutions: if constructor of control receives flow layout panel, have control add itself flow layout panel, add additional controls. instead of adding additional control in construc...

django - How to save current login user? user_id may not be NULL -

i have error: appname_mymodel.user_id may not null def form_view(request): user = request.user f_form = fform(request.post or none, request.files or none) if request.method == "post": if f_form.is_valid(): f_form.user = user f_form.save() return httpresponseredirect('/thanks/') return render_to_response('upload.html', {'f_form': f_form}, context_instance=requestcontext(request)) forms.py: class fform(modelform): class meta: model = mymodel exclude =['user'] how save current login user? the form doesn't have user attribute useless assign it. should instead is: if f_form.is_valid(): my_model = f_form.save(commit=false) my_model.user = user my_model.save() this way form construct mymodel instance, not attempt save database. can fill user field , save it.

r - Closest pair for any of a huge number of points -

we given huge set of points in 2d plane. need find, each point closest point within set. instance suppose initial set follows: foo <- data.frame(x=c(1,2,4,4,10),y=c(1,2,4,4,10)) the output should this: closespair(foo) 2 1 4 3 3 # (could 4 also) any idea? the traditional approach preprocess data , put in data structure, k-d tree , "nearest point" query fast. there implementation in nnclust package. library(nnclust) foo <- cbind(x=c(1,2,4,4,10),y=c(1,2,4,4,10)) <- nnfind(foo)$neighbour plot(foo) arrows( foo[,1], foo[,2], foo[i,1], foo[i,2] )

sql - Query to get only numbers from a string -

suppose have data this: string 1: 003preliminary examination plan string 2: coordination005 string 3: balance1000sheet the output expect string 1: 003 string 2: 005 string 3: 1000 and want implement in sql. please help. in advance :) first create udf create function dbo.udf_getnumeric (@stralphanumeric varchar(256)) returns varchar(256) begin declare @intalpha int set @intalpha = patindex('%[^0-9]%', @stralphanumeric) begin while @intalpha > 0 begin set @stralphanumeric = stuff(@stralphanumeric, @intalpha, 1, '' ) set @intalpha = patindex('%[^0-9]%', @stralphanumeric ) end end return isnull(@stralphanumeric,0) end go now use function as select dbo.udf_getnumeric(column_name) table_name sql fiddle i hope solved problem. reference

Drawing a Discrete number of rects in an svg element.using D3.js -

js , trying figure out how draw discrete number of rectangles in svg element. 5 rectangles million. best way go this? should using ordinal scale since have discrete number of rectangles or should using linear scale? i'm thinking width of rectangles should shrink number of rectangles grows larger. you have compute layout , create appropriate scales. example: var width = 300, height = 20, margin = 2, nrect = 20, rectwidth = (width - (nrect - 1) * margin) / nrect, svg = d3.select('#chart').append('svg') .attr('width', width) .attr('height', height); var data = d3.range(nrect), posscale = d3.scale.linear() .domain(d3.extent(data)) .range([0, width - rectwidth]); svg.selectall('rect') .data(data) .enter() .append('rect') .attr('x', posscale) .attr('width', rectwidth) .attr('height', height); i wrote small jsfiddle code: ...

wordpress - URL to edit image with media uploader thickbox -

i'm using wordpress 3.5 , trying figure out how can edit image clicking on media uploader thickbox. what found out far the url below work fine need edit special image, not add one. have attachment id. /wp-admin/media-upload.php?post_id=1&type=image&tb_iframe=1&width=640&height=553 to make thickbox work need add classes info thickbox . question i found many articles on how upload images not how edit them. maybe can add variale work?

Get data from database Android -

i have page can retrieve user data database after whole day of trying, able table column name not value inside. this code create database public static final string lastlogin = "lastuser"; public static final string user_id = "suser_id"; public static final string user_name = "suser_name"; public static final string user_password = "spassword"; public static final string prime_id = "id"; private static final string table_user = "create table "+ lastlogin+" (" +prime_id+" integer primary key autoincrement, " + user_id + " text, " + user_name +" text, " +user_password+" text); "; and here function implemented user data public cursor getuser() { string[] columns = new string[]{prime_id, user_name, user_password}; cursor cursor = sqlitedatabase.query( lastlogin, columns, null, null, null, null, prime_i...

Using google drive api to duplicate a worksheet -

i tring copy/duplicate worksheet using google apps script. possible ? not able find reference of such call in api docs. https://developers.google.com/google-apps/spreadsheets/ sorry, far know, there no function that. google apps script it. i did manual way. created new sheet , did copy of formulas/data. there bugs if use $ in formulas, read works fine, write pain, formulas, e.g. a$1 references won't write sheet (because of bug). need switch them a1. can't copy fonts/colours etc. my code doing in java, not easy split out bit need.

c# - MVC 4 Href or onclick without Postback -

i have question related mvc postbacks problem/issue i have anchor following code <a style="text-align:left;" data-role="button" onclick="window.location='@url.action("taken_detail", new { taakid = tk.id }) + " data-ajax="true" data-icon="alert"><span class="agenitems"></span> if click on it redirect me current page taken_detail id thats nice happend postback / page flicker how avoid ? if use @html.actionlink("toezicht", "toezicht", "toezicht", new { data_transition = "none" }) than page won't have white page flickering ?

actionscript 3 - How to get alert in flex web application when browser window is minimized? -

i have flex web application. want show pop-up window or alert when event received. browser window minimized. thank you. the idea use desktop notifications through javascript. use externalinterface call javascript as3. might not work every browser though.

linux - How to detect if my server is running centos or other from a perl script -

i want display text in script if operating system centos . how can in perl script ? to answer exact question, can identify centos reading contents of /etc/redhat-release . e.g. $ cat /etc/redhat-release centos release 5.9 (final) as other commenters have made clear, better depend on exact os features want, or write code portable, rather limiting particular distribution of linux.

sqlite - Storage type for few data? -

i'm developing sms application , want message , phone number inserted user stored in memory in order automatically retrieved next time user opens application. storage type should use? think sqlite database unnecessary such few data... xml files read-only. should use cache memory? thanks! cache memory? next time reboot pc gone. databases best options. if not simple text file suffice guess. simple file i/o needed every time user opens app. note in case need encryption/decryption if storing passwords. for xml files need define xpaths, parsing logic etc. better write in plain text file delimiter space or comma or *.

ssas - A complex ragged hierarchy and generic queries in MDX with compound keys -

dimension made collection of key column attributes so: ... hierarchylevel2key = level2attribute + level1attribute hierarchylevel1key = level1attribute ... hierarchy has many levels, in lowest levels of hierarchy, key combinations quite complex: [dim].[hierarchy].[level1].&[level2]&[level3]&[level4]&[level5]&[level6]&[level7] now if want make generic named set level5 members, it's in mdx: [dimension].[hierarchy].[level5].members.item(2) and returns second member of level5, because hierarchy ragged (?) item(2) not exist. . do have make gazillion of different named sets , manually have pick right existing items sets? or alternatively have made mistake building dimension hierarchy way ?

php - Convert Text on database mysql and output them in pdf file -

column address in database type text write code: $string = mb_convert_encoding($addr,'sjis-win','utf-8'); and ouptut $string in pdf file export. machine text ok, japan machine character space display "*" . please me fix!

php - Gathering information in 1 row using related tables -

i trying build database using related tables. getting right output database, - since user same, , change in data courses, gather values "engelsk" , "matematik" in same row, instead of having 2 outputs virtually same, except courses. possible without having in same row in database? , if so, i'd know how :) array ( [0] => array ( [type] => elev [username] => test [name] => test testsen [grade] => 9. klasse [course] => engelsk ) [1] => array ( [type] => elev [username] => test [name] => test testsen [grade] => 9. klasse [course] => matematik ) ) so achieve this: array ( [0] => array ( [type] => elev [username] => test [name] => test testsen [grade] => 9. klasse [course] => engelsk, matematik ) my query looks this: select * ...

geolocation - Android using AutoCompleteTextView with Location suggestions (Using Geocoder and getFromLocationName()) -

i have autocompletetextview want search locations, example: type "vig" , autocompletetextview list shows 5 best results that: "4560 vig", "juan pablo perez..", "the vig 4041...", "vig" example, type "vigo": says right place: "vigo, pontevedra" , can select , put on autocompletetextview. for now, have working have 1 error: the display list showing when delete on character, if not doesn't show, , shows last string result, example: have typed "vigo", , nothing appears, delete "o" , display list shows results "vigo" instead of "vig", typed in autocompletetextview in moment. i perform search locations in asynctask: private class searchaddress extends asynctask<string, void, string[]> { @override protected string[] doinbackground(string... params) { //adapter.clear(); string[] addressarray = getstreetlist(query); ret...