Posts

Showing posts from May, 2014

.htaccess - Redirecting 301 non-existing files(pdf,doc) etc -

i've drupal cms based site in files regularly deleted. keep backlinks want non-existent pdf , word files redirect common page informing deletion. is right way do? : ( picked 301 redirects on non existent image, pdf or url using .htaccess ) : rewriteengine on rewritebase / rewritecond %{request_filename} !-d # not dir rewritecond %{request_filename} !-f # not file rewriterule ^.*\.(pdf|doc|xls|xlsx|docx|zip)$ show-deleted-page.htm [r=301,l] here drupal .htaccess file needs work: # # apache/php/drupal settings: # # protect files , directories prying eyes. <filesmatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|entries.*|repository|root|tag|template)$"> order allow,deny </filesmatch> # don't show directory listings urls map directory. options -indexes # follow symbolic links in directory. options +followsymlinks # make drupal handle 404 errors. errordocument 404 /index.php # s...

mysql - A relational query, not sure how to build it with EXISTS -

carts id user_id cart_proucts id cart_id product_id price products details product... so easier form of table structure currently. have list of product id, need check against user if has them or not, know looking @ cart_products cart belongs user, relationship described above. if has should retrieve "user" , information contains. need check if price range of product, i.e. product must not lower 500 i.e. price column in cart_products... how can easiest build sql? thinking of joins , use of exists or in perhaps? select * `users` `u` join `carts` `c` on (`u`.`id` = `c`.`user_id`) join `cart_products` `cp` on (`cp`.`cart_id` = `c`.`id`) join `products` `p` on (`p`.`id` = `cp`.`product_id` , `p`.`price` > `cp`.`price`) `p`.`id` in (...);

tsql - RAISEERROR or throw in trigger to rollback DML statement -

just have throw or raiseerror in trigger below if object_id('sales.orderdetails_aftertrigger', 'tr') not null drop trigger sales.orderdetails_aftertrigger; go create trigger sales.orderdetails_aftertrigger on sales.orderdetails after insert, update begin if @@rowcount = 0 return; set nocount on; -- check rows if exists(...) begin raiserror ('this error message not displayed', 10, 1 ) end end go if raiseerror thrown in trigger prevent dml statement being rolled back? just notice still getting rows inserted when happens. check out remarks section in raise error page microsoft http://msdn.microsoft.com/en-us/library/ms178592.aspx "when raiserror run severity of 11 or higher in try block, transfers control associated catch block" your throwing 10 control not go catch statement. that'll calling code flow if trying stop there (not shown hard tell). but!! made comment rows still inserted. suspect should perhaps using insert...

c# - ScatterPlot PlotXY NI - Performence -

i use plotxy function of scatterplot (ni): scatterplot.plotxy(xvalues.toarray(),values.toarray()); when have large data, works slow. the graph updated slowly, , besides all program hangs . i read in few places works slow large data, wanted know if there way improve performance of plotxy?

scripting - Terminate shell code while it is running -

for clearing screen in shell code if write ctrl + l printf "\033c" then shall done ctrl + c ? just exit not working in code because handling errors , in case of bad inputs have run code again , when unseting variables unset working fine later again code shows output no input variables. if understand correctly want do, should use trap command. trap prevent shell default handling , allows interrupt, quit, hangup etc. doing. the syntax following trap <command execute> <signal intercept> so like trap break int to have equivalent of ctrl-c.

jquery - Select all child div tags in all parents div tags -

i want select children classes attribute(tbox,tarea,cts,tox) inside of parents. this code: <div class='cts'> var s = $('div.cts').children().attr('class'); alert(s); but shows first parent first child class attribute: <fieldset id="tt"> <div class="cts"> <div class="tbox"> <input type="text" /> </div> </div> <div class="cts"> <div class="tarea"> <input type="hidden"> </div> </div> <div class="cts"> <div class="tss"> <input type="password"> </div> </div> <div class="cts"> <div class="tox"> <input type="text"> </div> </div> </fieldset> u...

android - java.lang.IndexOutOfBoundsException -

i want save multiple selection listview mysql database,, logcat give error "java.lang.indexoutofboundsexception".. this code sparsebooleanarray checked = kuliah.getcheckeditempositions(); arraylist<string> selecteditems = new arraylist<string>(); (int = 0; < checked.size(); i++) { // item position in adapter int position = checked.keyat(i); // add sport if checked i.e.) == true! if (checked.valueat(i)) selecteditems.add(adapter.getitem(position)); } arraylist<string> selecteditems1 = new arraylist<string>(); (int = 0; < checked.size(); i++) { // item position in adapter int position = checked.keyat(i); // add sport if checked i.e.) == true! if (checked.valueat(i)) selecteditems1.add(adapter1.getitem(position)); } arraylist<string> selecteditems2...

loops - Data manipulation on multiple dataframes in R -

suppose have dataframes a_january, a_february, a_december etc 10 columns each... all of them have same 10 columns.. need data manipulation on 1 of 10 columns , produce new bunch of columns in each of data frames.. can manually dataframes, have 400 such dataframes.. how do this?. please let me know... suppose, need same set of operations on multiple dataframes...(create new variables, sort them etc etc) a_january$new_var<-a_january$var1+a_january$var2 how do this?. how can put in loop , make happen? please let me know first step important: not create variable each data.frame. instead, put them list of data.frames: data <- list(a_january, a_february, a_december) this might cumbersome type, if have hundreds of data.frames. if can tell how came create these data.frames might fix problem @ root. once have list, easy modify of them: data <- lapply(data, transform, new_var = var1 + var2)

mongodb - Performance issue with JSON input -

i loading mysql table mongodb source through kettle. mongodb table has more 4 million records , when run kettle job takes 17 hours finish first time load. incremental load takes more hour.i tried increasing commit size , giving more memory job, still performance not improving. think json input step takes long time parse data , hence slow. have these steps in transformation mongodb input step json input strings cut if field value null concat fields select values table output. same 4 million records when extracted postgre way more fast mongodb. there way can improve performance? please me. thanks, deepthi run multiple copies of step. sounds have mongo input json input step parse json results right? use 4 or 8 copies of json input step ( or more depending on cpu's) , it'll speed up. alternatively need parse full json, maybe can extract data via regex or something.

android - How do I change TextView when I rotate my device? -

i'm trying write android program in eclipse. idea of program display message in textview saying "the device has been flipped" if device rotated 180 degrees (in xy plane, think?). i'm using rotation sensor , trying write code in onsensorchanged event. code supposed change textview when rotation detected, not. so questions in simple are: how textview change given rotation? how apply rotation of 180 degrees? package com.example.rotation2; import android.hardware.*; import android.os.bundle; import android.app.activity; import android.content.context; import android.view.menu; import android.widget.textview; public class mainactivity extends activity implements sensoreventlistener { textview message; private sensormanager msensormanager; private sensor rotation; context context; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview message = (...

javascript - ember-konacha-rails isValid AssertionError -

i using ember-konacha-rails test ember.js application, here model testing: //sales_rep.js app.salesrep = ds.model.extend({ firstname: ds.attr('string'), lastname: ds.attr('string'), }); here test : #= require spec_helper describe "app.salesrep", -> beforeeach( -> test.store = testutil.lookupstore() ) "is ds.model", -> assert.ok app.salesrep assert.ok ds.model.detect(app.salesrep) describe "attribute: firstname", -> "can created valid value", -> ember.run( -> test.contact = app.salesrep.createrecord firstname: 'joe' ) expect(test.contact.get 'firstname').to.equal 'joe' describe "attribute: lastname", -> "can created valid value", -> ember.run( -> test.contact = app.salesrep.createrecord lastname: 'swanson' ) expect(test.contact.get...

c# - Is it possible to execute a method before and after all tests in the assembly? -

i built nunit project selenium ui automation. sign in site before running tests (all of them) , close browser after running tests (all of them). i can't use setup since related fixtures , want before , after everything. do know execute it? i'm familiar setup , teardown attribute. let me explain again. i need logic executed before tests fixtures starts (aka - first test in entire assembly) , logic executed after tests fixtures ended (aka - last test in entire assembly). if test fixtures within same namespace can use [setupfixture] attribute mark class global setup , teardown. can put login/logout functionality in there. nunit 2.x namespace mynamespace.tests { using system; using nunit.framework; [setupfixture] public class testssetupclass { [setup] globalsetup() { // login here. } [teardown] globalteardown() { // logout here } } } see: h...

Shiro, Multi Factor Authentication -

is there way implement multi factor authentication in shiro? can give me hint on how implement this? for more details: basic idea is, user needs login usual, using username , password, before being authenticated user needs enter one-time-token received sms. thank you! i solved problem on own, i'm of course open other suggestions. i implemented own 2 - factor authentication flow: first of changed url of login page, shiro redirects unauthenticated user own login page, leads authentication mechanism. user needs complete 2 "stages" login. on first stage he/she has provide username , password, if these valid, user redirected second stage of login. meanwhile, 1 time token has been generated , sent user via sms. user's authentication progress has been saved in session (which means remember, stage 1 completed successfully). on stage 2 user needs enter token. if token not valid or number of attempts (5) exceeded expired (after 5 minutes) number of...

javascript - How can add fade In() effect to each appearance of a div when the mouse click? -

how can add fadein() effect each appearance of div when mouse click? so when onmouseclick, yellow part showing fadein() effect. fiddle : http://jsfiddle.net/2ehdw/7/ script : window.jqueryclick: function (event) { if (!event.point.selected) { $('#testdiv').show(); var chart_data = '<div> name: ' + event.point.name + ' share: ' + event.point.y + '</div>'; $('#testdiv').html(chart_data); } else { $('#testdiv').hide(); } } add parameter .show() method , hide div before showing again: if (!event.point.selected) { $('#testdiv').hide(); $('#testdiv').show("300"); //or $('#testdiv').fadein(); var chart_data = 'name: ' + event.point.name + ' share: ' + event.point.y; $('#testdiv').html(chart_data); } else { $('#testdiv').hide(); } fiddle

java - How to set the same Button size and label for our screen in android -

am try fit buttons, textviews etc., in relative layout.and using header , footer linear layout(vertical). screen looks diff. in tablet device, , looks diff. in mobile device why? coding xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <linearlayout android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_centerhorizontal=...

c# - quickfix/n error : MsgSeqNum too high -

i have created fix application using 'quickfix/n v1.4.0' ' http://www.quickfixn.org/download ' site. when executed application,i randomly error of sequence number.sometimes application runs fine , sometime sequence number problem.the log details below: 20130828-10:28:30.468 : created session 20130828-10:28:31.328 :> fix.4.4:server->client socket reader 7995840 accepting session >fix.4.4:server->client 192.168.1.*:7356 20130828-10:28:31.328 :> fix.4.4:server->client acceptor heartbeat set 0 seconds 20130828-10:28:31.578 : received logon 20130828-10:28:31.625 :> responding logon request 20130828-10:30:28.968 : created session 20130828-10:30:29.796 : fix.4.4:server->client socket reader 36610825 accepting session fix.4.4:server->client 192.168.1.*:7364 20130828-10:30:29.796 : fix.4.4:server->client acceptor heartbeat set 0 seconds 20130828-10:30:30.625 : verify failed: msgseqnum low,expecting 94 received 44 20130828-10:30:...

Durandal: At what stage in lifecycle should router.isNavigating deactivate? -

sigh it's becoming "daily question" routine me, sorry! i have nav.html contains: <div class="loader pull-right" data-bind="css: { active: router.isnavigating }"> <i class="icon-spinner icon-2x icon-spin"></i> </div> trouble is, never deactivates! spinner stays rotating, basically. i've put in debugs in viewmodels in durandal html samples page: var vm = { activate: activate, //refresh: refresh, //sessions: sessions, title: 'my app home page', activate: function () { system.log('lifecycle : activate : home'); }, binding: function () { system.log('lifecycle : binding : home'); return { cacheviews: false }; //cancels view caching module, allowing triggering of detached callback }, bindingcomplete: function () { system.log('lifecycle : bin...

sql server - Limit records in query -

this query select [mo].[id] [objectid], [ca].[id] [categoryid], [gr].[id] [groupid] [myobject] az [mo] inner join [category] [ca] on [ca].[id] = [mo].[categoryid] inner join [group] [gr] on [gr].[categoryid] = [ca].[id] the result is: objectid categoryid groupid ----------------------------------- 1 1 1 1 2 2 2 1 1 2 2 2 but need distinct on objectid mean categoryid , groupid not important me need following: objectid categoryid groupid ----------------------------------- 1 1 1 2 1 1 or objectid categoryid groupid ----------------------------------- 1 2 2 2 1 1 both of above result fine me , both of them see real record (as see in first query) so, how can result? fastest way this? suggestion? use group by , use aggregate function on other columns: select ...

multiprocessing - Python multicore without communication -

i want call methode getrecommendations pickle recommendations specific user file. used code book works. saw 1 core works , want cores work, because faster. here method. def getrecommendations(prefs,person,similarity=sim_pearson): print "working on recommendation" totals={} simsums={} other in prefs: # don't compare me myself if other==person: continue sim=similarity(prefs,person,other) # ignore scores of 0 or lower if sim<=0: continue item in prefs[other]: # score movies haven't seen yet if item not in prefs[person] or prefs[person][item]==0: # similarity * score totals.setdefault(item,0) totals[item]+=prefs[other][item]*sim # sum of similarities simsums.setdefault(item,0) simsums[item]+=sim # create normalized list rankings=[(total/simsums[item],item) item,total in totals...

javascript - URL changes for a millisecond and comes back to original.$location.url not working (Angular JS) -

here code angular app. in $scope.$on('promotion_create) event handler, trying change url , render partials .but url changes few milisecond , comes without rendering . (function (angular){ var app = angular.module('promotionsdashboard',[]); app.config(['$routeprovider', function($routeprovider) { $routeprovider. when('/', {templateurl: 'promotions/routes/dashboard/promotions-home', controller:'promotionshomecontroller' }). when('/create/', {templateurl: 'promotions/routes/dashboard/create-promotions', controller: 'createpromotionscontroller'}). otherwise({redirectto: '/'}); }]); app.controller('promotionshomecontroller', ['$scope', '$rootscope','$location', function($scope, $rootscope,$location){ $scope.createpromotion = function(){ console.log("hello"); ...

how to solve calculations in java -

i'm working on calculator, should receive input string , perform calculation, outputting result. for example, input be ((23+17) mod 7 × 4 , 13 and output 4 , expected. how can parse input, extract operands , perform calculation ? the other answers "how set variable result" if you're looking parse input, should refer this: equation (expression) parser precedence? there number of ways go solving kind of problem, , number of algorithms doing so. of them stack based, perform descent of "tree", , can think of (somewhat) convoluted way oop-ize it. start link above.

slug - when to store slugfield in database in django? -

suppose access article at /article/23/the-46-year-old-virgin in /article/id/slug form. i can use id fetch data in view. don't see reason store slug in database. besides, /article/id/slug isn't better /article/slug ? the problem using id hurt both url readability , search engine optimization. (see here latter.) one problem using slug long , urls truncated in real world. if have id @ beginning use lookups , redirect if went wrong slug part. other problem have guarantee slugs unique. sure you'll never want have 2 articles same title? so doing 1 or other possible, there benefits doing both. as whether or not should store slug in database, first decide if want url change when title changes. 1 advantage keeping same have single, permanent, canonical url resource, 1 won't change if need edit title. obvious downside url no longer reflect exact title of article. if want slug match title, becomes standard database denormalization question -...

configure networking between vm on virtualbox -

i installed virtual box on window 7 laptop, when install new vm , install ubuntu os,now when choose nat works fine when unable configure host-only network on . and 1 more problem facing when clone machine , start , change mac address setting , start sometime no network configured on machine . i want start 2 vm on virtual box ,both machine have 2 network adapter 1 nat communicate , 1 host , local vms. if possible or not if yes tell me configuration . tried solution googling no luck still . you can achieve using "host-only networking". setup follows: host: @ least 1 host-only network present , configured, e.g. - ip address set to: 192.168.56.1 - dhcp server: enabled or disabled (works on both) note name of host-only network, e.g. "vboxnet0". used in next steps. guest vm 1: 1. set adapter 1 (or other adapters) "host-only adapter". 2. make sure name set name noted in host section above, e.g. "vboxnet0". guest vm 2 (same ...

networking - Pushing SKB to the network stack -

i have net_device has ndo_start_xmit function implemented. when ndo_start_xmit function called have skb contains ip packet. i'll need overt packet ip+udp headers , send routing system. the problem when call dst_input(skb) or dst_output(skb) i'll catch null pointer dereference error. seems can't use functions push encapsulated packet network stack. can helps me solution? if want push skb kernel stack use netif_rx(skb) function.

jquery - Select2 doesn't work when embedded in a bootstrap modal -

Image
when use select2 (input) in bootstrap modal, can't type it. it's disabled? outside modal select2 works fine. working example: http://jsfiddle.net/byjy8/1/ code: <!-- modal --> <div id="mymodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="mymodallabel">panel</h3> </div> <div class="modal-body" style="max-height: 800px"> <form class="form-horizontal"> <!-- text input--> <div class="control-group"> <label class="control-label" for="vdn_number">numer</label> <div class="controls"> <!-- sele...

c++ - Interactively editing an existing rectangle on a QPixmap? -

Image
i'm trying creat dicom gui toolkit user selects dicom images , image of first dicom image selected ones shown. user clicks on image , image pops out bigger image window. in shown bigger image, image consist of red colored rectangle contains necessary regions of dicom image while unnecessary region outside rectangle. user should have option change rectangle mouse. until now, have been able show big dicom image rectangle in using qlabel following code snippets. void mainwindow::showbigimage() { qpixmap bigimage; bigimage.load(imagename.c_str()); qpainter painter(&bigimage); painter.setpen(qt::red); qrectf rect(xmin, ymin, xmax, ymax); painter.drawrect(rect); qsize bigsize = ui->bigimagelabel->size(); ui->bigimagelabel->setpixmap(bigimage.scaled(bigsize, qt::ignoreaspectratio, qt::fasttransformation)); ui->bigimagelabel->show(); } and big image on app looks following: can please suggest me how should make rectang...

actionscript 3 - How to random every time object.Y is out of stage -

Image
im trying random object(2) every time object(1).y beyond stage. problem comes moving , "jumps" position im looking make change. did try "if (road1.y >= stage.stageheight) {" doesnt trigger. , when i'm doing the speed of movement triggers when has been on stage 2 times before. registration point of movieclips in top left. code this private var road1,road4:road1; private var road2:road2; private var road3:road3; private var randomroad:sprite = new sprite(); private var offset:number = 0; private var counter:number = 0; public function onadded(e:event):void { removeeventlistener(event.added_to_stage,onadded); addchild(road1=new road1()); addchild(randomroad); addchild(road4=new road1()); addeventlistener(event.enter_frame, onenterframe); } public function onenterframe(e:event):void { if (startrandom == true) { if (math.random() > 0.5) { randomro...

django - How to add modelforms dynamically? -

i have simple use case. have 3 models foo, foo1 , foo2. have created model forms them. in page have these forms on page. problem : user has option click on "add" button. once clicks on able add 1 more foo2 i.e. 1 more foo2 form open or displayed. how should ? i.e. how add modelform dynamically ? edit: this can done using jquery. question how differentiate in view ? should use prefix ? i.e. should add dynamic prefix forms being created ? as rohan says in comments, if have more 1 of same kind of form on page, should using formsets. each form within formset has own prefix includes id can increment javascript.

html - Javascript changing iframe src doesn't work -

on website wrote function this: function apri(dat) { document.getelementid('dado').src= dat; } and iframe html code following. <iframe id="dado"src="http://mk7vrlist.altervista.org/" width="100%" height="700px" scrolling="yes" frameborder="0"> browser doesn't load iframe. </iframe> i call apri() function in way: <p onclick="apri(http://mk7vrlist.altervista.org/other/staffpage.html)"> <img src="/pictures/uno.png" /> staffers</p> the content of iframe not changing. i've googled lot didn't find solution. can do? do think should use different instead of iframe? check error console after click text. see error message. syntaxerror: missing ) after argument list the bug quoting problem. have string no quotes around it. <p onclick="apri('http://mk7vrlist.altervista.org/other/staffpage.html')"> ...

popupwindow - My Popup window is not closing when the button is pressed twice in android -

hi trying put custom popup in layout popup showing properly. if button in pressed once , click dismiss or outside area closing when button pressed twice popup not closing. can suggest on below code. popupview = getlayoutinflater().inflate(r.layout.word_meaning, null, false); popupwindow = new popupwindow( popupview, 100, 100, true); dismiss = (button)popupview.findviewbyid(r.id.dismiss); popupwindow.setoutsidetouchable(true); popupwindow.setfocusable(true); // removes default black background popupwindow.setbackgrounddrawable(new bitmapdrawable()); dismiss.setonclicklistener(new button.onclicklistener(){ @override public void onclick(view v) { system.out.println("dismiss"); // todo...

jsf 2 - Custom PhaseListener called twice in jsf 2 -

i working phaselistener in jsf 2.0. it's methods getting called twice every time. @override public void beforephase(phaseevent arg0) { system.out.println("start phase "+arg0.getphaseid()+" here value "+ ++i +" object "+this); } and output this start phase restore_view 1 here value 1 object com.phaselistener.myphaselistener@cc8c29 start phase restore_view 1 here value 1 object com.phaselistener.myphaselistener@106054a each time being called 2 different objects. please let me know, why so?? in case helps googling problem. in case, moved glassfish 3 tomcat 7 , noticed custom phase listener being registered twice causing duplicated log entries. in web.xml had configurelistener required glassfish 3 triggers second registration on tomcat 7: <listener> <listener-class>com.sun.faces.config.configurelistener</listener-class> </listener> i removed block , resolved issue.

Why cbind for ts objects behaves different from cbind for matrices and data.frames in R? -

does why result of following code different? a <- cbind(1:10,1:10) b <- colnames(a) <- c("a","b") colnames(b) <- c("c","d") colnames(cbind(a,b)) > [1] "a" "b" "c" "d" colnames(cbind(ts(a),ts(b))) > [1] "ts(a).a" "ts(a).b" "ts(b).c" "ts(b).d" is or compatibility reasons? cbind xts , zoo not have feature. i accepted given, code littered following: ca<-colnames(a) cb<-colnames(b) out <- cbind(a,b) colnames(out) <- c(ca,cb) this cbind.ts method does. can see relevant code via stats:::cbind.ts , stats:::.cbind.ts , , stats:::.makenamests . i can't explain why made different, since didn't write it, here's work-around. cbts <- function(...) { dots <- list(...) ists <- sapply(dots,is.ts) if(!all(ists)) stop("argument ", which(!ists), " not ts object") do.call(cbind,unlist...

PHP Logical operators -

i have weird syntax issue. can tell me why isn't working: if ( ! is_single() || ! is_archive() ) but is: if ( ! is_single() || is_archive() ) and how first statement work? in advance! edit: still editing question when answer came. anyway, should have mentioned meant syntax. aware logic of 2 statements not same. ! has put outside. guys. ! (negate) operator has higher precedence in php. why need enclose second expression in brackets: if ( ! (is_single() || is_archive()) ) to work you're expecting.

Selenium C# - Catching Javascript errors -

i'm testing selenium web driver using c#. want check web pages no javascript errors present. i have installed jserrorcollector.xpi firefox , added following lines code (taken here ). list<object> errors = (list<object>)((ijavascriptexecutor)_driver).executescript("return window.jserrorcollector_errors.pump()"); assert.isnull(errors); but brings following error: window.jserrorcollector_errors undefined (unexpectedjavascripterror) any ideas how fix or provide better alternative? there no jserrorcollector_errors object in window , @ least when try access pump method. make sure when call pump function of jserrorcollector_errors object, object exists.

c++ - Why the following code is error (about overload resolution) -

this question has answer here: how `is_base_of` work? 5 answers given following code in gcc-4.8.1 struct base { }; struct derive : private base { }; void fn(base, int); struct conv { operator base() const; operator derive(); }; int main() { conv c; fn(c, 0); return 0; } when gave above code, got error.i think compiler select conv::operator base() compiler selected conv::operator derive() but when gave following code, compiler selected conv::operator base() struct base { }; struct derive// : private base { }; void fn(base, int); struct conv { operator base() const; operator derive(); }; int main() { conv c; fn(c, 0); return 0; } the key access specifiers not checked until conversion sequence selected, code feels like: struct base {}; struct derived : base {}; struct conv { operator base() const;...

c# - How to loop through checkbox value in gridview -

hi have problem regarding checkbox of gridview, upon checking checkboxes checked rows should reassigned reassign button clicked. reasigning first items checked, seems not looping through gridview. can please me identify whats wrong or missing in code: protected void reassign_click(object sender, eventargs e) { foreach (gridviewrow row in particularworkgridview.rows) { checkbox _checkbox = (checkbox)row.findcontrol("reassigncheckbox"); label _recordnumberlabel = (label)row.findcontrol("numberlabel"); if (_checkbox != null && _checkbox.checked == true) { sqlconnection con = new sqlconnection(getconnectionstring()); sqlcommand cmd = new sqlcommand("[reassig]", con); cmd.commandtype = commandtype.storedprocedure; string memberid = dropdrownlist.selectedvalue; cmd.parameters.addwi...

android - Application not running properly on Samsung Galaxy Ace -

i have made application not running on samsung galaxy ace.my problem when trying call particular activity dialog box on activity not work.although able call remaining activities same activity. can not understand problem behind it. please me. thanks. my calling activity code is: public void onclick(view v) { if(iscollageframeselected) { editimageactivity.this.progress = progressdialog.show(editimageactivity.this, "", "loading collage frames...", true); editimageactivity.this.framedialog.dismiss(); new thread(new runnable() { public void run() { intent localintent = new intent(editimageactivity.this, photocollageactivity.class); localintent.putextra(constants.layout_id , layoutid); localintent.putextra(constants.image_count, imgcount); localintent.putextra(constants.mybitmap, selectedbitmap); ...