FAQ Database Discussion Community


#1066 - Not unique table/alias: 'course'

mysql
I am trying to join four tables using the below query and I get the above error SELECT student.names, student.surname, coursemarks.mark, class.form,class.id FROM `student`, `course` INNER JOIN `course` on course.courseid = coursemarks.course.id INNER JOIN `coursemarks` on student.idNumber = coursemarks.studentid INNER JOIN `class`on student.idNumber = class.studentID; Here is my database schema...

Can I load multiple QTranslator files, each for different parts of my application?

qt,qtranslate
I can install translator as myApp.installTranslator(&translator) Is it possible to have multiple translation files and load them from different parts of my application? How can I do it?...

Partially filling a rectangle in HTML5

javascript,html5,rectangles
I have a canvas in which I want to draw multiple rectangles (of varying sizes). These rectangles have to be filled or emptied over time, be it automatically or by input from the user. The problem is that I have never programmed HTML5 before and don't know how to partially...

Action Intent like feature in Phonegap

cordova
I have some document like a pdf, doc and excel file. In android we used Action Intent that helps to open such files or prompt with the software that are available in our phone to open that. I would like to do the same using phonegap. Can anyone help ?

Map from JSON to java object with different structure

java,json,mapping,jackson,dozer
I have a JSON string representing an object, and I want to put its information into a Java object (B) with a different structure. Currently the solution I am taking is creating a Java Object (A) with a structure identical to the JSON object, made the conversion from JSON to...

How can I send a file, for example “exe”, with Telnet?

file,smtp,attachment,telnet,email-attachments
With smtp, i know the commands: "HELO", "MAIL FROM", "RCPT TO", "QUIT", but i don't know how can i attach one file. Anyone can help me ? telnet smtp.xxxx.xxxx 25 helo xxxx.xxxx mail from: [email protected] rcpt to: [email protected] data subject: hi hello . quit ...

How to call phone in android fragment class?

android,phonecalls
I want to call to phone when I click OK button. Now I am getting error Error message 12-23 17:19:39.547: E/AndroidRuntime(4095): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL dat=91 90-37-300100 flg=0x10000000 } Here is my code public class ContactFragment extends Fragment { private View parentView; public View onCreateView(LayoutInflater...

basic daterange picker angular js. double entry

angularjs,twitter-bootstrap
I am hoping to create a date range picker using angular js and bootstrap. I have two text boxes and they both open the date picker box. However it enters the date into both boxes at the same time? html snippet <div class="form-group"> <div class="input-group"> <input type="text" class="form-control date" id="dateFrom"...

Repeat text extraction with Python

python,xml,bash,loops,text-extraction
I have the following code which I would like to use to extract texts information between <font color='#FF0000'> and </font>. It works fine but it only extracts one unit (the first one) whereas I would like to extract all textual units between these tags. I tried to do this with...

Sorting files in a directory by date in c# using directory.get files()

c#,file,directory,order,iostream
At the moment I have my code to get some files from a Dir. foreach (var file in Directory.GetFiles(MainForm.DIRECTORY_PATH, "*.csv")) { //Process File string[] values = File.ReadAllLines(file) .SelectMany(lineRead => lineRead.Split(',') .Select(s => s.Trim())) .ToArray(); I want to be able to order these file by date order first before i start...

Removing Element from XML in C# [duplicate]

c#,xml,xml-parsing,xelement
This question already has an answer here: How to remove an xml element from file 3 answers below is the xml and i need to remove the Element SMS where code equals to "ZOOMLA". i am using C# code as below but it does not work. and gives me...

Connecting db using shell script by passing db credentials from shell

linux,oracle,bash,shell
Hi I am trying to connect my database using shell script and by passing the db credentials from shell. I am getting "ORA-12162: TNS:net service name is incorrectly specified". Please find the script below. #!/bin/bash DB_CREDENTIALS=$1 mkdir -p $PWD/logs sqlplus -silent $DB_CREDENTIALS <<EOFSQL set echo on set timing on set...

How to properly clear VFS Ram filesystem

java,filesystems,ram,vfs,apache-commons-vfs
I'm using VFS2 to construct an in-memory filesystem (uring the ram scheme) for tests. After each test I've to clean up (destroy all created files and folders), I'm using the following command: VFS.getManager().getFilesCache().close(); However this doesn't seem to clear everything! what's the proper way to do it?...

Dapper - call Oracle schema.package.function

oracle,stored-procedures,oracle11g,dapper
I can call Oracle stored procedure and function with Dapper, but I have problems with calling a function inside of package. My error is: ORA-06550: line 1, column 39: PLS-00302: component 'funct' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored My code is : using (IDbConnection cn...

Issue with jQuery resize and if :visible.

jquery
I am creating responsive navigation and am experiencing an issue when resizing. Here is a simplified codepen to illustrate the problem... http://codepen.io/anon/pen/xbEwmJ When you start on a wide viewport (desktop view) and then resize down, you'll notice when you click on the hamburger icon, the menu slides down then slides...

Why compareTo param is allways null when sorting a List

java,hibernate,sorting,compareto
Here is my code in ManagedBean: public List posortujGrupe(Set<Uczestnik> sm) { List sortedList2 = new ArrayList(sm); System.out.println("^^^^^^^^^^1"); for(int i = 0 ; i < sortedList2.size() ; i++) System.out.println("i: "+i+" -> "+((Uczestnik)(sortedList2.get(i))).getStatusUczestnictwa()); System.out.println("^^^^^^^^^^2"); Collections.sort(sortedList2); return sortedList2; } It should sort the list that is displayed in in jsf page Here is...

Java convert drawable to bytearray

java,android,facebook,bitmap
I was having some problem when trying to customize the share dialog of Facebook in Android. Basically what I am trying to do is get the drawable image from ImageView component then pass it as params into my share dialog. Here is the codes where I set image to my...

Multiple Object use across class c#

c#
I have three classes that hold data from an input form and then each submit an insert query to the database. There must be a better way of doing this with using the existing objects and a singular stored procedure, but I can't get the existing objects to work in...

Controller not picking up on actions sent from template

ember.js
I have a problem with getting my controller to respond to an action from its corresponding template controllers/calendars/show.js import Ember from 'ember'; export default Ember.ObjectController.extend({ queryParams: ['year', 'week'], year: null, week: null, incrementWeek: function() { var currentWeek = this.get('week'); var nextWeek = moment(new Date(moment().week(currentWeek + 1))).week(); if (currentWeek > nextWeek)...

Dismiss Presented View Controller from Another View in ios

ios,objective-c,xcode,navigation,presentmodalviewcontrolle
I have a ViewController named A. it contains a button to present a new ViewController named LinkedInWebVC. now, I want to dismiss a LinkedInWebVC from A. my code is as follow: -(IBAction)button_tap:(id)sender { _loginWebViewController = [[LinkedInWebVC alloc]initWithNibName:@"LinkedInWebVC" bundle:nil]; [self presentViewController:_loginWebViewController animated:YES completion:^{ [self.oauth1Controller loginWithWebView:_loginWebViewController.webView completion:^(NSDictionary *oauthTokens, NSError *error) { if...

How to paste dummy text from 1 site to my own PHP & MySql

php,mysql
When em pasting dummy text from any website to my textarea it is not saving into mysql server but some time it works correctly i don't no why it is happening kindly tell me why i am facing this kind of confusion please tell me it's urgent. Here is my...

Slice array with objects and get array with objects copies [duplicate]

javascript,arrays,javascript-objects,slice
This question already has an answer here: What is the most efficient way to clone an object? 43 answers When I made a slice of array containig objects new array are still have references to objects in initial array. How can I make a slice with objects copies? var...

Difference between onResume() and onResumeFragments()

android,android-fragments,android-fragmentactivity,android-lifecycle
FragmentActivity.onResume() javadoc: Dispatch onResume() to fragments. Note that for better inter-operation with older versions of the platform, at the point of this call the fragments attached to the activity are not resumed. This means that in some cases the previous state may still be saved, not allowing fragment transactions that...

appending array of option object to multiple selects

javascript,jquery,html
I am trying to append array of option objects to two select tag. But it appends to second select tag only. <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script> <select id="select1"></select> <select id="select2"></select> <script> var options = []; var option1 = new Option("1", "1"); options.push(option1); var option2 = new Option("2", "2"); options.push(option2); var option3 = new...

insert programmatically a panel inside an easyui accordion

jquery,jquery-easyui
I'm using an accordion with jeasyui (version 1.4.1, with jquery version 2.1.3, on a recent firefox 31.3, Linux/Debian/Sid x86-64) The accordion has a somehow sorted (by the AJAX application, to be released under GPLv3) sequence of panels. I would like to insert a new accordion panel in the "middle" (i.e....

Simulink .NET integration

.net,matlab,simulink
I am working on a project where I need to integrate a certain PI-AF (database) with a Simulink model. I know that PI-AF has a certain .NET AF-SDK api through which I can reference/access the elements/attributes. And I also know that you can load a .NET assembly into MATLAB and...

NoClassDefFoundError when attempting to compile main class in Java program, while all resources are imported

java,eclipse,command-line,compilation
I'm creating a small app to send messages to phone numbers using google voice. I made a simple test case that works in Eclipse and can send out messages as expected. However, when I try to run it on a terminal, I keep running into issues. Here is the main...

Elasticsearch - search_type as a body parameter

elasticsearch
I am a bit fighting with specifying search_type as a body parameter. As a query parameter that is just fine and works but haven't found single example in manual where it is specified as a query parameter. POST /index/type/_search { "search_type": {:"query_then_fetch"}, "explain": false, "query" : { "query_string": { "default_field":...

Powershell, copy modified time of file to semaphore file

powershell,null,copy,semaphore,last-modified
I would like to use powershell to copy the modified time from a file to a new file but have the content of the file be nothing. In command prompt I would use the following syntax: copy /nul: file1.ext file2.ext The second file would have the same modified time as...

Adding data to a database in ruby

ruby-on-rails,ruby,sqlite
I am in quite the pickle , I think I overreach with my current ruby knowledge but I don't want to give up. I currently have a tweeter that can post and people can follow other people thanks to https://www.railstutorial.org/book/ . I do want to add hashtags to this tutorial...

Chrome crashes while performing regex matching

javascript,jquery,html,regex,google-chrome
I'm trying to match 50 email ids seperated by comma (,) with a regex and every time i try to perform this operation chrome crashes. But, Safari seems to handle it. I'm using the below code var emailValidator = /^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,4},*[\W]*)+$/; if(!formData.emailList.match(emailValidator)) showWarning("Invalid email ids"); Can someone tell me why this...

jquery surround selected text and image with span tag

javascript,jquery,html,range,selection
I want to surround selected text and image or texts with multiple tags with span tag in jquery. How can i achieve that, I have seen many examples like the below jsfiddle code. All the examples are done only with text, but now want to surround both text and image...

Protect remote resources when served with nodejs

node.js
This is more of an architecture question involving nodejs as implementation. I have on a folder not exposed by the webserver files that I want to offer to the user. The way nodejs should expose the resource to the end user is via a one shot link, that once is...

Transferring one datagridview data to another datagridview in VB.NET

.net,vb.net,datagridview
Issue: Moving multiple rows and columns from one datagridview(non-data bound) to another datagridview and then displaying the second datagridview rows from another form which is data bound. Developing platform : VB.NET 2008 Issue description: I have some rows and columns in another form's datagridview which is now populated from a...

Better database basis for table with multiple date informations

mysql,database-design
What do you think is the better basis, in sense of "easyer to use" with SQL Syntax - the first or the second table? Please give reasons. table one: +----+--------------------------------------+ | id | date1 | date2 | date3 | +----+------------+------------+------------+ | 1 | 2014-02-15 | 2014-03-24 | 2014-03-24 | |...

jsf render components with js

jsf,primefaces
Let's say I have <p:outputPanel/> What I want to do is to specify rendered attr using js method not serverside. This is for improving performance. So I need something like : <p:outputPanel rendered = "someJsFunction()"/> What is the solution?...

Error in Plotting circle for Similarity measure using matplotlib in python

python,matplotlib,plot,visualization
I am working on project to find similarity between two sentences/documents using tf-idf measure. Now my question is how can I show the similarity in a graphical/Visualization format. Something like a Venn diagram where intersection value becomes the similarity measure or any other plots available in matplotlib or any python...

getting user-agent info from flask's socketio

python,websocket,flask,socket.io,flask-socketio
Is it possible to get user-agent information from socketio in flask? I guess user related information is sent to socket server during handshaking. If not possible, I will require clients send this information manually. ...

RowSet Returns From Inter-active queries

oracle,oracle11g
New to Oracle, having loads of niggling troubles, strong in tSQL not in pl\SQL I want to list the contents of a table in SQL Developer dependant on some pre-programmed variables, ultimately I would like this to be like a MS-SQL Stored Procedure where I call it passing parameters... I...

Move website to subdirectory

.htaccess,redirect
I'm working on a new version of a website and I'd like to move the files/folders of the old one to a subdirectory 'old'. Is there a way to keep all links (css, references to "includes" folder and files, etc.) working using a redirect rule, instead of having to manually...

Adding a non-null ForeignKey field in Django

django,python-2.7,django-models,django-admin
I want to add a new Model which consists of a refernce to django users model. The existing model is signed in users table provided by django and new model has a foriegn key to user. What is the command to add all existing users in the django users table...

Why do I get this warning?

c,c99,keil
I'm trying to write this program: #include "stm32f10x.h" #include "ILI9325.h" /* Private functions ---------------------------------------------------------*/ /******************************************************************************* * Function Name : main * Description : Main Program * Input : None * Output : None * Return : None * Attention : None *******************************************************************************/ int main(void) { uint8_t b,c; Lcd_Configuration(); Lcd_Initialize(); Lcd_Clear(0xffff);...

reverse proxy with a connection pool using a custom session endpoint?

apache,session,nginx
I'm currently using nginx as a proxy to provide connection pooling to a backend database service that uses basic HTTP authentication on connections: user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 10000; } http { client_max_body_size 0; sendfile on; upstream cloudant_backend { server <hostname>.cloudant.com:443; keepalive 64; } server {...

Laravel 4: include template with parameters in single line

laravel,laravel-4,blade
I'm trying to save a blade template into a javascript variable but I can't figure out how to remove the line breaks from the template. I looked at extending blade and created the following code based on BladeCompiler:compileInclude() which removes all line breaks, but only for templates without parameters. Blade::extend(function($view,...

converting a function into a php shortcode

php,html,wordpress
i'm new to php wordpress shortcode and i'm having issues regarding creating a shortcode which i can insert into my content. The function/shortcode that i'm creating has no input values. The issue is that when i'm using it in the content all content seem to disappear and nothing is shown...

Visual studio web essentials 2013 cannot compile bootstrap.less V3.1.1

visual-studio,twitter-bootstrap-3,less
I have a fresh ( few days old ) and fully up to date install of VS2103 and Web Essentials 2013. When I compile a simple less file of my own in "~/Content/bootstrap/less/site.less" it works fine. I Can see the .css files. But if I try to either import bootstrap...

QString New Line

c++,qt,qstring,qtcore
I want to add a new line to my QString. I tried to use \n, but I am receiving an error of "Expected Expression". An example of my code can be found below: if (ui->lineEdit_Company_Name->text().isEmpty()) ErrorLog = ErrorLog + "Company Name is empty", \r\n; if(ui->lineEdit_Company_Owner->text().isEmpty()) ErrorLog = ErrorLog + "Company...

How to extract attributes values from svyciprop object?

r,survey,confidence-interval
How can I extract attributes from svyciprop object below to a data.frame: library(survey) api <- read.dta(file = "http://www.ats.ucla.edu/stat/stata/library/apipop.dta") data(api) dclus1 <- svydesign(id=~dnum, fpc=~fpc, data=apiclus1) prop.ci <- svyciprop(~I(ell==0), dclus1, method="li") printing prop.ci Yields: > prop.ci 2.5% 97.5% I(ell == 0) 0.021858 0.000664 0.11 str(prop.ci) > str(prop.ci) Class 'svyciprop' atomic [1:1] 0.0219...

What does systemFlags:1.2.840.113556.1.4.803:=2 mean in ldap?

c#,active-directory,ldap,ldap-query
When I write the following ldap query in C#: (&(objectClass=crossRef)(systemFlags:1.2.840.113556.1.4.803:=2)) What exactly the systemFlags:1.2.840.113556.1.4.803:=2 filter is used for? I'm trying to follow the following MSDN explanation but yet I don't understand : http://msdn.microsoft.com/en-us/library/cc223141.aspx Thank you in advance...

delete uploaded image, upload new image and change database reference

php,image,file-upload,upload,image-uploading
<?php $image = $_FILES['image']; //name of new file selected $imagename = $image['name']; //name of file in database $filename = $row['filename']; //folder to move image $TARGET_PATH = "../$university/img/users/$category/$username/"; //if imagename in DB is different to image just selected if ($filename <> $imagename) { // *** Include the class include("resize-class.php"); //if the...

how to change language in openERP(odoo 8)

odoo
I want to change the language of openERP's latest version Odoo 8, some one give me suggestion and I am also googling about this problem and I found that change into the preferences but that menu also I not locate, Please give me a suggestion for how to do that...

Problems passing value from Google Play URL to app via INSTALL_REFERRER Intent

android,android-intent,google-play
I'm having problems passing transaction_id from google play URL after app is installed. The URL looks something like this: https://play.google.com/store/apps/details?id=com.bouncing.mate.bouncer&transaction_id=12345 When app is installed using this url, I try to retrieve transaction_id value from INSTALL_REFERRER Intent. To do this, I declared a receiver in my manifest: <!-- The Google Play...

IndexOf not finding string in text

javascript,jquery,html
So I've this <p> that contains characters wrapped with a <span> that in total form a sentence. Now I need to insert some <br/> at several unknown positions in the <p> where certain words are positioned. To do this I wrote a function: function spaceInsert() { var sentence = [...

Name for sender/receiver of messages

java,naming-conventions
I have a class which is responsible for sending and receiving messages. Messages are sent by using myInstance.send(message, channel) and messages are received by registering a MessageListener with a channel to listen on. I would usually just call this something fairly generic such as MessageManager but I have recently read...

MySQL Insert INTO using SELECT from another table with additional data

mysql
What I'm Trying To Achieve I'm trying to insert a record from one table into another, but also add additional data that isn't sourced from the second table. Example Problem I'm trying to put insert field1, field2 and field3 into tableA. field1 and field2 are sourced from tableB. However, field3...

How to set the separator for HttpHeaders?

c#,.net,asp.net-web-api,http-headers
In my WebApi application is there anyway to get the raw data when multiple headers have the same name? When passing in multiple Http headers with the same name they get joined with a ', ' as a separator. The HttpHeaders class under System.Net.Http.Headers seems to be the culprit. Some...

Anaconda: Attribute error while running pylab with anaconda distribution on Windows

python,matplotlib,anaconda
I am trying to import pylab and this is the code that I am writing. import pylab pylab.figure(1) pylab.plot([1,2,3,4],[1,7,3,5]) pylab.show() But I am getting the error that File "E:\mitedx1\mitedx2\week1\pylab.py", line 2, in <module> import pylab File "E:\mitedx1\mitedx2\week1\pylab.py", line 4, in <module> pylab.figure(1) AttributeError: 'module' object has no attribute 'figure' [Finished...

iOS subview custom transition

ios,objective-c,xcode,user-interface
When presenting a UIViewController that implements UIViewControllerTransitioningDelegate it is easily possible to customize the viewtransition. Now I would like to know if I can customize a viewtransition for a subview? Lets say I have a tapable tile that currently flips when tapped (UIViewAnimationOptionTransitionFlipFromRight). Although that is a very nice effect...

How to create process attachment in the Activiti

alfresco,activiti
I have used the following code in the Alfresco 4.1 but after upgrading to Alfresco 4.2 it stop working and throw exception like "org.activiti.engine.ActivitiObjectNotFoundException: Process instance activiti$401 doesn't exist". I've checked the process id in database it is exist. Any ideas how to create attachments? the failing code below //...

Mysql select Query with multiple conditions of same column

mysql,sql,select,where,in-operator
I need MySQL select query like select wt_id,wt_name from work_type where cat_id=1,2,5..; Is it possible?...

Why “<<” operator can be inherited but “>>” operator can't?

c++,inheritance,operator-overloading
Forgive me if it's just a silly question. I'm still new in C++ and this is my practice. I'm trying to create a simple game with Actor Object and Enemy Object that inherit from Unit Object. I put all of stats and overloaded operator that Actor and Enemy share in...

JQuery page scroll animation only works in chrome

javascript,jquery,html,google-chrome
I have the following two html files. When you click on the link in the first page (a.html), it will open a second page (b.html) and scroll down to the relevant place. I have added a JQuery animation to the scroll. This works perfectly in chrome but not in other...

Trouble with Arithmetic operations in Assembly

assembly,x86,att
I am trying to solve an arithmetic operation which is giving a different output in AT&T assembly program. The arithmetic operation is something like this ((i-(a+b)*(g+c))/((h*e)+(f+j)*d). The values are the following a: .long 1 b: .long 2 c: .long 3 d: .long 1 e: .long 1 f: .long 1 g:...

Are Application Settings reliable?

c#,winforms,visual-studio,application-settings
I'm wondering if Application Settings are reliable for storing values? I was thinking of storing my application's XML file path in there so when I run the program, it knows where the XML file is located even if the path was changed during last runtime. Is there a chance that...

JSON service is not getting in controllers

angularjs
I don't know what wrong with my code. <body ng-app="MyApp"> Please check this url http://jsfiddle.net/9budtfmo/1/ The JSON response is not getting in my controllers. If I have added the json data in the variable 'users' without using $http.get() method, it will work perfectly. But I didn't get response when I...

If write to the remote memory over PCIe which marked as WC(Write Combined), then do we have any consistency automatically?

multithreading,concurrency,x86,x86-64,memory-fences
As we know on x86 architecture the acquire-release consistency provided automatically - i.e. all operations automatically ordered without any fences, exclude first store and next load operations from different locations. (As said Herb Sutter on page 34: https://onedrive.live.com/view.aspx?resid=4E86B0CF20EF15AD!24884&app=WordPdf&authkey=!AMtj_EflYn2507c ) And as we know when we write to the remote WC-marked...

Two .htaccess files doesn't work together

.htaccess,mod-rewrite
I have two htaccess files and one of them located in root directory and other one in gifts/ directory. Root .htaccess contains: RewriteEngine on RewriteCond %{REQUEST_URI} /gifts/ RewriteRule gifts/([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)$ gifts/catalog.php?catalog=$1 [NC,L] RewriteCond %{REQUEST_URI} /gifts/ RewriteRule gifts/([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)/([0-9]+)$ gifts/catalog.php?catalog=$1&page=$2 [NC,L] Gifts/ .htaccess contains: RewriteEngine on RewriteCond %{HTTP_HOST} ^gifts.example.com$ [NC] RewriteRule...

custom keyboard in iOS 8 access

ios8,custom-keyboard
is a custom keyboard in iOS 8 able to get access to the iPhone camera ?? because i heard that it can't get access to the microphone ...

Wrong date formatting

javascript,jquery,morris.js
I'm using Morris.js to display a line chart, and feeding it with timestamps as X axis values. As an example will be better than any explanation, here is an example data : { "1415376000": {"VALUE1":0,"VALUE2":0,"VALUE3":16,"VALUE4":0}, "1415980800": {"VALUE1":0,"VALUE2":0,"VALUE3":2,"VALUE4":0}, "1416585600": {"VALUE1":0,"VALUE2":0,"VALUE3":2,"VALUE4":0}, "1417190400": {"VALUE1":0,"VALUE2":0,"VALUE3":7,"VALUE4":0}, "1417795200": {"VALUE1":10,"VALUE2":6,"VALUE3":16,"VALUE4":3}, "1418400000": {"VALUE1":5,"VALUE2":4,"VALUE3":67,"VALUE4":5},...

java.nio.charset.UnmappableCharacterException: Input length = 1

xml,scala,save,runtime-error
Full error message: java.nio.charset.UnmappableCharacterException: Input length = 1 at java.nio.charset.CoderResult.throwException(CoderResult.java:261) at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:266) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116) at java.io.Writer.write(Writer.java:140) at scala.xml.XML$.write(XML.scala:108) at scala.xml.XML$$anonfun$save$2.apply$mcV$sp(XML.scala:91) at scala.xml.XML$$anonfun$save$2.apply(XML.scala:91)...

Is there any caching enabled setting at F5 loadbalancer level?

asp.net-mvc-2,iis-7.5,f5
I have a single webserver for my application, where I deploy the code. The webserver is linked with F5 loadbalancer. I have deployed the latest code twice on the webserver and also validated the code by manual checking. I also cross checked the database entries on the database server (SQL...

Index not updated when upserting document

java,elasticsearch
I'm using ElasticSearch 1.4.2 and want to upsert some document in json format to it. When I try to insert a test document I can only find it via id, but not via search of the logName field or others that I tried. Probably I miss a step in the...

Reading all the leaf nodes for a given Parent Node

c#,xml,xpath
I need a list of leaf nodes under the given parent node body. Basically I want all the nodes like 11 and 10 from the below XML. I tried this but it brings all the nodes. //[not()] for example I want to give something like this var vNode= nodeBody.SelectNodes("Body"+@"//[not()]"); which...

stack variable lifetime curious example [duplicate]

c++
This question already has an answer here: Can a local variable's memory be accessed outside its scope? 16 answers Please consider this simple example: #include <iostream> const int CALLS_N = 3; int * hackPointer; void test() { static int callCounter = 0; int local = callCounter++; hackPointer = &local;...

Two y-axes plot for multiple data set in Matlab

matlab,plot
I am trying to create two y-axes plot in Matlab. I have two groups of data, with each group having three plots of similar type. When I am trying to plot it, the scaling on right hand side y-axis get messed up. I would appreciate some help. X = [50,...

Downsampling large 3D image in numpy

python,image,numpy
I need to downsample large 3D images (30GB +) that are composed of a series of 2d tiff slices by arbitrary non-interger factors. scipy.ndimage.zoom works well for input images that fit into RAM. I was thinking about reading in parts of the stack and using scipy.ndimage_map_coordintes to get the interpolated...

Splitting a List on the basis of comman ( ,) delimiter and handling NUmberformat exception

java,string
I have the following method applyIncentives which takes ListlstIds public void applyIncentives(List<String> lstIds) throws Exception { Session session = null; Transaction tx = null; String pricingTierId = null; if (lstIds != null && lstIds.size() > 0) { for (String lstpricingTierIds : lstIds) { pricingTierId = lstpricingTierIds.trim(); } } try {...

how to use retrofit with otto and picasso [closed]

android,retrofit,picasso,otto
I want to load data from my API into custom gridview in my android application, my API return some text information and some image URL as JsonArray. I want to use retrofit and otto and picasso (for loading image), also I want asynchronous fetching. The problem is I can't understand...

C# Export to excell

c#,excel,export
ActionResult: var strLawTable = new StringBuilder(); strLawTable.Append("<thead>"); strLawTable.Append("<tr>"); strLawTable.Append("<th style=\"text-align: right\">Dollar</th>"); strLawTable.Append("</tr>"); strLawTable.Append("</thead>"); strLawTable.Append("<tbody>"); foreach (Currency currency in Model.List) { strLawTable.Append("<tr>"); strLawTable.Append("<th style=\"text-align: right\">" + GetExcellFormatString(Currency.USD) + "</th>");...

Using findSimilarColor to set a Background on Excel file

java,excel,palette,poi-hssf,hssf
I'm having a little problem using the findSimilarColor on my java code. I already read some articles from the stackoverflow that helps me get to the following code. HSSFCellStyle style = wb.createCellStyle(); HSSFPalette palette = wb.getCustomPalette(); // get the color which most closely matches the color you want to use...

Android Studio Plugin issue

android,android-studio,android-gradle
I am new in android studio I am importing a project i android studio and getting this issue. You can see error.I did download new android Studio Bundle.Please help me in this.thanks Error:(23, 0) Gradle DSL method not found: 'runProguard()' Possible causes:<ul><li>The project 'shalomapps' may be using a version of...

How to pass long filename in url and download the file using php function?

javascript,php,html
I have a following function that downloads the file whose name is passed as a parameter in the url. Here is the code: public function actionDownloadFile($filename) { $file = Yii::app()->request->getBaseUrl(true) . '/upload/digitaluploads/' . $filename; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($file) . '"'); readfile($file); } This function is called from...

Soundcloud API - How to get all Favorite Sets?

soundcloud
Is there an official way of getting all Favorites including the favorite Sets of the user or getting all playlists including the favorite sets ? i tried the following urls but none of them gets the job done: /me/favorites/sets /me/sets /me/playlists Any Ideas ?...

Every Nth Item RavenDB

c#,ravendb
Any way I can get the every Nth doc in RavenDB? I tried something like this, as seen on here: Query<MyDoc, MyDoc_Index>().Where((x, i) => i % nStep == 0); I get the following error: Could not understand how to translate '(i % 1000)' to a RavenDB query. Are you trying...

Constant alert when I click in li element using jQuery

jquery
I am having this HTML code: <div id="pagination"> <ul> <li class="active"><a href="?page=1">Page 1</a></li> <li class="active current"><a href="?page=2">Page 2</a></li> <li class="active"><a href="?page=3">Page 3</a></li> </ul> </div> I have this jquery code: $("#paginacion ul li.active").click(function (event) { event.stopPropagation(); alert(); $(this).find("a").trigger("click"); }); Why when I click in li element it an alert appears? I...

Linq and Entity Framework: Find first X datarows with same status

c#,linq,entity-framework,linq-to-entities
I have the following items in my database: id status changeDate userId .... 1 1 2 1 3 1 4 2 5 2 6 3 7 2 8 2 9 1 I need a list of first 2 same status items: Expected result loop 1: id status changeDate userId .......

Image onload not working with img and Blob

javascript,image,canvas,blob,onload
Here is the problem, I need to create an image file with a .svg file. I have a function which should draw the svg, and then, i get it from a canvas to save it as an image file. my draw function is : function drawInlineSVG(ctx, rawSVG, callback) { var...

ckeditor in Drupal 8 custom module

ckeditor,drupal-8
I am currently developing a custom module for Drupal 8. While adding a backend form to get some data from users I tried to get the ckeditor configured to replace my textareas... and failed >.< here is the form definition: $form['text'] = array( '#type' => 'textarea', '#title' => t('Text'), '#required'...

p:calendar does not work

jsf,jsf-2,primefaces,calendar
I have a very strange problem regarding <p:calendar> component. I have a calendar in a <p:panelGrid> (see below), but when I open my page, calendar is not opened when clicked on a "input box" like it should. <p:panelGrid> <p:calendar value="#{backingBean.date}" /> </p:panelGrid> Of course, date attribute is in my backing...

Javascript Function for mouse events

javascript,jquery,events,mouse,sender
I am trying to change the following code so that instead of having to click-and-hold the linked image to make it bigger (150 into 300), I could click it once to make the image bigger, and click it again to make the image return to smaller. I have to do...

How to check version of libpkcs11 on Solaris

solaris,pkcs11,pkcs#11,sunos
As stated in subject. How to check in terminal which version of pkcs11 I've got on SunOS 5.11? How is it possible to update this library? It is causing me some issues to my Java standalone application. Thanks!...

How to get the path in which my .bat file is saved?

batch-file,path,cmd
Suppose i have a .bat file saved in a folder . When my .bat file runs i need to get the path in which this .bat file is saved . I tried Google it but could not find the answer. Thanks.

Parameter class like a class

java,generics,methods
I want do a GenericDao pass by parameter Entity but I don´t know how to convert Entidad to Object. I tried put GenericDaoWithOrder<Entidad extends Object> but does not work. public abstract class GenericDao<Entidad> { @PersistenceContext private EntityManager em; public List<Entidad> findAll(Integer start, Integer maxResult) { TypedQuery<Entidad> query = em.createNamedQuery(Entidad.class.getCanonicalName() +...

sending curl request twice in a function not working

php,curl,dictionary
I am sending curl request to freemaptools.com to find zipcode in a radius.My code is below function get_zip_in_radius($lng,$lat,$radius,$a) { $headers = array( 'Referer:http://www.freemaptools.com/find-zip-codes-inside-radius.htm', 'User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36', 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language:en-US,en;q=0.5', 'Connection:keep-alive', 'Pragma:no-cache', 'Cache-Control:no-cache',...

Django getting related items in self-referential ManyToManyField in view

python,django,sorting,django-orm
How do I get all the items associated with a part via the self-referential ManyToManyField? How to I fix my view to get part_list to contain a list of all the parts associated with 'product' and in the order specified by order_by? # views.py def productdetail(request, slug): product = get_object_or_404(PartModel,...

Yii echmultiselect not filtering multiselect

php,yii,widget,cgridview,jquery-multiselect
i'm having problems with echmultiselect in my project, it doesn't filter at all and inhibits other column filters already working. View array ( 'name'=>'typeSelectedName', 'value'=>'$data->typeSelected->name', 'filter'=> $this->widget('EchMultiselect', array( 'model' => $model, 'dropDownAttribute' => 'typeSelectedName', 'dropDownHtmlOptions'=> array( 'style'=>'width:225px;', 'multiple'=>true, ), 'data' => array('A'=>'A','B'=>'B','C'=>'C','Z'=>'Z','X'=>'X','K'=>'K','T'=>'T'),...

Excel VBA function to solve impossible round-robin tournament roster with venue constraint

excel,vba,excel-vba
I am really having difficulty generating a round-robin tournament roster with the following conditions: 10 Teams (Teams 1 - 10) 5 Fields (Field A - E) 9 Rounds (Round 1 - 9) Each team must play every other team exactly once. Only two teams can play on a field at...

Controller splitting ViewBag model into multiple pages with database parameters is skipping records

javascript,asp.net,asp.net-mvc,razor
Summary: Separating a list of Services into multiple pages by a page limit is losing a record in between the two pages. The second page starts from the same ID regardless of change using Razor. In other words, I need Page 2 to pick up where Page 1 ends. This...

Init SqlDependency and notify changes

sql-server-2008,notifications,messaging,service-broker,sqldependency
I need something telling to my app when someone has updated data in the database. If I don't have misunderstood, SqlDependancy is what I need. I have followed this tutorial and write this code: class dbListener { public dbListener() { Debug.WriteLine(MainWindow.dbContext.Database.Connection.ConnectionString + "Password=12345;"); SqlDependency.Start(MainWindow.dbContext.Database.Connection.ConnectionString + "Password=12345;"); connection = new SqlConnection(MainWindow.dbContext.Database.Connection.ConnectionString...

How to get rid of inline code inside a plugin when building a Chrome Extension

javascript,google-chrome,google-chrome-extension
I'm building a Chrome Extension using the midi.js plugin. One of the functions inside that plug returns a script to the DOM, and I don't know how to inject this script directly, which I must do, since it's a security violation. This is the function - var addSoundfont = function(text)...