Posts

Showing posts from September, 2011

extjs4 - Strange failures in ExtJS MVC -

extjs4 - Strange failures in ExtJS MVC - using extjs v4.1 mvc, have application class includes next code: ext.application({ name: 'shop', appfolder: 'shop', ... and main viewport has next code , items: requires: ['shop.view.categorykey'], requires: ['shop.view.productlister'], ... layout: { type: 'border', padding: 3 }, items: [{ region: 'west', title: 'test1', xtype: 'categorykey' },{ region: 'center', title: 'test2', border: false }] note viewport not using productlister object (yet. please bear me). for completeness, below code productlister. note basic stuff intended set view application. ext.define('shop.view.productlister', { extend: 'ext.view.view', alias: 'widget.productimages', title: 'list test...

ios - UIImage too many files while cloning UIImage Object -

ios - UIImage too many files while cloning UIImage Object - i creating single uiimage based on image file using next code: uiimage *myimage = [[uiimage alloc] initwithcontentsoffile:myimagepath]; i'm looping , adding myimage many objects containing uiimage property. results in me getting next error: error = 24 (too many open files) my question is, how clone uiimage without cloning file reference it. seems happening. put line outside loop. uiimage *myimage = [[uiimage alloc] initwithcontentsoffile:myimagepath]; ios uiimage clone

javascript - RegEx to replace all the double quotes to single quotes in side parenthesis -

javascript - RegEx to replace all the double quotes to single quotes in side parenthesis - i'm looking single liner regular look should convert double quotes single quotes nowadays in side parenthesis. ex: <span onclick="javascript:myfunction("param(s)1", "param(s)2")" i want above 1 converted to <span onclick="javascript:myfunction('param(s)1', 'param(s)2')" i'm novice in regular expressions. please help! a function is: function replacequotes(inputstring) { var output = ''; var inbrackets = 0; (i = 0; < inputstring.length; i++) { var currentchar = inputstring.charat(i); switch (currentchar) { case '\"': if (inbrackets > 0) output += '\''; else output += '\"'; break; case '(': ...

Node.js Provider Rest API and angular.js WEB APP -

Node.js Provider Rest API and angular.js WEB APP - i'm developing rest api in node.js / express expose resources (to backend). , web application manages sessions , interacts rest api (to frontend). api , web_app, in same domain, subdomain in both: backend: api.example.com 2 frontend: www.example.com the web application accessed client angular.js. architecture 2 situations: main_rest_api <-> web_app <-> browser_user main_rest_api <-> rest_sdk <-> client my question is: architecture consistent? best way implement scheme? update: i have implement architecture provide restfull via oauth2 third-party clients also i don't understand question, are sure need separate servers serving web app , api? you'll need handle cross domain requests way. if don't need 2 servers, it'll simpler have 1 app, /api/ routes (for example) rest api. angularjs app can create ajax requests /api/ , / serve javascript web ap...

mysql - Storing footnotes related to fields -

mysql - Storing footnotes related to fields - take next (straightforward) transaction table stock trades: trade date | shares | cost | commission | total amt 2/11/2013 | 100 | $10 | $10 | $1000 etc. let's wanted store footnote-like comment(s) on of these fields. there best-practices kind of storage? i thinking of 2 options: 1) add together fields in transactions table -- 1 per primary value -- store comment ids in plain text, perhaps separated bar (|), , parse through them @ runtime. solution doesn't allow joins, preserve transaction list in more normal fashion. 2) alter table transactions more name-value storage, have footnotes placed related table, usual lookup table between them. solution allows joins, slow produce results, , isn't human-readable. incidentally, name-value table more this: item | value | footnoteid date|2/11/2013|22 shares|100|0 price|$10|24 etc. thanks tips. mysql normalization

Intellij IDEA not recognizing Android library resources -

Intellij IDEA not recognizing Android library resources - i have added google play services library project android project in intelli-j appears resources still not beingness recognized ide. getting next error when app attempts inflate map: error/androidruntime(16002): fatal exception: main java.lang.noclassdeffounderror: com.google.android.gms.r$styleable @ com.google.android.gms.maps.googlemapoptions.createfromattributes(unknown source) @ com.google.android.gms.maps.supportmapfragment.oninflate(unknown source) here code fragment in layout xml. <fragment xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="200dp" class="com.google.android.gms.maps.supportmapfragment" map:camerazoom="13" map:maptype="normal" map:uicompass="false" ...

c# - Entity Framework 4.0 mapping issues -

c# - Entity Framework 4.0 mapping issues - i'm getting next error when trying run solution using entity framework 4.0 , wondering how alter mapping settings right it: problem in mapping fragments starting @ line 588: must specify mapping key properties (userdatas.id) of entityset userdatas to give background - created tables shown below modified/created date/by , id columns in each of them, decided pull them out abstract userdata , utilize inheritance instead. since changed it's gone pot! does have pointers i'm going wrong? i've been using design view show below (the gui) , feels i've nail brick wall. my db.edmx design view looks this, , clicking on error takes me variables table shown below, error repeated other tables inherit id (please ignore links other tables - didn't want post whole big db schematic): many thanks. sounds mis-using oo inheritance here. because objects share items same property names doesn't mean inhe...

java - android - unset default dialer -

java - android - unset default dialer - there many similar questions, in none of them i've found reply problem. i have dialer application, appears in dialer chooser dialog. , there 2 standard choices "use always" , "use once". problem when user other application clicks "use always" because after dialer chooser dialog won't appear anymore, , user won't able utilize application. i know there way unset in settings-> application manager-> {whatever dialer set default} -> clear defaults, users don't know this, , i'm not sure if works on every android version. , of them reported couldn't dialer chooser back. don't know app set default, have problem find it. so, question -> there way unset default dialer code? or maybe start 1 time again chooser user can redo choice? any help appreciated. java android settings default appsettings

javascript - HTML5 multiple drop targets defined in loop -

javascript - HTML5 multiple drop targets defined in loop - this seems similar problem found here, i'm afraid i'm not understanding solution provided. multiple drop events in html5 i'm attempting setup multiple drop targets 1 drag source, using ext js library. when define closure notifyenter, appears if utilize variable "i", alert (i've changed alert debugging purposes). coming java background, gut solve defining final variable within loop , assigning either or playerlocationpanel i'd before defining closure, doesn't appear valid solution. this first foray javascript in 8-10 years, help appreciated. /**** * setup drop targets ***/ var playerpaneldroptargets = new array(); var droptargetels = new array(); for(var i=0;i<=5; i++){ droptargetels[i] = playerlocationpanels[i].body.dom; playerpaneldroptargets[i] = ext.create('ext.dd.droptarget', droptargetels[i], { ddgroup: 'gridexample', notifyenter:...

vb.net - If Else using Column in Table -

vb.net - If Else using Column in Table - i have table named studentlogs.. , has column status on it.. when finished inserting records on pupil logs .. want utilize if else statement.. status column can have 3 values either 1,2 , 3.. now.. wanted after insert records.. doing.. if status="1" phone call sendsms() endif` if status="2" msgbox("")endif if status="3" msgbox("") how can when dealing columns? thanks..:) try using case statement when there more 1 potential value prevent having utilize lot of elseif statements. value of row in specifical column, utilize parenthesis right after row object , specify columnname or columnindex property value. class="lang-vb prettyprint-override"> 'declare local variables dim dr datarow 'create table dim studentlogs new datatable("studentlogs") 'add columns studentlogs .columns.add("sta...

java - Get a component from JList by click location -

java - Get a component from JList by click location - how can fetch component jlist , click location? i have own list cell renderer insert panels , labels. want e.g. label user clicked at. i tried method list.getcomponentat(evt.getpoint()); returns entire jlist . i've not tested this, basics be... use jlist#locationtoindex(point) index of element @ given point. get "element" @ specified index (using jlist#getmodel#getelementat(int) ). get listcellrenderer using jlist#getcellrenderer . render element , it's component representation set renderer's bounds required cell bounds convert original point component s context use getcomponentat on renderer... possibly, like... int index = list.locationtoindex(p); object value = list.getmodel().getelementat(int); component comp = listcellrenderer.getlistcellrenderercomponent(list, value, index, true, true); comp.setbounds(list.getcellbounds(index, index)); point contextpoint = swingutilities.conv...

html5 - How to set fixed dimensions for images on desktop only in twitter bootstrap? -

html5 - How to set fixed dimensions for images on desktop only in twitter bootstrap? - i have web page made using twitter bootstrap . works fine, set manual height , width images when site viewed on desktop (for eg height:30px ; width:60px:) . not want these dimensions apply tablet or mobile phone. how accomplish this? you can add together classes .visible-desktop , hidden-desktop than set optimized image version of desired width , height within div for illustration check fiddle html5 css3 twitter-bootstrap

php - Better way of building dynamic PDO statement -

php - Better way of building dynamic PDO statement - i'm trying build dynamic pdo sql statement. thought on how better? i maintain getting array(3) { [0]=> string(5) "00000" [1]=> null [2]=> null } free when run this... so mysql pdo statement doesn't seem working well! any thought on how prepare this? $park = $_post["park"]; $lecturestyle_id = $_post["lecturestyle"]; $group_size = $_post["groupsize"]; $roomstructure_id = $_post["roomstructure"]; $array = explode(",", $_post["facilities"]); // alter mon here echo '<td class="gridside"> mon '; // build facilities search for($i = 0; $i < count($array); $i++){ if ($array[$i]!=0) { $fac .= 'and facilities_id='.$array[$i].' '; } else $fac .= ''; } echo '</td>'; ($i = 1; $i <= 9; $i++) { // alter mon here echo '<td ...

python - Counting factors in a list? -

python - Counting factors in a list? - okay made list called numberslist, variable number = 20, count = 0, , spot = 0. numberslist = range(1, 11) number = 20 count = 0 spot = 0. i want count numbers in list go 20. tried this: while spot <= len(numberslist): if(number % int(numberslist[spot]) == 0): count = count + 1 spot = spot + 1 print count but keeps saying list index out of range. please help! your index goes far @ lastly iteration of while loop. alter <= < , should work: while spot < len(numberslist): or utilize for loop: for in numberslist: if number % == 0: count += 1 python list count

php - AJAX is temperamental or slow when deleting from database -

php - AJAX is temperamental or slow when deleting from database - i'm having problem when utilize ajax edit sql database through php. works in effect, have click "remove" button, refresh page see hasn't worked , exact same thing 1 time again works, or wait few seconds before reloading page. seems odd. this html , js <html> <script type="text/javascript"> $("#placetable").on('click', 'button.remove', function(e){ var targ = e.target; var id = $(targ).attr('data-id'); bootbox.confirm("are sure want remove?", function(result) { if (result == true) { $.post('/removelocation', {lid : id}, function(){ $(targ).closest('tr').remove(); }) } }) }) </script> <table id="placetable" class="table table-hover table-condensed"> <tr> <th>date<...

sql server 2008 - Calculate number of grouped rows in SQL -

sql server 2008 - Calculate number of grouped rows in SQL - i have 2 tables, requests , responses requests: requestid userid insertdate 1 1 5/4/2013 2 2 6/4/2012 . . . . . . responses: responseid requestid(fk) responsecode 1 1 2 1 v 3 1 m 4 2 5 2 s 6 2 d . . . . . . request considered "passed" if response codes , d received (like request id 2 in example). want write sql queries homecoming 3 things: number of "passed" requests requestids of requests pass requestids of requests didn't pass i wrote don't , suppose there improve way. query is: select count(*) ( select count(*) c, req.requestid responses res inner bring together requ...

jquery - vertical grid/table layout javascript -

jquery - vertical grid/table layout javascript - i need display json info vertically instead of horizontally: column1: value1 column2: value2 and on. these values coming database , i'll need ability scroll through records beingness returned database. this mvc3 application using c#, , i'm open whatever possible solutions out there. update: while below wasn't needed, set me on right path using pivot table hadn't thought previously. if want utilize linq, convert this: var pivottable = m in db.table select new { column1 = (from t1 in m t1.field == "column1" select t1.value, column2 = (from t2 in m t2.field == "column2" select t2.value }; json(pivottable, jsonrequestbehavior.allowget) first look: ----...

iphone - Push ViewController with modal animation (horizontal flip) -

iphone - Push ViewController with modal animation (horizontal flip) - i need force view controller view controller. menuvc -> vc1 ->vc2 going menuvc vc1 requires no animation, going vc1 vc2 , vc2 vc1 requires flip animaton occur. however, when going vc2 menuvc, no animation needed. i using next code: (from how force viewcontroller flip animation) [uiview beginanimations:nil context:nil]; [uiview setanimationduration:1]; [uiview setanimationcurve:uiviewanimationcurveeasein]; [uiview setanimationtransition:uiviewanimationtransitionflipfromleft forview:self.view cache:yes]; flashcardvc *flashcardvc = [[flashcardvc alloc] init]; [self.navigationcontroller pushviewcontroller:flashcardvc animated:no]; [uiview commitanimations]; the screen goes blank when seek , above. what wrong? you should using block based animations now. also, if you're instantiating storyboard controller controller that's in same storyboard, can more access storyboard sel...

asp.net - browse for sql 2008 instalation media -

asp.net - browse for sql 2008 instalation media - i have windows 7 64 bit.i installed vs 2010 on machine iso file.i have not mount content cd.i used 1 software convert iso image cd/dvd media.vs 2010 installed properly.with vs,sql came.but when trying install sql 2008,from configuration tool-> sql server installation center ,it asking file.when trying browse iso file,that file not visible in browse dialog box.what can do? the installer needs able see setup.exe file , related folders in order able work, can't read iso file directly. either extract contents of iso file filesystem or mount iso disc image , point installer there. asp.net sql sql-server-2008

android - Java Build Path and the cleaning up of unwanted debris -

android - Java Build Path and the cleaning up of unwanted debris - in course of study of endevours added 2 versions of androidplot project. realised causing conflict tried removing both start 1 time again , getting 02-11 22:50:10.769: e/androidruntime(20299): java.lang.runtimeexception: unable start activity componentinfo{com.cpdsessions.exercise_app/com.cpdsessions.exercise_app.activitylevelview}: android.view.inflateexception: binary xml file line #21: error inflating class com.androidplot.xy.xyplot 02-11 22:50:10.769: e/androidruntime(20299): @ android.app.activitythread.performlaunchactivity(activitythread.java:1872) 02-11 22:50:10.769: e/androidruntime(20299): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1893) 02-11 22:50:10.769: e/androidruntime(20299): @ android.app.activitythread.access$1500(activitythread.java:135) 02-11 22:50:10.769: e/androidruntime(20299): @ android.app.activitythread$h.handlemessage(activitythread.jav...

bit manipulation - PIC Bit Masking and Shifting for 4 Bit LCD Control -

bit manipulation - PIC Bit Masking and Shifting for 4 Bit LCD Control - i have question regarding both masking , bit shifting. i have next code: void writelcd(unsigned char word, unsigned commandtype, unsigned usdelay) { // important bits // need bit masking upper nibble, , shift left 8. lcd_d = (lcd & 0x0fff) | (word << 8); enablelcd(commandtype, usdelay); // send info // to the lowest degree important bits // need bit masking lower nibble, , shift left 12. lcd_d = (lcd & 0x0fff) | (word << 12); enablelcd(commandtype, usdelay); // send info } the "word" 8 bits, , beingness set through 4 bit lcd interface. meaning have break important bits , to the lowest degree important bits apart before send data. lcd_d 16 bit number, in important bits pass want "do" something. want previous 12 bits preserved in case doing else. is logic in terms of bit masking , shifting "word" right...

javascript - HighCharts: How to combine custom colors with gradient -

javascript - HighCharts: How to combine custom colors with gradient - for while im playing coloring of pie chart... , either got custom colors without gradient, or default colors gradient... colors stored in php field, want load colors: <?echo $mycolors;?> . actual state of code (it shows default colors gradient): colors: highcharts.map(highcharts.getoptions().colors, function(color) { homecoming { radialgradient: { cx: 0.5, cy: 0.3, r: 0.7 }, stops: [ [0, color], [1, highcharts.color(color).brighten(-0.3).get('rgb')] // darken ] }; }) how should edit show own colors in simple way? didn´t find "stops" alternative for... use colors in map instead of highcharts built-in ones: colors: highcharts.map(<?echo $mycolors;?>, function(color) { homecoming { radialgradient: { cx: 0.5, cy: 0.3, r: 0.7 }, stops: [ [0, color], [1,...

Multiple Screen Size support for android? -

Multiple Screen Size support for android? - i creating simple layout in android customized buttons(not ones android provides default).the image appears proper on screen size 2.7 5.1. buttons appear stretched on screen size 5.4 , greater (tried till screen size 7).i have made 4 same images named them of different densities , placed them correspondingly in folders ldpi,mdpi,hdpi,xhpi .i need know whether need create different layouts different screens?or android picks images automatically corresponding folders?some body please guide me new android on struggling create layouts targeting android mobile devices. no need of defining different layout folders( layout-land , layout-large , layout-small ) if u designed layouts consistently. android os take care of that(regarding images display). thing have add together <support-screens> in manifest , below <support-screens> : <supports-screens android:resizeable=["true"| "false"] ...

Android have alertdialog not block app options menu -

Android have alertdialog not block app options menu - i've searched around while on haven't found anything. have "about" alternative in app's main options menu gives user back upwards info (# call, version info, etc). have alertdialog prompts user take external action before app proceeds (they have this). it's possible user may want back upwards info while alertdialog present. there way create alertdialog not block app's alternative menu? or maybe show options menu on top of alertdialog somehow? edit - not on top of dialog itself, in same spot be, on top of overlay. i ran similar problem dialog , sound. problem when dialog appears, caused original activity pause, had unintended consequences. in case found easier implement own dialog interface using relativelayout , framelayout within original activity. android android-layout

Changing urls in ruby on rails depending on different conditions -

Changing urls in ruby on rails depending on different conditions - i'm new ruby on rails....i wanted know if there way alter url displayed depending on client's response. mean... here's example: i'm making project showing listings in various places... now in general have home page, search page, , detail page listings. so, respective urls officespace/home , officespace/search?conditions , officespace/detailpage?id=(controller-officespace)[&conditions eg.---price,size,place,type...] so, every time client makes request search, same url shown, of course of study given conditions. now want if client asks place , mentions nil size, price, etc., url should /listing/location_name . if mentions other conditions, it'll listing/(office_type)/size(x sq feet)_office_for_rent_in_locationname) b.t.w. (i have controller named listings , purpose else.) and on ........... actually, want alter urls number of things. anyway, please help me. , please don't...

ruby on rails - If current page posts_edit_path then show a text -

ruby on rails - If current page posts_edit_path then show a text - i need show text if user in posts_edit_path, how can this? thank you! my posts form want show text (lai izdzēstu bildes, ieklikšķiniet tās united nations publicējiet rakstu.) users in posts_edit_path <%= nested_form_for(@post) |f| %> <% if @post.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited post beingness saved:</h2> <ul> <% @post.errors.full_messages.each |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div id="field"> <%= f.label :nosaukums %>:<br /><br /> <%= f.text_field :title %><br /><br /> </div> <div id="field"> <%= f.label :raksts %>:<br /><br /> <%= f...

How to solve a "Variable 'args' is accessed from within inner class" Java error? -

How to solve a "Variable 'args' is accessed from within inner class" Java error? - the java class quoted below uses 3 numerical values. want phone call class command line passing different values each time through args variable. when that, "variable 'args' accessed within inner class" java error. what's efficient way - if - accomplish goal? class userbaserecommenderevaluation { private userbaserecommenderevaluation() {} public static void main(string[] args) throws exception { datamodel model = new filedatamodel(new file("/home/eualin/downloads/ml-100k/final.data")); recommenderbuilder builder = new recommenderbuilder() { @override public recommender buildrecommender(datamodel model) throws tasteexception { usersimilarity similarity = new loglikelihoodsimilarity(model); userneighborhood neighborhood = new nearestnuserneighborhood(2, similarity, ...

esb - JBI-Free Normalized Message Router -

esb - JBI-Free Normalized Message Router - the normalized message router ( nmr ) part of jbi environment responsible mediating messages between jbi components; servicemix 4 has moved jbi osgi . however, read somewhere still can utilize nmr without jbi based servicemix ( jbi-free nmr ). mean? illustration can follow? you can utilize activemq , jms "jbi-free nmr". in fact activemq jms queues jbi nmr uses under covers. in servicemix 4.x can utilize camel , jms queues nmr if want. , messages not need normalized anymore, eg can of type, opposed jbi message must xml. esb servicemix jbi

intellisense - What is the shortcut for the little auto suggest blue bar in Visual Studio 2012 -

intellisense - What is the shortcut for the little auto suggest blue bar in Visual Studio 2012 - in visual studio, when type in class name or property intellisense doesnt recognise little bluish bar show underneath first letter of word options suggestion namespace import , refactor etc. does know shortcut open window having mouse on it? can't life of me find on google, because can't find out function called. i utilize ctrl + . (period) shortcut open menu when bluish bar showing. visual-studio-2012 intellisense

class - Accessing classes from another source in C++, issues initializing the constructor -

class - Accessing classes from another source in C++, issues initializing the constructor - i have class called player has constructor takes 5 float parameters declared in "player.h" file , initialized in "player.cpp" file shown @ bottom of post. whenever seek run program, error: build/debug/mingw-windows/player.o: in function `player': c:\users\user\dropbox\netbeans workspace\testing/player.cpp:11: multiple definition of `player::player(float, float, float, float, float)' build/debug/mingw-windows/main.o:c:\users\user\dropbox\netbeans workspace\testing/player.h:20: first defined here what doing wrong here? tried getting rid of "public:" before constructor, didn't help @ all. says have multiple definitions of constructor, initialize once. sure obvious. the finish source of 2 files: "player.cpp" #include "player.h" player::player(float x, float y, float z, float rx, float ry) { } "player.h...

playframework 2.0 - How can I set the javac compile version for Play Framework 2.0 to prevent "Unsupported major.minor version"? -

playframework 2.0 - How can I set the javac compile version for Play Framework 2.0 to prevent "Unsupported major.minor version"? - a module using must have been compiled java 1.7, , have 1.6. if want module compiled specific version 1.6, how can set in play! framework 2.0 can prevent "unsupported major.minor version" errors. in play! 1.x set "java.version=1.6" in application.conf. i assume in play! 2.x needs set somewhere sbt - where/how? adding javacoptions ++= seq("-source", "1.6", "-target", "1.6") to build.sbt file worked me (to transparent, in case 1.7 build jdk 8). playframework-2.0 sbt

ios - TableViewController Calls Parser message but doesn't work -

ios - TableViewController Calls Parser message but doesn't work - i'm writing xml feed reader , viewcontroller isn't messaging parser properly. i have print statement in parsefeedwithresults message isn't printing , items remains null after call. i made dummy message in parser class made print when called , doesn't print either. what's issue? - (void)viewdidload { nslog(@"at viewdidload"); [super viewdidload]; self.title = @"feeds"; [self loaditems]; [parser testmessage: kfeedurl]; } - (void)loaditems { nslog(@"at loaditems"); self.items= [parser parsefeedwithresults:[nsurl urlwithstring:kfeedurl]]; nslog(@"passed parser initialization, parse: %@", self.items); } ios objective-c rss-reader

c# - UPDATE a Table when another has been modified -

c# - UPDATE a Table when another has been modified - i have 2 tables in access database. (sql examples fine). the first table table called reports. the fields :- id reportname reporttype the sec table template, user store host of reports. user modifies template table each week. below fields :- id userid reportname reporttype scheduleddate completed assignedby i have in code working, overlooked vital. i need reflect changes user may create study table, i.e, edit reports name, template table, instance of edited report, shows new name. i'm struggling work out how can this? any help appreciated, doesn't have exact code, more method. only works .adp project, should able using trigger. something create <trigger_name> on study .... c# database ado.net oledb

python - Defining __str__ and __repr__ for a set container -

python - Defining __str__ and __repr__ for a set container - i have been working on big assignment , i'm finished except need help writing __str__ , __repr__ functions of set container. i have never done , have no clue do. searching internet, i'm still stuck. i've tried like: '%s(%r)' % (self.__class__, self) i need print out representation this: 'set([element_1, element_2,..., element_n])' my elements stored in array class wrote set container around. access loop for item in self or if item in self please help? i suspect next work: def __repr__(self): homecoming 'set([%s])' % ', '.join(self) python string repr

How to apply coupon in the magento product view before adding product to cart -

How to apply coupon in the magento product view before adding product to cart - i had replicate coupon functionality in user can able apply coupon code , see discount cost in product page before adding product cart. so used ajax phone call load coupon code , rule conditions next way <?php ----- $ocoupon = mage::getmodel('salesrule/coupon')->load($couponcode, 'code'); if($ocoupon){ $orule = mage::getmodel('salesrule/rule')->load($ocoupon->getruleid()); $rule_arr = unserialize($orule->getconditionsserialized()); $actions_serialized = unserialize($orule->getdata("actions_serialized")); $conditions = $rule_arr['conditions']; foreach($conditions $condition){ $conditions1 = $condition['conditions']; $type = $condition['type']; foreach($conditions1 $condition1){ ...

worklight - Deploying the adapter shows null in console -

worklight - Deploying the adapter shows null in console - i not touch worklight past 3 months. lots of changes made in version. in 1 of project created http adapter working fine before. seek run project shows error. cant help in ibm forum because changed business relationship read only. [2013-02-15 10:20:37] starting adapter deployment on worklight server [2013-02-15 10:20:37] deploying adapter: university [2013-02-15 10:20:37] server host: localhost [2013-02-15 10:20:37] server port: 8085 [2013-02-15 10:20:37] null [2013-02-15 10:20:37] adapter deployment failed [2013-02-15 10:20:37] error it running in version platformversion="5.0.2". whether need alter version make sure review changes made in authentication mechanism starting worklight 5.0.0.3; create appropriate changes in project , re-deploy. ibm tech note: ibm worklight project auto-upgrade 5.0.0.3 authentication model note did not supply other info project , environment setup. adapter w...

Error in mysql connectivity with netbeans while creating database? -

Error in mysql connectivity with netbeans while creating database? - i using xampp.i want connect mysql netbeans.i tested connection while creating new connection database in services tab.i connection successful message.but while trying create database error access denied user"@'localhost' database 'student' for mysql revoke privileges revoke privileges on *.* 'student'@'localhost'; then grant appropriate privileges desired: grant select,insert,update,delete on `db`.* 'student'@'localhost'; in case may want grant privileges on *.* 'student@localhost'; finally, flush: flush privileges; mysql database netbeans

R - count matches between characters of one string and another, no replacement -

R - count matches between characters of one string and another, no replacement - i have keyword (e.g. 'green') , text ("i not them sam am!"). i'd see how many of characters in keyword ('g', 'r', 'e', 'e', 'n') occur in text (in order). in illustration reply 3 - text doesn't have g or r has 2 es , n. my problem arises if character in text matched character in keyword, can't used match different character in keyword. for example, if keyword 'greeen', number of "matching characters" still 3 (one n , 2 es) because there 2 es in text, not 3 (to match 3rd e in keyword). how can write in r? ticking @ border of memory - sense it's mutual problem worded differently (sort of sampling no replacement, "matches no replacement"?). e.g. keyword <- strsplit('greeen', '')[[1]] text <- strsplit('idonotlikethemsamiam', '')[[1]] # how many ch...

how to merge some elements array in php? -

how to merge some elements array in php? - example: array ( [0] => 35 [1] => - [2] => 59 [3] => * [4] => 2 [5] => / [6] => 27 [7] => * [8] => 2 ) then calculated: 59*2=118 and new array is: array ( [0] => 35 [1] => - [2] => 118 [3] => / [4] => 27 [5] => * [6] => 2 ) this original source : input ($_post['numbers']) string, like: 65*6/6+5-5 class calculator { //property private $str=''; private $len=0; private $ar_str=array(); private $ar_design=array(); private $ar_sum=array(); private $ar_min=array(); private $ar_mult=array(); private $ar_divi=array(); //method public function __construct($str1=''){ $this->str=$str1; $this->len=strlen($this->str); $this->ar_str=str_split($this->str); if($this->ar_str[0] == '+' || $this->ar_s...

c# - Visual Studio adding executable file with same name as dll -

c# - Visual Studio adding executable file with same name as dll - in visual studio 2008, added winscp.dll (in project root) reference , there yellowish icon. @ compile-time: the type or namespace name 'winscp' not found (are missing using directive or assembly reference?) resolved file has bad image, no metadata, or otherwise inaccessible. not load file or assembly 'e:...\winscp.exe' or 1 of dependencies. module expected contain assembly manifest. after hour's frustration, figured out if removed winscp.exe project file (also in project root), compiled fine. weird!!!! the problem need both winscp.dll , winscp.exe in output directory. do? edit: understand there workarounds, such renaming files or changing paths. renamed exe @ first; rename dll (thanks @michael) because not require me specify renamed exe in code. but why there problem in first place? winscp.dll , winscp.exe 2 different files. bug in visual studio, or intricacy of dll/exe don't unde...

android - Issue while loading images in SurfaceView -

android - Issue while loading images in SurfaceView - i need load different images of auto saved in drawable simulate 360 grade rotation, when ever user drag through view have set drag distance 1 time user cross load next frame. using surface view , draw images on canvas. since images big not able load images @ time memory, loading images on fly keeping current image in memory. approach sluggish. can 1 point out doing wrong ? or other improve way accomplish same. help. this code /** * @author rajeshcp * class deed top view in view * hierarchy cardetailsactivity * @since 13 feb 2013 */ public class virtualview extends surfaceview implements surfaceholder.callback, ontouchlistener, tweenlistener { private final int frame_width = 1024; private final int frame_height = 462; private interactionlistener minteractionlistener; private final int msnapvelocity = 1000; private velocitytracker mvelocitytracker; protected int mtouchslop; private int mmaxvelocity;...

A Batch Script that copies a file do a network computer then logs if it was successful -

A Batch Script that copies a file do a network computer then logs if it was successful - i have list of computer names feeding script form text file , each workstation want re-create text file desktop, want log weather or not re-create successful or not different text file, have 2 workstation names in read file 1 contactable , 1 not , getting 1 homecoming in log file , workstation name not populating. set copied=successful set workstation=xl /f %%x in (workstations2.txt) re-create /y physicians.txt "\\%%x\c$\documents , settings\all users\desktop\physicians.txt" set workstation=%%x if errorlevel 1 set copied="not successful" echo %date% %time% file re-create %copied% %workstation% >> logfile.txt @echo completed. pause here output log file tue 02/19/2013 14:02:42.74 file re-create successful %x i'm not sure why setting workstation that, works me note parenthesis around mass of loop set copied=successful /f %%x in (workstat...

python - S3 Object Expiration using boto -

python - S3 Object Expiration using boto - i trying figure out way clean s3 bucket. want delete keys older x days ( in case x 30 days). i couldn't figure out way delete objects in s3. i used next approaches, none of worked (by worked, mean tried getting object after x days, , s3 still serving object. expecting "object not found" or "object expired" message approach 1: k = key(bucket) k.key = my_key_name expires = datetime.utcnow() + timedelta(seconds=(10)) expires = expires.strftime("%a, %d %b %y %h:%m:%s gmt") k.set_contents_from_filename(filename,headers={'expires':expires}) approach 2: k = key(bucket) k.key = "event_" + str(key_name) + "_report" expires = datetime.utcnow() + timedelta(seconds=(10)) expires = expires.strftime("%a, %d %b %y %h:%m:%s gmt") k.set_meta_data('expires', expires) k.set_contents_from_filename(filename) if can sh...

animation - Android switching views -

animation - Android switching views - ok, have worked fading out content within id (thanks http://stackoverflow.com/a/4570977/971392). i have next function: public void switchview(view view) { layoutinflater inflater = layoutinflater.from(getbasecontext()); view to_load = inflater.inflate(r.layout.activity_register, null, false); relativelayout rl = (relativelayout) findviewbyid(r.id.content_login); animation fadeoutanim = animationutils.loadanimation(loginactivity.this, r.anim.fadeout); rl.startanimation(fadeoutanim); //rl.setvisibility(view.gone); //rl.removeview(view); rl.addview(to_load); } it desired action, if comment the rl.startanimation(fadeoutanim) there purpose of giving animation on alter view. with animation executing, function changes view through rl.addview() applies fadeout , disappears. so, how may utilize fadeout, without removing content? you need delay rl.addview(to_load...

javascript - beforeSend: function() and window.location Ajax -

javascript - beforeSend: function() and window.location Ajax - i'm getting links radio buttons ... have: $('.submitorder').click(function() { $.ajax({ type: 'get', beforesend: function() { var radio1 = $("input:radio[name=radio1]:checked").attr("data-carturl"); console.log(radio1); window.location = radio1; var radio2 = $("input:radio[name=radio2]:checked").attr("data-carturl"); console.log(radio2); window.location = radio2; }, complete: function(data){ console.log('done'); window.location = www.url.com + '/cart'; } }); homecoming false; }); is there way submit 2 links before redirect cart ? i'm not sure what's best way this. javascript jquery ajax

matlab - How can I sum specific values of a column corresponding to unique values of another column, without using the "accumarray" command? -

matlab - How can I sum specific values of a column corresponding to unique values of another column, without using the "accumarray" command? - i have matrix in matlab: a=[1 1; 1 2; 1 3; 2 1; 2 5; 2 7; 3 2; 3 1; 3 4]; if a1=[1 1 1 2 2 2 3 3 3]; first column and a2=[1 2 3 1 5 7 2 1 4]; sec column of matrix, want repeated values "unique(a1)" of a1 sum corresponding values of a2, this: a3=[1+2+3 1+5+7 2+1+4]=[6 13 7] but without using "accumarray" command help please? my consolidator tool you, offering tolerance. [a1cons,a2cons] = consolidator(a1',a2',@sum) a1cons = 1 2 3 a2cons = 6 13 7 matlab

ruby on rails 3 - Devise ldap authenticatable returns 401 error -

ruby on rails 3 - Devise ldap authenticatable returns 401 error - i making application in rails in user needs log-in first see content. used devise , ldap_devise_authenticatable create user log-in through existing ldap account. however, when tried log in business relationship application log-in failure occurs(401 error unauthorized) though have business relationship on ldap. i next this tutorial and next screenshot of ldap server page: i know problem in ldap configuration file. how can configure application send right string ldap server in above screenshot code of ldap.yml follows: authorizations: &authorizations group_base: ou=groups,dc=test,dc=com required_groups: - cn=admins,ou=groups,dc=test,dc=com - cn=users,ou=groups,dc=test,dc=com - ["moremembers", "cn=users,ou=groups,dc=test,dc=com"] require_attribute: objectclass: inetorgperson authorizationrole: postsadmin ## environment development: host: 172.16...

c++ - Accessing and changing parent values from subclass instances -

c++ - Accessing and changing parent values from subclass instances - i beginner , tryed find reply on website not able figure out how solve specific c++ oop problem. short: want access , alter values of parent class subclass instances, somehow approach seems not working. example: there many car instances in programme (created new construct). if 1 of car objects detects collision, car instances should inverse movement. car registered collision should phone call parents' changespeed method or alter speed value directly. problem: speed variable seems not updated. there wrong particular code/ approach or have search problem somewhere else? // speedcontrol.h ------------------------------ class speedcontrol { public: void changespeed(int); protected: int speed; }; class car: public speedcontrol { public: void movecar(); void detectcollision(); private: int position; }; // speedcontrol.cpp ------------------------------ #include sp...

GitHub API: Fetch all folders and Files in Single GET Request -

GitHub API: Fetch all folders and Files in Single GET Request - in github api, can issue request of https://api.github.com/repos/owner/repo/git/trees/master?recursive=1 to recursively fetch of trees of repository. in add-on giving me of directories, gives me urls can utilize download individual files: [...] { "mode": "100644", "type": "blob", "sha": "abc1234", "path": "path/to/file.txt", "size": 104361, "url": "https://api.github.com/repos/owner/repo/git/blobs/abc1234" }, [...] while recursive=1 piece prevents me having create new request every directory in repository, still have create individual phone call every file. i've looked through github api docs, don't nowadays way this. it's there isn't way fetch files , folders in single request, wanted inquire here verify have no other option. the way single requ...

.htaccess rewrite rules stops reading url after first part of string -

.htaccess rewrite rules stops reading url after first part of string - thank reading. i trying rewrite dynamic category links (/product_list.php?cat_id=xxx) more "friendly" text links. problem i'm running subcategories: rewriterule complete-ac-systems product_list.php?cat_id=2 works great, when sub category present: rewriterule complete-ac-systems__packaged-systems product_list.php?cat_id=7 the browser stops reading after complete-ac-systems , re-directs product_list.php?cat_id=2 not cat_id=7 most of our categories 3 , 4 levels in, pervasive issue. thanks help can offer. how reversing order of rules? i.e., putting longest matches first. .htaccess mod-rewrite

image - JavaScript - How do I stop a script from running onClick()? -

image - JavaScript - How do I stop a script from running onClick()? - i'm trying figure out how stop script running , rotating images onclick(). any help? please? thanks, in advance! document.queryselector('#imagegallery').addeventlistener('click', function () { cleartimeout(thetimer); }); this stop images. if want able toggle stopping , animating, can maintain track of stop/resume state using dataset (at least, suggest way) , phone call numb when resuming state start timeout 1 time again. this not 100% cross-browser compatible. you'll have utilize attachevent ie, , shouldn't utilize thetimer global variable, declare var . javascript image onclick gallery

java - Tomcat 7: avoid automatic restart when change context.xml -

java - Tomcat 7: avoid automatic restart when change context.xml - when edit global conf/context.xml of tomcat 7.0.34 server seems restart automatically. want avoid automatic restart, server should run "old" configuration until restart hand. so question is: how avoid automatic restart when alter global conf/context.xml in tomcat 7.0.34? according automatic application deployment, application redeployed when changes detected updating context file trigger undeploy of application removal of associated work directory. current user sessions not persisted. application redeployed next time auto deployer checks changes. to stop functionality autodeploy flag must set false : this flag value indicates if tomcat should check periodically new or updated web applications while tomcat running. if true, tomcat periodically checks appbase , $catalina_base/conf/[engine_name]/[host_name] directories , deploys new web applications or context xml descriptors found....

php - MySQL - Perform JOIN from serialized array? -

php - MySQL - Perform JOIN from serialized array? - i creating simple cart script php , mysql, , having problem figuring out fastest , efficient way perform query. i have table called carts , table called products . carts table has column called contents contains serialized array of item numbers. these items numbers correspond pid column of products . what looking have query pull array of info , match contents of array corresponding rows in products can echo out of matching info product. create table `carts` ( `cart_id` int(10) not null auto_increment, `session_id` varchar(50) null default null, `contents` longtext null, `first_name` varchar(50) null default null, `last_name` varchar(50) null default null, `address` varchar(100) null default null, `city` varchar(100) null default null, `state` varchar(100) null default null, `postal` varchar(20) null default null, `country` varchar(20) null default null, primary key (`ca...

node.js - Express NodeJS web.config in Azure for SVG & Fonts -

node.js - Express NodeJS web.config in Azure for SVG & Fonts - i had problem in express nodejs website create utilize svg , other files fonts. when ran app locally didn't have problem. when had set on azure, files svg , fonts did not appear anymore. i created web.config file @ root of project : <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <staticcontent> <mimemap fileextension=".svg" mimetype="image/svg+xml" /> <mimemap fileextension=".woff" mimetype="application/x-woff" /> <mimemap fileextension=".ttf" mimetype="application/x-woff" /> </staticcontent> </system.webserver> </configuration> also did told here (svgs , other mime types in windows azure) both solutions permit me access svg files, problem not able see webpages ! (http 500) it seems ove...