Posts

Showing posts from May, 2010

d3.js - Is it Possible to search within dc.js graphs (ex: row chart)? -

suppose have row chart rows. on entering text , clicking button can focus particular row in rowchart? if yes, please suggest example. i think you're looking chart.filter method . in handler button click event, call rowchart.filter(value); with value text box.

javascript - Can I access a variable's name as a string after passing it as an argument to another function? -

perhaps dim question i'm trying design i'm using javascript / jquery change layout of website , i'd see values of both variable name , it's current value in div. i doing $test.append('example string' + examplevar) lot thought make function called test(). so far have: function test (test) { $test = $('.test'); $test.append(test+"<br>"); } and pass variable name argument can't find way of making display name string. know making object access key , value doesn't seem work here? bit of long-winded way it, here's example using object: function tester(options) { var keys = object.keys(options); console.log(keys[0] + ': ' + options[keys[0]]); // test: value } tester({ test: 'my value' }); demo

javascript - Loading a background-color for a div when page is loaded -

i wrote simple code i'm trying load background-color div when page loads. here code: <div id="offerone"> <img src="images/images.jpg" class="img-responsive center-block" alt="img"> </div> javascript: <script type="text/javascript"> $('#offerone').attr('style', 'background-color: #f12 !important'); </script> but isn't loading background-color div when page loads. how can it? you should put code inside dom ready, $(function(){ $('#offerone').attr('style', 'background-color: #f12 !important'); })

html - Strange CSS Class Name, someone explain to me what is going on? -

i'm trying make bit of copy of this website i'm having issues gallery part, images won't behave same website im attempt copy. change around once complete. here jsfiddle of code if helps. here css section: /* gallery start */ .box.style2 header { display:inline-block; background:#fff; padding:2em 3em; margin:0px; } .box.style2 .inner { position:relative; padding:40px 0 0px 0; } .box.style2 { text-align:center; } .box.style2 .inner:after { content: ''; display:block; position:absolute; top:0; left:50%; height:100%; border-left:solid 1px #fff; } .box.style2 .inner .row { position:relative; } .row { border-bottom:solid 1px transparent; box-sizing:border-box; } .row:after, .row:before { content: ''; display:block; clear:both; height:0; } .row > * { float:left; } .box.style2 .inner .image { position:relative; z-index:1; padding:20px; } .image.fit

libraries - Parsing ASCII in raw memory in C -

my goal parse potentially garbled ascii data containing text , numbers. far i've been doing fine getting pointer numbers within text strcmp , hard-coded pointer arithmetic , converting them strtol , feel there must better way. is there function effect of scanf takes pointer memory instead of input stream? you'll wanting sscanf . note expect null-terminated string.

python - How do I get my data in my heatmap? -

i've programmed conways game of life in python , i'm trying display simple data gives me output in heat map. current code: from tkinter import * import matplotlib.pyplot plt import time import numpy np import random size_x = 100 size_y = 10 # create matrices cell = [[0 row in range(0, size_y)] col in range(0, size_x)] live = [[0 row in range(0, size_y)] col in range(0, size_x)] temp = [[0 row in range(0, size_y)] col in range(0, size_x)] # process , draw next frame def frame(): process() draw() root.after(100, frame) # load initial data def load(initial=0.5): y in range(0, size_y): x in range(0, size_x): if random.random()<initial: live[x][y] = 1 temp[x][y] = 0 # applying rules def process(): y in range(0, size_y): x in range(0, size_x): lives = live_neighbors(x,y) if live[x][y] == 1: if lives < 2 or lives > 3: temp[x][y] = 0

pdf generation - iText: Word document has multiple columns -

i found following issues itext pdf conversion: - if word file has multiple columns, itext produces pdf 1 column. - if word file has multiple lines of text next picture, first line of text displayed next picture. other lines of text displayed within picture. these seem bugs in itext. there way fix these issues or workaround around them? regards,

join - MySQL - Select in same table -

i need use mysql show users (a) not follow b, (a) followed b. gonna used suggest connections on social media website. my table structure: id followed follower i've tried use left join or not exists , didn't work. @drapp shows me how user left join on query. works. now, how add users information on query ( left join + inner join ). inner join need follow table , user table ( inner join users on follow.follower = user.id ) users`s table structure: id name given scenario of sample data of "yourtable" id follower followed 1 c 2 b c 3 b d 4 b e 5 c b 6 d the people followed "b" include "c", "d" , "e" users. that, user "c" follows "b". so, looking no match a/b, b/a type of combination. basis of left-join. clause querying records based on user "b" considering originating "follower". select

How could I Turn 2 arrays and 1 hash into single hash by Ruby? -

my question here, have 2 arrays , 1 hash, @key_array = %w(year entry amount) @nums = { "sales": [1000, 2000, 3000, 4000], "net_income": [20, 30, 50, 60], } @years = [2011, 2012, 2013, 2014] what turn 3 this [{"year"=>2011, "entry"=>:sales, "amount"=>1000}, {"year"=>2012, "entry"=>:sales, "amount"=>2000}, {"year"=>2013, "entry"=>:sales, "amount"=>3000}, {"year"=>2014, "entry"=>:sales, "amount"=>4000}, {"year"=>2011, "entry"=>:net_income, "amount"=>20}, {"year"=>2012, "entry"=>:net_income, "amount"=>30}, {"year"=>2013, "entry"=>:net_income, "amount"=>50}, {"year"=>2014, "entry"=>:net_income, "amount"=>60}] so far, have tried ruby code.

javascript - update a model in a ng-repeat inside another -

i having first ng-repeat looping on data , ng-repeat looping on other data . added ng-change in inner ng-repeat loops on data fill select element "options/values" , ng-change must listen changes in select element , calls function everytime value gets changed dose not happen . here html code <tr ng-repeat="memo in memos" class="no-animate"> <td class="text-center">{{memo.memostatus | localize:'ar'}}</td> <td class="text-center"> {{memo.memorequireddate | date: 'yyyy-mm-dd'}} <p ng-hide="memo.memorequireddate">----</p> </td> <td class="text-center"> <select ng-model="newinfo.selectedconsultantindex" ng-change="updateconsultant(memo.ca

python - how to iterate through xml data to remove next duplicate element using lxml -

i struggling come simple solution iterates on xml data remove next element if dplicate of actual one. example: from "input": <root> <b attrib1="abc" attrib2="def"> <c>data1</c> </b> <b attrib1="abc" attrib2="def"> <c>data2</c> </b> <b attrib1="uvw" attrib2="xyz"> <c>data3</c> </b> <b attrib1="abc" attrib2="def"> <c>data4</c> </b> <b attrib1="abc" attrib2="def"> <c>data5</c> </b> <b attrib1="abc" attrib2="def"> <c>data6</c> </b> </root> i "output": <root> <b attrib1="abc" attrib2="def"> <c>data1</c> </b> <b attrib1=&

export - How to save data library to csv file. -

so have been trying upload data got json library using api key csv file may manipulate in excel. whenever enter command following error.what doing incorrectly? >>> open("output_data.csv","w") out_file: ... in range(len(name)): ... print ... traceback (most recent call last): file "<stdin>", line 1, in <module> ioerror: [errno 13] permission denied: 'output_data.csv' >>>

javascript - Repartition of points in an ellipsoid PointCloud with Three.js -

i have started experiment three.js. tried create ellipsoid cloud of particles using pointcloud object. i generate random points using parametric equation of ellipsoid so: var vertex = new three.vector3(); u = math.random() * 2 * math.pi; v = math.random() * math.pi; vertex.x = math.random() * * math.cos(u) * math.sin(v); vertex.y = math.random() * b * math.sin(u) * math.sin(v); vertex.z = math.random() * c * math.cos(v); but when render cloud, notice unusual amount of particles agglomerate around ellipsoid's axes. i wondering if linked distribution of math.random() function or missing ? please me understand this. you can have @ here , made screenshot in case doesn't same on browser. edit: code modified kindly suggested @severin-pappadeux in order avoid incorrectly distributed points, problem remains. edit: modified part use math.random() set length of vertices, was: vertex.x = math.random() * * wx; vertex.y = math.random() * b * w

initialization - Eclipse Initializing Quick Diff Error -

i using eclipse version 3.5.2 when trying open eclipse, error occuring @ start , says: "an internal error occured during: "initializing quick diff". when changed workspace working when try open eclipse default workspace in codes exist giving error again. how can handle ? 1-i unbinded ctrl+3 key. (you can see details log below) 2-i unchecked quick diff enable preferences here detailed log: !session 2015-08-19 16:23:54.864 ----------------------------------------------- eclipse.buildid=unknown java.version=1.7.0_51 java.vendor=oracle corporation bootloader constants: os=win32, arch=x86, ws=win32, nl=en_us command-line arguments: -os win32 -ws win32 -arch x86 !entry org.eclipse.osgi 2 1 2015-08-19 16:24:05.490 !message nls missing message: jesinputdialog_dialogtitle in: com.gt.decent.zos.uiresources !entry org.eclipse.ui 4 4 2015-08-19 16:24:05.553 !message plug-in 'com.metrixware.cobos' contributed invalid menu extension (path: 'cobos.menu/

How to store data permnanently in angularjs -

i find whenever refresh page, angular rebuild whole module. there way store data permanently. cookie service way? you can use local storage this: localstorage.setitem('variable', 'stored value'); alert(localstorage['variable']);

SQL Server - Selecting periods without changes in data -

what trying select periods of time rest of data in table stable based on 1 column , check there change in second column value in period. table: create table #stable_periods ( [date] date, [car_reg] nvarchar(10), [internal_damages] int, [external_damages] int ) insert #stable_periods values ('2015-08-19', 'abc123', 10, 10), ('2015-08-18', 'abc123', 9, 10), ('2015-08-17', 'abc123', 8, 9), ('2015-08-16', 'abc123', 9, 9), ('2015-08-15', 'abc123', 10, 10), ('2015-08-14', 'abc123', 10, 10), ('2015-08-19', 'abc456', 5, 3), ('2015-08-18', 'abc456', 5, 4), ('2015-08-17', 'abc456', 8, 4), ('2015-08-16', 'abc456', 9, 4), ('2015-08-15', 'abc456', 10, 10), ('2015-01-01', 'abc123', 1, 1),

java - Expected an array of objects but got an object in an object -

in project i'm working on got angular exception: error: [$resource:badcfg] error in resource configuration. expected response contain array got object? in search find solution entered url of web service directly browser , surprisingly did not receive array expected. the web service class: @path("/menu") public class menuhandler { @get @path("/cls") @produces(mediatype.application_json) public list<clazz> getclss() { clazz clazz = new clazz(); clazz.setfoo("foo"); clazz.setbar("bar"); arraylist<clazz> clazzes = new arraylist<>(); clazzes.add(clazz); return clazzes; } } when enter url http://localhost:8080/myproject/rest/menu/cls expect see json array json objects: [ {"foo": "foo", "bar": "bar"} ] but instead, receive json object property json object expecting without array: { "clazz":

mysql - WSO2 identity server: phone fields using SCIM don't accept numbers -

i'm using wso2 identity server version 5.0.0 user store on mysql. when try insert user phone numbers, phone number not stored. curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyname":"rossi","givenname":"mario"},"username":"rossiusr","password":"rossipsw","emails":"rossim@aaaa.it" ,"phonenumbers":[{"value":"8811","type":"work"},{"value":"3473344555","type":"mobile"}]}" --header "content-type:application/json" https://localhost:9443/wso2/scim/users the result is: connection #0 host localhost left intact {"id":"f6ce5310-a2ee-4976-9579-0299029183bb","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyname":"rossi","givenname":"mario"},"

java - Eclipse wizard closes after pressing Enter key -

i've created eclipse wizard. works fine except wizard closes if hit enter key. i tried handle traverselistener , didn't work. i tried swt.traverse_return , didn't work. new traverselistener() { @override public void keytraversed(traverseevent event) { if(event.keycode == swt.cr){ /** */ event.doit = false; } } }; the plugin written in java 1.7 in eclipse mars. what best practice handle issues this? add traverse listener dialog shell , use swt.traverse_return getshell().addtraverselistener(new traverselistener() { @override public void keytraversed(traverseevent event) { if (event.detail == swt.traverse_return) { event.doit = false; } } });

Jenkins jobs on slave servers -

i have many jenkins jobs need run on every build, at present time have 4 slave servers. i jobs run in parallel as possible, hence defined jobs follow: execute concurrent builds if necessary - disabled restrict project can run - enabled following values salvelinux1ht||salvelinux2ht||salvelinux3ht||salvelinux4ht to understanding if job , b triggered @ same time, 1 should use 1ht , other should use 2ht , can run in parallel however jenkins build job on 4 slaves , after it's finished build job b on 4 slaves this opposite of goal any ideas? thanks in advance you can use build flow plugin you can find both installation , configuration instructions of plugin @ above mentioned link. if want run jobs in parallel can use following scripts: parallel ( // job , b scheduled in parallel. { build("joba") }, { build("jobb") } ) // jobc triggered after jobs , b completed build("jobc")

Endless loop in afterSave function in yii2 -

i have aftersave function in model, function executes, in endless loop. reason? function inserts data db, in multiple rows. thanks. my function: public function aftersave($insert) { $modelproject = projects::find() ->where(['status' => 2]) ->one(); $idproject = $modelproject->pid; $candidateforproject = new candidateforproject(); // $candidateforproject->id = 3; $candidateforproject->idproject = $idproject; $candidateforproject->idcandidate = $this->prid; $candidateforproject->idquestionnaire = $this->id; $candidateforproject->idstatus = 0; $candidateforproject->insert(); $answerone = questionsgrades::findone($this->answer1); $grade1 = $answerone->grade; $answertow = questionsgrades::findone($this->answer2); $grade2 = $answertow->grade; $answerthree = questionsgrades::findone($this->answer3); $grade3 = $answerthree->grade; $answerfour = qu

sql server - How can I append a column in SQL? -

i've tried different things in sql server 2012 append columns. concat merges columns this: catdogparrot whereas want in list like: cat dog parrot i've tried + in sql, giving me same result. saw '||' well, reason says wrong syntax @ second pipe. there way append column new one? or have create new column multiple columns? these columns in same table. suggestions advice appreciated, thanks! i'm not sure trying do, try use concat(' - ', `column1`, ' - ', `column2`, ' - ', ... `column999`)

java - RTT time not being shown android studio using asyncTask -

protected string doinbackground(pair<context,integer>... params){ // protected string doinbackground(pair<context, string>... params) { context = params[0].first; int name1 = params[0].second; httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://android- 996.appspot.com/hello"); // 10.0.2.2 localhost's ip address in android emulator try { string name= string.valueof(name1); // add name data request list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(1); namevaluepairs.add(new basicnamevaluepair("name", name)); httppost.setentity(new urlencodedformentity(namevaluepairs)); // execute http post request long starttime = system.currenttimemillis(); httpresponse response = httpclient.execute(httppost); if (response.getstatusline().getstatuscode() == 200) { return entityutils.tostring(r

go - Instance new Type (Golang) -

can tell me how create new instance of type string? reflect? there examples older (pre go 1 versions) of language [:(] so, if understand question correctly, asking how can create object when have name of type string. so, example, might have string "mystruct" , want create object of type. unfortunately, that's not possible because go statically typed language , linker eliminate dead code (or inline parts of it). so, there no guarantee, final executable contain code of "mystruct". you can however, maintain global map[string]reflect.type manually. example initializing map in init() function of packages defines such discover-able types. tell compiler using types. afterwards, can use map reflect.type of type want create , use reflect.new pointer new object of type (stored reflect.value). can extract object interface this: reflect.new(yourtype).elem().interface() elem() de-reference pointer , interface() return reflected value interface{}

sql - How to avoid datepart to start from new week on year change -

i have sql query using weekly data. works fine when year changes stops week on 4 days or whatever , starts new week new year. dont want that. want keep working like before. idea of how force group datepart(week, ad.xdate) select 'playing' activity ,min(ad.xdate) xdate ,isnull(sum(t.timeperday),0) timeperday alldates ad (nolock) left join @test t on ad.xdate = t.date group datepart(week, ad.xdate) order min(ad.xdate) option (maxrecursion 0) group datediff(week, 0, ad.xdate)

python - Pygame colliderect constant collisions? -

thanks blackjack, here's code suggestion. player image stays in top-left corne (0,0). image cycles through in runner array, pressing left or right not make player sprite move @ edge of background image, or move background image , blocks. import pygame, math math import * backimage = pygame.image.load("c:/users/jed/desktop/drawings/dsc_0001_cropped.jpg") camerax_offset = 0 cameray_offset = 0 screen = pygame.display.set_mode([700,700]) pygame.init() pygame.key.set_repeat(20, 20) #runner instances# runner = [] #lots of images disk add array currentrunner = 17 #end of runners!# freespeed = 5 #speed character moves @ edges of background jumping = false jumpingleft = true jumpvariable = 0 initialy = none class player(pygame.sprite.sprite): def __init__(self): self.image = runner[int(floor(currentrunner))] self.rect = self.image.get_rect() self.rect.topleft = (350, 500) def see_on_block(self): new_rect = self.rect.move(0,

ios - Xcode : Is there a way to search string in expressions defined in breakpoints? -

i followed tuto debugging in xcode. got rid of nslog instructions in favor of expressions defined in breakpoints automatic continuation . ex : expr (void)nslog(@"comments %@",data) after while, wanted search breakpoint printed specific string. i can't find way in xcode. possible ? there isn't great way ui. please file enhancement request http://bugreporter.apple.com kind of "find in breakpoint commands", seems useful thing do. can hack around searching log text in data file holds user breakpoints, in .xcodeproj directory in xcuserdata/.xcuserdatad/xcdebugger/breakpoints_v2.xcbkptlist. should considered read-only file, wouldn't try edit it...

c# - converting a list of string to integers starting at 0 to 1 to -

i wondering how convert these lists of unknowing strings list of integers, starting @ 0, 1, 2, , forth, , in collaboration of google sheets api. here circumstances: credits sheets api overview page google, have this foreach (spreadsheetentry entry in feed.entries) { // print title of spreadsheet screen console.writeline(entry.title.text); } now instead of wanting debug strings of retrieved list off of google spreadsheets, want convert values/integers, work chunk: spreadsheetentry spreadsheet2 = (spreadsheetentry)feed.entries[the solution code above]; thanks reading guys! :) for example lets imagine have want populate list<string> , list<int> or list<object> values , want avoid populating list using loop or foreach loop can following 1st example populate list dynamic empty string array {}` string[] bargearr = { }; var bargelist = new list<string> { "ticketid", "refno", "m

how to split the column in R? -

i want split same column in same way . wanted following bur not working propely. the code used t38kbat = read.table("test38kbat.txt", header = false) head(t38kbat) t38kbat <- separate (t38kbat, v2, c("sp", "id", "gene_organism"), \\"|") t38kbat <- separate (t38kbat, gene_organism, c("gene", "organism"), \\"_") t38kbat <- unite (t38kbat, sp, sp, id, sep = "|") while run script recieved error error: unexpected input in "t38kbat <- separate (t38kbat, v2, c("sp", "id", "gene_organism"), \" can guide me how resolve it. in base r, strsplit command operate on vector of form, produces list, have simplify further. in tidyr package, there's separate function preserve data frame nature of things. that's preferable use case. for example > library(tidyr) > <- data.frame(x=1:3, y=c("a|b|c", "b|c

Accessing docker host from (jenkins) docker container -

Image
i need run docker commands jenkins installed container on docker. local setup on osx , use boot2docker virtualize docker machine. i have installed jenkins on docker docker run -d -p 8080:8080 --name jenkins jenkins , running fine. on jenkins have installed "docker plugin" https://wiki.jenkins-ci.org/display/jenkins/docker+plugin needs docker url in order access docker api. when boot2docker starts following: docker_host=tcp://192.168.59.103:2376 , assume docker api running on host/por? on jenkins set docker url field http://192.168.59.103:2376 following error "shaded.org.apache.http.client.clientprotocolexception". it seems container cannot access boot2docker docker server. maybe i'm missing not able figure out correct ip/port have use. update: more details this when start boot2docker: bash-3.2$ unset dyld_library_path ; unset ld_library_path bash-3.2$ mkdir -p ~/.boot2docker bash-3.2$ if [ ! -f ~/.boot2docker/boot2docker.iso ]; cp /usr/loca

javascript - Should a callback be passed null or undefined when there is no error? -

i'm hoping simple question. accepted best practice callbacks? option 1: function (id, callback) { var topic = find(id); var err = new error('sorry, ' + id + ' not valid id.'); err.status = 404; return (topic) ? callback(null, topic) : callback(err); } option 2: function (id, callback) { var topic = find(id); var err = new error('sorry, ' + id + ' not valid id.'); err.status = 404; return (topic) ? callback(undefined, topic) : callback(err); } side note, find() returns undefined , not null . thanks in advance. i node built-in api functions do. a trivial experiment tells me that: open passes null err on success. open passes null data parameter on failure. a couple of other points: your code constructing error object, if things worked. wouldn't that, it's pointless. your code returning result of calling callback. that's unusual. your code calling callback synch

ruby - String interpolation update after change -

i have values in interpolated string refer array this: attr_accessor :s, :gamespace def initialize @s = [1,2,3] @gamespace = "#{@s[0]} | #{@s[1]} | #{@s[2]} " end when change value of @s , doesn't update value of @gamespace . i resorted making additional method this: def gamespace @gamespace = "#{@s[0]} | #{@s[1]} | #{@s[2]}" end and call after change @s . is there way let attr_accessor update string interpolation after change without writing method? a reader method refers instance variable, doesn't re-evaluate it. if want use reader method updated value, thing can not use default setter method, write own. def s= @s = @gamespace = "#{a[0]} | #{a[1]} | #{a[2]} " end setting @a should not done directly, should done through s= . applies initialize well: def initialize; s=([1, 2, 3]) end

python - Return is always giving me the same value -

my return value printing out total of 20 regardless of cards in user_hand. reason why? suits = ["heart", "diamond", "spade", "club"] ranks = ['a', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'j', 'q', 'k'] deck = [(suit, rank) rank in ranks suit in suits] random.shuffle(deck,random.random) user_hand = [] dealer_hand = [] user_hand.append(deck.pop()) dealer_hand.append(deck.pop()) user_hand.append(deck.pop()) dealer_hand.append(deck.pop()) def handtotal (hand): total = 0 rank in hand: if rank == "j" or "q" or "k": total += 10 elif rank == 'a' , total < 11: total += 11 elif rank == 'a' , total >= 11: total += 1 elif rank == '2': total += 2 elif rank == '3':

c - Why sizes of an array and a pointer to a first element are different? -

kernighan & ritchie 2nd ed. says: the correspondence between indexing , pointer arithmetic close. definition, value of variable or expression of type array address of element 0 of array. after assignment pa = &a[0]; pa , a have identical values. since name of array synonym location of initial element, assignment pa=&a[0] can written as pa = a; if a , pa identical, why code: #include <stdio.h> int main() { char a[] = "hello"; char *pa = a; printf("array: %ld\n", sizeof(a)); printf("pointer: %ld\n", sizeof(pa)); } outputs this: array: 6 pointer: 8 reference authoritative source appreciated. two objects can have same address sizes can different. from c standard (6.5.3.4 sizeof , alignof operators) 2 sizeof operator yields size (in bytes) of operand, may expression or parenthesized name of type. the size determined type of operand .... consider following example #

ios - Swift Using NSFetchedResultsController to update TableView -

i have nsfetchedresultscontroller populating tableview . tableview using custom cells. when search getting correct results tableview isn't getting updated, ideas? func controller( controller: nsfetchedresultscontroller, didchangeobject anobject: anyobject, atindexpath indexpath: nsindexpath?, forchangetype type: nsfetchedresultschangetype, newindexpath: nsindexpath?) { switch type { case nsfetchedresultschangetype.insert: if let insertindexpath = newindexpath { self.tbljobs.insertrowsatindexpaths([insertindexpath], withrowanimation: uitableviewrowanimation.fade) } case nsfetchedresultschangetype.delete: if let deleteindexpath = indexpath { self.tbljobs.deleterowsatindexpaths([deleteindexpath], withrowanimation: uitableviewrowanimation.fade) } case nsfetchedresultschangetype.update: // note update, update row @ __indexpath__

c++ - How can I initialize the default value of a CArray<CClass*> function parameter with an empty CArray? -

i know better std::vector , application messing with, has bunch of carray parameters on lot of related functions ... , not change them @ moment! i want define empty carray<cclass*> — array of pointers cclass , problem can not be on cclass constructor — default value of function parameter. approach 1 if try assignment operator , default constructor : void function(carray<cclass*> parameter = carray<cclass*>()); i error: 1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(262): error c2248: 'cobject::cobject' : cannot access private member declared in class 'cobject' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(535) : see declaration of 'cobject::cobject' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(510) : see declaration of 'cobject' 1> diagnostic occurred in compiler generated fu

float data[] = new float[j]; why isn't this valid in java ? Cant we have an array in float type? -

when compile error solution.java:13: error: possible loss of precision float data[] = new float[j]; ^ required: int found: float got in following code import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class solution { public static void main(string[] args) { scanner in = new scanner(system.in); float sum =0; float j = in.nextfloat(); float data[] = new float[j]; for(int i=0;i<j;++i) { float m = in.nextfloat(); data[i] = m; } for(int k =0; k<j;++k) { sum += data[k]; } system.out.println(sum); } } may wrong, new learner please bear noobness. the index of array must int. can't have array 17.54 elements. if wish length of array determined value of float variable, can cast int (assuming j not large) : float data[] =

virtual - ICMP replies seen by tcpdump but ping 100% fails -

i have virtual interface (oip1) configured has valid ip config. when try ping address on internet oip1, can see icmp echo requests/replies on tcpdump, ping still reports 100% failing. root@openair-pc:~/openair4g# ifconfig oip1 oip1 link encap:ampr net/rom hwaddr inet addr:192.188.0.2 bcast:192.188.0.255 mask:255.255.255.0 broadcast running noarp multicast mtu:1500 metric:1 rx packets:10 errors:0 dropped:0 overruns:0 frame:0 tx packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 rx bytes:840 (840.0 b) tx bytes:840 (840.0 b) i've created new table "lte": root@openair-pc:~/openair4g# ip rule show 0: lookup local 32743: fwmark 0x1 lookup lte 32766: lookup main 32767: lookup default thus, i'm marking packets to/from oip1 address: root@openair-pc:~/openair4g# iptables -t mangle -l chain prerouting (policy accept) target prot opt source destination

Same Java, but java.lang.ClassFormatError: app.CardNumberHashCalculator -

i have 1.6.0_45 jdk , remote server has too. checked, class has major 50 version. why error occurs? java.lang.classformaterror: app.cardnumberhashcalculator (unrecognized class file version) @ java.lang.vmclassloader.defineclass(libgcj.so.7rh) @ java.lang.classloader.defineclass(libgcj.so.7rh) @ java.security.secureclassloader.defineclass(libgcj.so.7rh) @ java.net.urlclassloader.findclass(libgcj.so.7rh) @ java.lang.classloader.loadclass(libgcj.so.7rh) @ java.lang.classloader.loadclass(libgcj.so.7rh) @ gnu.java.lang.mainthread.run(libgcj.so.7rh)

Ctrl Left click in Android Studio shows multi declaration of same variable with @+ -

in android studio 1.3.1 , before that, noticed ctrl+left_click in java code r.id.myet takes me location attribute located in xml file. gives more 1 choice, particularly when there edittext has @+id/myet , same id used in edittext attribute android:nextfocusforward="@+id/myet one listing each @+, when remove "+" nextfocusforward attribute take me @+/myet, break nextfocusforward functionality. how can nextfocusforward work without having add "+", or android studio take me view myet , not view nextfocusforward attribute set @+id/myet?

ios - AVAnimator Assertion failure in -[AVMvidFrameDecoder advanceToFrame:] 'framebuffer num bytes' -

i have dolwoaded latest code github avanimator library. added folders avanimator , lzmasdk in addition autopropertyrelease.h , autopropertyrelease.m. i using following code play video alpha channel (adopted form avanimator app examples): cgrect iphoneexplosionrect = cgrectmake(0, -2, 640/2, 480/2); cgrect ipadexplosionrect = cgrectmake(0, -5, 840, 630); nsstring *rgbresourcename = @"explosionadjusted_rgb_crf_30_24bpp.m4v"; nsstring *alpharesourcename = @"explosionadjusted_alpha_crf_30_24bpp.m4v"; // output filename nsstring *tmpfilename; nsstring *tmppath; tmpfilename = @"explosion.mvid"; tmppath = [avfileutil gettmpdirpath:tmpfilename]; // set true decode h.264 bool alwaysdecode = false; if (alwaysdecode && [avfileutil fileexists:tmppath]) { bool worked = [[nsfilemanager defaultmanager] removeitematpath:tmppath error:nil]; nsassert(worked, @"could not remove file %@", tmppath); } // loader join 2 h.264 videos sing

ios - UIScrollView _delegateScrollViewAnimationEnded crash -

i'm seeing crash in uiscrollview because delegate released memory before scrollview has finished animation. i know cause, , solution should manually nil out delegate of uiscrollview when delegate hits own dealloc call. i've done every viewcontroller can find has uiscrollview subview, crash still persists. know root cause uiscrollview's delegate assign instead of weak, , i'm curious if can override somehow (through category?). is there solution? here's dump of crash, find curious 1 of calls on stack references uitextview (which inherits uiscrollview), offer clue location of offending uiscrollview? crashed: com.apple.main-thread exc_bad_access kern_invalid_address @ 0xc1a9e521 0 libobjc.a.dylib objc_msgsend + 5 respondstoselector: 1 uikit -[uiscrollview(uiscrollviewinternal) _delegatescrollviewanimationended] + 52 2 uikit -[uiscrollview(uiscrollviewinternal) _scrollviewanimationended:finished:] + 184 3 uikit -[uitextview _scrollviewanimationended:finish

node.js - Checking to see if a RethinkDB shard is in use? -

i wondering if there way check see if rethinkdb shard in use before performing reql query on it. i calling 2 functions back, first creating rethinkdb table , inserting data, second read data newly created table. works okay if data being inserted minimal, once size of data set being inserted increases, start getting: unhandled rejection rqlruntimeerror: cannot perform write: primary replica shard ["", +inf) not available this because primary shard still doing write previous function. guess wondering if there rethinkdb specific way of avoiding or if need emit/listen events or something? you can use wait command this. docs: wait table or tables in database ready. table may temporarily unavailable after creation, rebalancing or reconfiguring. wait command blocks until given table (or database) date. http://rethinkdb.com/api/javascript/wait/

java - why isn't my program displaying february 2016 and following months correctly? -

i trying create simple calendar android. supposed show 1 month @ time , list associated events according selected day. stuck on implementation of calendar ui since doesn't list february 2016 , following months correctly. instead of 29 days lists 28 , listing of february starts on sunday instead of monday. can please take @ program , me? i suspect error in following lines: // init temporary calendar monday, first day of displayed month calendar calx= getcalendar(year, month, 1); // week_of_year of first day of month int firstweek = calx.get(calendar.week_of_year); // set day_of_week monday cal.set(calendar.day_of_week, calendar.monday); // set week_of_year first week month part of cal.set(calendar.week_of_year, firstweek); i hope not offend posting complete program, unsure bug crawling........ drawable/circle_today.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"&g