Posts

Showing posts from July, 2015

Adding maven dependency gives a specific error during my spring batch -

i working on batch , face problem. have identified cause of issue not able solve it. as add dependency in pom start error the maven dependency <dependency> <groupid>org.springframework.data</groupid> <artifactid>spring-data-jpa</artifactid> </dependency> my pom shown below <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.edf.fr.batch</groupid> <artifactid>edf-batch</artifactid> <version>0.0.1-snapshot</version> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.5.6.release</version> </parent>

html - PHP: Passing Foreach Data Values to Input Boxes while incrementing the number of their ID and Name -

Image
hi guys summarize problem here hope understand. main goal: main goal have foreach of datas , pass designated input boxes while, in same way i'm appending number of id , name already accomplished: have forloop of x can increment , pass values array in input boxed id , name html code: <table class="table table-bordered" id="addsubpaymenttable"> <thead> <tr> <th>particulars</th> <th>balance</th> <th>payment amount</th> </thead> <tbody> <?php $arraynumber = 0; for($x = 1; $x < 2; $x++) { ?> //this make loop increment x supply diffrent number values same id , name have input boxes. <tr id="row<?php echo $x; ?>" class="<?php echo $arraynumber; ?>"> //increment rows <td class="form-group"> <input type="text" class="form-control" name=

java - Is there some way to call a class which is defined by String or a similar way? -

i have program where, if user enters "1" "assignment01" class called , if user enters "14" "assignment14" class called , on. currently, using switch case statement call function according user's number input shown on code. if there 100 of classes needs called per user's input? it frustrating have create case calling every single class. so, there way make short , efficient? for example: // assume user inputs "10" 'userinput = 10' string classvariable = "assignment" + userinput + ".main(args)"; classvariable; // result in 'assignment10.main(args);' unfortunately, can't done string there similar way define string class can called that? edit: want when user enters integer "30" class "assignment30" should called can done "assignment30.main(args);" through switch case statement can't create every single case. it better if put "assignment

python - Using the %cd magic command in Jupyter Notebooks -

i have jupyter notebook use %cd magic command. @ top of notebook set bookmark ( %bookmark 'base_dir' ) can return starting directory (via %cd -b 'base_dir' ). is there easier way return starting directory (i.e. directory running *.ipynb exists)?

angular - Angular4: Component reference inside ng-template -

i new angular 4. want handle of component(validation-alerts) inside ng-template <ng-template #content let-c="close" let-d="dismiss" size="600px" > <validation-alerts [formgroup]="requesttypeform"></validation-alerts> <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix head" tabindex="-1"> <span id="ui-id-6" class="ui-dialog-title popup-title">client name </span> <button (click)="d('cross click')" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close" role="button" aria-disabled="false" title="close"> <span class="ui-button-icon-primary ui-icon ui-icon-closethick popup-close-icon"></span><span class="ui-button-text">close</span> &

swift3 - Swift 3 SpriteKit Detecting Contacts -

i'm new swift , have been trying figure out how use bitmasks , didbegin(_ contact: skphysicscontact) detect when 2 spaceships touch each other. can't seem figure out how. here have far: import spritekit import gameplaykit class gamescene: skscene, skphysicscontactdelegate { let puffercategory: uint32 = 1 << 0; let enemycategory: uint32 = 1 << 1; var spaceship1: skspritenode! var spaceship2: skspritenode! override func didmove(to view: skview) { spaceship1 = skspritenode(imagenamed: "spaceship"); spaceship1.setscale(cgfloat(0.1)) spaceship1.position = cgpoint(x: self.frame.width / 2, y: (self.frame.height / 2)); spaceship1.name = "spaceship1"; spaceship1.physicsbody = skphysicsbody(circleofradius: spaceship1.size.width / 2); spaceship1.physicsbody?.isdynamic = true // apply gravity, friction, , collision spaceship1.physicsbody?.affectedbygravity = false; spaceship1.physicsbody?.allowsrotation = false

qml - Can i use quick controls in a qt widgets application? -

i need material styled replacements of standard widgets , it's kind of hard implement them using custom widgets. wondering if there's way include widgets quick control module , use them regular widgets? if application qt5.1 , above, answer yes can. you have use qquickview object , pass static function createwindowcontainer of qwidget , takes qwindow in paramater. qquickview derived qquickwindow derived qwindow . so can pass qquickview input createwindowcontainer . below rough code. //create qquickview object. qquickview *view = new qquickview(); //add qquickview object qwidget::createwindowcontainer qwidget *container = qwidget::createwindowcontainer(view, this); //add source view->setsource(qurl("your.qml")); //add container layout. ui->verticallayout->addwidget(container);

JetBrains Rider #region defaults in Structure pane -

in rider, c# #regions shown auto-collapsed in structure pane. if open region in structure pane make edit anywhere in open file auto-collapse again. is there way change behavior? i'd default them open , edits not make difference collapse state. you can change in preferences | editor | general | code folding

javascript - Messenger Extensions - FB Shared Link -

i have web page have added messenger extension sharing message messenger. have followed link follows. https://developers.facebook.com/docs/messenger-platform/webview/sharing/v2.10 the message object trying share follows: var messagetoshare = { "attachment": { "type": "template", "payload": { "template_type": "generic", "elements": [{ "title": "title text", "image_url": "image url", "subtitle": "subtitle text", "default_action": { "type": "web_url", "url": "url" }, "buttons": [{ "type": "web_url", "url": "button url",

python - Comparing one row in a data frame to multiple rows in a different data frame to generate similarity score -

i new python, pandas , fuzzywuzzy , i'm trying use fuzzywuzzy package generate similarity scores in order assign correct values rows in data frame. i have 2 data frames follows df: df2: user_id employer employer_list score 1 google amazon nan 2 citibank citibank nan 3 b m google nan 4 amazon inc ibm nan 5 dell corp the first data frame ( df ) export contains user_id , respective employers. goal of second data frame store fuzz.ratio obtained comparing each distinct employer value first data frame employer_list in second one. for example first employer 'google' compared values in df2['employer_list'] : df: df2: user_id

c# - Normalize volume in a 32 bit PCM Wav with NAudio -

is there way normalize volume in 32-bit wav file using naudio? if volume clipping, want downward normalize , vice versa if volume low. there no built-in feature, if use audiofilereader can examine values of samples find max absolute sample value. can work out how original file can amplified without clipping. then can use volume property of audiofilereader amplify audio, , use wavefilewriter.createwavefile write out new (ieee floating point) wav file. wavefilewriter.createwavefile16 used if wanted 16 bit output after normalizing. here's simple sample code var inpath = @"e:\audio\wav\input.wav"; var outpath = @"e:\audio\wav\normalized.wav"; float max = 0; using (var reader = new audiofilereader(inpath)) { // find max peak float[] buffer = new float[reader.waveformat.samplerate]; int read; { read = reader.read(buffer, 0, buffer.length); (int n = 0; n < read; n++) { var abs = math.

objective c - iOS: how to convert nib-involving codes to storyboard codes? -

recently started learning ios programming, , found books ios programming in objective-c. book (learning ios programming, 2013) has part demonstrates way produce table-view apps, got stuck in codes in book. for example, book used below codes in didfinishlaunchingwithoptions of appdelegate.h implement desired table. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. city *london=[[city alloc] init]; london.cityname=@"london"; london.citydescription=@"the capital of united kingdom , england."; london.citypicture=[uiimage imagenamed:@"london.jpg"]; city *sanfrancisco=[[city alloc] init]; sanfrancisco.cityname=@"san francisco"; sanfrancisco.citydescription=@"the heart of san francisco bay area."; sanfrancisco.citypicture=[uiimage imagenamed:@"sanfrancisco.jpg"]; city *sydney=[[city alloc] init]; sydney.c

mongodb - PHP - - ini "(none)" and not loading extensions -

Image
so ran i'm hoping can understanding on. there clean centos machine clean install of php. had mongodb driver installed well. when accessing web app through browser, kept complaining mongo client didn't exist. of installation procedures followed, php.ini contained extension=mongo.so , , httpd restarted. php info() did not contain mongo conf. ended working adding mongo.ini file /etc/php.d directory extension=mongo.so written it. i'm getting sneaky suspicion php.ini wasn't being loaded correctly, don't understand why. reason i'm thinking is, one, worked after adding mongo.ini . second, there mismatched php info() outputs cli , browser gui. and gui both of these snapped seconds apart. no configuration changes or restarts made. reason cli output says loaded configuration file /etc/php.ini expected. browser gui shows (none) . going on here? why extension=mongo.so never loading php.ini file? versions apache/2.4.6 php/5.4.16 centos linux relea

github - Automatic git Pull on Cloned Folder in desktop -

i have folder on desktop git cloned branch. want automatic git pull whenever pushed branch (assuming there no conflicts). how achieve ? novice in git. looking detailed solution. automatic git push not there in git. plus won't suggest because might working on or in middle of something. auto pull may cause issues. if still want there 2 ways: set cron in system , add git pull it. another that, github provides webhooks, can setup local web server on machine , trigger git pull on trigger on webhook

r - Create individual plots for each column -

Image
i have dataframe similar df below. each factor, i'd create boxplot comparing factor final score. without loop, looks code below. in practice, want 40 columns, , display in grid. sort of looping through columns seems appropriate here, i'm unsure how that. library(ggplot2) library(gridextra) scores <- c(97, 98, 90, 92) factor1 <- c(1, 0, 0, 1) factor2 <- c(2, 1, 2, 0) factor3 <- c(0, 0, 0, 1) df <- data.frame(scores, factor1, factor2, factor3) plot1 <- ggplot(df, aes(x=factor(factor1), y=scores)) + geom_boxplot() plot2 <- ggplot(df, aes(x=factor(factor2), y=scores)) + geom_boxplot() plot3 <- ggplot(df, aes(x=factor(factor3), y=scores)) + geom_boxplot() grid.arrange(plot1, plot2, plot3, ncol=2) library(ggplot2) library(gridextra) df <- data.frame(scores=c(97, 98, 90, 92), factor1=c(1, 0, 0, 1), factor2=c(2, 1, 2, 0), factor3=c(0, 0, 0, 1)) fun <- function(x) { dts <- df[,c("scores",x)] names(d

jquery - How to use a javascript to validate a form? -

i trying build django form. , javascript logic trying implement if input form value not empty, submit form. however, not sure how id of {{form.value}}. <form id = "form1" action="." method="post">{% csrf_token %} <div class=".col1" style="float:left;vertical-align: middle;"> {{ form.region }} {{ form.operator }} </div> <div class="col-xs-2 style="vertical-align: middle;"> {{ form.value }} </div> </form> function submitform1(){ if(document.getelementbyid( {{form.value}} ).value != ""){ document.getelementbyid("form1").submit(); } } the source of problem mixing code in django template, processed on server side, code doing in javascript, processed on client (browser) side. variable names exist on server side not exist in same way in browser. in javascript can work elements temp

mysql - Wordpress: Request key values from wp_usermeta AND fields from wp_users -

how query values stored in wp_users table , key-value pairs stored sequential in wp_usermeta meta parameter matches? case: there custom user meta field thats called profession. want id, login, first name, last name, e-mailadress, adress, country etc. wp users of profession 'medical doctor'. my problem of values e-mail , login stored in wp_users , (such profession) stored in wp_usermeta key-value pairs. how can accomplish query?

php - Symfony 3 Injecting Services in Services with __construct -

having issue injecting services in services following: https://symfony.com/doc/current/service_container.html#injecting-services-config-into-a-service this code: namespace servicesbundle\services; use symfony\bundle\frameworkbundle\controller\controller; use symfony\component\httpfoundation\session\sessioninterface; use symfony\component\httpfoundation\request; use symfony\component\httpfoundation\response; use doctrine\orm\entitymanagerinterface; class services { private $email; public function __construct($email, $message, sessioninterface $sessint) { $this->email = $email; $this->message = $message; $this->sessint = $sessint; } public function displaymessage(){ return "this services class in services namespace. email administrator @ " . $this->email . " | " . $this->message; } public function sessionidgetaction(){ $hello = $this->sessint->getid(); return $hello; } } throws error: type error: a

datetime - Add a vector of days and hours to plot in R -

i add concise date , time info plot in r. i adding plot research paper , when it's shrunk fit template loses of it's info. my actual datetime range 20/07/2017 18:15 - 23/07/2017 21:15 i'd abbreviate date days such thur 18:15 , sun 21:15 5 days , times in between. i can create correct range in posixlt format it's big needs. my.date <- seq(as.posixlt(strptime('20/07/2017 18:15',"%d/%m/%y %h:%m"),tz="gmt"), as.posixlt(strptime('23/07/2017 21:15',"%d/%m/%y %h:%m"),tz="gmt"),length.out = 7) is there better way achieve datetime rage? the key problem convert posix object character string desired format. format function used here: format(my.date, "%a %h:%m") here simple example: my.date <- seq(strptime('20/07/2017 18:15',"%d/%m/%y %h:%m"), strptime('23/07/2017 21:15',"%d/%m/%y %h:%m"), length.out = 7) #x axis labels in desire

java - How setMessage() works and sound changes in each row? -

i new java , sound api, have written code , not able understand how different sound coming different rows have not changed instrument in code. import java.awt.*; import javax.swing.*; import javax.sound.midi.*; import java.util.*; import java.awt.event.*; public class beatbox { jpanel mainpanel; arraylist<jcheckbox> checkboxlist; sequencer sequencer; sequence sequence; track track; jframe theframe; string[] instrumentnames = {"bass drum", "closed hi-hat", "open hi-hat","acoustic snare", "crash cymbal", "hand clap", "high tom", "hi bongo", "maracas", "whistle", "low conga", "cowbell", "vibraslap", "low-mid tom", "high agogo", "open hi conga"}; int[] instruments = {35,42,46,38,49,39,50,60,70,72,64,56,58,47,67,63}; public static void main (string[] args) { new beatbox().buildgui(); } public

java - Setting up Tomcat in Eclipse on Ubuntu -

Image
i'm trying setup tomcat in eclipse. i've followed tutorial on how install tomcat , i'm able see default tomcat page @ localhost:8080 . what need setup tomcat on eclipse. i following: window->preferences->server->runtime environment->add->"apache tomcat v8.5" as tomcat's installation directory enter /opt/tomcat , specified in tutorial linked above in step 3: install tomcat : we install tomcat /opt/tomcat directory. create directory, extract archive [...] but following error: unknown version of tomcat specified. as can seen here: some more infos: tomcat 8.5.20 eclipse java ee ide web developers (4.7.0) ubuntu 17.04 update: when check permission ls -ltra /opt/tomcat output: total 124 drwxr-x--- 7 tomcat tomcat 4096 aug 2 23:36 webapps -rw-r----- 1 tomcat tomcat 15946 aug 2 23:36 running.txt -rw-r----- 1 tomcat tomcat 7064 aug 2 23:36 release-notes -rw-r----- 1 tomcat tomcat 1723 aug 2 23:

powerbi - R in Power BI: Error in plot.window(...) : need finite 'xlim' values -

using r visualization in power bi error: stack trace: microsoft.powerbi.exploreservicecommon.scripthandlerexception: r script error. error in plot.window(...) : need finite 'xlim' values calls: plot -> plot.default -> localwindow -> plot.window in addition: warning messages: 1: in min(x) : no non-missing arguments min; returning inf 2: in max(x) : no non-missing arguments max; returning -inf 3: in min(x) : no non-missing arguments min; returning inf 4: in max(x) : no non-missing arguments max; returning -inf execution halted ---> microsoft.powerbi.radio.rscriptruntimeexception: r script error. error in plot.window(...) : need finite 'xlim' values calls: plot -> plot.default -> localwindow -> plot.window in addition: warning messages: 1: in min(x) : no non-missing arguments min; returning inf 2: in max(x) : no non-missing arguments max; returning -inf 3: in min(x) : no non-missing arguments min; returning inf 4: in max(x) : no non-missing ar

Pre-populating Model Form with object data - Django -

i have tried various options no luck far. trying instance data pre-populated modelfield. here have: forms.py class edit_project_info(modelform): project_name = forms.charfield(max_length=150) class meta: model = project exclude = ['project_type', 'created_date', 'start_date', 'end_date', 'pm_scope', 'dev_scope', 'design_scope', 'testing_scope' ] view.py def edit_project (request, offset): this_project = project.objects.get(pk=offset) data = {'project_name' : 'abc'} if request.method == 'post': form = edit_project_info(request.post, instance=this_project, initial=data) if form.is_valid(): form.save() return httpresponseredirect('/project_profile/%s/' % offset) else: form = edit_project_info() all empty field. can add initial value forms.py, static rather populated based on form instance. have done here

Varnish sha256 .tgz don't match -

it's me or varnish .tgz signatures don't match ? this have: $ wget https://varnish-cache.org/_downloads/varnish-4.1.8.tar.gz $ sha256sum varnish-4.1.8.tar.gz cd95d1f885479307b7a5d6b1d00e5557c41209f9f2bfaabd22722af423621bbe varnish-4.1.8.tar.gz http://varnish-cache.org/releases/rel4.1.8.html#rel4-1-8 sha256 (varnish-4.1.8.tar.gz) = 908e7fbfa0325498717686b2050181134aa0a69d1495c02b2625cd34d35a4ff1 thanks! it's not you: $ sha256sum varnish-4.1.8.tar.gz cd95d1f885479307b7a5d6b1d00e5557c41209f9f2bfaabd22722af423621bbe varnish-4.1.8.tar.gz

c# - Correct Way to store multiple social accounts using Xamarin.Auth -

in app, have keep logged many social media logins (instagram, facebook, etc...) using xamarin , successfull logged facebook , got data want. if need keep accounts logged, xamarin.auth ? store = accountstore.create(); await store.saveasync(account = e.account, appname); checking code, supose save data in "appname" variable. if login facebook , instagram, per example, how xamarin knows wich 1 ? check if logged, using: account = store.findaccountsforservice(appname).firstordefault();

Spark Session read mulitple files instead of using pattern -

i'm trying read couple of csv files using sparksession folder on hdfs ( i.e don't want read files in folder ) i following error while running (code @ end): path not exist: file:/home/cloudera/works/javakafkasparkstream/input/input_2.csv, /home/cloudera/works/javakafkasparkstream/input/input_1.csv i don't want use pattern while reading, /home/temp/*.csv , reason being in future have logic pick 1 or 2 files in folder out of 100 csv files please advise sparksession sparksession = sparksession .builder() .appname(sparkcsvprocessors.class.getname()) .master(master).getorcreate(); sparkcontext context = sparksession.sparkcontext(); context.setloglevel("error"); set<string> fileset = files.list(paths.get("/home/cloudera/works/javakafkasparkstream/input/")) .filter(name -> name.tostring().endswith(".csv")) .map(name -> name.tostring()) .c

html - Why are my side by side scrolling divs on different levels? -

Image
i've set system of side side scrolling divs (code below). however, whenever there different amount of content in them, appear on different levels (as seen in below picture). i'm not quite sure what's going on , have feeling has css display attribute. code included. project using bootstrap. brackets in code cms. it's automatically embedding content. here's representative jsfiddle: https://jsfiddle.net/d8jopwnr/ my html code: <div class="row"> <div class="col-lg-10 col-lg-offset"> {exp:channel:entries channel="constructs" limit="1"} <h1>{title} <span class="header-box">{abbreviation}</span></h1> <br> <br> <div class="container level-box"> <div class="row"> {if summary!=""}

java - 'else' without 'if' despite use of braces -

i've been getting 'else' without 'if' error following code , i'm not sure why. i've used braces , i'm confused. if(mean >= 90 && mean <= 100){ grade = 'o';} else{ if(mean >= 80 && mean < 90) grade = 'e';} else{ if(mean >= 70 && mean < 80) grade = 'a';} else{ if(mean >= 55 && mean < 70) grade = 'p';} else{ if(mean >= 40 && mean < 55) grade = 'd';} else{ if(mean < 40) grade = 't';} i think not using right structure if-else if statement in java. should : if (testscore >= 90) { grade = 'a'; } else if (testscore >= 80) { grade = 'b'; } else if (testscore >= 70) { grade = 'c'; } else if (testsc

c++ - Why is data type having an effect on performance in this particular case? -

i've written following code benchmarking effect of cache misses on performance: #include <chrono> #include <cstdint> #include <cstring> #include <iostream> // avoiding using power of 2 because of possible performance degradation due cache associativity? static const size_t row_size = 600; static const size_t col_size = 600; static const size_t test_count = 50; #define same_types 1 #define init_to_one 0 #if same_types #define ary_type uint64_t #define ret_type uint64_t #else #define ary_type uint32_t #define ret_type uint64_t #endif ret_type sum_array_rows(const ary_type *a, const size_t step) { ret_type sum = 0; (size_t row = 0; row < row_size; row++) (size_t col = 0; col < col_size; col++) sum += static_cast<ret_type>(a[row * step + col]); return sum; } ret_type sum_array_cols(const ary_type *a, const size_t step) { ret_type sum = 0; (size_t col = 0; col < col_size; col++)

powerbi - Matrix Visuals - How to remove the grand total and keep subtotals? -

Image
in power bi desktop, there way keep subtotals , remove grand total in matrix? for example, in following matrix, doesn't make sense add values multiple years of sales (thus, keep grand total row), necessary add values different months in same year: it's still not yet possible in power bi turn off grand total while keeping subtotals . (it's weird have separate control panels subtotals , grand total toggle option combined 1 under subtotals .) i've come cosmetic workaround may achieve same result: for grand total , can set font color , background color white (or same visual background) total invisible in visual. result:

Fille::stat returns defined on <control> character 0x00 - perl - feature or bug? -

# perl 5, version 22, subversion 1 (v5.22.1) # built x86_64-linux-gnu-thread-multi use file::stat; $wchar = chr 0; $unicode = sprintf 'u+%06x', ord $wchar; $file = './'.$wchar; $sb = stat($file); if($sb){ printf "file %s, size %s, perm %04o, mtime %s\n", $file, $sb->size, $sb->mode & 07777, scalar localtime $sb->mtime; printf "unicode $unicode\n", } ----- gives me.. ---- file ./^@, size 4096, perm 0775, mtime mon aug 14 20:34:21 2017 unicode u+000000 i'm bit baffled. suggestions why happen. feature or bug? stat passes string os untouched. os expects nul-terminated string, sees ./ when pass ./␀ . before 5.20, used case open well. returns error enoent instead. $ perlbrew use 5.20.0t $ ls -1 $ perl -e'open $fh, ">", "abc\0def" or die $!;' no such file or directory @ -e line 1. $ perlbrew use 5.18.2t $ ls -1 $ perl -e'open $fh, ">

objective c - iOS Realm - CPU Overload and block UI when save data -

i have 1 app use realm save data @ device. when need save big list (9k object), app blocking ui , cpu got 130% more 10minutes. tried set save method main thread ui still blocking. can help? want transaction don't block ui , need in background. this method use save objects realm db. receive list of participantes , check before save if object exists in db. dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ (participante *p in participantes) { participante *dbparticipante = [weakself fetchparticipantebyid:p.identification]; if(dbparticipante) { [dbparticipante setidingresso:p.idingresso]; [dbparticipante setidentification:p.identification]; [dbparticipante setidcortesia:p.idcortesia]; [dbparticipante setidevento:p.idevento]; [dbparticipante setnome:p.nome]; [dbparticipante setdocumentonumero:p.documentonumero]; [dbparticipante setcodigoingresso:

ldap - Java DirContext sreach only few records -

when try search records using query (testatt=1) in apache directory studio showing me 17062 records , when run same query on java code 8531 records. java code given below string searchfilter = propfile.getproperty(constants.getallusersquery); string ldapsearchbase = propfile.getproperty(constants.edir_searchbase); searchcontrols searchcontrols = new searchcontrols(); searchcontrols.setsearchscope(searchcontrols.subtree_scope); namingenumeration<searchresult> resultsapp = ctx.search(ldapsearchbase, searchfilter, searchcontrols); int = 0; while (resultsapp.hasmoreelements()) { searchresult result = (searchresult) resultsapp.next(); string dn = ""; dn = result.getnameinnamespace(); if (!dn.isempty()) { edir_allusersdnlist.add(i, dn); i++; } resultsapp.nextelement(); } system.out.println("edir_allusersdnlist : "+edir_allusersdnlist.size()); please me find out issue. using java 8. while (resultsapp.hasmor

php - Comments array / loop not looping -

i'm trying loop comments $feed while loop, however, displaying 1 comment, doing wrong? if remove name, loop. how can name comment while loop? think may solve problem. below current code $rows = array(); while($feed = mysqli_fetch_assoc($sth)) { $query_ppimage = "select id, post_id, relation, userid, file_format media userid = '".$feed['userid']."' , relation = 'profile_picture' union select -1 id, '55529055162cf' post_id, 'profile_picture' relation, '0' userid, 'jpg' file_format order id desc limit 1"; $qppimg = $conn->query($query_ppimage); while($ppimg = mysqli_fetch_assoc($qppimg)) { $newrow = $feed; if($feed['relation'] == 'page'){ $query_type = "select name 'page_name' pages id = '".$feed['relation_id']."'"; $typeload = $conn->query($query_type); while($t

alias not recognized in while read line loop in UNIX -

here sample code: while ifs= read var shopt -s expand_aliases alias fin="cd /directory/" fin done result: script.sh: line 53: fin: command not found i using var in other command. concern here that, after running script error occurs.

javascript - Node Mongodb TypeError: Cannot read property 'find' of undefined -

Image
still working on rest service mongo , node , got error it's kind of weird cause have route call users in mongo , runs out problems, difference it's i'm using 'find' fro , 'findone' ones i'm calling id. read findone it's depreciate in mongo 4 or more can't find proper syntax it. these package , .js i'm working with. //app.js var express = require('express'); var app = express(); var morgan = require('morgan'); var bodyparser = require('body-parser'); var users = require('./routes/users'); //app settings //configure app jade rendering engine app.set('view engine','jade'); app.use(express.static('public')); //add morgan app.use(morgan('dev')); /* 'default','short','tiny','dev' */ app.use(bodyparser.urlencoded({extended:false})) app.use(bodyparser.json()) //root '/' request app.get('/', function(req,