Posts

Showing posts from July, 2013

mongodb - Uploading multiuple images with Node.js using Multer S3/Amazon S3 -

overview: have figured out how allow users upload multiple images amazon s3 using node, express & multers3. code shows solution below. working well. issue on edit route. want users able edit or delete images. far way have been able have new images override previous filepaths. this big problem because means user has reupload every single image every time try edit post. not good. think solution might create images array instead of having individual image paths. appreciate advice. i've seen code creating array local storage i'm not sure how alter work amazon s3: if(req.files.length) { for(var = 0; < req.files.length; i++) { updatedlisting.moreimages.push() // needs push amazon s3 here somehow. } updatedlisting.save(); first show "listings" mongoose model: var listingsschema = new mongoose.schema({ name: string, description: string, image: string, image2: string, image3: string, image4: string, image5: string, author: {

android - Enqueue callback not called -

i using retrofit2 , recognized callback call.enqueue not called. retrofit retrofit = new retrofit.builder().baseurl(usuarioservice.base_url).addconverterfactory(gsonconverterfactory.create(usuarioservice.g)).build(); usuarioservice service = retrofit.create(usuarioservice.class); call<string> user = service.verificarusuario(login.gettext().tostring(), senha.gettext().tostring()); user.enqueue(new retrofit2.callback<string>() { @override public void onresponse(call<string> call, response<string> response) { string resultado = response.body(); if (resultado.equals("false")) { toast toast = toast.maketext(mainactivity.this, "senha ou usuário não existente", toast.length_short); toast.setgravity(gravity.top | gravity.center_vertical, 0, 0); toast.show(); } else { if (resultado.equals("true")) { toast toast = toast.maketext(mainactivity

ios - WKWebView requires delay to set its scrollView's contentOffset and zoomScale after load() -

i wrote code save off wkwebview's scroll view's contentoffset , zoomscale , restored after webview loads. i've found setting scrollview properties works using delay (e.g. dispatchqueue.main.asyncafter() . why necessary? there better way achieve this? import uikit import webkit class viewcontroller: uiviewcontroller, wknavigationdelegate { var contentoffset = cgpoint.zero var zoomscale: cgfloat = 1.0 lazy var webview: wkwebview = { let wv = wkwebview(frame: cgrect.zero) wv.translatesautoresizingmaskintoconstraints = false wv.allowsbackforwardnavigationgestures = true wv.autoresizingmask = [.flexiblewidth, .flexibleheight] wv.navigationdelegate = self return wv }() override func viewdidload() { super.viewdidload() view.addsubview(webview) webview.topanchor.constraint(equalto: view.topanchor).isactive = true webview.bottomanchor.constraint(equalto: view.bottomanchor).is

javascript - Firefox with Protractor - testForAngular: Document was unloaded during execution -

Image
firefox version: 54.0.1 (32-bit) protractor version: 5.1.2 when trying run protractor tests firefox, i'm getting following error: failed: error while running testforangular: document unloaded during execution build info: version: '3.5.0', revision: '8def36e068', time: '2017-08-10t23:00:22.093z' system info: host: 'desktop-9avdli7', ip: '192.168.2.100', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131' driver info: driver.version: unknown error: error while running testforangular: document unloaded during execution build info: version: '3.5.0', revision: '8def36e068', time: '2017-08-10t23:00:22.093z' system info: host: 'desktop-9avdli7', ip: '192.168.2.100', os.name: 'windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131' driver info: driver.version: unknown @ executea

c# - Expected behavior when Private Memory Limit in IIS exceeds machine RAM -

so have couple of questions re: private memory limit in iis using c# web app. when set private memory limit 0, per docs here should have no limit. saw behavior app trigger iis reset when reaching approximately 60% of machine ram seems counter intuitive. grok? the second issue expected behavior when private memory limit set value exceeds amount of ram available on machine. co-worker solved above problem setting private memory limit above system memory , did perform well. seems have ramifications proper gc times. for example if system ram 32 gb , memory limit set 35, not trigger gargbage collection when gets close 32 because thinks can 35? or guaranteed garbage collection happen before then? additionally requires config change if ever change size of machine (we aws shop can happen @ relatively high frequency).

android - Retrieve already saved data from firebase database and displaying it on several textviews in a new activity -

package com.example.ogho.thesistorone; import android.content.intent; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.widget.button; import android.widget.textview; import com.google.firebase.auth.firebaseauth; import com.google.firebase.auth.firebaseuser; import com.google.firebase.database.datasnapshot; import com.google.firebase.database.databaseerror; import com.google.firebase.database.databasereference; import com.google.firebase.database.firebasedatabase; import com.google.firebase.database.valueeventlistener; import org.w3c.dom.text; public class orderactivity extends appcompatactivity { private firebaseauth mfirebaseauth; private firebaseuser mfirebaseuser; private string muserid; databasereference db; boolean saved = false; button btnstatus; textview txtcourse,txttypofjob,txtduration,txtprice,txttopic; @override protected void oncrea

android - Ionic Qr scan tutorial -

i trying scan qr code using phonegap-plugin-qrscanner . follow tutorial steps but, camera not open in device. it code: constructor(private qrscanner: qrscanner) {} this.qrscanner.prepare() .then((status: qrscannerstatus) => { console.log('qrscanstatus status:'); console.log(status); if(status.authorized) { // start scanning let scansub = this.qrscanner.scan().subscribe((text: string) => { console.log('scanned something', text); this.qrscanner.hide(); // hide camera preview scansub.unsubscribe(); // stop scanning }); this.qrscanner.show(); }else if(status.denied) { console.log('status denied ...'); }else{ console.log('otro estado ...'); } }) .catch((e) => { console.log('error atrapado: ', e); }); any ideas ? seems trying use api of plugin, namely cordova-plugin-qrscanner so sugge

python - Drop Upon Conditions -

i trying solve following problem: have dataframe. 1 of columns, have nan , numbers, distributed in random fashion. want drop lines based on column. criteria is: if line above 1 , 1 below have nan value, drop line. else, keep line in data frame. this have managed to, quite sure wrong... appreciated! i=0 while <= 500: if (np.isnan(df.iloc[i+1]['column1'])) & (np.isnan(df.iloc[i-1]['column1'])): df2[i] = df.drop(df[i]) create sample data: np.random.seed(0) df= pd.dataframe({'column1': np.random.randn(10)}) df.iloc[[2, 4, 7], 0] = np.nan >>> df column1 0 1.764052 1 0.400157 2 nan 3 2.240893 # <<< drop. 4 nan 5 -0.977278 6 0.950088 7 nan 8 -0.103219 9 0.410599 apply filter. >>> df[~((df['column1'].shift(1).isnull()) & (df['column1'].shift(-1).isnull()))] column1 0 1.764052 1 0.400157 2 nan 4 nan 5 -0.977278 6 0.950088 7 nan 8

php - Unable to save into postgresql using symfony and doctrine with its association objects or table? -

i have save ticket ticket_attachments , ticket_comments , ticket_status_history . persist ticket object want save attachments,comments , history. using doctrine , symfony , annotations. i have created 3 array collections in ticket mappedby , cascade remove , persist. , used inversedby in attachments, comments , history. after persisting , flush ticket being saved other objects i.e. attachments,comments , historys not saving. shows no error . ticket.php /** * @orm\onetomany(targetentity="appbundle\entity\ticketattachments", mappedby="ticket", cascade={"persist", "remove"}) */ private $attachments; /** * @orm\onetomany(targetentity="appbundle\entity\ticketcomments", mappedby="ticket", cascade={"persist", "remove"}) */ private $comments; /** * @orm\onetomany(targetentity="appbundle\entity\ticketstatushistory", mappedby="ticket",

Creating online android app with Firebase -

i want create online app between 2 players , join , find each other simple question-answer app , more thousand people can join server. it's better use firebase or create web server host ... (i'm interesting web servers)i mark correct can answer thanks the choice between firebase , web-server solely based on needs of application , on skills. firebase provides features of real-time database, authentication, storage, notifications, hosting etc. without server-side coding , other options makes easy integrate app. however, if app requirements above free usage quota of firebase, have pay services. since need server more thousand people, have pay firebase services. also, if app complexity increases, firebase may or may not able cater needs of app. on other hand, custom server have options enough app. however, creating custom server hard, depending on skills. require more maintenance firebase.

windows - GDB: ImportError: No module named libstdcxx.v6.printers -

i have msys2 , mingw64 installed under windows 7. gdb reports "importerror: no module named libstdcxx.v6.printers": $ gdb gnu gdb (gdb) 7.11.1 copyright (c) 2016 free software foundation, inc. license gplv3+: gnu gpl version 3 or later <http://gnu.org/licenses/gpl.html> free software: free change , redistribute it. there no warranty, extent permitted law. type "show copying" , "show warranty" details. gdb configured "x86_64-pc-msys". type "show configuration" configuration details. bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. find gdb manual , other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. help, type "help". type "apropos word" search commands related "word". traceback (most recent call last): file "<string>", line 3, in <module> importerror: no

javascript - Why does a click event not reach the <body>? -

this slider runnning in animation loop unless 1 of dots @ top clicked. then, animated elements (the <span> dots , <figure> s) style stop animation. <section id="slider"> <span class="control" tabindex="1"></span> <span class="control" tabindex="2"></span> <span class="control" tabindex="3"></span> <figure class="slide"> <!--image 1---> </figure> <figure class="slide"> <!--image 2---> </figure> <figure class="slide"> <!--image 3---> </section> script: window.onload = function () { var slider = document.queryselector('#slider'); var animated = slider.queryselectorall('.control, .slide'); function switchall (focus) { animated.foreach(function (el) { el.style['anim

html - Vertical scrollbar pushing content over, creating horizontal scrollbar -

so here's page i'm working right now: http://home-dev.mpcleague.com/contact i'm working on positioning right image looks it's coming out of right side of screen. far looks good. but notice when plug mouse in, safari and/or mac detects have mouse , displays vertical scrollbar. that's normal, except fact little bit of image (the width of scrollbar) displaying off edge of screen, creates horizontal scroll bar. the html/css relating image , container follows: <div class="col-md-6 image-col"> <div class="image-container"> <img class="contact-graphic" src="/assets/contact-us-graphic.png" /> </div> </div> .image-container { height:70vh; } img.contact-graphic { height:100%; border-radius:5px; } .image-col { padding-right:0 !important; padding-left:0; margin-right:0 !important; overflow-x:hidden !important; width:50vw !important; margin-

Invert names of IDs in a form using Javascript -

i have following form: <form id="currency" name="form" onsubmit="return redirect(this)"> <div style="clear:both;text-align: center;"> <select id="firstcurrency" class="selex" name="firstcurrency" style="float: left;"> <option value="usd">usd</option> <option value="btc">btc</option> </select> <span style="margin: 0 auto;">=</span> <select id="secondcurrency" class="selex" name="secondcurrency" style="float: right;"> <option value="btc">rrr</option> <option value="xvg">xvg</option> <option value="xrp">xrp</option> <option value="ntx">ntx</option> </select>

perl6 - Why isn't my object attribute populated? -

given oversimplified xml file: <foo>bar</foo> and code extracts value foo element: use xml::rabbit; use data::dump::tree; class runinfo xml::rabbit::node { has $.foo xpath("/foo"); } sub main ( $file! ) { $xml = runinfo.new( file => $file ); dump $xml; put "-----------------------"; put "foo $xml.foo()"; } you'll see value foo nil , though output shows foo bar : .runinfo @0 ├ $.foo = nil ├ $.context rw = .xml::document @1 │ ├ $.version = 1.0.str │ ├ $.encoding = nil │ ├ %.doctype = {0} @2 │ ├ $.root = .xml::element @3 │ │ ├ $.name rw = foo.str │ │ ├ @.nodes rw = [1] @4 │ │ │ └ 0 = .xml::text @5 │ │ │ ├ $.text = bar.str │ │ │ └ $.parent rw = .xml::element §3 │ │ ├ %.attribs rw = {0} @7 │ │ ├ $.idattr rw = id.str │ │ └ $.parent rw = .xml::document §1 │ ├ $.filename = example.xml.str │ └ $.parent rw = nil └ $.xpath rw = .xml::xpath @9 ├ $.document = .xml::document §1 └ %.registered-namespa

php - Sending emails to multiple recipients with different content -

i need send mails multiple recipients notifying pending tasks. this array querying pending tasks each recipient. $pending = array( "select * user status='processing' , reason!='out of island'", "select * user status='processing' , reason!='out of island'", //dgm-hr "select * user status='new'", //dgm-itas "select * user status='processing' , reason='out of island'", //manager-hr "select * user crm_status='pending'", //crm-eng "select * user oss_status='pending'", //oss-eng "select * user bss_status='pending'" //bss-eng ); //retrieve results each query , pass array. array not working. $pending = implode("\r\n", $pending); $result = array( mysqli_query($dbcon,$pending) ); //getting result , send mail relevant recipient. haven't set recipient part yet. foreach($result $result1) { if(!$result1)

mysql - why mysql5.5 AUTO_INCREMENT dose not affect? -

here question: have table (innodb), max primary-key value 5000000, user alter table tb set auto_increment = 20000; when on local, it's ok; on server, auto_increment still 5000000. can me? @inkparker should work. alter table tb auto_increment = 5000000;

Curved scrollbar in ScrollView on Android Wear 2.0 -

is possible have curved scrollbar on wearablerecyclerview on scrollview? how done? here reference started. to create curved layout scrollable items in wearable app: use wearablerecyclerview main container in relevant xml layout. set setedgeitemscenteringenabled(boolean) method true. align first , last items on list vertically centered on screen. use wearablerecyclerview.setlayoutmanager() method set layout of items on screen. if explore document, able in touch code snippet customization of scrolling. for circular scrolling gesture : by default, circular scrolling disabled in wearablerecyclerview . if want enable circular scrolling gesture in child view, use wearablerecyclerview ’s setcircularscrollinggestureenabled() method.

I made a Toggle menu but my JavaScript does not look right, I need to understand why this way works and what is the right way to do this -

content navbar <a class="menubtn" onclick="togglebar()">&#9776;</a> <div id="mynav" class="overlay"> <div class="overlay-content"> <a href="#">about</a> <a href="#">services</a> <a href="#">clients</a> <a href="#">contact</a> </div> </div> <style> .overlay { width: 0%; background-color: steelblue; transition: 0.5s; overflow: hidden; float: right; } .overlay-content { text-align: center; margin-top: 50px; } .overlay { padding: 8px; text-decoration: none; display: block; } .menubtn { position: absolute; top: 25px; right: 30px; } </style> <script> function togglebar() { var x = document.getelementbyid('mynav'); if (x.style.width === '') { x.style.width = '100%'; } else { x.style.width = 

c# - Struct extension methods -

with code: somevector.fixrounding(); //round vector's values integers if difference 1 epsilon float x = somevector.x; //still getting old value public static void fixrounding(this vector3 v) { if (mathf.approximately(v.x, mathf.round(v.x))) v.x = mathf.round(v.x); if (mathf.approximately(v.y, mathf.round(v.y))) v.y = mathf.round(v.y); if (mathf.approximately(v.z, mathf.round(v.z))) v.z = mathf.round(v.z); } the fixrounding method doesn't change vector's values although mathf.approximately returns true. this declaration: public static void fixrounding(this vector3 v) ... means v being passed by value , , it's struct, assuming documentation correct. therefore changes make won't visible caller. need make regular method, , pass v reference: public static void fixrounding(ref vector3 v) and call as: typedeclaringmethod.fixrounding(ref pos); here's demonstration of extension methods try modify structs passed value failin

javascript - Rotate svg pattern around it's center when using objectBoundingBox -

i need rotate pattern used background svg element (part of wheelnav.js menu) around it's center. know can use patterntransform = rotate(angle, centerx, centery) , pattern uses objectboundingbox patternunits , don't know how width , height of element. is there way dimensions? or rotate around center without knowing width , height? edit: here code use: var bounrect = document.getelementbyid("wheelnav-piemenu" + 3 + "-slice-" + 0).getboundingclientrect() var patt = document.createelementns('http://www.w3.org/2000/svg', 'pattern'); patt.setattribute('id', 'img' + itemid); patt.setattribute('patternunits', 'objectboundingbox'); patt.setattribute('width', '1'); patt.setattribute('height', '1'); patt.setattribute('x', '0'); patt.setattribute('y', '0'); patt.setattribute('patterntransform',"rotate(" + itemid*-36 + ", 0.

linux - Jenkins slave with specific port -

i have main jenkins server, running on linux vm, listening on foo.com:9090/jenkins . i need create node, on windows vm, inside same network. i tried using javawebstart, not configure right. need way specify /jenkins path. foo.com:9090 doesn't work, neither foo.com . , when specify correct address, foo.com:9090/jenkins , jnlp file gives input exception on /jenkins . i tried ssh, not work on windows either. is there way specify on /jenkins when configuring host? jenkins error go manage jenkins > configure global security , add fixed port jnlp agents. then configure firewall rule fixed port in master machine can allow connections. for ubuntu: sudo ufw allow <fixed_port>/tcp then try launch agent.

c - PrintList function is not working properly -

i'm working on list program course , seems working correctly far, thing acting weird printlist function. let's compile program , push 1 number (e.g. 4) in first node , print list, output is: [4]->[0]->null if didn't add node 0 data. sorry in advance if stupid question, here code wrote: #include <stdio.h> #include <stdlib.h> struct node{ int data; struct node *next; }; typedef struct node node; void printlist(node *); void push(node **, int ); void insert(node *, int ); void append(node **, int ); void delete(node **, int ); void reverse(node **); int main(){ node *head, *temp; head=malloc(sizeof(node *)); if(head==null){ puts("cannot allocate memory"); } int i, t; int x; while(1){ printf("insert choice:\n1. print list\n2. push\n3. insert\n4. append\n5. delete\n6. reverse\n\nenter other number exit."); scanf("%d", &x); switch(x){

initialization - In TBB, is there a way to find out if there is an existing task scheduler? -

in threading building blocks (tbb), if initialize 2 task schedulers within same scope, argument of second initialization ignored unless argument of first initialization deferred. in order avoid conflicts, find out if task scheduler has been initialized earlier in program. there way it? if so, argument that? you may want consider tbb::this_task_arena::current_thread_index() , tbb::this_task_arena::max_concurrency() functions. the tbb::this_task_arena::current_thread_index() function returns " tbb::task_arena::not_initialized if thread has not yet initialized task scheduler." ( documentation link ). if task scheduler initialized can obtain requested number of threads tbb::this_task_arena::max_concurrency() function. however, cannot stack size used during previous task scheduler initialization.

svg - How do I compensate for the extra pixels added by stroke-linecap="round" in my calculated arc? -

i'm creating arc based on sunrise , sunset using following example of sunrise @ 6:15am hour * 15 = 90 minutes * 0.25 = 3.75 hour + minutes = 93.75 here function used calculate path. polartocartesian: function (centerx, centery, radius, angleindegrees) { var angleinradians = (angleindegrees - 90) * math.pi / 180.0 return { x: centerx + (radius * math.cos(angleinradians)), y: centery + (radius * math.sin(angleinradians)) } }, describearc: function (x, y, radius, startangle, endangle) { var start = this.polartocartesian(x, y, radius, endangle) var end = this.polartocartesian(x, y, radius, startangle) var largearcflag = endangle - startangle <= 180 ? '0' : '1' var d = [ 'm', start.x, start.y, 'a', radius, radius, 0, largearcflag, 0, end.x, end.y ].join(' ') return d } and here svg snippet <path id="sun_ring_start" :d="getarcs(27, 93.75, 0)" fill="none" stroke=

python - Separating clusters by a line -

Image
i have data set consists of several clusters. want separate these clusters line, voronoi diagram not created 1 dot. idea have determine shortest distance between each point , find points on outside of cluster. average distance needs taken, determine line separating clusters. the closest point can determined via cdist. want loop on each cluster , compare each point in cluster other points in other clusters. however, i'm stuck @ doing this. below can find code written in python. import matplotlib.pyplot plt scipy.spatial.distance import cdist def closest_point(pt, others): distances = cdist(pt, others) return others[distances.argmin()] ppx = [[615, 618, 621], [629, 623, 620, 625], [614, 622, 610, 612]] ppy = [[524, 530, 527], [559, 556, 548, 548], [559, 574, 572, 542]] in range(0,3): # range(len(grouped)) j in range(len(ppx[i])): = [[ppx[i][j], ppy[i][j]]] others = ..??.. print("closest:", closest_point(a, others)) plt.sca

cytoscape.js - How to change label of cytoscape nodes -

this newbie cytoscape.js question. nodes labeled using data(lbl) below, , dynamically switch pulling label from different data element, e.g. change 'label': 'data(lbl2)' style:[ { selector: 'node', style: { 'background-color': 'data(color)', 'label': 'data(lbl)', 'font-size' : '25px', 'width' : 'data(size)', 'height' : 'data(size)' } to honest not sure how iterate on nodes, let alone apply style change. had no trouble laying out nice graph using instructions provided, seems me guidance javascript controls quite telegraphic comparison. there no sample code see showing simple operations being performed. use selectors in html/css. simplest case classes. style: [ { selector: 'node.foo', style: { 'label': data(foo) } }, { selector: 'node.bar', style: { 'label':

angular - IONIC - VirtualScroll Performance issue -

so, have array of items between 0 - 2500. i'm trying use virtualscroll option (as have read handle large arrays) improve diabolical performance issue when displaying\scrolling through 1300 items. so i've done following, still painful , can crash app when scrolling. <ion-list [virtualscroll]="results" approxitemwidth="100%" approxitemheight="45px" bufferratio=60> <button ion-item *virtualitem="let result" (click)="gotoclient(result)"> {{result.firstname}} {{result.lastname}} </button> </ion-list> anyone advise i'm doing wrong\ how improve? try install cordova wkwebview engine , optimizes ios performance issues: installation instructions ensure latest cordova cli installed: (sudo may required) npm install cordova -g ensure ios platform has been added: ionic cordova platform ls if ios platform not listed, run following command: ionic cordova platfo

Bootstrap 4 compatibility with Font Awesome -

Image
does bootstrap 4 work font awesome? bootstrap 4 hit beta, , i'm concerned font awesome not listed in bootstrap's official "preferred icon set" page . font awesome separate bootstrap framework , should function within components without issue. bootstrap 4 seems favor svg-based icon solutions , may contribute why font awesome not on list of preferred icon solutions. that being said - font awesome 5 in beta 2 of 8/15/17. has svg icon support if important may option consider. note though; font awesome 5 premium service.

IntelliJ can't display big file? -

my text file 1.58g, intellij custom vm options set "-xmx4g". why shows "the file large; 1.58g. showing read-only of first 2.56m". idea.properties file contains default limits files intellij idea can handle: #--------------------------------------------------------------------- # maximum file size (kilobytes) ide should provide code assistance for. # larger file slower editor works , higher overall system memory requirements # if code assistance enabled. remove property or set large number if need # code assistance files available regardless size. #--------------------------------------------------------------------- idea.max.intellisense.filesize=2500 #--------------------------------------------------------------------- # maximum file size (kilobytes) ide able open. #--------------------------------------------------------------------- idea.max.content.load.filesize=20000 these can changed using help | edit custom properties .

html - Move title to the bottom with CSS -

how can move title bottom on screen on max-width 640px without changing structure on html file? #header-image { width: 100%; position: relative; } .header-title { color: #000000; font-size: 3em; font-weight: 700; position: absolute; top: 25%; width: 255px; right: 50px; text-align: left } .bottom-bar { display: block; height: 25px; width: 100%; background- color: #007cb0; } .screen-480 { display: none; } .screen-768 { display: block; } @media screen , (max-width: 480) { .screen-480 { display: block; } .screen-768 { display: none; } } <div id="header-image"> <div class="image"> <div class="header-title">the quick brown fox jumped on lazy dog</div> <img src="http://via.placeholder.com/480x683.png" width="100%" class="screen- 480" alt="img" /> <img src="http:/

Memory Usage and Garbage Collection in Java -

i have read many things memory usage in java. my questions points towards game making. every frame call methods 500 times creating binary tree. each node call function , create 10 local variables. is better memory usage , or garbage collector create separate class holds needed variables, instantiate once , give every node reference object ? if first question better, more "expensive" call .getsomething() separate object storing thing want in own object ? thank all! as rule of thumb, less objects create, less pressure have on gc. if every "node" in application needs access same set of values, putting these values in 1 single object better allocate them each node on , on again. most not. jit compiler inline these calls if executed often. as mentioned in comment of question, local primitive variables allocated on stack , not subject garbage collection. in cases, objects can allocated on stack due jit compiler's escape analysis technique.

vba - Linked table OLE Object shows as null in a recordset while it is displayed on query view as OLE Object -

i have following oracle table connected access via odbc id (int) file_type (varchar(20)) blob_data (blob) the blob_data field holds excel files , want download them. in access query view, field shown ole object i have written following code till - dim db database dim rst recordset set db = currentdb set rst = db.openrecordset("select blob_data my_table;") dim fld variant fld = rst.fields(0).value when inspect fld field, shows null though access query view shows ole object. have odbc , linked tables? or missing something? you can't set variants equal value of ole or blob fields, since can contain large objects. need use .getchunck on field return chuncks of data of file, don't have load entire blob variable. working .getchunck enables have small part of file in memory when writing entire file disk. the code required not small, following microsoft article describes well: https://support.microsoft.com/en-us/help/210486/acc2000-reading-

Java: Clear the console -

can body please tell me code used clear screen in java? example in c++ system("cls"); what code used in java clear screen? thanks! since there several answers here showing non-working code windows, here clarification: runtime.getruntime().exec("cls"); this command not work, 2 reasons: there no executable named cls.exe or cls.com in standard windows installation invoked via runtime.exec , well-known command cls builtin windows’ command line interpreter. when launching new process via runtime.exec , standard output gets redirected pipe initiating java process can read. when output of cls command gets redirected, doesn’t clear console. to solve problem, have invoke command line interpreter ( cmd ) , tell execute command ( /c cls ) allows invoking builtin commands. further have directly connect output channel java process’ output channel, works starting java 7, using inheritio() : import java.io.ioexception; public class cls { p

kubernetes - What would be an ideal way to share writable volume across containers for a web server? -

the application in question wordpress, need create replicas rolling deployment / scaling purposes. it seem can't create more 1 instance of same container, if uses persistent volume (gcp term): the deployment "wordpress" invalid: spec.template.spec.volumes[0].gcepersistentdisk.readonly: invalid value: false: must true replicated pods > 1; gce pd can mounted on multiple machines if read-only what options? there occasional writes , many reads. ideally writable containers. i'm hesitant use network file systems i'm not sure whether they'll provide sufficient performance web application (where page load rather critical). one idea have is, create master container (write , read permission) , slaves (read permission), work - i'll need figure out kubernetes configuration required. in https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistent-volumes can see table possible storage classes allow readwritemany (the option lookin

xpath - Select element and its descendants -

i'm trying select folder , descendants jcr xpath. can select folder enough: //content/documents/folder-name i can select descendants too: //content/documents/folder-name//* however, can't figure out how both. i've tried several things. these select nothing: //content/documents/folder-name | //content/documents/folder-name//* //content/documents/folder-name(. | *) //content/documents/folder-name/(. | *) //content/documents/folder-name/descendant-or-self //content/documents/folder-name/descendant-or-self::node() these both throw javax.jcr.query.invalidqueryexception : //content/documents/folder-name[. | *] //content/documents/folder-name/[. | *] obviously i'm terrible @ xpath. please help. edit: using // prefix because didn't realize use /jcr:root/content instead. have same problem that, however. you can combine 2 xpaths using union operator: xpath1 | xpath2 however, first xpath, //content/documents/folder-name does select fold

file - C programming, fscanf only inputs the last element -

i'm trying multiple elements file , put in array linked list inputs last element of file. inside file is 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 here's code typedef struct node{ int elem; struct node *next; }node; void insert(node **a) { int temp,elem; node *tempstruct; tempstruct = (*node)malloc(sizeof(struct node)); file *fp; if(fp = fopen("input.txt","r")){ while(fscanf(fp,"%d",&elem)==1){ temp = elem%10; tempstruct->elem = elem; tempstruct->next = a[temp]; a[temp] = tempstruct; } } } the expected output should be a[0] 10 a[1] 11 1 a[2] 12 2 a[3] 13 3 a[4] 14 4 a[5] 15 5 a[6] 16 6 a[7] 17 7 a[8] 18 8 a[9] 19 9 but a[0] 19 a[1] 19 a[2] 19 a[3] 19 a[4] 19 a[5] 19 a[6] 19 a[7] 19 a[8] 19 a[9] 19 i trying put elements in indexes corresponding ones digit,

angular - Aut0 angular2 seed application does not properly login on Firefox -

i have downloaded starter project provided auth0 angular2: https://auth0.com/docs/quickstart/spa/angular2/01-login when run locally behaves differently in chrome compared firefox. in chrome can login expected , end on url: http://localhost:4200/ in firefox can login after login i'm stuck on url: http://localhost:4200/callback can explain why difference happens?

html - Header Image not displaying -

when run code doesn't display image in background .bgimg-1 { background-image: url("/images/oldcam.jpg"); background-repeat: no-repeat; min-height: 100%; } following code :- .bgimg-1 { width: 400px; height: 200px; background-repeat: no-repeat; background-image: url("https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"); } <div class="bgimg-1 w3-display-container w3-opacity-min" id="home">

html - How to set width based on content length using flex -

this question has answer here: make flex items take content width, not width of parent container 1 answer i'm trying make width of each item based on content have far set width way available spaces. flex: 0 0 auto not seem trick. doing wrong? goal have width based on content size. [hello] [hello world] currently [hello ] [hello world ] https://jsfiddle.net/v6cgljbd/8/ <span class='box'> <span class='item'>hello</span> <span class='item'>hello world</span> <span class='item'>hello looooong text</span> </span> .box { height: 200px; width: auto; border: 1px solid red; display: flex; flex-direction: column; } .item { background-color: gray; flex: 0 0 auto; width: auto; } you need add align-items: flex-start on fle

wordpress - WooCommerce Hidden Tag from past page -

we using woocommerce in wp our ecommerce sales. have purchase funnel goes, intro page 1 (or 2 or 3) -> general product page -> cart -> purchase. hoping somehow add tag when user adds item product page cart include intro page user came from. for example, user starts @ intro page 2 , clicks on buy now. user goes product page , selects product. cookie or url tag added cart product tell user came from. any suggestions? have searched , couldn't find this.

How to sum individual elements MATLAB -

suppose have row matrix [a1 a2 a3 a4 .. an] , wish achieve each of following in matlab 1) 1+a1 2) 1+a1+a2 3) 1+a1+a2+a3 4) 1+a1+a2+a3+a4 .... 1+a1+a2+...+an how shall them? this purpose of cumsum function. if a vector containing elements [a1 a2 a3 .. an] then b = cumsum([1 a]); contains terms searching for. possibility is b = 1 + cumsum(a); edit if don't want use built-in function cumsum , simpler way go for loop: % consider preallocation speed b = nan(numel(a),1); % assign first element b(1) = 1 + a(1); % loop = 2:numel(a) b(i) = b(i-1) + a(i); end or, without preallocation: b = 1 + a(1); = 2:numel(a) b(end+1) = b(end) + a(i); end best,

java - Calling a class from same package and assigning variables -

i'm trying pull restaurantselector1 class cuisinechoice can able have users input choices can assign variables in restaurantselector1(if makes sense. have: in restaurantselector1: public class restaurantselector1 { public static string getrandom(list<string[]> list) { random random = new random(); int listaccess = random.nextint(list.size()); string[] s = list.get(listaccess); return s[random.nextint(s.length)]; } public static void main(string[] args){ arraylist<string[]> westvillagecuisine = new arraylist<string[]>(); westvillagecuisine.add(expensive.westvillage.italian); . . . westvillagecuisine.add(expensive.westvillage.greek); final string[] randomcuisine = westvillagecuisine.get(random.nextint(westvillagecuisine.size())); final string randomrestaurant = randomcuisine[random.nextint(randomcuisine.length)]; final string[] randomwvitalian = westvillagecuisine.get(0); final string westvillageitalian = r randomwvitalian[random.nextint(rando