Posts

Showing posts from July, 2012

datetime - GMT+ string convert to Date Java -

i trying convert string in format of "wed jun 01 00:00:00 gmt-400 2016" iso8601 "2016-06-01t00:00:00.000z". getting error "unparseable date". not sure doing wrong. dateformat startdate = new simpledateformat("eee mmm dd hh:mm:ss 'gmt'z yyyy", locale.us); startdate.settimezone(timezone.gettimezone("etc/utc")); simpledateformat formatter = new simpledateformat("yyyy-mm-dd't'hh:mm'z'", locale.us); formatter.settimezone(timezone.gettimezone("etc/utc")); date aparseddate = null; try { // give date in format aparseddate = (date) startdate.parse(inputdateasstring); system.out.println(aparseddate.tostring()); // convert date iso8601 string nowasiso = formatter.format(aparseddate); system.out.println("iso date = " + nowasiso); return nowasiso; } catch (parseexception e) { e.printstacktrace(

html - white space is displaying after we added tabs in page -

Image
before displaying 2 kinds of information in site1 1 below other. 1)product description 2)packaging now displaying information in site2 tabs . after displaying tabs. not displaying information in full width, can see white space displaying in right side of information. i want remove white space , display in site1 once click on tabs. .tabs{ display:inline-block; width:250px; height:45px; line-height:45px; cursor:pointer; background:orange; color:white; font-size:19px; text-align:center; } .tabs:hover{ text-decoration:underline; } .tabs.active{ cursor:default; } .tabs.active:hover{ text-decoration:none; } .tab-text{ display:none; width:90%; height:auto; padding:5%; } .tab-text.active{ display:block; } phtml <div id="tab-container"> <div class="tabs active&quo

ios - Meaning of Array Contents of Map Annotations -

i'm trying iron out bug in map app. i've added working code (1) determines number of annotations displayed on map , (2) builds nsset of annotations. when return array nsset , nslog contents of array, don't understand output. can me understand meaning of array output , how information relates latitude/longitude coordinates plotted when map generated? i'm using xcode 7.1 sample code: -(void)getanotationsinvisiblemaprectangle{ mkmaprect visiblemaprect = mapview.visiblemaprect; nsset *visibleannotations = [mapview annotationsinmaprect:visiblemaprect]; // print number of annotations nslog(@"number of annotations in rect: %lu", (unsigned long)visibleannotations.count); // return array nsset nsarray *annotationarray = [visibleannotations allobjects]; nslog(@"%@", annotationarray); } sample output when array logged: 2015-10-30 14:22:45.635 [17633:6301958] number of annotations in rect: 0 2015-10-30 14:22:45.635

dashboard - Kubernetes remove addons added by running deployAddons.sh on Ubuntu -

i've finished installing kubernetes on local ubuntu cluster. after installation i've run deployaddons.sh dashboard still not working. following error: no endpoints available service \"kubernetes-dashboard\" can please tell me how rollback deployaddons.sh or how can fix error. see there endpoints problem don't know configure those. 10x "no endpoints available" means pods dashboard not running in cluster. should able check on status of dashboard deployment see why aren't running: kubectl describe deployment kubernetes-dashboard --namespace=kube-system

linux - Grouping TXT files -

i've been trying group big list of txt files sub folders, each containing random 5 files. i.e. pick 5 random files, create new folder group x , , move them it. any appreciated. thanks. this straightforward: #!/bin/bash mkdir -p groupx in `seq 1 5`; files=($( ls *.txt )) ran=`expr $random % ${#files[@]}` echo moving "${files[$ran]}" folder groupx mv "${files[$ran]}" groupx done warning, no checking if there less 5 txt files in directory.

Character in C and Java -

i have been trying 1 thing in c : int main(){ char ch; printf("enter character"); scanf(" %c",&ch); printf("the entered character %c\n",ch); return 0; } everything seems fine if put 2 characters @ input takes out first character. example if enter "as" give me "a" in ch. why , can tell me want give error if enter more 1 character. how can that? thank in advance. and if possible same thing want in java. as far c concerned: please modify code in following way, compile , run it, , you'll see self-explanatory answer: no matter how many characters type after 1 another, accumulated in stdin buffer, first character gets read program @ time (or @ pass), because of %c format specifier , target variable ch . #include <stdio.h> int main(){ char ch; printf("eneter character:\n"); while(scanf(" %c",&ch) != eof){ printf("the entered character %c\n",c

php array_unique method "puts key into array" -

im going parse json array unique values. here problem array_unique function. example: $contract_types = [ "asset sale , purchase agreement", "asset sale , purchase agreement", "concession agreement" ]; and return array_unique($contract_types); gives me: [{ "0": "asset sale , purchase agreement", "2": "concession agreement" }] what i'm doing wrong? array_unique() preserves keys. php docs: note keys preserved. if wish reindex array has consecutive integer indexes, use array_values() : return array_values(array_unique($contract_types));

javascript - Using json file as data source for chart.js -

i attempting include json values in bar chart. have json logging console not sure how include in data property chart. here source json... {time: "2016-07-03t21:29:57.987z", temperature: 25.2, pressure: 98241, altitude: 259.98737254818553} thanks <!doctype html> <html> <head> <title>weatherpush</title> <script src="../dist/jquery.min.js"></script> <script src="../dist/chart.bundle.js"></script> <style> canvas { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } </style> </head> <body> <div id='d1' style="position:absolute; top:50px; left:0px; z-index:1"> <canvas id='canvas' width='250' height='500'> browser not support html5 canvas. </canvas> </div> <div id='d1&#

c# - Invalid Operation Exception in file saving -

i have code , don't know why pops error message : "invalid operation exception unhandled user code". this error comes out when press save button. the purpose of program save text 1 textbox in mytest.txt file , file textbox1. appreciate here. thank in advance. public mainpage() { this.initializecomponent(); } private void buttonsave_click(object sender, routedeventargs e) { string path = @"c:\users\geora\mytest.txt"; if(!file.exists(path)) { using (streamwriter sw = file.createtext(path)) { sw.writeline(textbox.text); } } } private void buttonshow_click(object sender, routedeventargs e) { string path = @"c:\users\geora\mytest.txt"; using (streamreader sr = file.opentext(path)) { string s = ""; s = sr.readline(); textbox1.text = s; }

Spring Web MVC Json - jackson key/name for array of objects (named array) -

how json, containing java objects, key identifier of array? have following in spring mvc 4.x. use jackson library marshal objects json. @requestmapping(value="dogs") public list<dog> getdogs(){ list<dog> list_dogs = new arraylist<dog>(); list_dogs.add(new dog("dog1",1)); list_dogs.add(new dog("dog2",2)); return list_dogs; } i following response: [{"name":"dog1","age":1},{"name":"dog2","age":2}] i have following: { "array": [{ "name": "dog1", "age": 1 }, { "name": "dog2", "age": 2 }] } how provide name array? ok, use map instead of list. @requestmapping(value="dogs") public map<string, list<dog>> getdogs(){ map<string, list<dog>> map = new hashmap<string, list&l

d3.js - Having trouble converting a D3 v3 Force Directed graph into D3 v4 library implementation? -

i've created first force directed graph using v3 library, i'm required create same graph using d3 version 4 library, methods have changed tremendously in v4, , i'm getting error @ force()/drag() methods of 3 not exist in v4. my graph based on following mockup - http://www.ourd3js.com/wordpress/?p=606 is there repository of samples have been created in v4 library of d3 someplace can take , learn few functions can replace particular chart? edit: my current code looks this, i'm not able convert completely, example, node links close text of links , nodes overlapping. <svg width="960" height="600"></svg> javascript code : var svg = d3.select("svg"), width = +svg.attr("width"), height = +svg.attr("height"); var graph = root; var w = window, d = document, e = d.documentelement, g = d.getelementsbytagname('body')[0], x = w.innerwidth || e.clientwidth || g.clientwidt

PowerShell: concatenate strings with variables after cmdlet -

i new powershell. have looked online answer, no avail. perhaps i'm phrasing question incorrectly. i find myself in situation have concatenate string variable after cmdlet. example, new-item $archive_path + "logfile.txt" -type file if try run this, powershell throws following error: new-item : positional parameter cannot found accepts argument '+'. am not concatenating string correctly? i'd not have declare variable before each cmdlet in (e.g., $logfile = $archive_path + "logfile.txt" , new-item $logfile -type file ). also, won't concatenating file path. you error because powershell parser sees $archive_path , + , , "logfile.txt" 3 separate parameter arguments, instead of 1 string. enclose string concatenation in parantheses () change order of evaluation: new-item ($archive_path + "logfile.txt") -type file or enclose variable in subexpression: new-item "$($archive_path)logfile.txt"

R: convert XML data to data frame -

for homework assignment attempting convert xml file data frame in r. have tried many different things, , have searched ideas on internet have been unsuccessful. here code far: library(xml) url <- 'http://www.ggobi.org/book/data/olive.xml' doc <- xmlparse(myurl) root <- xmlroot(doc) dataframe <- xmlsapply(xmltop, function(x) xmlsapply(x, xmlvalue)) data.frame(t(dataframe),row.names=null) the output giant vector of numbers. attempting organize data data frame, not know how adjust code obtain that. it may not verbose xml package xml2 doesn't have memory leaks , laser-focused on data extraction. use trimws really recent addition r core. library(xml2) pg <- read_xml("http://www.ggobi.org/book/data/olive.xml") # <record>s recs <- xml_find_all(pg, "//record") # extract , clean columns vals <- trimws(xml_text(recs)) # extract , clean (if needed) area names labs <- trimws(xml_attr(recs, "label")

ios - Camera Preview Not Fitting To UIView -

Image
i'm making camera , i've decided make sort of square instagram camera , iphone default camera. i'm encountering problem image doesn't fit uiview. below example of happening. uiview should covering red edges left , right. here code starts session... func reloadcamera() { cameraview.backgroundcolor = uicolor.clearcolor() capturesession = avcapturesession() capturesession!.sessionpreset = avcapturesessionpresethigh let backcamera = avcapturedevice.defaultdevicewithmediatype(avmediatypevideo) if (camera == false) { let videodevices = avcapturedevice.deviceswithmediatype(avmediatypevideo) device in videodevices { let device = device as! avcapturedevice if device.position == avcapturedeviceposition.front { capturedevice = device break } else { capturedevice = backcamera } } } else { capturedevice = avcapturede

angularjs - Routing.generate() module (FriendsofSymfony/FOSjsRouting Bundle) -

Image
i trying create multiple input tags-input field in angularjs, want add auto complete, on typing atleast 3 letters in input field, existing tag names in database appear suggestions in dropdown. here problem: using routing.generate() module of fosjsrouting bundle call controller action inside javascript code (the action in-turn returns following jsonresponse object): here controller code: /** * @route("/jsondata", options={"expose"=true}, name="my_route_to_json_data") */ public function tagsaction(request $request) { $em = $this->getdoctrine()->getmanager(); $query = $em->createquery( 'select t.text appbundle:tag t t.id > :id order t.id asc' )->setparameter('id', '0'); $tagsdata = $query->getscalarresult(); $response = new response(json_encode($tagsdata)); $response->headers->set('content-type', 'application/json');

java - How can I reset my variable? -

Image
how can set variable in 1 class, , change in another, , use changed variable in third class? i have variable currenttime of application class, meaning can used in activities: i made game, , whenever person loses, displays time played app: this works fine, have button on gameover activity. takes user main_menu start game again. thing is, want variable currenttime reset whenever oncreate method of main_menu. otherwise, time keeps on adding onto itself. for example, if play game 5 seconds , lose, my score five. click "play again!" , play 6 seconds, score should six. instead displays eleven . how stop app adding times, when want reset? need somehow call activitycount.java again, called @ start of app. how address issue? much, appreciate help! btw: if need more code or think me solve issue, feel free let me know, , try , post here! here think work, have know idea how... i'd tempted add constructor activity account class calls application class&

angularjs - Karma + requirejs: Karma not able to run my angular modules and controllers -

karma + angularjs + requirejs: karma not able run angular modules , controllers . when trying execute tests gives me error: " error: [ng:areq] argument 'democontroller' not function, got undefined" i pretty new angular , karma/requirejs test frameworks. found couple of posts online set karma+require angular project. followed steps mentioned here http://karma-runner.github.io/0.8/plus/requirejs.html http://monicalent.com/blog/2015/02/11/karma-tests-angular-js-require-j/ i referred couple of posts on stack overflow said may missing module in controller defined. after doing getting same error. think there missing in terms of either configuration or paths js files in karma.conf and/or test-main.js. here how project structure looks like angularforkarma lib angular.js angular.min.js require.js angular-mocks.js node_modules src main.js app.js controller democontroller.js test karma.conf test-main.js controller test.js package.json

html - Jumping to a specific PDF page in EDGE browser -

i'm linking directly pages within pdf document using #page=xx format. e.g. <a href="mydocument.pdf#page=12">link here</a> this works in chrome, firefox , ie, not in edge. there workaround this?

go - golang json marshal: how to omit empty nested struct -

go playground as shown in code above, 1 can use json:",omitempty" omit fields in struct appear in json. for example type colorgroup struct { id int `json:",omitempty"` name string colors []string } type total struct { colorgroup`json:",omitempty"` b string`json:",omitempty"` } group := total{ a: colorgroup{}, } in case, b won't show in json.marshal(group) however, if group := total{ b:"abc", } a still shows in json.marshal(group) {"a":{"name":"","colors":null},"b":"abc"} question how only {"b":"abc"} edit: after googling, here suggestion use pointer , in other words, turn total into type total struct { *colorgroup`json:",omitempty"` b string`json:",omitempty"` } from the documentation : struct values encode json objects. each exported struc

theos - Jailbreak app - Play a background music during phone call -

i'm in process of writing jailbreak iphone app play background music during call. is there way play sounds or music in background while on call person can hear too? wouldn't tweak? trying hooking music or messages app. %hook whaterveryouwanthere //enter code here %end

image processing - Difference between HomographyBasedEstimator and findHomography OpenCV -

i trying write program stitches images using surf detector , know difference between 2 homography estimator. understand findhomography uses ransac, homographybasedestimator using ransac too? if isn't, point me paper homographybasedestimator used? thanks in advance the main difference between both functions findhomography , name says, used find homography, , homographybasesestimator uses existing homographies calculate rotation of cameras. i mean, homographybasesestimator doesn't find homographies, use them computation of camera motion , other camera parameters such focal lengths , optical centers. i hope can you.

design - OOP accessing method from non-related class -

hello stackoverflowers, i have 5 classes, foo, bar, thud, grunt, zot. thud , grunt instances field of bar. foo instance field of thud. foo, thud , grunt prepare data view (mvvm pattern, view model). foo , zot datas or create them (the model) among other things, foo produce zot listed in grunt (added bar, access foo thud). need foo list of zot in grunt. if possible avoid going work (will serialize list) in grunt or bar class because not model. process start foo (adding new classes or stuff of course possible) public class bar { thud thud; grunt grunt; bar(zot zotinstance) { new thud(); new grunt(); grunt.zotlist.add(zotinstance); } } public class thud { foo foo; } public class grunt { list<zot> zotlist; public list<zot> getlist(); } public class foo { public zot makezots() {}; public void bringmezots() // way zotlist when method called. } i'm not sure explain in simplest way. tell me if explanation of problem needed.

java - Stopping a repeating Println in a while loop, BlueJ -

below code have far, calculator computer science class. problem having on second run of program system.out.print("would perform calculation? (y/n) "); runs twice instead of once. have turned in project, know why , how, in future programs, can fix it. i'll post rest of code below. i appreciate of help, credit "a" got on of you. thanks! /** * calculator multiple functions. * @author () * @version (version 2.1) */ import java.io.*; import java.util.scanner; public class calc { public static void main(string args[]) { scanner reader = new scanner(system.in); string cont = "", funct = ""; double fnum = 0, snum = 0, answer = 0; while(true) { system.out.print("would perform calculation? (y/n) "); cont = reader.nextline(); if (cont.equalsignorecase("y")) { system.out.println("what function do?"); system.out.println("+?");

javascript - Fix div from the bottom -

i want create section (like right section on facebook). section fixed bottom; far scroll, section scrolls. when reach bottom of section, becomes fixed , stays on screen. i think it's not possible pure css, maybe js.. do have solution making happen ? in advance, thanks. using bootstrap make easier. can achieve navbar-fixed-bottom <!doctype html> <html lang="en"> <head> <title>bootstrap case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> </head> <body

c# - Using namespace in Unity hides functionality -

using unity 5.4 beta hololens, setting class within namespace disables unityengine functionality. if declare class, works fine. if wrap inside namespace, classes don't see each other, within same namespace or using addition. making class monobehaviour, can drag , drop onto game object, if wrap class inside namespace, unity complains not mb or has issue cannot dragged. does have similar issue? asking before reporting bugs since 5.4 still beta. classes don't see each other because not importing them or accessing them through namespace . access in namespace, must import namespace or call namespace followed class name. check below both examples. class namespace: namespace myanamespace { public class { } } in order see class a , have import using keyword. using myanamespace; public class b : monobehaviour { a; // use initialization void start() { = new a(); } } another method access them directly through na

jquery - How to use AngularJS in remote Modal window -

i have 2 page, person.html , personnewedit.html in first 1 open second bootstrap modal window. problem: angularjs not work in second file (personnewedit.html). person.html content: <!doctype html> <html> <head> <title></title> <meta charset="utf-8" /> <link href="css/bootstrap.min.css" rel="stylesheet" /> <script src="js/angular.min.js"></script> <script src="js/jquery.js"></script> <script src="js/bootstrap.js"></script> </head> <body> <div ng-app="myapp" ng-controller="myappctrl"> <p>in main page msg: {{msg}}</p> <!-- modal window wll display here --> <div id="mymodal" class="modal fade" role="dialog"> </div> <button type="button" class="btn btn-default" onclick="newperson()&

javascript - WebGL + Three.js - Applying Custom Texture to .Obj Model -

i've pasted of code. basically, can't figure out how apply custom texture object. apply javascript code below, replacing meshlambertmaterial have no idea started. feel should no more few lines of code. need replace following: var material = new three.meshfacematerial(materials); var material2 = new three.meshlambertmaterial({ color: 0x33ffcc }); object.traverse( function(child) { if (child instanceof three.mesh) { // apply custom material child.material = material2; } }); ...with more this: var texture = new three.texture(); var loader = new three.imageloader(); loader.addeventlistener( 'load', function ( event ) { texture.image = event.content; texture.needsupdate = true; texture.magfilter = three.nearestfilter; texture.minfilter = three.nearestmipmaplinearfilter; } ); loader.load( '

java - Most efficient way of creating a List for an Android App -

as of in title, experimenting 2 different ways of creating arraylistview in android. the first 1 looks this: list.add(new obj("smth", "note: na, na, na", image[0])); list.add(new obj("smth", "note: na, na, na", image[1])); list.add(new obj("smth", "note: na, na, na", image[2])); and has support array images: private int[] images = { r.drawable.image1, r.drawable.image2, r.drawable.image3, ...} the other way uses getter , setter methods of obj.class. this: arraylist<obj> objects = new arraylist<>(); obj a=new obj(); a.setname("smth"); a.setnote("na,na,na"); a.setimage(r.drawable.image1); objects.add(a); a=new obj(); a.setname("smth"); a.setnote("na, na, na"); a.setimage(r.drawable.image2); objects.add(a); a=new obj(); a.setname("smth"); a.setnote("na,na,na&quo

Webdriver test - pushing data from the app (Javascript) to the test (Python) -

tl;dr: in webdriver test can pass data js code running in tested app test code (written in python)? situation: when application hits error state want pass basic details error (things like: stacktrace, error message, etc.) webdriver test code used, instance, in assertion messages, in test. one way add dummy, invisible, dom element , store data (say) element's text. however, seems kind of hackish. wondering whether there's webdriver api providing functionality along these lines: allowing app pass in <key,value> pairs allowing test lookup value key in sense followup webdriver test - pushing events/notification test question. main difference here looking webdriver api support polling test code, in previous question looking api support event passing.

c# - How to make button visible inside repeater? -

here have kept 2 button( btnhide , btnunhide ) , label inside repeater , have made button btnunhide invisible initially. want press button btnhide btnunhide invisible intially should visible . solution great help. html used <asp:repeater id="repeater1" runat="server" onitemcommand="repeater1_itemcommand" > <itemtemplate> <asp:label id="label1" runat="server" text="label"></asp:label> <asp:button id="btn" commandname="h" runat="server" text="hide" /> <asp:button id="btnhide" visible="false" runat="server" text="unhide" /> </itemtemplate> </asp:repeater> code behind protected void repeater1_itemcommand(object source, repeatercommandeventargs e) { if (e.commandname == "h") { } } you c

wso2is - Is it possible to use username without domain for authentication in WSO2 -

i created tenant name mycompany.com. within tenant, registered service provider name sp. after integrating application wso2, apps create saml authn request <?xml version="1.0" encoding="utf-8"?> <saml2p:authnrequest assertionconsumerserviceurl="https://localhost:8443/myapp/auth/sso" destination="https://localhost:9443/samlsso" forceauthn="false" id="a2i70af753i64cce4ehj977h3h9085h" ispassive="false" issueinstant="2016-03-30t02:51:12.083z" protocolbinding="urn:oasis:names:tc:saml:2.0:bindings:http-post" version="2.0" xmlns:saml2p="urn:oasis:names:tc:saml:2.0:protocol"> <saml2:issuer xmlns:saml2="urn:oasis:names:tc:saml:2.0:assertion">sp@mycompany.com</saml2:issuer> <saml2p:nameidpolicy allowcreate="true" format="urn:oasis:names:tc:saml:2.0:nameid-format:persistent" spnamequalifier="

r - t.test for two variables using rollapply in a data.table -

i'm trying run 2 sample t-test t.test 7 days rollying window samples coming 2 seperate columns (sample1 , sample2). obtain p-values each test , add them current data, starting day 1. have try rollapply in several forms no success. # stackoverflow question library(data.table) library(zoo) # create data start = as.date("2014-01-01") end = as.date("2014-12-31") dat <- data.table(date = seq(start, end, = "1 day"), sample1 = sample(1:20, 365, replace = true), sample2 = sample(1:30, 365, replace = true)) # use rollapply fun = t.test dat[, pvalue := rollapply(c(sample1, sample2), 7, fun=t.test, alternative="less", conf.level=0.95, by.column = false, partial = t, fill=na, align='left')$p.value] i following error: # error in t.test.default(data[replace(posns, !ix, 0)], ...) : # not enough 'x' observations second try: # use rollaply more specific fun dat[, pvalue := rollapply(da

owl - Protege inconsistent ontologies warning -

followed intro youtube.com/playlist?list=plea0wjq13cnafcc0azrcyqucn_tpeljn1 create ontology. little reduced http://prntscr.com/bo4l3w , added canbetutor (meaning can become tutor somebody) object property on own. far understand, can add swrl rules , launch reasoner create new knowledge. added prntscr.com/bo4lk7 . started hermit reasoner prntscr.com/bo4lqx . obtained inconsistent ontologies warning prntscr.com/bo4lu0 . clicked explain button , got following explanation http://prntscr.com/bo4lyg . onto here synoparser.ru/onto/protege.owl 1. please tell mean? 2. general understanding. read reasoner can create new knowledge. mean relations, or individuals , classes? 3. can find readoner added knowledge in protege 5 ? the explanation in 1 of figures provided explains inconsistency. ontology says that the classes student , lecturer , disjoint (that is, no individual can both student , lecturer) the domain of studies student, means if x studies y, x student the domain

osx - Taking filename input using a mac automator python script -

first off want new python , mac os, program using c++ , using windows. what trying create drag , drop application plots data in file using python/matplotlib. have created run shell script (shell: /usr/bin/python) app using mac automator , script runs expected if hard code file path. however, change script runs dragging file onto app. code far: #!/usr/bin/python import sys import matplotlib.pyplot plt # code example online how create main in c++ if __name == "__main__": main() def main(input, *args, **kwargs): # if hardcode file name filename = '/usr/path/to/file/test.txt' # if try take filename argument dragging/dropping filename = sys.argv[1:] open(filename) f: # code read file , plot the error automator giving me: run shell script failed - 1 error file "<string>", line 13 i trying avoid installing external software, managers request, hence why trying use installed automator. need add commands in autom

c# - List<CustomClass> sent as List<T>; how to get the properties? -

i have piece of code public class ticket { public string strarticleid { get; set; } public string strarticledescription { get; set; } public decimal decarticleprice { get; set; } public decimal decarticlevat { get; set; } public decimal decarticulenetprice { get; set; } public decimal decarticlediscount { get; set; } public decimal decarticlequantity { get; set; } } public static list<ticket> _lstcurrentticket = new list<ticket>(); that want send external dll lines in _lstcurrentticket print ticket through for (int = 0; < datagridview1.rows.count; i++) { ticket ticket = new ticket(); string strrefid = this.datagridview1.rows[i].cells[0].value.tostring(); string strdescription = this.datagridview1.rows[i].cells[1].value.tostring(); decimal decquantity = (decimal)this.datagridview1.rows[i].cells[2].value; decimal decuprice = (

unity3d - Moving something rotated on a custom pivot Unity -

i've created arm custom pivot in unity supposed point wherever mouse pointing, regardless of orientation of player. now, arm looks weird when pointed side opposite 1 drawn at, use spriterenderer.flipy = true flip sprite , make normal. have weapon @ end of arm, fine well. problem have "firepoint" @ end of barrel of weapon, , when sprite gets flipped position of doesn't change, affects particles , shooting position. essentially, has happen y position of firepoint needs become negative, unity seems think want position change global, whereas want local can work whatever rotation arm at. i've attempted this: if (rotz > 40 || rotz < -40) { rend.flipy = true; firepoint.position = new vector3(firepoint.position.x, firepoint.position.y * -1, firepoint.position.z); } else { rend.flipy = false; firepoint.position = new vector3(firepoint.position.x, firepoint.position.y * -1, firepoint.position.z); } but works on global basis rather local 1 need