Home » Web Development » Page 6743

I have a dataset with several different measures (questionnaires)
in it. Each record has the score for one participant, at one
timepoint, on one of the measures. I am iterating over the list of
measures, creating a line graph for each one, and saving that graph as
a PDF with a filename based on the measure's number (e.g.,

This all works fine, except that the PDFs that are created seem to
be corrupted (see below for specific error messages). What's odd is
that if I pick any one measure and run the same code for that measure,
it works fine -- it's only when I run them all in a loop that I get
broken PDFs.

Question: Why would creating a file or filename within a
loop produce broken PDFs?

Specifics: I'm using R 3.1.0 on Mac OS 10.9. When opening the
broken PDFs in Preview, I get the error "It may be damaged or in a
file format that Preview doesn't recognize." When opening them in
Adobe Reader, I get "There was an error opening this document. This
file cannot be opened because it has no pages."

Example: Below is a minimal example (the real code
does a lot more processing in the loop, so it wouldn't work to use a
more idiomatic apply approach).


df<-structure(list(measure = c(1, 1, 1, 1, 2, 2, 2, 2), month =
c(3, 6, 12, 18, 3, 6, 12, 18), mean = c(-0.4,-1, -1.03, -0.85, -6.71,
-6.94, -7.86, -6.77)), .Names = c("measure", "month", "mean"),
row.names = c(NA,8L), class = "data.frame")

This produces two PDFs, graph1.pdf and graph2.pdf, neither of which
I can open:

for(i in min(df$measure):max(df$measure)) {
ggplot(g1, aes(x=month, y=mean)) + geom_line()

However, running the same code outside of a loop produces 2 pdfs
that I can open without problems:

ggplot(g1, aes(x=month, y=mean)) + geom_line()

ggplot(g1, aes(x=month, y=mean)) + geom_line()

I have this set of data that I get from html form. It
is basically a multidimensional array.


array(3) {
array(2) {
string(1) "2"
string(1) "4"
array(2) {
string(1) "5"
string(2) "96"
array(2) {
string(1) "7"
string(1) "8"

Problem: What i want to do, is to go over this
array and for each iteration create a data

So for example:

First iteration:

$data = array(
'r1' => '2'
'r2' => '5'
'tekma_id' => '7'

Second iteration:

$data = array(
'r1' => '4'
'r2' => '96'
'tekma_id' => '8'

I've tried with this:

foreach ($data as $key => $value) {
foreach ($value as $index => $v) {
echo "<br>";
echo "r1: $v";
echo "<br>";
echo "r2: $v";
echo "<br>";
echo "tekma_id: $v";

But it didn't work. Sorry for my bad english and thanks for any

I want to get element value of language (Women) & categories
xlink( rel="nofollow">http://test.com/api/categories/4 & href="http://test.com/api/categories/8"
rel="nofollow">http://test.com/api/categories/8) from associations
element. i tried to get name but language element keep repeating so i
get other values in my array besides name.

I have not added code to get xlink because i am trying to get name
right now, so suggest me to get xlink of categories.

I am looking for library/parser for prestashop webservice.

Here is the xml response:-

 <?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<language id="1"
<language id="1"
<language id="1"
will find here all woman fashion collections.</strong></p>
<p>This category includes all the basics of your wardrobe
and much more:</p>
<p>shoes, accessories, printed t-shirts, feminine dresses,
women's jeans!</p>]]></language>
<language id="1"
xlink:href="http://test.com/api/languages/1" />
<language id="1"
xlink:href="http://test.com/api/languages/1" />
<language id="1"
xlink:href="http://test.com/api/languages/1" />
<categories node_type="categories">

Here is my code

-(void)parser:(NSXMLParser *)parser
didStartElement:(NSString *)elementName namespaceURI:(NSString
*)namespaceURI qualifiedName:(NSString *)qName
attributes:(NSDictionary *)attributeDict
if ([elementName isEqualToString:@"language"])
results = [attributeDict objectForKey:@"name"];
recordResults = TRUE;

-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
results = [[NSMutableString alloc] initWithString:[string

-(void)parser:(NSXMLParser *)parser didEndElement:(NSString
*)elementName namespaceURI:(NSString *)namespaceURI
qualifiedName:(NSString *)qName
if ([elementName isEqualToString:@"language"])
recordResults = FALSE;
[test addObject:results];
results = nil;

I have a Jenkins instance running behind a firewall and I do not
want to expose the Jenkins UI to the internet. (Even with security on,
that is definitely not an option).
My wish would be to open a different port, that is only able to
trigger builds, but not exposes the UI. I browsed the plugin list, but
I did not find any suitable plugin.
My current setup is running apache as a proxy and allowing the trigger
via regex-module on a different port. (But not any other URL).
The apache does to much extra load (and memory, its a very small
machine), so I would really like to get rid of it.
Has anybody a suggestion how to allow triggers via an open port, but
not exposing the Jenkins UI or other Jenkins URLs through that

I am developing a GUI on MATLAB and for some unknown reason I am
unable to get the callback function of any new button I am adding.

I remember when putting in a new button I should just put the
button on the GUI and press save, the function is generated

For some reason it is not doing that anymore!
This below does not show up anymore:

function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

Also, if I right click on a button and go to the callback function,
only the property inspector is opened.

I dont know whats going on it can be something really stupid that I
am missing but any help would be great!


I have created telerik report wizared, Now i want write code in vb
class file to connect entity datasource with entity model. How can i
do this?

I am trying to append index value to element using the loop. i made
a closure to avoid the multiple index appended.

but my closure function still adding the
multiple(previous) index to dom

    var $newdiv =
$col = $('<div />');
var add = function () {
for(var i=1; i<=10; i++){
(function x (n) {
return function () { //not working!


$('button').click(function () { add()});


How can I convert a dateutil.relativedelta object to a
datetime.timedelta object?


# pip install python-dateutil

from dateutil.relativedelta import relativedelta
from datetime import timedelta

rel_delta = relativedelta(months=-2)
# How can I convert rel_delta to a timedelta object so that I can call
total_seconds() ?
time_delta = ???(rel_delta)
time_delta.total_seconds() # call the timedelta.total_seconds()

Can i change the color of text in an "li" html tag on

<li style=" border:2px;
<a href="testrequestform.php" title=" Test Request">Test

I search the document but I don't find anything about ACL
implementation in cakephp 3.
How can I implement authorization with ACL in cakephp 3?

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ C/C++/C#
+ VB/VB.Net
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow