Posts

Showing posts from February, 2015

d3.js - How to get only those data which have particular code in crossfilter -

i have following dataset var data= [ {code:501, value:25}, {code:501, value:30}, {code:501, value:30}, {code:501, value:35}, {code:501, value:60}, {code:502, value:25}, {code:502, value:25} ] i want dataset contains data code 501. tried following code var ndx=crossfilter(data); var dim1=ndx.dimension(function(d){return d.code}); var filtereddata=dim1.filter(501); but not working. not returning me data want. tried print returned data using console printed vague things. function getdata(){ var range = $("#range").val()*1; if(isnan(range)){ alert("kindly enter valid number"); }else{ var data= [ {code:501, value:25}, {code:501, value:30}, {code:501, value:30}, {code:501, value:35}, {code:501, value:60}, {code:502, value:25}, {code:502, value:25} ]; var ndx=crossfilter(data); var dim1=ndx.dimension(function(d){return d.code}); var filtereddata=dim1.filter(range); alert("requested data is\n"+(json.st...

Using MySQL Join -

i'm trying join 2 mysql tables staffid 1 , username tied staffid in table have username displayed select ost_ticket.staff_id, count(*) numbers ost_ticket join ost_staff re on re.username = us.userid group ost_ticket.staff_id; from i've been reading joins should work? edit: i've ran , unknown column 'ost_ticket.staff_id' in field list select us.staff_id, re.username, count(*) numbers ost_ticket join ost_staff re on re.userid= us.staff_id group us.staff_id;

sql server - create sql query to fetch repeat column values within time frame -

can me query? want result of customer_id repeats more once in 24hrs select o.order_no, o.customer_id, o.dateordered, o.ipaddress, c.firstname, c.lastname, cd.nameoncard order_no o inner join carddata cd on o.card_id = cd.id inner join customers c on o.customer_id = c.customer_id order o.order_no desc adding more details.. suppose order customer id xx placed on 04/23 2:30 pm , again 2nd order placed same customer id xx on same day 04/23 5:30 pm. i want query return me customer id xx thanks select customer_id, cast(dateordered date) dateordered, count(*) qtde order_no group customer_id, cast(dateordered date) having count(*) > 1 to customers have orders issued after first one, use following query: select distinct a.customer_id order_no inner join (select customer_id, min(dateordered) dateordered order_no group customer_id ) b on a.customer_id = b.customer_id , a.dateordered - b.dateordered <= 1 , a.dateordered >...

How to create explosion effect using image frames sprite kit swift -

so created game have shoot @ objects. now, have imageset replicates object exploding. call images appear in sequence looks explosion after projectile hits object. images have called @ exact location of projectile hits object. have idea on how make happen? here code. func projectiledidcollidewithmonster(projectile:skspritenode, monster:skspritenode) { projectile.removefromparent() monster.removefromparent() playerscore = playerscore + 1 playerscoreupdate() if (playerscore > 100) { let reveal = sktransition.crossfadewithduration(0.3) let gameoverscene = gameoverscene(size: self.size, won: true) self.view?.presentscene(gameoverscene, transition: reveal) } } func didbegincontact(contact: skphysicscontact) { var firstbody: skphysicsbody var secondbody: skphysicsbody if contact.bodya.categorybitmask < contact.bodyb.categorybitmask { firstbody = contact.bodya secondbody = contact.bodyb } else { ...

python - Get word frequency in Elasticsearch with large document -

i have been trying word frequency in elasticsearch. using elasticsearch python , elasticsearch dsl python client. here code: client = elasticsearch(["my_ip_machine:port"]) s = search(using=client, index=settings.es_index) \ .filter("term",content=keyword)\ .filter("term",provider=json_input["media"])\ .filter("range",**{'publish': {"from": begin,"to": end}}) s.aggs.bucket("group_by_state","terms",field="content") result = s.execute() i run code , output this: (i modified output more concise) { "word1": 8, "word2": 8, "word3": 6, "word4": 4, } the code run without problem in elasticsearch 2000 document in laptop. but, got problem when run code in droplet in do. have >2.000.000 document in elasticsearch , use droplet 1 gb ram. every time run code, memory usage increase , elasti...

angularfire - Firebase: Delete a node -

Image
need delete entry trainname i tried below code didnt work me. var usersref = new firebase('https://hosurcabapp.firebaseio.com').child('user');delee var clientinfo = $firebase(usersref); $scope.clientinfo = clientinfo.$asobject(); $scope.deleteclient = function(key) { clientinfo.$remove(key); }; kindly since new firebase you can not set null value in firebase, since firebase treats null instruction delete node. quote docs : passing null set() remove data @ specified location. since application uses null signal specific condition, should substitute value signal condition: ref.child('trainname').set('<unnamed>'); update if want delete node, can do: usersref.child(key).remove(); see documentation firebase delete function .

c# - How to get the PAN and TILT of a DMX spotlight from the X and Y of a plan (Camera View) -

context i have dmx spotlights fixed round platform located @ 12 meters above floor. camera fixed centre (approximately) of platform. camera supposed film ground find , track targets. camera static , give me 2d plan x/y cartesian coordinates system. when found target, need put spotlight on it. illustration top view of scene top view image http://img15.hostingpics.net/pics/635699691.png side view of scene side view image http://img15.hostingpics.net/pics/275272232.png problem to light target spotlight, need find pan , tilt angles corresponding of x/y position of target. these spotlights have no specific orientation, can find x/y projection point of on ground camera. some data i found formulas on web : float radius = sqrt( x*x + y*y + z*z ); float inclination = atan2( y, x ) * 180.0 / pi; float azimuth = acos( z/radius ) * 180.0 / pi; or rotx = math.atan2( y, z ) roty = math.atan2( x * math.cos(rotx), z ) rotz = math.atan2( math.cos(rotx), math.sin(rotx) * math....

dbcc - $db.CheckTables('None') in Powershell doesn't continue on after encountering corrupt database -

probably noob question here goes. i'm making backup test script powershell , i'm displaying results of dbcc in console , when $db.checktables('none') loops through database collection , encounters corrupt database doesn't continue on checking rest of databases. code foreach($db in $dbs) { if ($db.name.endswith("_test")) { write - host "checking database:" $db.name - backgroundcolor "yellow" - foregroundcolor "black" $dbname = $db.name# database check $db.checktables('none') either supress way: $db.checktables('none') -erroraction silentlycontinue or wrap in try/catch: try { $db.checktables('none') } catch {}

xcode - Extract Map Annotations from Plist swift -

firstly, have found loads covering issue on stackoverflow objectivec , not swift. can provide link, or share code explain how extract annotations information plist? my plist is... <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>name</key> <string>london eye</string> <key>location</key> <string>{51.503324,-0.119543}</string> </dict> <dict> <key>name</key> <string>big ben</string> <key>location</key> <string>{51.500729,-0.124625}</string> </dict> </array> </plist> using map kit, xcode , swift. so far view controller contains code obtain users position , allow ...

intellij idea - How do I stop Android Studio from highlighting specific words when double clicking? -

Image
whenever double click on whatever contains more 1 word in it, android studio highlight word thinks i'm clicking on rather entire value. take view.findviewbyid instance. double clicking on findviewbyid either highlight find , view , by , or id , want select findviewbyid . i've gone through android studio's preferences, didn't see looked toggle or option this. more examples: private string foobar; this either highlight foo or bar depending on click. myview.addview(...); this either highlight my / view or add / view , not myview or addview . use image below. have highlighted important bit

c - How do I subtract the address of a pointer from another pointer? -

i have hw assignment write malloc in c. part of whole algorithm of freeing pointer, need subtract address of heap using bit manipulation. have following 2 declarations later defined in program. void* heap; metadata_t* ptr; //always < 8kb heap my goal take address of heap , subtract ptr because bit manipulation i'm doing works if left bit zero. i've tried far has resulted in errors. know how i'm trying? the short answer subtraction "just works", , returns integer-type result. #include <stdio.h> int main(int argc, const char * argv[]) { char string[] = "this test string"; char *a = string+8; char *b = string+10; long x = b-a; printf("hello, world! , b %ld bytes apart\n", x); return 0; } longer answer - if you're going a lot of arithmetic, cast pointers appropriately-large integer type, arithmetic, cast them pointer. inherently unportable, you're writing malloc, portability not ...

python - Save File Function -

so intro programming class have create game save/load function , i'm trying test out code make sure works. for reason cannot following function work properly. i've tried going through line line in idle , works fine there once try use same system in function not work. please? def save(name,inventory,mapgrid,x,y,enemy):` choice = 0 file = shelve.open("save_files") save = {'save1':file['save1'],'save2':file['save2'],'save3':file['save3']} print("where save?") print("save 1 -", save['save1']['name']) print("save 2 -", save['save2']['name']) print("save 3 -", save['save3']['name']) choice = input("enter number:\t") if choice == 1: save['save1']['name'] = name save['save1']['inventory'] = inventory save['save1'][...

How to find out which rows are missing in excel -

Image
i work company business phone companies , has thousands of lines. sample of document. 4 thousand rows. i need formula tells me columns empty/blank in each row. what want in call l2, columns h, i, j, , k missing/blank. without vba if impossible, accept vba code. this columns h,i,j,k in l1 enter: =if(h1="","h","") & if(i1="","i","") & if(j1="","j","") & if(k1="","k","") and copy down: edit#1: to put space between letters, use formula instead: =if(h1="","h ","") & if(i1="","i ","") & if(j1="","j ","") & if(k1="","k","")

distributed computing - Spark CollectAsMap -

i know how collectasmap works in spark. more know aggregation of data of partitions take place? aggregation either takes place in master or in workers. in first case each worker send data on master , when master collects data each 1 worker, master aggregate results. in second case workers responsible aggregate results(after exchange data among them) , after results sent master. it critical me find way master able collect data each partition separately, without workers exchange data. you can see how doing collectasmap here. since rdd type tuple looks use normal rdd collect , translate tuples map of key,value pairs. mention in comment multi-map isn't supported, need 1-to-1 key/value mapping across data. collectasmap function what collect execute spark job , results each partition workers , aggregates them reduce/concat phase on driver. collect function so given that, it should case driver collects data each partition separately without workers exchanging data p...

java - Want to do something to view in item that got clicked in list view -

i have 2 buttons in each item set invisible. want, when user clicks on item, buttons in item turn visible. im using custom adapter list view... public class locationadapter extends baseadapter{ string [] n; context context; string[] a; int bint = view.invisible; private static layoutinflater inflater=null; public locationadapter(mainactivity mainactivity, string[] names, string[] addresses, int bint) { // todo auto-generated constructor stub this.bint = bint; n=names; context=mainactivity; a=addresses; inflater = ( layoutinflater )context.getsystemservice(context.layout_inflater_service); } @override public int getcount() { // todo auto-generated method stub return n.length; } @override public object getitem(int position) { // todo auto-generated method stub return position; } @override public long getitemid(int position) { // ...

ubuntu 14.04 - Chromium Source Code build seem to be stopped at LINK Chrome -

i downloaded chromium source code using tools ( as instructed here ) and started compiling using ninja -c out/debug chrome before ran ./build/gyp_chromium it took 6 - 7 hours , compiled , seems stuck @ link chrome. does show kind of error or should wait more? i using ubuntu.

plugins - Impresspages Data Grid Trouble -

i data grid implemented in impresspages admin environment. form has date fields. problem following. entered date storage in mysql (and logically returned too) 000-00-00. caught public function createdata($postdata) 1 field in grid , content correct, fields value right. let's see: array(12) { ["securitytoken"]=> string(32) "b9d273d7f6f17a43eacb61a008543d21" ["antispam"]=> array(2) { [0]=> string(0) "" [1]=> string(32) "692a03a931157644de8a0986ebfa54ea" } ["active"]=> string(1) "1" ["starsign"]=> string(2) "22" ["startperiod"]=> string(10) "2015-04-25" ["endperiod"]=> string(10) "2015-04-25" ["prevlove"]=> string(25) "dsdsds" ["prevhealth"]=> string(25) "asasas" ["prevbiz"]=> string(27) "lklklklk" ["prevlucky...

Using function integer arguments with my C++ program -

i have little project do, i've created program when user types number, if it's or odd. used function. here's question: how use integer arguments in function program? (my program does work , doesn't use integer arguments.) instructions write c++ function accepts integer argument, determines whether passed integer or odd, , displays result of determination. (hint: use % operator.) make sure function called main(). test function passing various data it. my code #include <iostream> using namespace std; void oddeven() //my function { int num; cout << "please enter number " << endl; cin >> num; if (num % 2) { cout << "it's odd" << endl; } else { cout << "it's even" << endl; } } int main() //main program { oddeven(); //calling function return 0; } sample program: #include <iostream...

php - Getting number of rows form SQL Server table -

i have problem getting right value after counted rows table. searched on web didn't find answer. in database have table categories in have id, , count using column. i have php code, works there other , better on this? $sql2 = "select count(id) categories"; $stmt2 = sqlsrv_query($conn, $sql2); $res = sqlsrv_fetch_array($stmt2, sqlsrv_fetch_assoc); foreach($res $row) { $rows = $row; } //if there categories display them otherwise don't if ($rows > 0) { $sql = "select * categories"; $stmt = sqlsrv_query($conn, $sql); while ($row = sqlsrv_fetch_array($stmt, sqlsrv_fetch_assoc)) { echo "<a href='#' class='cat_links'>" . $row['category_name'] . " - <font size='-1'>" . $row['category_description'] . "</font></a>"; } } else { echo "<p style=...

mkmapview - iOS mkmap - animating annotation on map jumps while zoom in/out -

an annotation moving on map, , trying zoom or scroll map annotation jump original position has stared animation. i adding animation layer of annotation after adding mkmapview. thanks in advance. first question on stack overflow. i got answer can not achieved adding animcation annotation. have found out interpolate function through can locations between "from" , "to" lat/lng , set annotation(setting annotation location in milliseconds) animation.

dart-eclipse plugin crashing after installing dart plugin -

i using new installation of eclipse luna sr2. install dart-eclipes update site https://storage.googleapis.com/dart-archive/channels/dev/release/latest/editor-eclipse-update/ . version 1.10.0-dev.1.9 (rev 45311) installed. however, after restarting eclipse after installation prompt restart, luna logo visible short while , crashes (is no longer visible). there no console output or anything. old eclipse metadata have been removed installation folder. thanks help the dart plugin checks 'dart-sdk' directory in eclipse installation directory. if have dart , eclipse unzipped in home ~/bin , should trick: $ cd ~/bin/eclipse $ ln -s ../dart/dart-sdk/ now should able start ./eclipse . update: have submitted issue dart bug tracker: https://code.google.com/p/dart/issues/detail?id=23335

Android Studio doesn't start, fails saying components not installed -

Image
i have installed latest version of android studio google. after launching it, tries download packages. after while shows following error. the following sdk components not installed: extra-android-m2repository, tools, addon-google_apis-google-21, android-21, sys-img-x86-addon-google_apis-google-21, source-21, extra-google-m2repository i couldn't rectify error, though pressed retry multiple times. anyone can suggest solution! i had been facing similar problem in windows 7 , got below problems while running android-studio shortcut start programs menu first time. solution : run administrator the problem due write permission in windows c: drive , access denied message displayed. running program administrator downloads necessary components , can start android studio ide. update: these permission issues doesn't seem exist in android studio latest versions(checked in 1.3.2 in windows 10) , works without "run administrator" commands....

mysql - SQL: how to select something using information from another table -

i have 2 sql tables. in first table, each line has (amongst other fields irrelevant question) score , category_id field the second table ( categories ) table listing possible categories element in first table can belong. i'd following sql request : select category_name, ( ??? ) category_score categories order category_score desc where ??? = the sum of scores of elements in table 1 belong category . you join , group by : select category_name, sum(score) category_score categories c join element e on c.category_id = e.category_id group category_name order 2 desc

parsing - Spot vars and functions with regex in mathematical formulas -

i trying array of functions , , array of variables in mathematical formula in vanilla js : a sample : 1+3*9/cos(4+2*x/6+pol)+ bdlire(longueur2)+2*8+sin(2) +g() for getting functions use : /([a-za-z]+)(?=[(])/gm https://regex101.com/r/ft3im7/1 for getting vars tried : /([a-za-z]+[a-za-z0-9]?)(?!\()/gm https://regex101.com/r/mg2fq2/1 but can see ignores last char of match followed ( char i'm bit stuck regex match variables. thanks :) you cannot use regex parse arithmetic expressions, maybe can, have flaky implementation , writing make go bonkers. you need parsers. check out peg.js, easy use framework writing parsers compiles js, "vanilla" (whatever mean that...): http://pegjs.org/

css - Logo placement overlapping // Joomla Bootstrap -

on joomla 3.x bootstrap site want have logo placed overlapping navbar , slideshow that: screenshot the navbar "fixed-top" , slideshow placed outside other container in order being displayed in full width. make matters more complicated, logo should fix on top while scrolling navbar. on mobile should move (again, navbar) , replaced (smaller) image. how achieved? the logo links home, right done putting both href , logo image in index.php. to change image according viewport i'd have in css. how link home? please me on getting placement of logo image (responsive) correctly. .logo-wrapper { position: relative; z-index:1; } .toplogo { position:absolute; width:auto; height:auto; z-index:10; left: 0px; top: 0px; } <body id="<?php echo ($itemid ? 'itemid-' . $itemid : ''); ?>"> <div id="toplogo"> <a href="<?php echo $root = juri::root();?>...

javascript - Cylinder partially visible WebGL -

Image
i designing cylinder in webgl 1.0 (which based on opengl es 2.0). it started off n-sided polygon (n slices) m stacks. normals specified follows: even though polygon/cylinder being drawn correctly, faces aren't visible every angle. can seen inside following images show: my goal have visible cylinder following 1 (no top/bottom faces required): does have idea on how fix this? code below: //end if stacks = 0 if (this.stacks <= 0) return; this.vertices = []; this.indices = []; this.normals = []; //--- vertices & normals --- var angle; var alpha = 360 / this.slices; var zcoord = 0; // (n) stacks -> (n + 1) faces -> (faces * this.slices) vertex ( var stackindex = 0; stackindex < this.stacks + 1; stackindex++) { //reset angle each face of stack angle = 0; ( var sliceindex = 0; sliceindex < this.slices; sliceindex++) { this.vertices.push(math.cos(angle * degtorad)); //x this.vertices.push(math.sin(ang...

c# - Using linq to merge multiple XML files with the same structure and removing duplicates based on a key -

i have multiple xml files i'm trying merge single file. linq xml best option i'm open ideas (xslt seems @ merging 2 files clumsy n > 2 or n = big). from reading other questions here, sort of join looks good. file1.xml: <first> <second> <third id="id1"> <values> <value a="1" b="one"/> <value a="2" b="two"/> <value a="3" b="three"/> </values> </third> <third id="id2"> <values> <value a="f" b="foo"/> <value a="b" b="bar"/> <value a="w" b="wibble"/> </values> </third> </second> </first> file2.xml: <first> <second> <third id="id1"> <values> <value a="2" b="two...

kentico - how do I change schema owner in ms sql server? -

Image
i have website hosted developed kentico 7. tried importing exported website localhost , failed. in findings, realised each table in online version has bvs (the database user created) prefix. have tried creating same scenario on localhost without luck. have idea ? here error displayed @ importation. you can change schema owner using command: alter authorization on schema::bvs db_owner;

r - Union two Arrays by colnames -

i have 2 named arrays of different length: x = setnames(c(0.3,0.5,0.1,0.2),c(4,5,7,9)) y = setnames(c(0,0,0,0,0,0,0,0,0),c(2,3,4,5,6,7,8,9,10)) and want union (or better: add) them column names, resulting in: 2 3 4 5 6 7 8 9 10 0.0 0.0 0.3 0.5 0.0 0.1 0.0 0.2 0.0 perhaps should mention 1 of arrays of class table , far understand it, nothing different named array. you can subset element indicating names rather indices. works example: y[names(x)]<-x # 2 3 4 5 6 7 8 9 10 #0.0 0.0 0.3 0.5 0.0 0.1 0.0 0.2 0.0

php - Laravel 4.2 white screen -

i've updated laravel 4.1 laravel 4.2. "require": { "laravel/framework": "4.2.3", "cartalyst/sentry": "2.1.*", "webpatser/laravel-uuid": "1.*" }, now can see white screen, no whoops errors @ all. read laravel 4.2 doesn't show more whoops errors. how can see if error happening? in app.php doesn't matter if put 'debug' => true, or false. same white screen appears. i've followed guide http://laravel.com/docs/4.2/upgrade , doesn't says this. anyone knows why happening? have considered setting php show errors, error_reporting in php.ini you can in apache logs find out caused errors

OpenGL transparent texture issue -

Image
i have issue texture alpha channel. i'm rendering palm tree leaves: but can see, sky on leaves on left side of picture. in code, sky rendered, render trees. here code renders 1 palm tree: renderframe(0);//trunk //glcolor3f(0.0, 0.6, 0.0); glenable(gl_blend); gldisable(gl_cull_face); glblendfunc(gl_src_alpha, gl_one_minus_src_alpha); gltexenvf(gl_texture_env, gl_texture_env_mode, gl_replace); leaves.renderframe(0); glenable(gl_cull_face); gldisable(gl_blend); like others stated, seems order of rendering wrong. i've had issue in past , isn't simple solution, since using deprecated immediate mode. take @ these solutions in question: opengl es2 alpha test problems

problems displaying json data retrieved using php curl -

first, reading. here code what json data looks when viewed in browser using url, { "$totalresults": 1500, "$startindex": 1, "$itemsperpage": 3, "$resources": [ { "$uuid": "5e7b9312-52e5-4fe1-b3e4-633ca04c9764", "$httpstatus": "ok", "$descriptor": "", "name": "heinz tomato sauce sachets qty 200" }, { "$uuid": "1a0f9dca-c417-4cff-94d2-99d16438723f", "$httpstatus": "ok", "$descriptor": "", "name": "heinz brown sauce sachet qty 200" }, { "$uuid": "126fdb17-81ce-41b4-bdba-91d0a170262a", "$httpstatus": "ok", "$descriptor": "", "name": "heinz english mustard sachets qty 300" } ] } test2.php <?php ...

CA AutoSys scripting supports invoking anonymous & secured REST service? -

need write autosys script invoke rest service e.g. http://example.com/api/job/test-job , setup autosys job. autosys script supports rest service? if yes, support anonymous rest service or can support secured service well? also, can record http response code? if yes, can record http response 200 ok success , rest failure when job runs? see link - https://support.ca.com/cadocs/0/ca%20workload%20automation%20system%20agent%20r11%203-enu/bookshelf_files/html/webservicescliuser_11_3_1/index.htm ca seems support automation agent using cli through may invoke http/https web services although there no information provided on response codes. also if filewatcher can trigger http requests, sort of rest interface pertinent web app functionality might work. there not seem way autosys directly invoke , record response rest service though. as alternative can interface web service using platform (such java) , calling same via autosys.

java - Why does Jackson require ALWAYS visibility to detect multi-arguments setters? -

with jsonautodetect.visibility set always , setter multiple arguments correctly invoked during deserialization. public void setsize( @jsonproperty("width") integer width, @jsonproperty("height") integer height) { super.setwidth(width); super.setheight(height); } if i, on other hand, try limit visibility of setters, settervisibility = visibility.none , setter not used though explicitely flag @jsonsetter . how can behavior explained? why jackson-275 seem imply there no support multi argument setters while visibility level support there?

javascript - Google Maps API: Move map center to a position on my page? -

Image
maybe there solution this: i'm using gmap api embed map undernaeth overlay have on top of map. overlay has little arrow on right side , want map marker positioned @ point (or few pixels beside it) i know possible use gmaps infowindow, have way. so i'm able use $("#arrow").offset() in order position on page, don't know how move or pan map center pixel-destination. window.onload = function() { var myoptions = { center: new google.maps.latlng(47.259998, 11.398032), zoom: 17, maptypeid: google.maps.maptypeid.roadmap, disabledefaultui: true }; var map = new google.maps.map(document.getelementbyid("map"), myoptions); var marker = new google.maps.marker({ position: new google.maps.latlng(47.260071, 11.404705), map: map, }); console.log( $("#arrow").offset().top ); } update: this code have in page-template right now. have on last problem though. if page h...

How do i remove 'availability in stock' display from magento category view -

i run magento store want run without stock management items displayed regardless of stock status. i have switched off stock management & have want showing cannot find way remove 'availability: in stock' message search results, category & brand views. how can stop showing? i have found edit style.css file removes product pages & not search results, category & brand lists. this in theme's list.phtml file. go here; mage root/app/design/frontend/xxx/yyy/template/catalog/product/list.html you find logic displaying message in there. xxx/yyy path of particular theme. in unlikely event theme doesnt have list.phtml file, check here; mage root/app/design/frontend/base/default/template/catalog/product/list.phtml

javascript - Clear all items from view in single page app -

i have single page app (written in backbone) backed database default (for time being) list number of items, however, wish provide option sort date or other criterion. therefore, need able clear items screen , query db items meet criterion. question: general strategy clearing views on screen before reloading new items db? note, in backbone todomvc app, strategy use css visible/hidden toggle between different states, unworkable if application backed db lot of items , 30 shown initially. if want delete events need undelegate events, if didn't , created new backbone view old view still listen actions , if have click callback triggered new , old one destroy:=> @.undelegateevents() @$(el).empty()

Is it possible to set the preview image for an Android Wear watch face dynamically? -

typically, preview of watch face set through wear module's manifest; e.g.: <service android:name=".analogwatchfaceservice" android:label="@string/analog_name" android:allowembedded="true" android:taskaffinity="" android:permission="android.permission.bind_wallpaper" > <meta-data android:name="android.service.wallpaper" android:resource="@xml/watch_face" /> <meta-data android:name="com.google.android.wearable.watchface.preview" android:resource="@drawable/preview_analog" /> <meta-data android:name="com.google.android.wearable.watchface.preview_circular" android:resource="@drawable/preview_analog_circular" /> <intent-filter> <action android:name="android.service.wallpaper.wallpaperservice" /> <category android:n...

Max value for rectangle's rounded corners in Android -

Image
i trying shape shown in figure, rectangle corners round: but seems can't corners "rounder" in figure: why that? there max value <corners android:radius="integer" /> ? of course png, suppose using shape more efficient, prefer that. my code: <button android:id="@+id/button_guest" android:layout_width="315dp" android:layout_height="80dp" android:background="@drawable/rounded_rectangle" android:contentdescription="@string/text_button_guest" android:onclick="startguestmode" android:text="@string/text_button_normal" android:textallcaps="false" android:textcolor="#ff000000" android:textsize="50sp" android:layout_marginleft="125dp" android:layout_marginstart="125dp" android:layout_alignparentleft="true" android:layout_alignparentstart="true" /> round...

amazon ec2 - ruby AWS SDK using wrong credentials -

i'm having slight issue aws sdk. i'm using aws sdk on ec2 box pull data need our services. i'm passing credentials via secret , id key when tries pull data want it's using iam role that's assigned box rather credentials. thing is, works fine in 1 of our environments behaves differently in one, what's going on? the latest ruby sdk checks credentials in following order: static_credentials -> env_credentials -> shared_credentials -> instance_profile_credentials so if using static credentials should ok, if exporting key , secret env vars ensure there none set using different name. the sdk looks env vars in order: aws_access_key_id -> amazon_access_key_id -> aws_access_key aws_secret_access_key -> amazon_secret_access_key -> aws_secret_key aws_session_token -> amazon_session_token make sure exporting both aws_access_key_id , aws_secret_access_key doing along lines of: export aws_access_key_id=asiaxxxxxxxxxxxxxxxx...

c++ - Converting gray scale BMP to full color -

i'm learning basic image processing , using gray scale bmp file work algorithms i'd convert code put out color bmp files instead of gray scale. i'm using easybmp library , have following read in , write bmp file: bool image::readfrombmpfile(const std::string & inputfilename){ bool success = true; // use bmp object read image bmp inputimage; success = inputimage.readfromfile(inputfilename.c_str() ); if( success ){ // allocate memory image (deleting old, if exists) m_numrows = inputimage.tellheight(); m_numcols = inputimage.tellwidth(); if( m_pixels != null ){ // deallocate old memory delete [] m_pixels; } m_pixels = new double[m_numrows * m_numcols]; // copy pixels for( int r = 0; r < m_numrows; ++r ){ for( int c = 0; c < m_numcols; ++c ){ rgbapixel pixelval = inputimage.getpixel(c, r); double val = (double) ...

dynamics crm - Email router crm 2015 -

while configuring email router crm 2015. when fetching user , queues details. getting error email router configuration manager the email router configuration manager unable retrieve user , queue information microsoft dynamics crm server. may indicate microsoft dynamics crm server busy. verify url '' correct. additionally, problem can occur if specified access credentials insufficient. try again, click load data. (the decryption key not obtained because https protocol enforced, not enabled. enable https protocol, , try again.) from: https://technet.microsoft.com/en-us/library/hh699774.aspx 1) make sure user account running email router service member of active directory directory service privusergroup security group. 2) make sure account specified in access credentials field on general tab of email router configuration profile dialog box microsoft dynamics crm administrative user. if access credentials set local system account, computer account must member o...

scala - Play framework create DEB and deploy it on Ubuntu 14.04 -

i'm using play framework 2.3.8 scala, , i'm trying create deb package install on prod server. after installation should automatically run thru "services" i've added build.sbt : import com.typesafe.sbt.packager.keys._ packagedescription := """admin application""" maintainer := """admin <contact@maintainer.com>""" after executing activator debian:packagebin it generates deb file, after installation script /etc/init.d/testapplication not working how can make working on ubuntu 14.04? i tried use java application archetype basing on http://www.scala-sbt.org/sbt-native-packager/archetypes/java_server/ i've added: import com.typesafe.sbt.sbtnativepackager._ import nativepackagerkeys._ packagearchetype.java_application but sill without success ===== update after setting upstart , during installation i'm getting: selecting unselected package testapplication. (readin...

java - Take data from Yahoo Finance and show it in Fragment -

in fragment of android application wanna show simple data yahoo finance price, company name, ticker etc of csv (comma-separated values). have error nullpointerexception when tried set values textview in financefragment. can show me correct way or fix code. thanks help! activity.java alertdialog.builder builder = new alertdialog.builder(this); layoutinflater inflater = this.getlayoutinflater(); view dialogview = inflater.inflate(r.layout.dialog_search_ticker, null); builder.setview(dialogview); final edittext input = (edittext) dialogview.findviewbyid(r.id.input_ticker); input.setinputtype(inputtype.type_class_text); builder.setpositivebutton("search ticker", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { final string searchticker = input.gettext().tostring(); if(searchticker.mat...

python - Lennard Jones interaction between particles. Particles moving to one point -

import numpy np import random import pygame background_colour = (255,255,255) width, height = 300, 325 eps = 1 sigma = 1 dt = 0.05 class particle(): def __init__(self): self.x = random.uniform(0,400) self.y = random.uniform(0,500) self.vx = random.uniform(-.1,.1) self.vy = random.uniform(-.1,.1) self.fx = 0 self.fy = 0 self.m = 1 self.size = 10 self.colour = (0, 0, 255) self.thickness = 0 def bounce(self): if self.x > width - self.size: self.x = 2*(width - self.size) - self.x elif self.x < self.size: self.x = 2*self.size - self.x if self.y > height - self.size: self.y = 2*(height - self.size) - self.y elif self.y < self.size: self.y = 2*self.size - self.y def getforce(self, p2): dx = self.x - p2.x dy = self.y - p2.y self.fx = 500*(-8*eps*((3*sigma**6*dx/(dx**2+dy**2)**4 - ...

javascript - jssor Scrolling Logo/Thumbnail Slider won't start automatically on page load -

could me jssoor scrolling logo/thumbnail slider please? i did implement in website scrolling through "partners logos". working charm expect 1 thing. when load page, thumbnail slider shows 1 icon/logo until drag left or right slightly. whole animation starts , required number of logos appear. i wondering did wrong or did miss. i did included required .js files. don't know if helps set up: jquery(document).ready(function ($) { var options = { $autoplay: true,//[optional] whether auto play, enable slideshow, option must set true, default value false $autoplaysteps: 1,//[optional] steps go each navigation request (this options applys when slideshow disabled), default value 1 $autoplayinterval: 1000,//[optional] interval (in milliseconds) go next slide since previous stopped if slider auto playing, default value 3000 $pauseonhover: 0,//[optional] whether pause when mouse on if slider auto playing, 0 no pause, 1 pause desktop, 2 pause touch device, 3 pause desktop ...

razor - Javascript Variable in Url.Content -

i have javascript variable called locid trying use part of url setting data-url of div follows: data-url='@url.content("~/catalogue_items/itemsactionviewpartial/")@model.catitemid?locationid=locid&asyncupdateid=catalogue-view'> i know can't throw locid in string have done in sample code put there illustrate need javascript variable be. how can achieve this?? you cannot use javascript variable directly attribute. workaround can reorder parameters of url , setting javascript variable in script tag. <button id="mybutton" data-url='@url.content("~/catalogue_items/itemsactionviewpartial/")@model.catitemid?asyncupdateid=catalogue-view'></button> i have reordered url parameters here. location parameter set following script. place script after button element. <script> var button = document.getelementbyid('mybutton'); var url=button.getattribute('data-url'); url+="&locati...