Posts

Showing posts from February, 2010

entity framework - Add multiple records to one record -

Image
i think should pretty standard requirement, i'm struggling ( load values via junctions table ) on how display on data-grid sufficiently. suspect maybe data design not done properly, that's why got stuck here. i have item table, every item have multiple groups, in data-grid need display group names assigned item in list.

What Type does Powershells `Get-Member` show -

i use powershell write database exporter. i have datarow s, serialized via export-clixml 'data.xml' . these datarows have column value . i read first row via $row = (import-clixml 'data.xml')[0] . if check it's type, via $row.value -is [system.management.automation.pscustomobject] true if use get-member on value, $row.value | get-member , output typename: deserialized.system.dbnull i kind of expected system.management.automation.pscustomobject . where type get-member shows me come from? if @ $row.value.psobject.typenames you'll see deserialized.system.dbnull first in list. also see this answer keith hill , msdn on typenames property .

swift - MPMusicPlayerController.play() not working after killing iOS music app -

i have app allows search title of song in music library , play it. play selected song using code: func playsongbypersistentid(id: int) { //id persistent id of chosen song let predicate = mpmediapropertypredicate(value: id, forproperty: mpmediaitempropertypersistentid) let songquery = mpmediaquery() songquery.addfilterpredicate(predicate) if songquery.items?.count < 1 { print("could not find song") // make alert return } else { print("gonna play \(songquery.items?[0].title)") } musicplayer.preparetoplay() musicplayer.setqueuewithitemcollection(songquery.collections![0]) musicplayer.play() } the above function gets called in tableview(:didselectrowatindexpath) . have confirmed correct id , song title retrieved when song selected. here problem. if go app , select song play after killing ios music app , song not play. if choose different song , different song plays no problem. if choose same song

java - Dagger2: Using factory methods in place of public constructors -

i trying use public factory methods in place of public constructors dagger2. think missing connection in using dagger2. when use public constructors, example interfaces / classes follows: interface interfacea { void foo(); } class implements interfacea { @inject public a() {} @override public void foo() { system.out.println("foo"); } } interface interfaceb { void bar(); } class b implements interfaceb { private final interfacea depa; @inject public b(interfacea depinstance) { depa = depinstance; } @override public void bar() { system.out.println("bar"); depa.foo(); } } @module class mymodule { @provides interfacea providea(final provider<a> provider) { return a.create(provider); } @provides interfaceb provideb(b binstance) { return binstance; } } @component(modules=mymodule.class) interface mycomponent { interfacea provideint

migration - Django 1.8 Syncdb vs migrate -

i have created model , executed syncdb had created tables model designed. afterwards modified model , executed makemigrations created migrations ignoring tables syncdb had created. so ended error "relation exists". why did makemigrations created scratch? how fix situation ? makemigrations creates new migrations based on changes detected models. also, 1 thing note syncdb command deprecated since django 1.7 , removed in django 1.9. so, should use migrate command. from syncdb docs: deprecated since version 1.7: command has been deprecated in favor of migrate command , performs both old behavior executing migrations.

regex - Nginx configuration equivalent for Apache -

i convert nginx rules work apache : location ~ ^/video/([a-za-z0-9=\?]+)$ { rewrite ^/video/(.*)$ /video/ break; } location /video { ssi on; } location /http-bind { proxy_pass http://localhost:5280/http-bind; proxy_set_header x-forwarded-for $remote_addr; proxy_set_header host $http_host; } after research, have found : rewritecond %{request_uri} ^/meet/[a-za-z0-9]+$ rewriterule ^/meet/(.*)$ /meet/ [pt] proxypreservehost off <location "/meet/http-bind"> requestheader set host "localhost" proxypass http://localhost:5280/http-bind proxypassreverse http://localhost:5280/http-bind </location> but configuration doesn't work well... can me modify configuration ? thanks

animation - Safari not rendering images inside SVG with Adobe Edge Animate -

i made animation edge animate, , i'm using svgs images embedded inside (exported illustrator cs6). display without problem in chrome, firefox , microsoft edge in windows , mac computers. problem when open safari, images not rendered , vector part showing. how can solve edge animate? thanks! the problem present in safari , apparently in browser running on apple os. solved exporting pngs instead of svgs (they lighter, too!)

node.js - NodeJS & Socket.io : issue with function killed by other user calls -

hello need socket.io, in app, user needs connect socket.io server, server launches process , sends updates progress client. code looks : var myprocess = require( './myprocess.js' ); var websocket = require( './class.websocket.js' ); var w = new websocket(8080); w.on('connexion', function(socket){ console.log('new client connected'); (...) // client launch process socket.on('process', function () { processaction( socket); }); }); function processaction( socket ) { var f = new myprocess(); f.doprocess(function(percent){ // progress received, (100 calls during 2-3mins) socket.emit("onprogress", percent); },function(){ // process completed (only 1 call) socket.emit("oncomplete"); }); } it works great 1 user. problem when second user connects, function processaction() seems killed or overrided. second user receives progress, first 1 doesn&

php - How to get parameter from this url? -

normally working expected, while building login page not working want to. well url http://localhost/?page_id=96?msg=invalid_password_msg and trying make work this..but not working, happy every :) <?php if (isset($_get['msg'])) { ?> <div class="invallidpassword"><cite><?php echo $_get['msg']; ?></cite></div> <?php } ?> i think need correct question marks. lets have query page retrieves page content database. should following. http://localhost/query?page_id=96&msg=invalid_password_msg the first question mark added after requested page, , parameters separated &

lifetime - Why can't I store a value and a reference to that value in the same struct? -

i have value , want store value , reference inside value in own type: struct thing { count: u32, } struct combined<'a>(thing, &'a u32); fn make_combined<'a>() -> combined<'a> { let thing = thing { count: 42 }; combined(thing, &thing.count) } sometimes, have value , want store value , reference value in same structure: struct combined<'a>(thing, &'a thing); fn make_combined<'a>() -> combined<'a> { let thing = thing::new(); combined(thing, &thing) } sometimes, i'm not taking reference of value , same error: struct combined<'a>(parent, child<'a>); fn make_combined<'a>() -> combined<'a> { let parent = parent::new(); let child = parent.child(); combined(parent, child) } in each of these cases, error 1 of values "does not live long enough". error mean? let's @ a simple implementat

algorithm - How to find the smallest gradient along the contour lines? -

Image
there 6 charges, 2 negative (yellow), , 4 positive (blue) confined plane shown below. i plotted equal potential lines. now, want draw several lines follow smallest potential gradient (black lines). these lines have properties such not touch positive charges, end @ negative charges. i did in matlab, , found point on black lines, if calculate potential distribution on line segment perpendicular tangent @ point, smallest potential achieved @ point. although possible found such points hand when there not many charges, , can connect them make black curves. wondering if there way automate process? when dealing different orientations, how choose 'right area' find smallest potential points? if @ whole domain, smallest potential points located faraway charges. thank time looking @ problem. please comment below if have thoughts. cheers, mike here plots: equal potential lines field line: equal potential lines boundaries: here codes. [x, y] = meshgrid(0:.1:20

oop - prevent session initialization in incomplete php object -

i'm using mvc pattren , start sessions in construct of controller class . class (expect core's one) loaded spl_autoload_register(). create ajax class that's subclass of controller in order prevent user executing multiple ajax request in short interval of time use following code class ajax extends controller { public function __construct() { parent::__construct(false); if ($this->checkattempts()) exit(); } public function checkattempts() { $counter = 0; $attempts = session::get(ajax); $attempts = ($attempts === false) ? [] : $attempts; if ($attempts === false) session::set(ajax, []); else $this->setattempt(); foreach ($attempts $key => $attempt) { if (time() - intval($attempt) <= 10) $counter++; else session::destroyarray(ajax, $key); } return $counter >

wpf - c# - 'an unhandled exception of type 'System.NullReferenceException' -

this question has answer here: what nullreferenceexception, , how fix it? 32 answers i'm newbie in mvvm, have model.cs contains few property of 'id' , 'positionname' , got view.cs contains datagrid selecteditems={binding items} , itemsource={binding position} , button command={binding showedits} after clicking encountered nullreference error @ 'items.positionname == null '. here's code. viewmodel.cs class positionvm : inotifypropertychanged { private observablecollection<positionmodel> _position; private positionmodel _items; private icommand _showedits; public observablecollection<positionmodel> position { { return _position; } set { _position = value; notifyproperty("position"); } } public positio

asp.net mvc - How to remove error about glyphicons-halflings-regular.woff2 not found -

Image
asp.net mvc4 bootstrap 3 application running microsoft visual studio express 2013 web ide. chrome console shows error http://localhost:52216/admin/fonts/glyphicons-halflings-regular.woff2 failed load resource: server responded status of 404 (not found) this file exists in fonts directory in solution explorer. build action set "content" , copy output directory "do not copy in other font files". bootstrap 3 added solution using nuget. how fix error not occur? application shows glyphicon , fontawesome icons properly. error occurs @ application startup. this problem happens because iis not know woff , woff2 file mime types. solution 1: add lines in web.config project: <system.webserver> ... </modules> <staticcontent> <remove fileextension=".woff" /> <mimemap fileextension=".woff" mimetype="application/x-font-woff" /> <remove fileextension="

linux - PowerMTA Server Not starting -

i have installed powermta server on centos 6 , every prerequisite installed according document , license entered in correctly configuration file correctly setup in /etc/pmta/config unable start pmta service , getting error in logs, 2015-08-30 16:08:28 domain suffix: pmta.com 2015-08-30 16:08:28 name servers: x.x.x.x x.x.x.x 2015-08-30 16:08:28 smtp source ip addresses: 2015-08-30 16:08:28 virtual mta "{default}": (any local) 2015-08-30 16:08:28 domain keys: 2015-08-30 16:08:28 os: linux 2.6.32-573.3.1.el6.x86_64 (centos release 6.7(final)) 2015-08-30 16:08:28 glibc v2.12 (stable), nptl 2.12 2015-08-30 16:08:28 openssl 1.0.0d 8 feb 2011 2015-08-30 16:08:28 8/8 cpus (x86_64; intel xeon cpu x3440 @ 2.53ghz) 2015-08-30 16:08:28 16128 mb memory detected 2015-08-30 16:08:28 priority nice range: min. 15, max. 0 2015-08-30 16:08:28 use of realtime priorities disabled 2015-08-30 16:08:28 max. opened files: 4096, max. threads: infinite 2015-08-30 16:08:28 max. virtual memo

python - Elegant way to complete a parallel operation on two arrays of unequal lengths -

i want write function in numba runs math operation on 2 arrays, , accommodate when both arrays don't have same element count. so example: lets want function adds each element of array a elements of array b these 3 possible scenarios: 1) both a , b have same number of items, c[ii]=a[ii]+b[ii] 2) a has more items b : c[ii]=a[ii]+b[ii] until b 's upper limit, , complete c[ii]=a[ii]+b[-1] 3) a has fewer items b : c[ii]=a[ii]+b[ii] until a 's upper limit, , complete c[ii]=a[-1]+b[ii] for wrote code below, works fine , fast when dealing millions of values, can see 3 identical code blocks feel terribly wasteful. plus if/else running in loop feels terrible. from numba import jit, float64, int32 @jit(float64[:](float64[:], float64[:]), nopython=true) def add(a, b): # both shapes equal: add between a[i] , b[i] if a.shape[0] == b.shape[0]: c = np.empty(a.shape) in range(a.shape[0]): c[i] = a[i] + b[i] return c

java - Jdbctemplate query: EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0 -

i using jdbctemplate retrieve list of 'spittles' db. here method . private static final string sql_select_spittle = "select id, spitter_id, spittletext, postedtime spittle"; public list<spittle> getrecentspittles() { return jdbctemplate.query(sql_select_spittle, new rowmapper<spittle>() { public spittle maprow(resultset resultset, int i) throws sqlexception { spittle spittle = new spittle(); spittle.setid(resultset.getlong(1)); spittle.setspitter(getspitterbyid(resultset.getlong(2))); spittle.settext(resultset.getstring(3)); spittle.setwhen(resultset.getdate(4)); return spittle; } }); } here table database id spitter_id spittletext postedtime 1 0 hello 2015-08-24 2 4

How to run Node.js on esp8266 (Nodemcu dev board)? -

i trying connect apple homekit nodemcu board, found tutorial works on computer, wonder if there way load , run node.js on nodemcu board (esp8266)? i think you're confusing nodemcu, firmware esp8266 boards interprets language lua , javascript runtime node.js, runs on computers. so, answer cannot run node.js on esp8266.

docker - Kubernetes: how to use gitRepo volume? -

can give example of how use gitrepo type of volume in kubernetes ? the doc says it's plugin, not sure means. not find example anywhere , don't know proper syntax. especially there parameters pull specific branch, use credentials (username, password, or ssh key) etc... edit: going through kubernetes code figured far: - name: data gitrepo: repository: "git repo url" revision: "hash of commit use" but can't seen make work, , not sure how troubleshoot issue this sample application used: { "kind": "replicationcontroller", "apiversion": "v1", "metadata": { "name": "tess.io", "labels": { "name": "tess.io" } }, "spec": { "replicas": 3, "selector": { "name": "tess.io" }, "template": { "metadata": {

xaml - Selected Item Pivot for Windows Phone 8.1 -

i have problem selecting item pivot in windows phone 8.1. have commandbar makes navigation between pages belonging pivot, , have programmed change in onclick selecteditem of each button , display changes each page. when start application buttons, making debug selecteditem change made , no exception display not change page. strangest thing when navigate manually between pages navigation pivot , pressed button on commandbar pages work. problem happens when start application. it can happen ?, can solve ?, i'm little frustrated xd. here code of pivot , command bar: <pivot x:name="pivotmain" style="{staticresource pivotstylemain}" margin="0,0,-0.333,0" > <pivotitem x:name="pvtmenu" header="online" datacontext="{binding groups}"> <listview automationproperties.automationid="itemlistviewsection3" automationproperties.name="items i

r - Sum of squares are different for the same factor -

i executing anova model data , observed sum of squares (and mean squares, resp.) 1 of effects not equal in 1-way anova , 2-way anova. # df sum sq mean sq f value pr(>f) # b 2 18.1 9.047 0.736 0.485 # residuals 44 540.5 12.285 summary(aov(x~a,dat)) # df sum sq mean sq f value pr(>f) # 1 1.0 1.001 0.081 0.778 # residuals 45 557.6 12.392 summary(aov(x~a+b,dat)) # df sum sq mean sq f value pr(>f) # 1 1.0 1.001 0.080 0.779 # **b 2 20.1 10.027 0.802 0.455** # residuals 43 537.6 12.502 summary(aov(x~a*b,dat)) # df sum sq mean sq f value pr(>f) # 1 1.0 1.00 0.113 0.738815 # **b 2 20.1 10.03 1.129 0.333084** # a:b 2 173.6 86.78 9.773 0.000338 *** # residuals 41 364.0 8.88 as see b effect sum sq not equal throughout different anova models.

python - Want to get video times from page -

i doing coursera course work. need log times of each of videos watching. found scrapy , excited. logged course , have finished watching videos section. i tried opening scrapy shell: scrapy shell " https://class.coursera.org/regmods-030/lecture " then opened page in new tab firebug try , find html tags had times. found: <a blah > title (1:23) </a> , <div class="hidden"> title (1:23) . in shell after opened url, tried response.xpath('//div[@class="hidden"]') , got nothing. here spider code: import scrapy class dataspider(scrapy.spider): name = "data" allowed_domains = ["coursera.org"] start_urls = [ "https://class.coursera.org/regmods-030/lecture" ] def parse(self, response): sel in response.xpath('//ul/li'): item = dataitem() item['title'] = sel.xpath('a/text()').extract() item['link'] = sel.xpath('a/@href').extra

php - Doctrine shopping cart after add order: undefined index -

i program shopping cart in doctrine , nette framework. there additem method: (add session cart) public function additem($item) { $cart = $this->getcartsection(); $product = $this->product_facade->getproduct($item['voucher_id']); if (isset($cart->cart_items[$product->getid()])) { $cart->cart_items[$product->getid()]['amount'] += $item['amount']; } else { $cart->cart_items[$product->getid()] = array( 'voucher' => $product, 'amount' => $item['amount'] ); } } and there method add order db public function add($creator, $data) { $order = new orders(); $order->setprice($data['price']); $order->setstatus($this->status_facade->getstatus(self::new_status_id)); $order->setpayment($this->payment_facade->getpayment($data->payment)); $order->setdate(new datetime()); $order->se

jsf - How to define the content of repeater inside composite through its interface? -

i have composite component ui:repeat , want define content of ui:repeat through interface of composite. following code working in myfaces looks more hack since variable name varrepeat must known outside of composite , works if no other childrens provided should rendered somewhere else. view define content of ui:repeat <comp:myrepeater value="#{of:createintegerarray(1,5)}"> <h:outputtext id="varcomp" value="#{varrepeat}"/> </comp:myrepeater> composite myrepeater <composite:attribute name="value" type="java.lang.object"/> <composite:implementation> <ui:repeat var="varrepeat" value="#{cc.attrs.value}"> <composite:insertchildren/> </ui:repeat> </composite:implementation> that's best can given var attribute doesn't support el. make clear enduser, document name of var in <cc:interface shortdescription> and

calculated field - Php calculation is posting as 0 -

i having problem getting calculation post 0. other post has correct info form calculation not working. data comes inputs , calculation of total pallets works. total price. the whole form: if(!checkadmin()) { header("location: login.php"); exit(); } $page_limit = 10; // filter values foreach($_get $key => $value) { $get[$key] = filter($value); } foreach($_post $key => $value) { $post[$key] = filter($value); } $rs_all = mysql_query("select count(*) total_all users") or die(mysql_error()); list($all) = mysql_fetch_row($rs_all); ?> <?php $rs_pickup = mysql_query("select count(*) total_all pickups") or die(mysql_error()); list($pickup) = mysql_fetch_row($rs_pickup); ?> <?php $sql="select companyid, company company "; $result=mysql_query($sql) or die(mysql_error()); $options=""; while ($row=mysql_fetch_array($result)) { $id=$row["companyid"]; $thing=$row["company"];

rust - How can I concatenate something to the front of a string? -

i keep getting error "use of moved value". let mut s = "s".to_string(); s = s + &s; think + desugars to: s = s.add(&s); now add from add trait , this: fn add(self: string, rhs: &str) -> string; the use of self means taking ownership of string; can’t pass reference second argument, because isn’t yours more. you might think it’d ok doing this, it’s not; whole class unsound, constituting mutable aliasing—both mutable , immutable reference same thing existing @ same time. specific case, 1 way imagine going wrong if permitted if string pushing reallocate string; rhs conceivably pointing non-existent memory when went use it.

encoding - How to convert from full-width to half-width Japanese characters in Java? -

i'm using class transliterator of icu project convert half-width full-width characters this: transliterator transliterator = transliterator.getinstance("hiragana-katakana"); string converted = transliterator.transliterate("コンニチハ"); //half-width the result of converted is: コンニチハ (full-width) but: string converted = transliterator.transliterate("コンニチハ"); //full-width the result of converted still: コンニチハ (full-width) my expectation コンニチハ . can me solve this? thanks. i found answer here . it's simple using different params below: transliterator transliterator = transliterator.getinstance("halfwidth-fullwidth"); string converted = transliterator.transliterate("コンニチハ"); //half-width converted value: コンニチハ transliterator transliterator = transliterator.getinstance("fullwidth-halfwidth"); string converted = transliterator.transliterate("コンニチハ"); //full-width converted val

c++ making coord globally accesible -

just real quicky, feel might basic question, can't wrap head around how make work. i've declared 2 coordinate points in: int x = (0); int y = (0); coord coord; coord.x = x; coord.y = y; they have been declared prior main, need globally accessible further functions within program, getting error messages when trying set coord.x/y, saying declaration has no storage type. can fix this? int x = (0); int y = (0); coord coord; these definitions of global variables, initialisation literal values first two. coord.x = x; coord.y = y; these statements . you cannot have statements outside of function, need put function e.g. main . but initialise member fields of instance of class coord use constructor of class: struct coord { int x; int y; coord(int x, int y) : x(x), y(y) { } }; coord p = coord (21, 42); but in case wouldn't need constructor @ all, can use structure initialisation: struct coord { int x; int y; }; coord q = {42, 21}; co

regex - How to replace any_string@a.net to any_string@b.com -

how replace any_string@a.net any_string@b.com using regex? i want strip @a.net , replace @b.com i've tried (.*@a.net) but $1 showing string. when try replace it, became any_string@a.net@b.com and can point me nice tutorial regarding regex? the () indicates capture group. put parts of expression don't want capture outside parens: (.*)@a.net a great site play around regular expressions http://refiddle.com/ . i fiddled problem already.

delphi - Error with ActiveX and MCVE -

Image
in search of error of return of s_ok , not s_false (see previous message), have made small sever 1 method wich send s_false (hresult type), unfortunatly have error small client program: project testtest.exe has send exception class eolesyserror message 'variable type invalid' (it's instruction return:=coll.method raise error). idea? .ridl server code: function ttest1.method: hresult; begin result:=s_false; end; and client code: procedure tform1.button1click(sender: tobject); var coll:variant; return:hresult; begin coll:= createoleobject('project.test1'); return:=coll.method; if return=s_false showmessage('ok') else showmessage('error!!!!!!!!!!!!!!!!'); end; for full problem have made mcve: server: enter link description here client: enter link description here i dont think need parameter 'value' of type hresult . can delete parameter: method return hresult . if want test parameter, try changing 'value&#

elixir - Import Phoenix Socket, Phoenix HTML JS Modules via Brunch when web server application is in an umbrella app -

when phoenix web server not in umbrella app, brunch finds modules in "deps/phoenix/web/static/js/socket" , "deps/phoenix_html/web/static/js/phoenix_html" because phoenix dependency gets installed location relative brunch config file. when in umbrella app, dependencies installed in umbrella app itself, not web server app. @ "../../deps/phoenix/web/static/js/" instead. i tried adding "../.." locations in brunch config file , import statements, , cannot brunch find files. you need configure brunch config point proper directory: watched: ["../../deps/phoenix/web/static", "../../deps/phoenix_html/web/static", "web/static", "test/static"], and import: import "../../../deps/phoenix_html/web/static/js/phoenix_html" we should fix phoenix though generate such default inside umbrellas.

python - Odoo: Get default field values that will be in the form beforehand -

i have form views similar account.voucher.receipt.dialog.form ( odoo/addons/account_voucher/voucher_payment_receipt_view.xml ). some field tags default values defined in model, some field tags default values on change methods (defined on_change attributes). i want bypass these form views , automate process, need know beforehand these default field values. in way, need add additional field values if needed, call create method on model. (i'm using odoo v8). how can achieve that? if want print in log default values of model can this: from inspect import isfunction @api.multi def get_default_fields(self): key, value in self._fields.iteritems(): if value.name not in models.magic_columns: if self._defaults.get(value.name, false): if isfunction(self._defaults[value.name]): _logger.debug(self._defaults[value.name]( self, self.env.cr, self.env.uid, none ))

jboss7.x - JBoss most latest and stable version -

i trying build highly available, scalable , performance optimistic jboss cluster system. using infinispan subsystem caching service. i started off jboss 7.1.1 final version later on found has serious bugs. also, infinispan subsystem not behaving per requirements in same. as of now, need evaluate different versions of jboss suffices above mentioned requirements. please let me know stable , latest version of jboss available. just information, performing whole stuff in cloud (aws). jboss application server renamed wildfly, checkout downloads page . right stable 9.0.1 (i think using infinispan 7.x) , unstable 10.0.0.beta2 (i think still uses 7.x since infinispan 8 not released yet, it's possible version 8 final release).

How to Lookup for 2 columns in Excel and Return Value if second column Matches -

i have 1 worksheet url's of 60 styles have multiple children styles different colors. for example: website/sh70_black_2.jpg, website/sh70_black_3.jpg, website/sh70_blue_1.jpg, website/sh70_blue_2.jpg, website/gn02_pink_2.jpg, website/gn02_pink_3.jpg, website/gn02_pink_4.jpg, website/gn02_yellow_1.jpg, website/gn02_yellow_2.jpg, website/gn02_yellow_3.jpg, website/gn02_yellow_4.jpg, website/gn03b_blue_1.jpg, website/gn03b_blue_2 (1).jpg, website/gn03b_blue_2.jpg, website/gn03b_blue_3.jpg, website/gn03b_gray_1.jpg, website/gn03b_gray_2.jpg, website/gn03b_gray_3.jpg, website/gn03b_gray_4.jpg, website/gn03b_red_1.jpg, and in inventory program, sku gn03b_red, gn03b_gray , on... "text column" in excel , separate sku color. how lookup 2 columns in excel , return value if second column matches (ie; color)? you can use index , match array formula(ctrl+shift+enter): =index(the column want return,match(1stlookupcol&2ndlookupcol,0))

java - Add a file inside a folder to Github using JGit or EGit - directory1\myfile.txt -

*added final working program bottom of question * i able add file github using org.eclipse.egit.github.core java library (and code sample referred here: https://gist.github.com/detelca/2337731 ) but not able give path "folder1\myfile.txt" or "folder1\folder2\myfile.txt" i trying find simple example add file under folder , not able find it. any on example? below code using: (configuration details username, reponame in method addfiletogh() ) import java.io.ioexception; import java.util.arraylist; import java.util.calendar; import java.util.collection; import java.util.date; import java.util.list; import org.eclipse.egit.github.core.blob; import org.eclipse.egit.github.core.commit; import org.eclipse.egit.github.core.commituser; import org.eclipse.egit.github.core.reference; import org.eclipse.egit.github.core.repository; import org.eclipse.egit.github.core.repositorycommit; import org.eclipse.egit.github.core.tree; import org.eclipse.egit.github.cor