Posts

Showing posts from September, 2011

hexdump - Generating a machine code using SPIM -

i have assignment consists of developing simulator mips instructions. test simulator need inputs code machine or hedump code of assembly file. tried use spim on linux when check menu can t find way generate these kind of files. suggestions or answers appreciated. in advance. try link gonna needs now, write own test file https://github.com/eliottwiener/mips-simulator/blob/master/test.hexdump

JMeter Recording Controller is not working -

Image
i using apache jmeter 2.13. recording step have followed link: https://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf after following these steps recording controller under test plan not start recording. can me on issue? according you, have created "thread group" under "test plan" , have created "recording controller" under "thread group". double check following: go "http(s) test script recorder" under "workbench" , set correct target controller @ right panel. start "http(s) test script recorder" clicking start button @ bottom in "http request defaults" under "thread group": input "server name or ip" correctly set browser proxy perfectly. (default port in "http(s) test script recorder" of jmeter 8080. use 8080 in browser proxy also. if want change proxy say, 9090 use same proxy (9090) in browser proxy set up) please see image attached here:

Avahi Daemon resolving to wrong host name -

i facing issues avahi's address resolution apple airport router. when run avahi-browse -alr eth0 ipv4 50-35-10-70.1 airport express _sleep-proxy._udp local hostname = [airport-express.local] address = [169.254.8.180] port = [54121] txt = [] this output, apple airport's ip address 192.168.1.21 when edited /etc/avahi/hosts file resolve ip address, works few minutes , address 169.254.8.180 thanks in advance.

javascript - Input number section function only works one time -

i have 1 function number input box come + , - button on sides, , copy code in shopify theme use. function show 1 time. need apply product offers. (function ($) { $.fn.bootstrapnumber = function (options) { var settings = $.extend({ upclass: 'default', downclass: 'default', center: true }, options); return this.each(function (e) { var self = $(this); var clone = self.clone(); var min = self.attr('min'); var max = self.attr('max'); function settext(n) { if ((min && n < min) || (max && n > max)) { return false; } clone.focus().val(n); return true; } var group = $("<div class='input-group'></div>"); var down = $("<button type='button'>-</button>").attr('class', 'btn btn-' + settings.

python - Disable automatic dismissal of iOS alerts on Device Farm -

it appears alerts on ios on device farm automatically dismissed can disable dismissal of tests dependent on alerts. have found forums of aws feature not yet available few months before. https://forums.aws.amazon.com/thread.jspa?messageid=716329&#716329 i work aws device farm team. today, autoacceptalert set true default when using appium. however, right looking @ ways give user more control on options passed appium. should see update on soon. feature wasn't available anytime before. the aws forum post best place update on makes in.

css - Random Background Image PHP -

i using php code below display random header image every time page refreshed. works fine need add specific background-position css property of images. for example headerimage3.jpg needs background-position:20px , headerimage1.jpg needs background-position:50px. is possible using php code below or javascript need used? <style type="text/css"> #header-image{background:url("/files/headerimage<?php echo rand(1,4)?>.jpg");background-position:center center;background-size:cover}} </style> add php header: <?php $rnd = rand (1,4); $pos = ($rnd == 1) ? "50px 0;" : ($rnd == 3) ? "20px 0;" : "top left"; ?> then in css: <style type="text/css"> #header-image { background-image: url("/files/headerimage<?php echo $rnd ?>.jpg"); background-position: <?php echo $pos ?>; background-size: cover; } </style>

swift2 - Swift - How to group table using object array -

i have following class: class providerschedule : anyobject { var provideruid : string = "" var lastname : string = "" var firstname : string = "" var scheduleregion : string = "" var scheduleamount : float = 0 init () { } } then create array of object in order set source uitableview. var tabledata : array<providerschedule> = [] my table functions are: func tableview(tableview: uitableview!, numberofrowsinsection section: int) -> int { return self.tabledata.count } func numberofsectionsintableview(tableview: uitableview!) -> int { return 1 } what need group data by: lastname , firstname name appears on group section of table. any clue how that? convert data format better suited table groups. make class represent group key, this: class groupkey : hashable { let firstname : string let lastname : string init(fn:string, _ ln:s

uitableview - UITableViewController UINavigationController -

Image
i declared gamepicerviewcontroller (subclass of uitableviewcontroller) .but got bug in prepareforsegue:sender: method . console says gamepickerviewcontroller uinavigationcontroller. have ideas? i post gamepickerviewcontroller.h playerdetailsviewcontroller.m , console in pic abve. problem solved. - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([segue.identifier isequaltostring:@"pickgame"]) { uinavigationcontroller *controller = segue.destinationviewcontroller; gamepickerviewcontroller *gamepickerviewcontroller = [controller viewcontrollers][0]; gamepickerviewcontroller.delegate = self; gamepickerviewcontroller.game = _game; } } i forgot line: uinavigationcontroller *controller = segue.destinationviewcontroller;

android - How to open different activity by clicking on different cards in a recycler view with cards -

i have created recyclerview , added cards.i want open different activity clicking on different cards. my codes are: mainactivity public class mainactivity extends appcompatactivity { recyclerview mrecyclerview; recyclerview.layoutmanager mlayoutmanager; recyclerview.adapter madapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mrecyclerview = (recyclerview)findviewbyid(r.id.recycler_view); mrecyclerview.sethasfixedsize(true); mlayoutmanager = new linearlayoutmanager(this); mrecyclerview.setlayoutmanager(mlayoutmanager); madapter = new cardadapter(); mrecyclerview.setadapter(madapter); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; }

ajax - POSTing JSON data to WCF Rest Service -

i know there many questions on none of suggestions have worked me. here code: var restservice = "http://wcfrestservice:8004/radpocservice/webapp1"; $.ajax({ url: restservice, type: "post", data: { phonenumber: y }, datatype: "json", contenttype: "application/json; charset=utf-8", success: function (data) { window.open(data.url, '_blank'); } }); fiddler shows request going across wire (redacted): post http://localhost:8004/radpocservice/webapp1 http/1.1 host: localhost:8004 connection: keep-alive content-length: 22 accept: application/json, text/javascript; q=0.01 origin: http://localhost:8000 user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/51.0.2704.103 safari/537.36 content-type: application/json; charset=utf-8 referer: http://localhost:8000/default.aspx accept-encoding: gzip, deflate accept-language: en-us,en;q=0.8 requestor: me phonenumbe

java - How to fix Malformed POM: Unrecognised tag: 'groupId'? -

i have school project i'am going change cql (caasandra query language), after doing need create specific cassandra java driver, problem couldn't run source code of driver on eclipse tried many things , search in internet nothing work every time have kind of problem: [debug] looking lifecyle mappings packaging bundle classrealm[project>com.datastax.cassandra:cassandra-driver-core:2.1.9-snapshot, parent: classrealm[maven.api, parent: null]] [error] build not read 1 project -> [help 1] org.apache.maven.project.projectbuildingexception: problems encountered while processing poms: [error] malformed pom i:\_cassandra\java-driver-2.1\driver-core\pom.xml: unrecognised tag: 'groupid' (position: start_tag seen ...<dependencies>\n <groupid>... @36:12) @ i:\_cassandra\java-driver-2.1\driver-core\pom.xml, line 36, column 12 @ org.apache.maven.project.defaultprojectbuilder.build(defaultprojectbuilder.java:363) @ org.apache.maven.defaultmaven.collectprojects(

ruby single word pig latin with regex -

calling forth ruby regex masters! i trying solve problem in ruby using regex. input single word. 2 conditions apply: if starts vowels [aeiou], returns word + 'way'. example, pig_latin('aye') #=> 'ayeway' if starts consonants, moves first letter of word end of string, + 'ay'. pig_latin('map') #=> 'apmay' i have tried: def pig_latin(ay) ay.gsub(/\a[aeiou](w+)/, '\2\1way') end pig_latin('map') #=> 'map' pig_latin('aye') #=> 'aye' when tried ay.gsub(/^[aeiou](\w+)*/, '\2\1way') pig_latin('map') #=> 'map' pig_latin('aye') #=> 'yeway' getting close. @ least recognizes consonants - removes 'a' in 'aye'. i have tried reading regex doc, on gsub , rubular helps illuminate bit, still in dark ages. in case 2 gsub calls allowed: def pig_latin(ay) ay[0] =~ /[aeiou]/ ? ay.gsub(/([aeiou])(\w+)*

Access C# COM object that has been separated from its underlying RCW cannot be used -

i worked lot not solved problem. making program in c# access database. i added new form , want update database form. i getting id in form; gelenid = form1.id2; this code. im getting error in komut.executenonquery(); isim = combobox1.text; yapilacak_is = textbox1.text.trim(); bolum = combobox2.text.trim(); tarih = monthcalendar1.selectionrange.start.toshortdatestring(); durum = combobox3.text; int idm = convert.toint32(gelenid); baglanti.open(); komut.connection = baglanti; komut.commandtext = @"update bakim set [ad]=@isim, [bolum]=@bolum, [yapilacak_is]=@yapis, [tarih]=@tarihim, [durum]=@durum [id]=@id"; komut.parameters.addwithvalue("@isim", isim); komut.parameters.addwithvalue("@yapis", yapilacak_is); kom

android - How to parse JSON eliminating nullpointer exception -

i trying parse json creating json object result string, parse json array , looping through it. jsonobject jsonobject = new jsonobject(json_string) json_string being result of url execution. json looks this. {"resulto":[{"surname":null,"firstname":null,"nrc":null}]} the line jsonobject = new jsonobject brings null pointer exception. how fix this? the exception coming because json_string null or empty better check if (!textutils.isempty(json_string)) {} before proceeding. if key has null value key_value:null jsonobject never throws exception instead set value string "null".

php - Laravel, can't find true source of html -

laravel 4.2, ubuntu 14.04. apologies being asked make small html change using framework have little experience with. i change date (just text) 2014 2015, , recursive grepping has revealed 2 files contain seems existing html: app/views/public/base/footer.blade.php and file generated ../shared/storage/views/9c6aa15f7975c94aeb3aadfdaa9a8f83 that second files enact changes when edited (editing first file crashes site), isn't how should done. generating file!? i have understanding of route > controller > blade sequence. incoming root url request goes this: app/routes.php route::get('/', 'homecontroller@show' ); which calls app/controllers/homecontroller.php public function show() { // ... omitted brevity return view::make('public.pages.home')->with(compact( 'home', 'popular', 'featured' )); } which calls blade file, continue follow since doesn't contain footer yet app/views/public/pages/home.bl

mysql - PHP, Uncaught TypeError: Cannot read property 'length' of undefined -

i'm trying make dependable dropdown lists on php ajax calls. there 9 columns on mysql table. found sample code. there 3 dropdown lists. , tried increase them. <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title></title> <meta name="description" content=""> <meta name="keywords" content=""> <script type="text/javascript"> function ajaxfunction(choice) { { alert(choice.options.length);} var httpxml; try { // firefox, opera 8.0+, safari httpxml=new xmlhttprequest(); } catch (e) { // internet explorer try { httpxml=new activexobject("msxml2.xmlhttp"); } catch (e) { try { httpxml=new activexobject("microsoft.xmlhttp"); } catch (e) { alert("your browser not support ajax!"); return false; } } } fun

html - Align elements in a figure -

i've got problem hw. cant align 2 elements on left side https://jsfiddle.net/tkjxlfjy/ code , tried things float:left didn't work... can me put meter , text under picture (the black sqare)? according w3school : elements after floating element flow around it. avoid this, use clear property. add clear:both div . image has float:left next elements sit behind that. jsfiddle figure div { clear: both; }

Ruby on Rails SyntaxError using Strong Parms -

i'm trying whitelist mhealth_ids in /app/controllers/clients_controller.rb displayed below. def client_params params.require(:client).permit(:firstname, :lastname, :dob, :gender_id, :remove_image, :rh_options, :insurance_id, :state_id, :ed_id, :wk_id, :grade_id, :rsource_id, :image, :race_id, :employment_id, :comments, :email, :phone, :address, :city, :state, :zipcode, :name, rhealth_ids:[], :name, mhealth_ids:[]) end i'm using same syntax :name, rhealth_ids:[] works fine when :name, mhealth_ids:[] isn't inserted. i'm not sure i'm missing. i'm sure it's small. the arrays go @ end copy pasted , forgot take out second :name.

javascript - jQuery JSON AJAX Request to different domain -

i'm trying make ajax request https://api.mojang.com/users/profiles/minecraft/username , should return json data (not sure if jsonp) when click on button perform ajax request this: http://prntscr.com/8xswr1 (google chrome console) when double click on 'dude1?callback...' this: http://prntscr.com/8xsx7q which contains json data want returned, meaning making request , getting json data can't parse or information code: <!doctype html> <html> <head> <title>website</title> <script src="https://code.jquery.com/jquery-2.1.4.js"></script> <script> function getinfo() { username = $('#username').val(); $.ajax({ type: 'get', url: "https://api.mojang.com/users/profiles/minecraft/" + username, //crossdomain: true, datatype: 'json

html5 - Show remaining characters for a text box using javascript -

this question has answer here: javascript character count 3 answers without editing html file, need show characters remaining maximum of 300 chars. <form> <fieldset> <div class="formrow clearfix"> <span> <label for="comments">comments</label> <label for="comments" id="charsleft">(300)</label> </span> <textarea name="comments" id="comments" rows="4" cols="40"></textarea> </div> </fieldset> </form> i have function ready im not sure on have in function work. $(document).ready(function () { var text_max = 300; $('#charsleft').html(text_max); $('#textarea').keyup(function() { va

java - Database Client Design to support different backends -

what usable design patterns use implementing data base client capable of supporting various backends? (e.g. mongodb, or postgres,...) as simple approach, create interface defines methods crud operations: interface dbdriver { void write(string data); string read(); ... } classes implementing interface injected in client class like: class dbclient() { public dbclient(dbdriver dbdriver) { ... } //methods write, read, update ... } adapter encapsulate database specific details while exposing common interface. factory method instantiate correct adapter. the dao pattern adapter.

Jmeter Beanshell ---- finding Highest number from the response -

Image
below response: <div class="input radio_buttons optional challenger_order_selected"><span class="radio"><input class="radio_buttons optional" id="challenger_order_selected_eulcrnhkvss5r0tqtg5obeziwwewdz09ls1usjdodytuditqdmnowe5lskzpmdvbpt0--3fb112e512edd2f77187705cbefeb5c479c85a80" name="challenger[order_selected]" type="radio" value="eulcrnhkvss5r0tqtg5obeziwwewdz09ls1usjdodytuditqdmnowe5lskzpmdvbpt0=--3fb112e512edd2f77187705cbefeb5c479c85a80" /><label class="collection_radio_buttons" for="challenger_order_selected_eulcrnhkvss5r0tqtg5obeziwwewdz09ls1usjdodytuditqdmnowe5lskzpmdvbpt0--3fb112e512edd2f77187705cbefeb5c479c85a80">54</label></span></div> <div class="input radio_buttons optional challenger_order_selected"><span class="radio"><input class="radio_buttons optional" id="challenger_order_sele

c++ - Error building openframeworks for android: “ invalid use of incomplete type ‘class Poco::Path’” -

i trying build android application of. application runs in 2 other computers. however, not work on mine. using mac. i run command "make androiddebug" in project folder, , error have: /library/openframeworks/addons/ofxhttp/libs/ofxhttp/src/postroutefilehandler.cpp:98:46: error: invalid use of incomplete type 'class poco::path' ss << poco::path(formfilename).getextension(); i have installed poco, nothing changes afterwards. what can solve this? thanks have included poco/path.h? a forward declaration might appeared earlier (possibly in header) without complete definition.

Delphi - Make a Delphi program that Self-extract a MIDI file -

i'm writing program in delphi 7, , think in put music run in background. so, composed song in .midi called song.mid, want put delphi program self-extract(sfx) song , execute, in end of program delete it. it's write in hex, think. how can it? create new text file, , write: midi rcdata 1.mid, save text file mid.rc create new text file, , write: brcc32 mid.rc, save "brcc.bat" run brcc.bat, convert *.rc file *.res move mediaplayer form (the media player on "system"tab). copy code project: unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, mplayer; type tform1 = class(tform) mplayer: tmediaplayer; procedure formcreate(sender: tobject); private { private declarations } public { public declarations } end; var form1: tform1; implementation {$r *.dfm} {$r mid.res} procedure tform1.formcreate(sender: tobject); var stream:tresourcestream; tmp:string; be

hadoop - Why use MapReduce vs HBase shell filter -

i need query data on hbase. queries this: show books of "authord". how many books of author "authora" in database? as far know can mapreduce or hbase shell filter. please correct me if i'am wrong. my question is: why use mapreduce (programming needed) if can same on hbase shell (no programming needed) using it's filters? thank answers. have nice day. there 3 ways results hbase. 1) shell : simple sure data analysis small volumes of data. small amount of data , developer analysis. if know rowkey directly can data quickly 2) hbase non batch clients : example java client connect hbase apply filters , results small amount of data. why mapreduce hbase api what happens if data huge , need process... in case, either hbase shell hang , become un-responsive or continuous flow of data there scrolling.. cant able see , analyze.. 3) mapreduce (batch client) : processing huge volume of data. can use same filter , scan obje

apache spark - Persist RDD as Avro File -

i have written sample program persist rdd avro file. i using cdh 5.4 spark 1.3 i wrote avsc file , generated code class user {"namespace": "com.abhi", "type": "record", "name": "user", "fields": [ {"name": "firstname", "type": "string"}, {"name": "lastname", "type": "string"} ] } then generated code user java -jar ~/downloads/avro-tools-1.7.7.jar compile schema user.avsc . the wrote example package com.abhi import org.apache.hadoop.mapreduce.job import org.apache.spark.sparkconf import org.apache.avro.generic.genericrecord import org.apache.avro.mapred.avrokey import org.apache.avro.mapreduce.{avrokeyoutputformat, avrojob, avrokeyinputformat} import org.apache.hadoop.io.nullwritable import org.apache.spark.sparkcontext object myspark { def main(args : array[string]) : unit = { val sf = new sparkconf

vba - Macro fails for large sets of items -

i have functioning macro fails @ seemingly random points when running on large number of items. macro used loop through inbox folder receives error logs, save error log text files, copy specified lines of text attachments (error operation names , such), place these strings in excel file track them, , move email items inbox folder once processed. works great when goes through less hundred emails above gets strange. in testing failed on 122nd iteration, 648, 350, etc. general structure below. sub errorlogauto() dim filename string dim path string dim timeinfo string dim subjectinfo string dim idnumber string dim dataline string dim oitem object dim item outlook.items dim myattachment(1000) outlook.attachments dim myinspector outlook.inspector dim appexcel object dim filenum integer dim found integer dim found1 integer dim found2 integer dim integer dim j integer dim op integer dim integer dim cdata integer = 0 k = 1 'returns proper source folder set mynamespace = applicat

javascript - Using spread operator and new Set() with typescript -

i using following code unique numbers: let uniques = [ ...new set([1, 2, 3, 1, 1]) ]; // [1, 2, 3] however, typescript report following error: type 'set' not array type. not typescript ninja, tell me wrong here? this missing feature. typescript supports iterables on arrays @ moment.

android - Storing a list of enums in firebase -

i have following code: public class testclass { public arraylist<objecttypes> list = new arraylist<>(); public testclass(){ list.add(objecttypes.type1); } } public enum objecttypes { type1, type2, type3, type4, } fb.child("test").setvalue(new testclass()); where fb databasereference. when running code application crashes , following error appears: com.google.firebase.database.databaseexception: no properties serialize found on class objecttypes this problem did not appear in old firebase. the problem solved enumerating enum elements (enumerating enum...) in above example: public enum objecttypes { type1(0), type2(1), type3(2), type4(3), } hopefully easier less boiler plated way added in future?

ios - My Xcode 7.3 compiler is constantly breaking and causing extremely long Build and Compile times -

this issue occurred on spritekit xcode project i have issue swift where, once project reaches level of complexity have tons of classes , methods around, autocompletion breaks "jump definition" ceases work , ide reduced usefulness of basic texteditor/notepad. my code's color change white completely, causes lot of strain on eyes, , seems happen when remove , add large blocks of code watch cpu activity climb 75% usage on cpu cores. i think started happening when switched target ios 9.3 on 8.0. issue compiler trying interpret old swift syntax? i have cases wait 2 minutes minor changes compile, build fail due "linker command failed exit code", fixed compiling twice. here's specs: os x 10.11.4 core i7 skylake 4.0ghz 16 gb ddr4 ram 256gb ssd i'm thinking building system running os x dual processors might alleviate issue, since can take upwards of 2 minutes compile code that's different 1 line. welcome swift! great language,

core - Opencl Workitems and streaming processors -

what relation between workitem , streaming processor(cuda core). read somewhere number of workitems should exceed number of cores, otherwise there no performance improvement. why so?? thought 1 core repsresents 1 workitem. can me understand this? gpus , other hardware tend arithmetic faster can access of available memory. having many more work items have processors lets scheduler stagger memory use, while work items have read data using alu hardware processing. here page optimization in opencl. scroll down " 2.4. removing 'costly' global gpu memory access", goes concept.

Javascript: Uncaught Error: Too many listeners for downloads.onDeterminingFilename -

here's code: assets.foreach(function(v) { var canvas = document.createelement('canvas'); canvas.id = "canvas"; canvas.width = 200; canvas.height = 150; var ctx = canvas.getcontext("2d"); var img = new image(); img.src = 'file:///path/to/file/' + v.name; img.onload = function () { ctx.drawimage(img, 0, 0, img.width, img.height-256, 0, 0, 200, 150); }; document.getelementbyid('download').addeventlistener('click', function() { chrome.downloads.download({ url: canvas.todataurl() }); chrome.downloads.ondeterminingfilename.addlistener( function(downloaditem, cb) { console.log(downloaditem); cb({ filename: 'path/to/file/thumb-' + v.name.split('_')[0] + '.png', conflictaction: 'overwrite&#

c++ - Load Lua script once, execute in multiple states in multiple threads -

i load lua script c++ program, , invoke script multiple times in separate threads. i'm trying avoid loading script in each thread (why go through overhead). i'm thinking in c++ program: create lua state l load script l and in n threads do: create local lua state si (i = 1..n, i.e., separate state per thread) grab "compiled" script l , invoke in context in si is there "standard" approach doing this? primary goal avoid having each thread load script. script may executed multiple times in state si. note scripts running in separate threads not cooperating (i.e., know nothing each other , keep way). as said in comment, dont think can want c++ threads without data races or mutexes block parallel execution. single lua state not seem designed used multiple threads , lua threads dont support multithreading either , there no way move data separate state magically. however can try "compile" lua scripts on state doing loadstring

c# - How to debug a Visual Studio 2013 Extension Update page error? -

Image
i'm trying open product updates in visual studio 2013 / extension , updates / updates / product updates whenever open it shows error message following message: '=' unexpected token. expected token ';'. line 124, position 93. is there way can investigate error, there editable configuration file or how go about? most irrelevant in case related i'm trying update following recommendation following issue visual studio 2013: database project msbuild error

matlab - Straighten and concatenate the individual grids from ndgrid -

this question has answer here: generate matrix containing combinations of elements taken n vectors 4 answers i'm trying following in general way: x = {0:1, 2:3, 4:6}; [a,b,c] = ndgrid(x{:}); res = [a(:), b(:), c(:)] res = 0 2 4 1 2 4 0 3 4 1 3 4 0 2 5 1 2 5 0 3 5 1 3 5 0 2 6 1 2 6 0 3 6 1 3 6 i believe have start following way, can't figure out how continue: cell_grid = cell(1,numel(x)); [cell_grid{:}] = ndgrid(x{:}); [cell_grid{:}] ans = ans(:,:,1) = 0 0 2 3 4 4 1 1 2 3 4 4 ans(:,:,2) = 0 0 2 3 5 5 1 1 2 3 5 5 ans(:,:,3) = 0 0 2 3 6 6 1 1 2 3 6 6 i can solve in many ways case 3 variables [a, b, c] , both , without loops, start struggle when more vectors. reshaping directly not give corre

php - Weird behaviour from joomla and virtuemart regarding cart data -

so wrote code display cart total outside of joomla framework: <?php // set flag parent file define( '_jexec', 1 ); define('jpath_base', dirname(realpath(__file__)). '/store' ); define( 'ds', directory_separator ); require_once ( jpath_base .ds.'includes'.ds.'defines.php' ); require_once ( jpath_base .ds.'includes'.ds.'framework.php' ); jimport('joomla.application.module.helper'); jimport('joomla.application.component.helper'); $mainframe = jfactory::getapplication('site'); $mainframe->initialise(); if (!class_exists( 'vmconfig' )) require(jpath_root.ds.'administrator'.ds.'components'.ds.'com_virtuemart'.ds.'helpers'.ds.'config.php'); vmconfig::loadconfig(); if(!class_exists('virtuemartcart')) require(vmpath_site.ds.'helpers'.ds.'cart.php'); $cart = virtuemartcart::getcart(false); $data = $cart->prepareajaxd

java - Colours not enabled with JSCH -

i'm trying create simple vt100 emulator in java - work jsch. colours displayed (when print them echo example). when open htop, display set monochromatic (and can't change it). i've looked in htop source code, , comes check (ncurses, has_colors): server think colours not enabled on terminal. this of course not server-side problem (working putty). thanks.

Javascript / jQuery change inline style values -

i have inline css in page: <style id="abc"> .player-holder{ position:relative; width:100%; height:40px; } .icon-color{ color:#fff; -webkit-transition: color 0.3s ease-in-out; transition: color 0.3s ease-in-out; } .icon-rollover-color{ color:#fff; -webkit-transition: color 0.3s ease-in-out; transition: color 0.3s ease-in-out; } </style> is possible change values on fly (using jquery/javascript) browser takes change immediately? like change: .icon-rollover-color to color:#333; yes, can change inline css using jquery .css() function. see this fiddle . $('p').css('color','#00ff00'); if dynamically adding elements suggest write function called whenever new element added, using event listener, can pass updated style values parameters. like: updatedomstyle('<style>','<value>');

Captured Picture Not Showing up in imageView in Dialog - Android Studio -

im trying access picture taken camera in dialog fragment. code. there no errors, image isn't loading imageview in dialog mainactivity @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); taskadapter adapter = new taskadapter(this); view view = layoutinflater.from(this).inflate(r.layout.picture_setup_dialog, null); button mtaskbutton = (button)view.findviewbyid(r.id.taskbutton); button mexambutton = (button)view.findviewbyid(r.id.exambutton); imageview muserpicture = (imageview) view.findviewbyid(r.id.userpicture); if (resultcode == result_ok){ if (requestcode == adapter.request_take_photo){ //write code happens after picture taken here picasso.with(this).load(adapter.getimageuri()).into(muserpicture); alertdialog.builder builder = new alertdialog.builder(this) .settitle("add picture") .setview(view)

Laravel Get Collection From Array of IDs -

i have array of user ids i'm trying collection of. have been using following foreach loop, realize each loop makes, overrides previous data. $users = db::table('user_tags')->where('tag_name', $tag)->wherenotnull('user_id')->lists('user_id'); $users = array_unique($users); foreach ($users $key => $value) { $users = user::where('id', $value)->get(); } how can return collection users in original array? thanks! there's easier way.. $ids = db::table('user_tags')->where('tag_name', $tag)->wherenotnull('user_id')->lists('user_id'); $users = user::wherein('id', $ids)->get();

Handling events for CompactCalendarView calendar in android -

i using compactcalendarview adding, deleting, viewing , updating events, every time when load fragment ( compactcalendarview activity calendar shown) making call rest api fetching events , adding compactcalendarview , don't know doing right may make events notifications removed(for every event added setting notification alert user notified event) also every time activity loaded dont find check if event present i sync compactcalendarview sync google account calendar any in enlightening me pretty confusing me understand whats happening in compactcalendarview thnaks.

jackson - Spark crash while reading json file when linked with aws-java-sdk -

let config.json small json file : { "toto": 1 } i made simple code read json file sc.textfile (because file can on s3, local or hdfs, textfile convenient) import org.apache.spark.{sparkcontext, sparkconf} object testawssdk { def main( args:array[string] ):unit = { val sparkconf = new sparkconf().setappname("test-aws-sdk").setmaster("local[*]") val sc = new sparkcontext(sparkconf) val json = sc.textfile("config.json") println(json.collect().mkstring("\n")) } } the sbt file pull spark-core library librarydependencies ++= seq( "org.apache.spark" %% "spark-core" % "1.5.1" % "compile" ) the program works expected, writing content of config.json on standard output. now want link aws-java-sdk, amazon's sdk access s3. librarydependencies ++= seq( "com.amazonaws" % "aws-java-sdk" % "1.10.30" % "compile", &quo

Do While Loop menu in C++ -

i'm having trouble do-while loop menu program i'm working on school. i've checked, , far i'm concerned have written code correctly. however, when testing, if type 'y' or 'n' result same: menu streaming down 100's of times non stop until exit program. idea on i'm doing wrong , how can display menu every time? in advance. #include <iostream> #include <iomanip> #include <string> #include "cashregister.h" #include "inventoryitem.h" using namespace std; int main() { // variables int selection, numunits, cont; double price; // use first constructor first item inventoryitem item1; item1.setcost(5.0); item1.setdescription("adjustable wrench"); item1.setunits(10); // use second constructor second item inventoryitem item2("screwdriver"); item2.setcost(3.0); item2.setunits(20); // use third constructor remaining items inventoryitem item3("pliers", 7.0, 35); inventoryitem item4(&qu