Posts

Showing posts from July, 2011

How to have "Add to cart" button in cs-cart php controller -

i trying make "required" addon cs-cart gives pop showing products required selected product in checkout summary page. i have been able make pop work using "checkout.post.php" in add-on, , create popup using: $msg = registry::get('view')->fetch('addons/my_new_addon/custom_product_notification.tpl'); fn_set_notification('i', __('custom_product_notification_title'), $msg, 'p'); however, have not yet been able put "add cart" button products going suggest in popup. can point me right direction? is product_data.tpl template called template? try add show_add_to_cart=true parameter when template included.

c# - Save an Image/Bitmap from hidden panels -

Image
i have tabcontrol 4 tabs, , every tab contains panel. want save panels 1 click, can save panel in front. do know way ? bitmap eins = new bitmap(p1.width, p1.height); eins.save(".string."+1+".jpg",system.drawing.imaging.imageformat.jpeg); i don't see filling bitmap . this should work panels , no matter tabpage on: foreach (panel px in new panel[] { p1, p2, p3, p4 } ) using (bitmap bmp = new bitmap(px.clientsize.width, px.clientsize.height)) { px.drawtobitmap(bmp, px.clientrectangle); bmp.save(somefolder + px.name + ".jpg", system.drawing.imaging.imageformat.jpeg); } in fact work if panels actually invisible , not in 1 of hidden tabpages ! of course must make sure panels have unique , filename compliant names .. update : know have controls inside panel , not graphics draw , maybe backgroundimage , can understand problems had.. unfortunately tabpages have nasty way of hiding embedded con

swift - How to save segmented control choice -

i have added segmented control in project set notification frequency (like daily, weekly, ecc..). don't understand how save user choice , how set notification on choice. have addcontroller user can insert reminders , in controller want set frequency notification repeat. code is: @ibaction func salva(sender: uibutton) { if fieldnomemedicina.text.isempty && fielddata.text.isempty && fielddosaggio.text.isempty{ //alertview che avverte l'utente che tutti campi sono obbligatori //return } var therapy = pillsmodel(nomemedicinain: fieldnomemedicina.text, dosaggioin : fielddosaggio.text, datain: fielddata.text ) profilo.therapyarra.append(therapy) datamanager.sharedinstance.salvaarray() datamanager.sharedinstance.detail.pillstable.reloaddata() dismissviewcontrolleranimated(true, completion: nil) let stringdate = fielddata.text//get time string //format date

measurement protocol - Google Analytices.js send method -

according analytics.js send method documantation ,i have question: after send ga('send',...) method , have execute or post request , or there implementation calling ? by default, analytics.js automatically choose transport method (based on factors hit size, etc.). can specify method explicitly setting transport field. for example: ga('send', 'pageview', {transport: 'beacon'});

Python 3 and cgi. Error image download from webbrowser -

my question python 3 , web cgi. have problem when download 1 image webbrowser, image downloaded, error format. code ... src = "../public/downloads/test.png" name = "test.png" data = open(src, 'rb').read() print("content-type: image/png;") print("content-disposition: attachment; filename="+name+";") print("content-transfer-encoding: binary;") print("content-length: " + str(os.stat(src).st_size)+";\r\n") print(data) the problem solved: src = "../public/downloads/test.png" name = "test.png" data = open(src, 'rb').read() print("content-type: image/png;") print("content-disposition: attachment; filename="+name+";") print("content-transfer-encoding: binary;") print("content-length: " + str(os.stat(src).st_size)+";\r\n") sys.stdout.flush() sys

javascript - JS "Greater than" operator; -

this expression: '33.33' > '100.00' return true . why? if work like: +'33.33' > +'100.00' it must return false because 33.33 < 100; if like: '33.33'.length > '100.00'.length then false , because 5 < 6; i'm interested know, how work in first case; ok. feel ashamed. while wrote & formated post, find answer. for string compare js use lexicographical order ; so, in case have just: '3' > '1' and it's true . maybe interesting someone.

javascript - Nesting a Nested Function to Run in Sequence -

i have 3 functions want run in sequence (and repeat, i'm not on yet.) when first function displays content , leaves, second function play afterwards , same thing. repeats third function. i'm using callbacks try achieve this. this isn't problem when i'm using 2 functions, when introduce third, renders first 2 menu boards, , third 1 comes afterwards, when should render 1, 2 , 3. javascript reference $(document).ready(function(){ board1 = function(callback){ $('#menu-board .board.one .row').slidedown(800).delay(10000).slideup(800, function(){ callback(); }); } board2 = function(callback){ $('#menu-board .board.two .row').slidedown(800).delay(10000).slideup(800, function(){ callback(); }); } board3 = function(){ $('#menu-board .board.three .row').slidedown(800).delay(10000).slideup(800); } boa

jquery - Flat UI Radiocheck plugin / radio buttons do not toggle (anymore) with iOS 8.4.1 -

i using latest version of flat ui pro 1.3.2 ( http://designmodo.com/flat/ ) , there seems problem jquery plugin flatui-radiocheck v0.1.0 , ios devices. you can see problem when load demo page: http://designmodo.github.io/flat-ui/ go section " radio buttons " , click on 2 buttons " radio on " , " radio off " toggle radio button. toggling (toggling state "visually" state of radio element in dom) works fine in major desktop browsers (ie, ff, safari (windows)). however there problem safari on ios (i running latest ios version on iphone 4s, 8.4.1): clicking 2 radio buttons not toggle state anymore! it seems related (possibly new version of) mobile safari on ios since works fine on desktop browsers. any idea or on how debug error appreciated! i using flat ui free (2.2.2) , have discovered same issue. i not sure why occurring have been able fix tweaking radiocheck plugin. inside of flat-ui.js radiocheck plugin definition chan

entity framework - SQL Server 2012 Express 32 bits or SQL Server 2014 Express 64 bits -

i have machine visual studio (windows 8.1 64 bits). use entity framework sql server 2012 express 32 bits. i created server of test (windows 7 pro 64 bits) i ask me if can put new version of sql server 2014 express 64 bits? or better put same version computer? if use 2014 version, when put publish web site, arrive? there risk of not connecting? finally make image of disk (true image) install sql express 2014 , try ... goog no need change 1 thing. run directly .

reactjs - How do I use jest to test jsx components? -

according docs, jest can used test js files. can use test jsx? jsx files? can use test jsx files? if so, how? you can use babel-jest testing jsx file. read more at here to run test jsx file need add more .jsx when unmock or import implement code. example: for js file: jest.unmock('../jsx/checkboxwithlabel') for jsx file: jest.unmock('../jsx/checkboxwithlabel.jsx')

c# - code analysis warning to make a collection read only -

i getting warning below: ca2227 : microsoft.usage : change addionaluserlist read-only removing property setter my code won't allow me make read only. setting property ajax call. can 1 tel me how rid of warning? right click on warning in code analysis or error view , add exclusion. add annotation either in file next property or in global suppression file depending on option choose prevent warning showing up.

Time to Click (seconds) in Google Analytics -

i want display widget in google analytics after amount of seconds users clicking link. how many users , click on external links tracked google tag manager. i know possible, don't know how. saw in video ( https://gyazo.com/ea04edaf30af80611e5eabeff4f0b89a ) can't finde solution. maybe has idea how it? thank much! you can create in google tag manager javascript custom variable measure time , use value when sending clic on external link or event have. take this article javascript example

android - Replace the normal intent with pending -

there activity started by: intent = new intent(checkoutactivity.this, livestatusactivity.class); startactivity(intent); finish(); livestatusactivity newest activity, started checkoutactivity. lets livestatusactivity lies on top of activity stack. at same time, starting pending intent on notification received, intent in = new intent(this, livestatusactivity.class); in.setflags(intent.flag_activity_reorder_to_front); contentintent = pendingintent.getactivity(this, 0, in, pendingintent.flag_update_current); on pending intent activity, previous livestatusactivity started activity should updated/replaced. right now, livestatusactivity started(by pending intent) , same activity still there on of it. ie. livestatusactivity(top t by pending intent )-----> livestatusactivity(t-1 by checkoutactivity )---->..... tried various flags, checked lot of answer @ s.o, in vain. tried putting android:launchmode="singletask" , same result. make livestatusact

Logic error in Java code to add hours and minutes -

can me find error in logic? have following 2 java files (main , time): /* * change license header, choose license headers in project properties. * change template file, choose tools | templates * , open template in editor. */ import java.util.scanner; import java.io.*; /** * * @author dave */ public class main { /** * @param args command line arguments */ public static void main(string[] args) throws ioexception { //array of class names string[] classlist = new string[29]; //create file , scanner class list file file = new file("c:\\users\\dave\\documents\\netbeansprojects\\tutordata\\src\\classes.txt"); scanner scan = new scanner(file); int index = 0; while(scan.hasnext()){ string s = scan.nextline(); classlist[index] = s; index++; } //for(string s : classlist) system.out.println(s); //parallel of array of total times

voltrb - Getting access to a ModelController -

i trying interface youtube player api. works fine. however, api lets define callbacks fired whenever, instance, video has finished playing. call modelcontroller action @ time. how can access actions on modelcontroller within native js? opal.volt.??? ? [question copied gitter] on accessing model controller. want set callback inside of controller. in opal can use proc (not block) callback (since can used in place of js function) inside of proc, call whatever want on modelcontroller. can convert method into module main class maincontroller < volt::modelcontroller def index callback = proc {|*args| some_method(*args) } `youtube.somehandler(callback);` end end end

VisualStudio 2015 Universal app .NET parse json -

how in visualstudio 2015 (net framewortk 4.5.2) downbload , parse json? url json is: http://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400 it not necessary parse building. values sunrise , sunset thank you there 2 nuget packages make easy. httpclient (package name microsoft.net.http) request. json.net (package name newtonsoft.json) make easy deserialize json. allow this: using (httpclient hclient = new httpclient()) { httpresponsemessage response = await hclient.getasync(url); string strcontent = await response.content.readasstringasync(); return jsonconvert.deserializeobject<yourtypehere>(strcontent); }

performance - Web API - Load Testing -

i have webapi method post operation. wanted load testing same using visual studio 2013. per knowledge, did is, added load test , called unittest method written above post webapi method , added performance counters it. the option or have other efficient way same. thanks, srikanth

Android Studio v1.4 preview 2 not able to install app on Phone -

after upgrading android studio 1.4 preview 2 using canary channel , since behaving little differently. not able install app on phone. getting stuck @ following line: uploading file local path: /volumes/project/app/build/outputs/apk/app-debug.apk remote path: /data/local/tmp/com.sample.android installing com.sample.android device shell command: pm install -r "/data/local/tmp/com.sample.android" any suggestions wrong. have restarted as, machine stuck in same mode. ps : understand canary channel provides latest stuff , maybe broken assuming wont break basic app installing. did timeout error message? after line device shell command: pm install -r "/data/local/tmp/com.sample.android" for me problem got timeout error, , after replacing usb cable, solved problem,

javascript - Security risk when exposing Facebook access_token? -

i'm pulling list of facebook albums page using url so: https://graph.facebook.com/<page-id>/albums?access_token=<app-id>|<app-secret> even though page public, apparently have provide access_token pull content. so, question is, huge security vulnerability publicly displaying app id , secret key in browser? i'm using javascript, i'm afraid grab app id , secret key , use post spam account. possible? or forgetting security step has taken in order write using api? you should never expose tokens (that not user’s own access token) in client-side code. can read them there, , abuse them. app access token allows lot of app settings changed, , performing of other actions in name of app well. you need either make viewing user login app, can use personal access token; or need move code server side.

c# - More than 2 Models in a ModelView with a twist -

i have been looking @ c# mvc while , getting in it. have come across how pass 2 or more domain models in view need ask security. have read on posting , can stopped binding inclusions , exclusions how effect viewmodel 2 or more model inside it. there still possibility of hidden fields in html resolve domain models , editable. i have been looking make viewmodels give things want user edit seems on complicated, there better , easier way of doing this. public ticketviewmodel { private ticket _ticket; public ticketviewmodel(ticket ticket) { _ticket = ticket; } public string title { { return _ticket.title; } } public list<comment> comments { { return _ticket.comments; } } } as can see create new viewmodel ticket domain model main concern have returning list of domain model comments want them read only. any appreciated. consider readonlycollecti

ios - How to open Google Maps to show route using Swift -

i read around internet couldn't find legit answer. need open google maps when user clicks button show directions. start , destination must automatically filled. how can achieve in swift? if has solution, please provide me sample code. start going user's current location. ok found answer myself. if want show directions user's current location, leave field saddr blank , in field daddr can enter destination coordinates. this how did it if (uiapplication.sharedapplication().canopenurl(nsurl(string:"comgooglemaps://")!)) { uiapplication.sharedapplication().openurl(nsurl(string: "comgooglemaps://?saddr=&daddr=\(place.latitude),\(place.longitude)&directionsmode=driving")!) } else { nslog("can't use comgooglemaps://"); } } for further queries can refer link google map url scheme

python - How to interleave two matrices in numpy without copying values? -

in pygame i'd interleave 2 surfaces before displaying them on screen that: odd numbered lines contain pixels surface a, even numbered lines contain pixels surface b. in pygame docs more efficient pixelarray , surface represented numpy array. did copying data new array, result still slow. is there more efficient way (i suppose using numpy method) pixel data accessed in original matrices, without copying every pixel?

python - Getting sphinx to format def docstring -

i'm having trouble getting sphinx format docstrings in api. simple example this gist stripped down version of https://github.com/rocky/python2-trepan . the command use in gist is: sphinx-apidoc -o modules api.py the docstring inside api.py looks this: def debug(dbg_opts=none, start_opts=none, post_mortem=true, step_ignore=1, level=0): """ enter debugger. parameters ---------- level : how many stack frames go back. default 0. though there may calls in setup debugger may want skip. step_ignore : how many line events ignore after debug() call. 0 means don't wait debug() call finish. param dbg_opts : optional "options" dictionary gets fed trepan.debugger(); `start_opts' optional "options" dictionary gets fed trepan.debugger.core.start(). use this:: ... # possibly python code import trepan.api # needed once ... # possibly more python code

sql - Give an alias to field name on ::find('all') -

i have field on database called name when retrieve called label . in raw sql can this: select name label ... theres "quick way" on find without need deal entity , virtual fields etc... i did using virtual properties on entity : protected $_virtual = ['label']; protected function _getlabel() { return $this->_properties['name']; } a potential gotcha be... i'm using _serialize return result , not working because have expose virtual properties using $_virtual .

javascript - Disable and Refresh within same function jQuery UI -

this isn't of problem i'm wondering if theres way can turn this $(".selector").sortable("disable").sortable("refresh"); into this $(".selector").sortable("disable", "refresh"); using disable , refresh within same sortable function seems more efficient/simple. i have no idea if can sortable api, if can't can add functionality youself using prototype : $.prototype.sortabledisableandrefresh = function() { this.sortable("disable").sortable("refresh"); } $(".selector").sortabledisableandrefresh(); i'm not sure kind of efficiency after. if want run faster, won't help. if want make 1 function call make code pretty, might.

cakephp - How can one set selected options for a cake php FormHelper multiple select? -

the template form element be: $ingredientoptions = array('potato','peanut','parsley'); echo $this->form->input('favouriteingredients', array('multiple' => true, 'options' => $ingredientoptions); echo $this->form->input('allergicingredients', array('multiple' => true, 'options' => $ingredientoptions); this creates 2 (ugly) multiple select boxes, each list consisting of elements options array, none of selected. to set initial values, i've tried few things in controller without success: $this->set('favouriteingredients',array(1,2)); $this->request->data['favouriteingredients'] = array(1,2); these multiple selects 2 habtm relationships defined in customer model: class customer extends appmodel { public $hasandbelongstomany = array( 'favouriteingredients' => array( 'classname' => 'ingr

html - One big css file vs multiple small css files -

i have read different information question, , see people suggest using 1 big css file, performance point of view. don't understand, won't take more time load css file of pages load each 1 each page, when requested? (examples of have seen: multiple css files or 1 big css file? , single huge .css file vs. multiple smaller specific .css files? ). yes, maybe there multiple http requests, happen in different periods of time, isn't better load each page when needed, waste time on loading css every page in beginning , displaying them on fly? there pros , cons of both approaches. having multiple css files allow organize , group css files in development. however, means there multiple http requests make. http requests more expensive in terms of loading time has contact server , fetch file. also once file loaded, cached browser. means, even-though might slower load huge.css , doesn't need loaded again when navigate around site. in experience , adapted of de

c# - Get count of records in excel by groupings with count? -

i have excel following data: week---parts 32--------part1 32--------part1 33--------part2 33--------part2 33--------part3 34--------part1 34--------part4 34--------part5 from this, somethin glike in datagridview week---part1---part2---part3----part4---part5 32 -----2------0--------0-------0--------0 33 -----0------2--------1-------0--------0 34 -----1------0--------0-------1--------1 this program importing excel files data , not connected database. using vb.net code, how can make desired results? tried (from hari prasad) no output. new in vb.net dim filepath string = openfiledialog1.filename dim extension string = path.getextension(filepath) constr = string.empty select case extension case ".xls" 'excel 97-03 constr = string.format(excel03constring, filepath, "yes") exit select case ".xlsx" 'excel 07 constr = string.form

php - Apache - Browsing of any domain URL is pointing to same folder -

we have hosted multiple php websites in different domains in same server. each domain have own folder under /var/www/html . e.g. example1.com pointing /var/www/html/example1.com example2.com pointing /var/www/html/example2.com example3.com pointing /var/www/html/example3.com etc.. since saturday, when browse example1.com or example2.com or example3.com , showing same content in browser. means every time browse showing website content /var/www/html/example3.com folder. i'm not sure how change happened. may 1 of our ex-employees changed this. so checked httpd.conf file in /etc/httpd/conf . here documentroot set correctly domains. i'm new web administration, i'm not sure i've correct make websites point right folder. what problem? how rectify this? do need correct in http.conf file or .htaccess file in every domain folders? i'm struggling since yesterday. appreciated. thanks in advance.. finally i'm able resolve issue. have 4 website

ms access - Listing Records with Zero-Length Field in Sub-Form -

i'm having problem database created in ms access 2003. there table (let's call tblitems) 4 fields: id, description, category, sub_category. sub_category field 1 not required , allows zero-length data. i created form based on table (frmadditems) has 2 combo-boxes (cbocategory & cbosubcategory), text box (txtdescription) , sub-form (sbfexistingitems) supposed list existing items based on selected in 2 combo-boxes. works long sub-category selected, if there's no sub-category, sbfexistingitems empty. the record source sbfexistingitems is: "select tblitems.id, tblitems.description, tblitems.category, tblitems.sub_category tblitems order [description];" frmadditems , sbfexistingitems linked follows: child fields: category;sub_category master fields: cbocategory;cbosubcategory the problem presumably related how access handles zero-length data, don't know how make want do. appreciated. update as suggested jhtuppeny, have removed child/master

php - UPDATE with Cassandra CQL -

i'm new cassandra , i'm trying update table using cql query: update analytics set counter = ? hash = ?; i work in php using datastax php-driver, code statement this: $statement = $session->prepare("update analytics set counter = ? hash = ?;"); $session->execute($statement, new cassandra\executionoptions(array('arguments' => array($count, $hash)))); the table: create table if not exists analytics (domain varchar, page varchar, ip inet, attributes map <varchar, varchar>, hash varchar, counter int, date timestamp, primary key(hash, domain, date)); when execute statement error " missing mandatory primary key part domain " added clause allow filtering: update analytics set counter = ? hash = ? allow filtering; but error, " line 1:48 missing eof @ 'allow' ". what's wrong in these queries? based on error have, guess created table compound primary key (hash, domain). in order update record in

html - Issue getting box to float left or display inline -

i running issues getting boxes in code float: left; of each other or display: inline-block; have moved them around different divs have listed , cannot work. created fiddle show code looks right now: https://jsfiddle.net/p4c8yrcz/ the containers have moved , tried lot of different options in these.. .countdown_position { /*display: inline-block;*/ /*padding-left: 7%;*/ position: absolute; width: 15%; } .countdownbox { border: 2px solid #b8b8b8; /*float: left;*/ display: inline-block; margin: 1em; } what doing wrong? i've checked on code, you've got countdown_position width set 15%, causing issue, check out; inline-block update: for adding float:left to countdown_out div, remove margin-left:15% , , add float:left . link updated.

javascript - How to handle Content-Description:File Transfer in AngularJS $http response -

short version: $http request works fine on desktop, fails on mobile within angular controller, have $http call resource returns following response headers: access-control-allow-origin:* cache-control:must-revalidate, post-check=0, pre-check=0 connection:keep-alive content-description:file transfer content-disposition:attachment; filename=verses.json content-length:1392 content-transfer-encoding:binary content-type:application/octet-stream date:sun, 16 aug 2015 23:13:18 gmt expires:0 keep-alive:timeout=5, max=100 pragma:public server:apache/2.4.6 (centos) openssl/1.0.1e-fips php/5.4.16 x-powered-by:php/5.4.16 as can see in jsfiddle , response recognized json. however, if load same jsfiddle on mobile device nothing returns. i've looked $http's transformresponse, documentation pretty sparse , can't find example of trying i'm getting. there examples of turning json response downloadable file, i'm looking opposite. i know obvious solution ask api return a

java - Why does this multiplication integer overflow result in zero? -

after answering this question , confused why overflowing integer in code resulted in 0 instead of negative number. it's strange, why such exact number? why 0? public class integeroverflow { public static void main(string[] args) { int x = 10; int = 0; (i = 0; <= 5; i++) { x = x * x; system.out.println(x); } } } output: 100 10000 100000000 1874919424 0 0 this happen if starting value of x even. according jls §15.17.1 : if integer multiplication overflows, result the low-order bits of mathematical product represented in sufficiently large two's-complement format. result, if overflow occurs, sign of result may not same sign of mathematical product of 2 operand values. this made more obvious if print numbers in binary format instead of in decimal: public class integeroverflow { public static void main(string[] args) { int x = 10; int = 0; (i = 0; <= 5; i++) { x *= x; system.o

Digital SIgnal Processing in Android -

i searching digital audio signal processing library android. want built app process input audio signal , plays speaker in real time. there ready dsp library/game engine has such functionality ? depending on kind of processing want do, check out superpowered .

javascript - JSLint issue in the code -

i facing wierd 2 jslint issues below code function hasspecialchars(str){ return (/[~`@!#$%\^&*+=\-\[\]\\';,/{}()|\\":<>\?\s]/g).test(str);} unescape '/' wrap regex patterns /regexp/ disambiguate slash operator i trying find special characters in string given. you need use match function inorder find special characters. str.match(/[~`@!#$%\^&*+=\-\[\]';,\/{}()|"\\:<>\?\s]/g) and must escape forward slash. to test atleast 1 special char. /[~`@!#$%^&*+=\-\[\]';,\/{}()|"\\:<>?\s]/.test(str) or /\w/.test(str)

ruby on rails - How to restrict edit action to only current user -

how can make user edit action available if user current user? using devise. devise has this: before_action :authenticate_user!, only: [:new, :edit, :update, :destroy], notice: 'you must sign in first!' but make sure user logged in not if user equal current user? want make sure other users aren't able edit other users accounts. what best way this? should create new before_filter ? couldn't find standard way. you can use current_user method provided devise . here can read more - current_user method . def edit unless current_user redirect_to home_path, :alert => "restricted area" end end

Sas calculation program doesn't run -

i have following data set: date jobboardid sales jan05 3 256 jan05 6 70 jan05 54 90 feb05 32 456 feb05 11 89 feb05 16 876 march05 april05 . . . jan06 6 678 jan06 54 87 jan06 13 56 feb06 mcdonald 67 feb06 11 281 feb06 16 876 march06 april06 . . . jan07 6 567 jan07 54 76 jan07 34 87 feb07 10 678 feb07 11 765 feb07 16 67 march07 april06 i trying calculate 12 month growth rate sales column when jobboardid column has same value 12 months apart. have following code: data want; set have; date jobboardid; format till monyy7.; = lag12(date); oldsales = lag12(sales); if lag12 (jobboardid) eq jobboardid , intck('month', from, date) eq 12 do; till = date; rate = (sal

css - Flex menu not working in Firefox -

you can check main menu flex here: http://funnyfrontend.com/ this menu works fine in chrome , ie11. thaks you. you have put display:flex firefox. .secondary-navigation ul.creative-menu { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; width: 100%; }

java - Why am getting error from SONAR even after removing @override Annotation.? -

class extends b{ protected void executeimpl(){ super.executeimpl(); } } above class in being injected in third class class c{ a; public void execute(){ a.executeimpl() } } error: description assignee resource new issue useless overriding method : overriding method merely calls super the @override annotation can added on inherited method. not mean if remove annotation method not inherited anymore. still inherited ! , therefore rule still valid did not change semantic of program remove annoation.

Yii2:- update record using update query for mongodb -

i trying make update query using yii2 mongodb. make following query: $collection = yii::$app->mongodb->getcollection('usermaster'); $arrupdate = [ 'firstname' => $fname, 'lastname' => $lname, 'email' => $email, 'is_visible' => $isvisibleuser, 'phonenumber' => $phone, 'username' => $uname, ]; $collection->update(['_id = 55a4957sd88423d10ea7c07d'],$arrupdate); but shows follwoing error in firebug. "networkerror: 500 internal server error - http://localhost/yii2angularseedmaster/frontend/web/category/corporateupdate?corpuserid=55a4957sd88423d10ea7c07d" my insert query works update query not works. please tell me wrong in query. $collection->update(['_id' => $id],$arrupdate);

php - Inserting radio button input in the database -

i'm creating quiz-like structure. i'm trying answer of each question , insert database type of question answered. i'm having trouble putting these data in variables , i'm getting: notice: undefined index: question-0-answer in commented part of code. help.. $options = ''; $filter=mysql_query("select afnumber employees status='employed '"); while($row = mysql_fetch_array($filter)) { $options .="<option >" . $row['afnumber'] . "</option>"; } $menu="<form id='filter' name='filter' method='post' action=''> afnumber : <select name='selectaf' id='filter' style='color:grey;'>" . $options . "</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; evaluation test type : <select name='type' id='type' style='color:grey;'><

CUDA Kernel for copying array location from neighbour location -

i have cuda kernel copies i+1 th location ith location in device array. copying not done locations index values multiples of 32. [32]->[31] not copied, [64]->[63] not copied. happens irrespective of block size. how resolved? here full program. no calls syncthreads(). still problem exists. #include <cstdio> struct soda { float *df0; size_t pitch; }; __global__ void stream_kernel (soda da1, soda da2, int m, int n); int main(int argc, char **argv){ int i, m=32, n=32;float *f0; soda da1, da2; dim3 blocksize = dim3(32,32); dim3 gridsize = dim3(1,1); f0 = (float *)malloc(m*n*sizeof(float)); cudamallocpitch((void **)&da1.df0, &da1.pitch, sizeof(float)*m, n); cudamallocpitch((void **)&da2.df0, &da2.pitch, sizeof(float)*m, n); (i=0; i<m*n; i++) f0[i] = (float)rand()/rand_max; cudamemcpy2d((void *)da1.df0, da1.pitch, (void *)f0, sizeof(float)*m, sizeof(float)*m, n, cudamemcpyhosttodevice); printf("\n")

visual studio 2010 - pip install distarray --> mpi.h not found, cannot install mpi4py -

i have tried install distarray requires c++ compiler (which got ms) , mpi4py. installer cannot locate mpi.h , cannot install mpi4py itself. documentation says should set env-path, path, visual studio? c:\program files (x86)\microsoft visual studio 10.0\vc\bin\cl.exe /c /nologo /ox /md /w3 /gs- /dndebug -ic:\python34\include -ic:\python34\include /tc_confi gtest.c /fo_configtest.obj _configtest.c _configtest.c(2) : fatal error c1083: cannot open include file: 'mpi.h': no such file or directory failure. removing: _configtest.c _configtest.obj failure. error: cannot find 'mpi.h' header. check configuration!!! what doing wrong? have tried both in windows , linux environment without luck. admin , sudo. (should there tags mpi4py, mpi.h, mpi.cfg cannot create these new user)

Checking if iOS app was launched from local notification? -

how detect if app not in active, inactive, or background state (terminated) launched local notification? far, i've tried 2 methods in app delegate's didfinishlaunchingwithoptions: func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // method 1: if let options = launchoptions { if let key = options[uiapplicationlaunchoptionslocalnotificationkey] { notificationcenter.postnotification(nsnotification(name: "applicationlaunchedfromnotification", object: nil)) } } // method 2: let notification = launchoptions?[uiapplicationlaunchoptionslocalnotificationkey] as! uilocalnotification! if (notification != nil) { notificationcenter.postnotification(nsnotification(name: "applicationlaunchedfromnotification", object: nil)) } return true } in view controller, observe notification in viewdidload , in response, set uilabel&

Creating a LOV of Database entries in APEX -

i need make form in apex can link contact entries database address table. want possibility in form select contact linked , select contact linked to. don't know if that's possible make listofvalue database entries?! thanx help.. in sample database application, can find examples of lov usage: page 7: p7_cust_state , select list shared component lov used page 11: p11_customer_id , popup lov sql query used

javascript - How to draw a Sphere without using SphereGeometry? -

Image
i'm trying draw sphere without using spheregeometry. i'm trying draw sphere latitudes , longitudes. here code: for (var phi = -math.pi / 2; phi < math.pi / 2; phi += math.pi / 15) { var longvertices = new three.geometry() (var theta = 0; theta <= 2 * math.pi; theta += math.pi/2 ) { longitudes = this.point[this.numberofvertices] = new three.vector3(); longitudes.x = origin.x + this.radius * math.cos(theta) * math.cos(phi); longitudes.y = origin.z + math.sin(theta) * this.radius; longitudes.z = origin.y + this.radius * math.cos(theta) * math.sin(phi); this.numberofvertices++; longvertices.vertices.push(longitudes); } longvertices.vertices.push(longvertices.vertices[0]); longverticesarr.push(longvertices); }

css - lighten background color on hover for different background colors -

i have multiple elements, background colors different each other. like: <div class="element"> content of div</div> <div class="element2"> content of div</div> .element{ width:100px; height:50px; background-color:#888888; } .element2{ width:100px; height:50px; background-color:#222222; } i want make hover like: .element:hover, .element2:hover{} when bring mouse on element, background should little bit lighter. don't want use opacity: 0.4 (lightens whole div) or background-color:rgba(50,50,50,0.5); (only 1 color) jsfiddle the easiest way achieve apply background-image elements on :hover . either using css gradient (which generated using colorzilla's "ultimate css gradient generator" ): .element:hover, .element2:hover, .element3:hover { /* permalink - use edit , share gradient: http://colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0.5+0,0.5+100 */ background-imag

c# - Using System.Windows.Forms namespace in web application -

i want make screenshot of full webpage in web application. found way using webbrowser class, example on here (the accepted answer). however, webbrowser class located in system.windows.forms namespace, , therefore feel unsure about, whether it's okay use namespace in web application. if not right approach this?

java - Find a specific object at a specific coordinate in ArrayList -

im working on 2d tile-based game , i've come point need optimise code quit bit. im adding lot of different elements in javas list such trees, rocks , on. reason why elements not static tile because want player able interact elements. therefor elements has own object , stored in list. the problem whenever want interact specific element in built in list in java have create for-loop , go through every single element in list find right element @ right coordinates. (such collision , on.) the way this: list<element> elements = new arraylist<element>(); public element getelementonpixel(int x, int y){` for(int = 0; < elements.size(); i++){ int xx = elements.get(i).getx() * game.tile_size; int yy = elements.get(i).gety() * game.tile_size; int w = xx + elements.get(i).width; int h = yy + elements.get(i).height; if(x >= xx && x < w && y >= yy && y < h) {

blogs - How to fix blogger template for mobile devices -

i have blog http://ahsancy.com . it's fine in pc when visit mobile or tab shows blank pic above post pic. how remove it? try adding .img-thumbnail{display:none;} @ end of styles. or particular screen size add following styles. @media screen , (max-width: 479px) .img-thumbnail { display none; } @media screen , (max-width: 767px) , (min-width: 480px) .img-thumbnail { display:none; } you can use {width:0; height:0} properties in place of {display:none}

spring - How to solve BeanNotOfRequiredTypeException -

i writing small application check functionality of "afteradvice" concept in spring-aop getting exception related xml file (i think) please me how solve exception applicationcontext.xml <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"> <bean id="pincheck" class="com.nt.advice.atmpinverifieradvice" /> <bean id="targetbean" class="com.nt.service.atmpingenerator" /> <bean id="pfb" class="org.springframework.aop.framework.proxyfactorybean"> <property name="target" ref="targetbean" /> <property name="interceptornames"> <list> <va

jsonlint - JSON Lint throwing parsing error -

json lint throwing parsing error following string. saying string because, got data in string format , generate code. isn't valid json? please help [ ​{ "x": "57", "y": "30", "z": "20", "name": "xyz" }, { "x": "0", "y": "0", "z": "20", "name": "ss" } ] that valid json if didn't have invisible character (a zero-width space) prior first { . it's character, u+200b , parser choking on.