mercredi 31 décembre 2014

Null exception on HttpContext.Current.Request.Cookies when firing SignalR method


Vote count:

0




First of all Happy new year to all! I shouldn't really be thinking about code today haha. I'm having an odd issue that I cannot seem to figure out or even understand properly.


(Sorry about the formatting, Couldn't get the editor to work - seemed to incorrectly format the code. Please feel free to edit this!)


Basically I have a basic Authorisation method that fetches a security token (cookie) and compares it to the currently logged on user. When firing this from a SignalR method it throws a null exception but I know the user has security token. This works fine without SignalR.


I'll provide code etc..To help understand the problem.


The Architecture:



  1. Business Layer


  2. Presentation Layer


    //Located within the business layer public static User getUserBySecurityToken() { string securityToken = ""; if (HttpContext.Current.Request.Cookies["SecurityToken"] != null) { securityToken = HttpContext.Current.Request.Cookies["SecurityToken"].Value.ToString();

    }



    return user;
    }


    //Located within the presentation layer (hubs) public void Arrange(int tid, string status, string content) { //Get logged on user Business.User user = Business.User.getUserBySecurityToken(); if (user != null) { Clients.Group(user.campaignName).changeTicket(tid, status, content); }



    }


    //Located within the presentation layer (client side script) $(document).on('click', '.move-option-js', function (e) { //This does not even get called due to cookie being null window.hubReady.done(function () { panelHub.server.arrange(i, s, content); }); });




Please note I have omitted some code for the readability. I hope I could get a better understanding of this problem and maybe slightly re-factor the code to get it working.



asked 16 secs ago







Null exception on HttpContext.Current.Request.Cookies when firing SignalR method

Unable fetch geo location in android 4.3


Vote count:

0




I am trying to fetch in cordova using getCurrentLocation of goelocalion. I was able to get location in android 2.3. I got geolocation object in console.log(navigator.geolocation);


Console logs:



01-01 12:43:47.354: I/Web Console(20388): [object Geolocation] at file:///android_asset/www/js/index.js:6


My device cofigrations:


enter image description hereenter image description here



asked 22 secs ago







Unable fetch geo location in android 4.3

How to store html tags in wordpress


Vote count:

0




How can i make my wordpress database store data with html tags :


(eg. <p>, <tr>, </br>, etc)


instead of plain text.



asked 1 min ago







How to store html tags in wordpress

Select Box Validation In angularJS


Vote count:

0




I want to enable the save button on successfully validation:



<form name="schedulerForm" class="form-horizontal">
<div class="row">
<div class="col-lg-12 col-md-12" ng-class="{'has-error' : schedulerForm.jobName.$invalid && !schedulerForm.jobName.$pristine }">
<h4 class="text-center">Assign Job Schedule</h4>
<select class="form-control" ng-change="getJobDetail(filterType)"
ng-model="filterType" id="jobName" required name="jobName">
<option value="">Select Job</option>
<option value="{{job.id}}" ng-selected="filterType == job.id"
ng-repeat="job in jobs" ng-disabled="jobStatus">{{job.jobName}}</option>
</select>
</div>
</div>
<button type="button" class="btn btn-primary"
ng-click="assignSchedule()" ng-disabled="schedulerForm.$invalid">Save</button>


On successfull validation I am unable to get the enable button its always in disabled mode.. Please help me out or guide where I am doing mistake...



asked 37 secs ago







Select Box Validation In angularJS

Grabbing the top (or lowest) result from a row sorted by groups of ids?


Vote count:

0




So the title might be a little confusing because I'm a little confused myself. What I am trying to do is grab the lowest time of a completed map from a mysql database to display in a table on a website. The maps are sorted by an id (MapID) with a time on the same row.


Example of a couple of rows with same MapID (the time is in seconds):



MapID: Time:
1 28.234
1 24.874
1 18.244
2 213.521
2 164.6


So I'd like to grab the lowest time from each MapID and be able to display that on a table in my site. How would I query something like this?



asked 46 secs ago







Grabbing the top (or lowest) result from a row sorted by groups of ids?

How to Create PDF in SAPUI5


Vote count:

0




Is it possible to generate a PDF using fetched Data in SAPUI5 form?


If yes, Do we have to use any API or something to achieve that?



asked 1 min ago

Rajan

175






How to Create PDF in SAPUI5

Asp column chart, how can I have the tick marks on the left of the columns instead of centered?


Vote count:

0




I've looked everywhere for the answer and I can't find it at all. Should be simple, but I can't get it to work. I want to have my x tick labels on the left, instead of centered on the column. The picture below shows my problem, around 0 I have an annoying grid line that I would like to get rid of. Any ideas ? I've tried to change interval offset but to no avail....


Actual result


I would like something similar to this website : Desired layout chart


Thanks a lot if anyone can figure it out....



asked 38 secs ago







Asp column chart, how can I have the tick marks on the left of the columns instead of centered?

How to return ArrayBuffer from $http request in Node.js?


Vote count:

0




I sent a $http.post request from Angular.js to Node.js in order to get an ArrayBuffer as following:



$http.post('/api/scholarships/load/uploaded-files', Global.user, {responseType:'arraybuffer'}).success(function(ab){
console.log(ab); // Return ArrayBuffer {}
});


Then, in Node.js, I retrieved uploaded files data and transform a Buffer object to ArrayBuffer object:



exports.loadUploadedFiles = function(req, res) {
db.UserFile.findAll().success(function(files) {
var buffer = files[0].dataValues.data; // Get buffer
var arrayBuffer = new ArrayBuffer(buffer.length); // Start transforming Buffer to ArrayBuffer
var views = new Uint8Array(arrayBuffer);
for(var i = 0; i < buffer.length; ++i) {
views[i] = buffer[i];
}
res.type('arraybuffer');
res.send(arrayBuffer);
}).error(function(err) {
console.log(err);
res.sendStatus(500);
});
};


When I tried to print the response from above $http.post, I always got ArrayBuffer{}. What did I do wrong? Any help would be appreciated.



asked 54 secs ago

LVarayut

2,325






How to return ArrayBuffer from $http request in Node.js?

Method in the type is not applicable to arguments


Vote count:

0




I'm a newbie working on a basic class creation tutorial and have been given the below instructions.



1) Create a new class called Book.
2) Create fields for title, author, numPages, and isbn.
3) Create a method called toString that appropriately describes the book.
4) In the file, BookRunner.java:
a) Declare two book variables
b) Instantiate two book objects and set their fields.
c) Print descriptions of the book objects using their toString methods.


So I've been working with two classes as instructed, and you can see the code below



public class Book {
public String title;
public String author;
public String numPages;
public String isbn;

public void toString(String bookName) {
String description = "Title:" + title + "Author"+ author + "Num. of pages" + numPages + "ISBN" + isbn;
System.out.println(description);
}

public class Ex1_BookRunner {

public static void main(String[] args) {
Book firstBook;
Book secondBook;

firstBook = new Book();
secondBook = new Book();

firstBook.title = "One Piece";
firstBook.author = "Oda-Sensei";
firstBook.numPages = "100";
firstBook.isbn = "123456";

secondBook.title = "Life of Megan Fox";
secondBook.author = "Micheal Bay";
secondBook.numPages = "200";
secondBook.isbn = "098765";

toString(firstBook);
toString(secondBook);
}
}


My code shows no errors until the last two lines where I call the method toString.


I get the error below



The method toString() in the type Object is not applicable for the arguments (Book)


Am I making some fundamental error somewhere in my method declaration? I've looked at other posts on SO with the same question but I have trouble understanding the explanations given because they mostly cover code syntax I haven't learnt yet.


Any help is appreciated :)



asked 1 min ago







Method in the type is not applicable to arguments

How to draw texture from imputProcessor class? LibGDX


Vote count:

0




I try drawing stuff using InputProcessor class of LibGDX. But nothing is drawn! Can I draw textures from any other place rather than render () class in LibGDX?


And yes, if I draw in render () class it is drawn ok, but can I draw from somewhere else, like InputProcessor touchDragged?


here is my code



public class mm_imput implements InputProcessor {

SpriteBatch batch=new SpriteBatch();
Texture pixel=new Texture("something.png");

@Override
public boolean touchDragged (int x, int y, int pointer) {

drawSomething();

}
void drawSomething() {
batch.begin();
batch.draw(pixel, 100, 100, 100, 100);
batch.end();
}


}


I should be showing something every time I drag mouse. How to achieve this?



asked 25 secs ago







How to draw texture from imputProcessor class? LibGDX

Disable default PopUp (Context) Menu


Vote count:

0




In a Delphi XE7 Firemonkey project i want to block the default Popup-Menu that show up when the user presses the right mouse button on a control.


In VCL you could easily set Handled := true in ContextPopup (link)


Unfortunately this event doesn't exist in FMX.


Is there any way to archieve this in Firemonkey?



asked 1 min ago







Disable default PopUp (Context) Menu

sql injection using the the value of a parameter as its name


Vote count:

0




Can i be victim of sql injection attack if I use the the value of parameter as its name ?



for(String tag : choixalerte.selectedNomExestingtags)
where += " ach.NOM_ACHTEUR LIKE :"+tag+" or ao.OBJET LIKE :"+tag+" or lot.INTITULE LIKE :"+tag+ "";

...

Query native_query = entityManager.createNativeQuery(...);

if( choixalerte.selectedNomExestingtags != null )
for(String tag : choixalerte.selectedNomExestingtags)
native_query.setParameter(tag, "%"+tag+"%");


asked 1 min ago







sql injection using the the value of a parameter as its name

How to use a Java Image Processing Lookup Table to replace just a single color in a Buffered Image


Vote count:

0




I am writing a video game and I am looking for a very fast way to recolor an Image. The Image is currently in Black, and I would like to recolor the entire Image in red.


Could someone point me in the direction of how to use the Java Image Processing Library LookupTables on how to replace just a single color? I am having difficulty finding an example on how to do this. It appears that these filters you would write should be faster than having to interate through each pixel. Is this correct?


If could provide example code on how to replace a single color with another (i.e. replace Black with Red) using the LookupTable, that would be great!


Thanks.



asked 1 min ago







How to use a Java Image Processing Lookup Table to replace just a single color in a Buffered Image

understanding this keyword in Alloy


Vote count:

0




In the bellow code from Alloy book, what does this keyword refer to:



module library/list [t]
sig List {}
sig NonEmptyList extends List {next: List, element: t}


...



fun List.first : t {this.element}
fun List.rest : List {this.next}
fun List.addFront (e: t): List {
{p: List | p.next = this and p.element = e}
}


I would appreciate if you give me an elaborate description of this usage in Alloy.



asked 36 secs ago

qartal

188






understanding this keyword in Alloy

saving object to IsolatedStorage in windows phone 8


Vote count:

0




I have a class structure with properties below:



public string Artiste { get; set; }
public string Featuring { get; set; }
public JObject RegionName { get; set; }
public JArray Seasons { get; set; }


the problem is that I want to save an instance of this class to an IsolatedStorage, I added the DataContract attribute to the class and DataMember attribute to each property but I got an error that "Newtonsoft.Json.Linq.JValue" cannot be serialized. How can I serialized and save a complex object like the above.



asked 2 mins ago

jade

184






saving object to IsolatedStorage in windows phone 8

Insert VBA sub into Excel Worksheet


Vote count:

0




Good day,


I am using Excel 2013 and I would like to hide and unhide my Sheets as I work with them. I spent some time Googling around and found plenty of ancient posts on forums about adding VBA to modules, but that's not quite what I'm looking for.


On a main page where I spend most of my time using data, I have a button that shows a UserForm with a list of sheets in a ListBox. I choose the Sheet from the ListBox, hit OK, and it runs the following;



Private Sub OKButton_Click()
ThisWorkbook.Sheets(JobListBox.value).Visible = xlSheetVisible
ThisWorkbook.Sheets(JobListBox.value).Activate
Unload Me
End Sub


I would like it so when I have my new sheets created via VBA, I can populate the sheet with the following subroutine;



Private Sub Worksheet_Deactivate()
Me.Visible = xlSheetVeryHidden
End Sub


If anyone can let me know how I can make a Subroutine to insert this code into my sheets, I would greatly appreciate it.


PS: My fallback method is to, of course, just copy/paste the code manually... But I would prefer to automate it if possible.



asked 1 min ago







Insert VBA sub into Excel Worksheet

QT, cannot instantiate an object in a window's constructor?


Vote count:

0




How do I create an instance of an object in the constructor for a window? I am generating three errors just by declaring a pointer, named objects, in 'window.h' and instantiating it in 'window.cpp:' 'Window::Window(...){...objects = new objectHandler(1)}'



window.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall objectHandler::objectHandler(int)" (??0objectHandler@@QAE@H@Z) referenced in function "public: __thiscall Window::Window(class QWidget *)" (??0Window@@QAE@PAVQWidget@@@Z)
(file not found)

window.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall objectHandler::~objectHandler(void)" (??1objectHandler@@QAE@XZ) referenced in function "public: void * __thiscall objectHandler::`scalar deleting destructor'(unsigned int)" (??_GobjectHandler@@QAEPAXI@Z)
(file not found)

debug\Phursik.exe:-1: error: LNK1120: 2 unresolved externals


I looked up the errors and apparently they have to do with the functions being declared but not defined by the class. I am sure; however, that all functions declared in 'objectHandler.h' are defined in 'objectHandler.cpp' and QT Creator even knows how to find one from the other. I am quite perplexed so thank you for your help in advance.



asked 31 secs ago







QT, cannot instantiate an object in a window's constructor?

Controlling playback in scenekit Animations


Vote count:

0




Hi Is there a way I can control the playback of an animation imported from a collada file (DAE).


For example I have a few animations in one collada file such as walk,run,idle and I want to control the playback head to skip into the individual animations?


Thanks!



asked 1 min ago







Controlling playback in scenekit Animations

How To Use SQLite COUNT in Android to return number of rows


Vote count:

0




I want to write a query that add up all the rows that have the string value of "left" in column named DIRECTION. Next I want to return this sum.


In my code snip-it below assume data and data base are established.


Here is the prototype:



public int getSumLeft() {
String selectQuery = "SELECT COUNT( "+TableData.TableInfo.DIRECTION+" ) WHERE "+TableData.TableInfo.DIRECTION+" = left";
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
cursor.moveToFirst();
int sum = cursor.getInt(0);
cursor.close();
return sum;
}


I've tried several queries and this one seems to be the closes to what I need. I think the problem is with statement 'int sum = cursor.getInt(0);'


I think the zero parameter is overriding the results. When I remove the zero the code breaks. getInt is an SQLite function that is used to access data in the database. I did not create that function. But I must use it or and another function like it.


Also, do I need to put a while loop around the query to move the cursor for a COUNT query? Doesn't the Database count for you, therefor no need for iteration?


Is there another way of counting the rows where the string value is 'left' and the sum can be returned?


Full code here:


Database: http://ift.tt/1xABS7u


Implementation (see the button in onCreate function ): http://ift.tt/1rBHtuT


Thanks for looking into this.



asked 44 secs ago

Leoa

428






How To Use SQLite COUNT in Android to return number of rows

R cannot be resolved to a Variable


Vote count:

0




im useing http://ift.tt/XbmwkO ,when Add ActionBarSherlock as a dependency to SlidingMenu and SlidingActivities that you plan on using make them extend Sherlock___Activity instead of ___Activity. my project have this error R cannot be resolved to a Variable



asked 1 min ago







R cannot be resolved to a Variable

osgi.wiring.package=com.bedas.ima missing requirement error in karaf


Vote count:

0




I want to make an application with using Apache Camel.I wrote the route in xml file.But Karaf container does not recognize the package that i wrote for beans.Here is my xml and pom.xml files:



<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://ift.tt/jtTJvY Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->

<!-- START SNIPPET: e1 -->
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU" xmlns:camel="http://ift.tt/TZ5qsO"
xmlns:cxf="http://ift.tt/1cLbWMF" xmlns:context="http://ift.tt/GArMu7"
xsi:schemaLocation="
http://ift.tt/GArMu6 http://ift.tt/1jdM0fG
http://ift.tt/GArMu7 http://ift.tt/1jdLYo7
http://ift.tt/TZ5qsO http://ift.tt/1apCv6i
http://ift.tt/1cLbWMF http://ift.tt/1i7BB3m">


<bean id="aysProcessor" class="com.bedas.ima.AysProcessor" />

<bean id="executor" class="java.util.concurrent.Executors"
factory-method="newFixedThreadPool">
<constructor-arg index="0" value="16" />
</bean>

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="tcp://localhost:61616" />
<property name="userName" value="akin" />
<property name="password" value="akin123" />

</bean>


<!-- <import resource="classpath:META-INF/cxf/cxf.xml" /> -->


<!-- this is the CXF web service we use as the front end -->
<cxf:cxfEndpoint id="ima-okuma"
address="http://localhost:8168/sep/services/cxf/imaOkumaCxfService"
serviceName="s:ImaOkumaServiceImplService" wsdlURL="META-INF/wsdl/imaokuma.wsdl"
xmlns:s="http://ift.tt/1zxPiiT" />

<cxf:cxfEndpoint id="ays-service"
address="http://localhost:8080/ays/services/begisService"
serviceName="s:BegisServiceImplService" wsdlURL="META-INF/wsdl/aysBegis.wsdl"
serviceClass="com.bedas.ays.ws.service.BegisService"
xmlns:s="http://ift.tt/1zxPkr4" />

<!-- <bean id="myNameStrategy" class="org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy"> -->
<!-- <constructor-arg value="com.bedas.sep.ws.cxf.service.ImaOkumaCxfService"/> -->
<!-- <constructor-arg value="true"/> -->
<!-- </bean> -->

<!-- <bean id="enrichBean" class="com.bedas.ays.ws.service.EnrichBean"/> -->


<!-- this is the Camel route which proxies the real web service and forwards
SOAP requests to it -->
<!-- <route errorHandlerRef="dlc" id="imaRoute2"> --><!-- <from uri="activemq:queue:imaokumaq?disableTimeToLive=true"/> --><!-- <to uri="http://ift.tt/1B6pezF"/> --><!-- </route> -->
<camelContext trace="false" errorHandlerRef="defaultEH" id="ImaOkuma" xmlns="http://ift.tt/TZ5qsO">

<errorHandler type="DefaultErrorHandler" id="defaultEH">
<redeliveryPolicy maximumRedeliveries="0" retryAttemptedLogLevel="WARN"/>
</errorHandler>
<errorHandler type="DeadLetterChannel" deadLetterUri="activemq:queue:imaOkumaERROR" useOriginalMessage="true" id="dlc">
<redeliveryPolicy maximumRedeliveries="0"/>
</errorHandler>
<dataFormats>
<jaxb id="myJaxb" prettyPrint="true" contextPath="com.bedas.sep.ws.cxf.service"/>
</dataFormats>
<route errorHandlerRef="dlc" id="imaRoute1">
<from uri="cxf:bean:ima-okuma?dataFormat=MESSAGE"/>
<wireTap uri="activemq:queue:aysq?jmsMessageType=Object"/>
<inOnly uri="activemq:queue:imaokumaq"/>
<to uri="velocity:response.vm"/>
<!-- <camel:transform><camel:constant>OK</camel:constant></camel:transform> -->
<!-- <to uri="cxf:bean:ays-service?dataFormat=POJO"/> -->

<!-- <convertBodyTo type="com.bedas.ays.ws.service.BegisModel"/> -->
<!-- <marshal> -->
<!-- <soapjaxb contextPath="com.bedas.sep.ws.cxf.service" version="1.1" elementNameStrategyRef="myNameStrategy"/> -->
<!-- </marshal> -->
<!-- <multicast parallelProcessing="true" executorServiceRef="executor" stopOnException="false"> -->
<!-- <inOnly uri="activemq:queue:imaokumaq"/> -->
<!-- <to uri="aysProcessor"/> -->
<!-- </multicast> -->
</route>
<route errorHandlerRef="dlc" id="imaRoute2">
<from uri="activemq:queue:aysq?jmsMessageType=Object"/>
<camel:log message="BURADAYIMMMM"></camel:log>
<to uri="aysProcessor"/>
<!-- <unmarshal> -->
<!-- <soapjaxb contextPath="com.bedas.sep.ws.cxf.service" version="1.1" elementNameStrategyRef="myNameStrategy"/> -->
<!-- </unmarshal> -->

<!-- <convertBodyTo type="com.bedas.ays.ws.service.BegisModel"/> -->
<!-- <from uri="aysProcessor"/> -->
<!-- <to uri="cxf:bean:ays-service?dataFormat=POJO"/> -->
</route>
</camelContext>

</beans>
<!-- END SNIPPET: e1 -->


When i make mvn:install and deploy it in fuse karaf container,it throws the exception in the question title.Here is my pom.xml file:



<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://ift.tt/jtTJvY Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/HBk9RF">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.camel</groupId>
<artifactId>examples</artifactId>
<version>2.12.3</version>
<relativePath></relativePath>
</parent>

<artifactId>ima-okuma</artifactId>
<name>Camel :: Example :: CXF :: Proxy</name>
<description>An example which uses Camel to proxy a web service</description>
<packaging>bundle</packaging>

<properties>
<camel.osgi.export.pkg>
com.bedas.sep.ws.cxf.service*
com.bedas.ays.ws.service*
com.bedas.ima*
</camel.osgi.export.pkg>
<camel.osgi.private.pkg>
com.bedas.sep.ws.cxf.service.imaokuma
com.bedas.ays.ws.service.begismodel
com.bedas.ima.AysProcessor
</camel.osgi.private.pkg>
<!-- to avoid us import bunch of cxf package -->
<camel.osgi.dynamic>*</camel.osgi.dynamic>
</properties>


<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<scope>provided</scope>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.apache.camel</groupId> -->
<!-- <artifactId>camel-soap</artifactId> -->
<!-- </dependency> -->

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>

</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-soap</artifactId>
</dependency>

<dependency>

<groupId>org.apache.camel</groupId>
<artifactId>camel-velocity</artifactId>
<scope>provided</scope>

</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<scope>provided</scope>
</dependency>

<!-- cxf -->
<!-- used by the real web service -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf-version}</version>
<scope>provided</scope>
</dependency>
<!-- regular http transport -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf-version}</version>
<scope>provided</scope>
</dependency>

<!-- logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>provided</scope>
</dependency>

<!-- cxf web container for unit testing -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf-version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>

</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>

<exclusions>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>

</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>

</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<includePluginDependencies>false</includePluginDependencies>
</configuration>
</plugin>
<!-- CXF wsdl2java generator, will plugin to the compile goal -->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/META-INF/wsdl/imaokuma.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
<execution>
<id>generate-sources1</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/META-INF/wsdl/aysBegis.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${project.version}</version>
</plugin>

<!-- <plugin> -->
<!-- <groupId>org.apache.felix</groupId> -->
<!-- <artifactId>maven-bundle-plugin</artifactId> -->
<!-- <extensions>true</extensions> -->
<!-- <configuration> -->
<!-- <instructions> -->
<!-- <Import-Package>*</Import-Package> -->
<!-- <EXPORT-PACKAGE>${camel.osgi.export.pkg}</EXPORT-PACKAGE> -->
<!-- <_failok>true</_failok> -->
<!-- </instructions> -->
<!-- </configuration> -->
<!-- </plugin> -->


</plugins>
</build>

</project>


asked 44 secs ago







osgi.wiring.package=com.bedas.ima missing requirement error in karaf

Array of multiple strings possible? Or just array of characters for one string? XGetWindowProperty on atom's where we know a string is returned


Vote count:

0




When I do XGetWindowProperty on atoms that return strings, such as _NET_WM_NAME, WM_CLASS, WM_NAME. They are returning an array of characters. However when I ask for long or short types like _NET_WM_PID it returns an array of longs, for the PID its just 1 element array, the nitems_return argument is populated with number of elements returned in the array, so for PID its 1. But for the string atoms, the nitems_return hold number of characters returned.


I tested convenience function of XGetWMName and this set the nitems field of XTextProperty to number of characters returned which matches XGetWindowProperty, so I was wondering, is there ever a chance that XGetWindowProperty can returned number of elements in array like for long and short? OR is there only ever just one string associated with those string atoms?


docs on XGetWindowProperty


Thanks



asked 34 secs ago

Noitidart

5,538






Array of multiple strings possible? Or just array of characters for one string? XGetWindowProperty on atom's where we know a string is returned

Jquery File upload without using FormData


Vote count:

0




I am struggling with uploading a file through an ajax form without using FormData. FormData isn't an option because the form contains credit card info that I am tokenizing with a third party and I don't want the CC info submitted to my backend.


I did see this question, which I have used as a starting point, but I'm fairly new to jQuery and struggling with implementation.


I am not getting a submittal of the var file at all, but everything else works great. Am I not collecting the file correctly or am I not bringing it into scope the right way?


My upload.js file:



var file;
$("#file").on("change", function(){
var file = this.files[0],
filename = this.files[0].name;
filesize = this.files[0].size;
//calling alert(file) provides a response of [object file]
})

function handleResponse(response) {
// fires if credit card info is successfully tokenized
if (response.status_code === 201) {

var fundingInstrument = response.cards != null ? response.cards[0] : response.bank_accounts[0];

//rest of the form inputs
var name = $('#name').val();
var contact_name = $('#contact_name').val();
var cell = $('#cell').val();
var address_1 = $('#address_1').val();
var city = $('#city').val();
var state = $('#state').val();
var zip = $('#zip').val();
var tax = $('#tax').val();

//trying to bring file var in scope
var file = file;


// ajax .post
jQuery.post(baseURL+'/contractors/edit', {
uri: fundingInstrument.href,
name: name,
contact_name: contact_name,
cell: cell,
file: file,
address_1: address_1,
city: city,
state: state,
zip: zip,
tax: tax,
file: file,
}, function(r) {
// Check backend response
if (r.status === 200) {...


asked 32 secs ago







Jquery File upload without using FormData

Drawing a modifiable diagram


Vote count:

0




I am trying to draw a diagram like the image below and would like to know if there is a more efficient way to doing this in XML. Below is my unfinished code but I want to hear suggestions and examples from others please. I want to also be able to copy and modify the code at a later stage & I want the diagram to look right on all devices (i.e. suitable margins, padding, etc.) All helpful replies would be very much appreciated.


diagram



<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<RelativeLayout
android:id="@+id/colored_bar"
android:layout_width="10dp"
android:layout_height="40dp"
android:background="@color/central"/>

<RelativeLayout
android:layout_width="0dp"
android:layout_height="40dp"
android:background="@color/grey"
android:layout_weight=".25" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="1"
android:textColor="@color/black"/>
</RelativeLayout>

<View
android:id="@+id/car_separator0"
android:layout_width="1dp"
android:layout_height="50dp"
android:background="@color/black" />

<RelativeLayout
android:layout_width="0dp"
android:layout_height="40dp"
android:background="@color/grey"
android:layout_weight=".25" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="2"
android:textColor="@color/black"/>
</RelativeLayout>

<View
android:id="@+id/car_separator1"
android:layout_width="1dp"
android:layout_height="50dp"
android:background="@color/black" />

<RelativeLayout
android:layout_width="0dp"
android:layout_height="40dp"
android:background="@color/grey"
android:layout_weight=".25" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="3"
android:textColor="@color/black"/>

<RelativeLayout
android:layout_width="10dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_weight=".25"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>



<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</RelativeLayout>

<View
android:id="@+id/car_separator2"
android:layout_width="1dp"
android:layout_height="50dp"
android:background="@color/black" />

<RelativeLayout
android:layout_width="0dp"
android:layout_height="40dp"
android:background="@color/grey"
android:layout_weight=".25" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="4"
android:textColor="@color/black"/>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentLeft="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_centerHorizontal="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>

<RelativeLayout
android:layout_width="15dp"
android:layout_height="10dp"
android:background="@color/red"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="5dp"
android:padding="1.5dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</RelativeLayout>

<RelativeLayout
android:layout_width="10dp"
android:layout_height="40dp"
android:background="@color/central"/>

</LinearLayout>


asked 1 min ago







Drawing a modifiable diagram

Dynamics CRM 2013: Accessing Billable Time on Case Resolution Entity


Vote count:

0




I have a couple of things I'm trying to do:

1.) Create a workflow that updates a task's duration from a case's billable time resolution

2.) Run a report on Billable time or billable time vs other activities


The main issue that I'm having is that I can't seem to pull the billable time (time spent) field in any report or workflow. For whatever reason there's a separate entity from the case entity (Case Resolution) that contains this data however it seems uncustomizable and virtually invisible.


Anybody have ideas?



asked 57 secs ago







Dynamics CRM 2013: Accessing Billable Time on Case Resolution Entity

Exit jQuery loop


Vote count:

0




This jQuery code loops through rows in a table and highlights each row as it goes. I have a stop button that sets a variable to false.


I know that I can break out of the .each loop by returning false, but I want it to break out from within the queue.


How can I do this if the var is false?



$('.js-channel-notes tr').each(function(i) {

$(this).delay((i++) * 160).queue(function(){

$('.channel-row-highlight').removeClass('channel-row-highlight');
$(this).addClass('channel-row-highlight').clearQueue();

});

});


asked 1 min ago







Exit jQuery loop

linux plotting a ghraph


Vote count:

0




I want to plot a data file (speed11.data) in Linux. the data file looking like:


1,4.45823517e+01


2,4.45873528e+01


3,4.45923538e+01


4,4.45973549e+01


I used gnuplot, but I got error.


gnuplot> plot "speed11.data"


gnuplot> 1,4.45823517e+01 ^ "speed11.data", line 1: invalid command


Could you help me to plot a graph?


Thanks



asked 37 secs ago







linux plotting a ghraph

Creating a Form from a Query then a subform from that same query


Vote count:

0




I created a query that combined two tables to show only certain rows. I have a general form that shows all the data and I want to create a form that only shows the query data, which doesn't show all the data in the first form.


I then made a subform from the query to have the ability to add more rows to the second table linked to the first table but, I get this error every time I enter in a new row in the linked second table.



The LinkMasterFields property setting has produced this error: "The object doesn't contain the Automation..


Can I not create a subform from the same query that is used to create the form?



asked 1 min ago







Creating a Form from a Query then a subform from that same query

Trouble storing image path into MySQL


Vote count:

0




I'm having troubles understanding the storing of images file path into MySQL database. But it is storing the images details as well as moving the image file into directory. I've tried many approaches but no luck. I'm a PHP novice.


Question: How do I properly capture and store the path to the image into MySQL?


Also: Please suggest any better coding practices overall for consideration. Much appreciated!



//MYSQL TABLE
CREATE TABLE `userimages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL DEFAULT '',
`type` varchar(30) NOT NULL DEFAULT '',
`size` int(11) NOT NULL,
`ipath` varchar(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;


Here are my error messages.


Notice: Undefined variable: path in /useradmin-processor.php on line 45


Notice: Undefined index: ipath in /useradmin-processor.php on line 55


Notice: Undefined variable: path in /useradmin-processor.php on line 59



// IMAGE UPLOAD FILE
if(isset($_POST['imagesupload'])) {
/*
Note: The below code will upload the image to the images folder.
Then store the image name in your database. When you want to show the
image, just append the image name(taken from database) to the image path
and paste it in the <img>
*/
$imageFileName = $_FILES["imageFileName"]["name"];
$tmpImageFileName = $_FILES["imageFileName"]["tmp_name"];
$imageSize = $_FILES["imageFileName"]["size"];
$imageType = $_FILES["imageFileName"]["type"];

move_uploaded_file($tmpImageFileName,"images/".$imageFileName);

/*
Note: You can make sure that the images are not overritten by checking
if there is a different image with the same file name, by using the
below code prevents overwriting of images due to same Image names.
You have to store the new Image name in the database.
*/
$newImageFileName = $imageFileName;

loop1:

if(!file_exists("images/".$newImageFileName)){
move_uploaded_file($tmpImageFileName, $path.$newImageFileName);
} else {
$newImageFileName .= "_1";
goto loop1;
}

/*
Note: store the image details into the database and make the connection.
*/
$params = array(
':$path'=>$_POST['ipath']
);

$sql = "INSERT INTO userimages ( name, size, type, ipath ) ".
"VALUES ( '$imageFileName', '$imageSize', '$imageType', '$path' )";

// the connection to db
executeSQL($sql, $params);
}


asked 25 secs ago







Trouble storing image path into MySQL

How can i get the headers request from client side for sockets using NodeJS


Vote count:

0




I am quite new to this thing. I just wanted to know if it is possible to get the web sockets client side request header. I'm using in the server side node.js:




  • Using ExpresJS I can get headers like:



    router.post('/', function (req, res, next) {
    console.log(req.headers);


    });




  • Using Web Socket, its possible?



    var WebSocket = require('ws');
    var ws = new WebSocket('ws://www.host.com/path');
    ws.on('open', function open() {
    // how to get the headers
    ws.send('something');
    });



It is possible? Thanks



asked 44 secs ago







How can i get the headers request from client side for sockets using NodeJS

Export to Excel does not render in SharePoint for large files


Vote count:

0




I have an SSRS report that has 50 columns and ~77,000 rows when run for a Plant (Distribution Center). This report shows inventory and relating statistics (which is why it is so large). When i attempt to export this from SharePoint it hangs for a very long time (<10 minutes) and then responds with "Sorry something went wrong". So i took a look at the file size which is only 3mb. I did some digging online and found that SharePoint has a maximum file size limit when exporting (our config file was set at 4mb). So i had our SharePoint administrator take a look. He increased the size to 10mb and the file still has the same exporting problem. I ran the same report for a different distribution center (with significantly less data. About 2000 rows) and the report exports fine. I set my report up as a subscription and the report export also fails. So i am wondering if there is a setting in the reporting server or SharePoint that will fix this issue.



asked 2 mins ago







Export to Excel does not render in SharePoint for large files

Windows CMD equivalent of CTRL+X and CTRL+V


Vote count:

0




I know how to copy/move files in windows CMD. I use robocopy. But I want to move one directory from location A to location B immediately. Both locations are on same partition:


source: I:\actual destination I:\archive


I Want to move some dir from source to destination with all subfolders, files.... with all content. If I use robocopy it is realy copying files, which takes long, because it Is real copy all and then delete source - this requires enought free space.


I need efect same as if I use combination of CTRL+X and CTRL+V on explorer - not real copy, only changing records in folder list - this is immediately moving directory.


Is this possible some way??



asked 18 secs ago







Windows CMD equivalent of CTRL+X and CTRL+V

Data not being saved properly


Vote count:

0




I'm getting data from a url (.m4a file), then I'm trying to save the file so I can change it's metadata. I have the code below and it seems like it should be working. The file that is copied in the end is empty (88 bytes).



_previewData = [NSMutableData dataWithContentsOfURL:[NSURL URLWithString:@"http://ift.tt/1AKYk2g"]];
NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDirectory=[paths objectAtIndex:0];
NSString *path = [documentDirectory stringByAppendingPathComponent:[NSString stringWithFormat: @"file.mp4"]];
NSFileManager *filemanager;
filemanager = [NSFileManager defaultManager];
[_previewData writeToFile:path atomically:YES];
if ([filemanager fileExistsAtPath:path]) {
// Runs
NSLog(@"It worked");
}
NSLog(@"%@",path);

ANMovie* file = [[ANMovie alloc] initWithFile:path]; // or .mp4
NSData* jpegCover = UIImageJPEGRepresentation(artworkImage, 1.0);
_imageView.image = [UIImage imageWithData:jpegCover];
ANMetadata* metadata = [[ANMetadata alloc] init];
metadata.albumCover = [[ANMetadataImage alloc] initWithImageData:jpegCover type:ANMetadataImageTypeJPG];
[file setMovieMetadata:metadata];
[file close];

_previewData = [NSMutableData dataWithContentsOfFile:path];

UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSDictionary *imageItem=@{@"public.mpeg-4-audio":self.previewData};
NSDictionary *textItem=@{@"public.plain-text":self.linkData};

pasteboard.items=@[imageItem,textItem];


asked 26 secs ago







Data not being saved properly

Alternative to colon in a time format


Vote count:

0




ISO 8601 recommends to following format for a date and time:



2014-12-29T16:11:20+00:00


I'm rather fond of this format since it allows for lexical ordering. But there is a small problem: some file systems don't allow colons in file names (at least not normally). ISO 8601 does allow for omitting the colons, but I would rather have some symbol there than have the numbers run together:



2014-12-29T161120+0000


Does ISO 8601 allow for a symbol other than colons? I couldn't find any indication that it does. If not, is there another well recognized symbol I could use? (Perhaps another standard proposes such a symbol?)



asked 44 secs ago

jpmc26

3,955






Alternative to colon in a time format

Newbie (myself) would like to pay to get an AWS requester pays bucket usage for arxiv answer - - is that allowed here?


Vote count:

0




Newbie (myself) would like to pay to get an AWS requester pays bucket usage for arxiv answer - - is that allowed here?


My amazon account is set up, and I have tried a few programs to try to locate and download the arxiv requester pays bucket, but no success.


If permitted here, I would like to pay for a detailed start-to-finish outline of how the HECK to do this on windows 7x64.


Yes, already checked here and on youtube, and am so frustrated I am willing to pay $10US via PayPal to the first brilliant person who solves this for me. Thanks in advance, miniscule



asked 18 secs ago







Newbie (myself) would like to pay to get an AWS requester pays bucket usage for arxiv answer - - is that allowed here?

Many broadcastreceivers with only one service


Vote count:

0




I have some classes that extend from BroadcastReceiver. They only work when I start the app and have the MainActivity (Its only one activity) running, but I want those BroadcastReceivers to work since the device boots.


I've read many questions here about creating a service and starting those broadcastreceivers but I don't know how to do it with many broadcastreceivers.



asked 47 secs ago







Many broadcastreceivers with only one service

Playing MP3s in Java from within the Project


Vote count:

0




I am working on a Java project that involves playing mp3 files. I want my application to play the files from within the project so I have the music files stored in a folder called music which is in a source folder called resources. This is the code I have right now but when I run it I get a Bitstream errorcode 102. I can't seem to figure out what is wrong, any help? I am using the javazoom library (javazoom.jl.player.Player) Any help would be appreciated



public void play() {
try {
InputStream stream = MP3.class.getClassLoader()
.getResourceAsStream("/music/LoveStory.mp3");
BufferedInputStream bis = new BufferedInputStream(stream);
player = new Player(bis);
} catch (Exception e) {
System.out.println("Problem playing file " + filename);
System.out.println(e);
}

// run in new thread to play in background
new Thread() {
public void run() {
try {
player.play();
} catch (Exception e) {
System.out.println(e);
}
}
}.start();

}


asked 42 secs ago







Playing MP3s in Java from within the Project

Calling a function from within applicationwillresignactive


Vote count:

0




I have a function uploadScore() inside my viewController Class PlayViewController


When I call this function uploadScore() from within applicationWillResignActive(application: UIApplication) it throws error Use of unresolved Identifier 'uploadScore'


uploadScore() has references to objects in PlayViewController.


What am I doing wrong? What would be the best solution? Code is in swift.



asked 1 min ago

TPos

19






Calling a function from within applicationwillresignactive

How to read N number of lines from a file in java randomly


Vote count:

0




I am fairly new to java, so please bear with me if I have done something wrong. I have written a code in java that reads in N number of lines from a file in java and puts it in array of double and then prints it out;



ArrayList<Double> numbers = new ArrayList<Double>();
Scanner read = new Scanner(new File("numberfile"));
int counter = 0;
while(read.hasNextLine() && counter < 10)
{

System.out.println(read);
counter++;

}


The file contains bunch of numbers from 1 to 100;


Currently, my code prints out all the numbers like this [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], if I tell it to read the first 10 numbers. What I want to do now is print out these numbers in a random order, for example [2, 1, 6, 8, 9, 3, 7, 10, 3, 5].


And also if possible, I want to write a code that prints out the first 10 numbers randomly N number of times. For example, print out the first 10 numbers 50 times in a random order.


Thanks for your help and please let me know if I am unclear.



asked 1 min ago







How to read N number of lines from a file in java randomly

pdf.js failing on getDocument


Vote count:

0





  • browser: Chrome

  • environment: grails app localhost


I'm running a grails app on local host (which i know there's an issue with pdf.js and local file system) and instead of using a file: url which i know would fail i'm passing in a typed javascript array and it's still failing. To be correct it's not telling me anything but "Warning: Setting up fake worker." and then it does nothing.



PDFJS.disableWorker = true; // due to CORS

// I convert some base64 data to binary data here which comes back correctly
var data = utilities.base64ToBinary(result);

PDFJS.getDocument(data).then(function (pdf) {
//nothing console logs or reaches here
console.log(pdf);
});


I'm wondering if I just don't have it set up correctly? Can I use this library purely on the client side by just including pdf.js or do I need to include viewer.js too? and also i noticed compatibility file... the set up isn't very clear and this example works FIDDLE and mine doesn't and I'm not understanding the difference. Also if I use the url supplied in that example it also says the same thing.



asked 1 min ago

btm1

1,640






pdf.js failing on getDocument

Unity MonoDevelop: Auto-complete's completely gone


Vote count:

0




I've run into the same problem as this guy on the Unity forums, which already has its own copy of the answer on StackOverflow.


Except, these answers are out-of-date. (I don't the reputation for a bounty either; 119 out of 125, at the time of posting.)




So, running on the newer MonoDevelop 4.0.1 (compared to 2.4.2), I've tried the solution that was given;



Close MonoDevelop and delete the %AppData%\MonoDevelop-Unity\CodeCompletionData. After, reopen and MonoDevelop will regenerate all the configuration files and everything should be working fine again.



Except, the problem has gone from bad to worse:

MonoDevelop now does not list anything for auto-completion, from previously, only listing key methods/functions/whatevers (ie. void, public, If and not rigidBody, fMath etc.)



asked 48 secs ago







Unity MonoDevelop: Auto-complete's completely gone

display a c++ created object in a qt quick application


Vote count:

0




Now I have a Qt Quick Application, version 2.4, and I want to use C++ code to create an object to display some text in the Qt application.


I've tried reading countless Qt documentation, from the source themselves, most of which examples don't even compile on their own.


So I wanted help on display a C++ function returned value in the Qt Quick Application. All my code will be attached below, hope this isn't too much to ask and thanks for answering in advanced.



//MainForm.ui.qml, the area I want to display the text.
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.1

Rectangle {
id: mainWindow
color: "#302a2a"
anchors.fill: parent

Rectangle {
id: equationAreaBackground
height: parent.height - 400
color: "#3f3737"
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: parent.top
anchors.topMargin: 0

Text {
id: equation
color: "white"
text: qsTr("The Equation comes here")
anchors.fill: parent
font.pixelSize: 64
}
}

GroupBox {
id: mainTable
width: parent.width * 0.7
height: parent.height * 0.4
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: equationAreaBackground.bottom
anchors.topMargin: 0

/* Period One (1) */
Button {
id: elementH
x: 0
y: 0
width: parent.width/19
height: parent.height/7
text: qsTr("H")
}


And I want to display some C++ struct data on click of Button with ID: elementH. It is found in another file element.cpp, with header file: element.h.


File: Element Header



#ifndef ELEMENT
#define ELEMENT

struct element{};

#endif // ELEMENT


File: Element Source



#include <string>
#include "element.h"

struct element
{
// General Properties
string name;
string symbol;
int atomicNumber;
double atomicMass;
string category;
int group;
char block;
int period;
string electronConfig;
int valenceCount;

// Physical Properties
string color;
string phase;
double meltingPoint;
double boilingPoint;
// Others not yet necessary.
} elements[114];

void elementH()
{
// General Properties
elements[0].name = "Hydrogen";
elements[0].symbol = "H";
elements[0].atomicNumber = 1;
elements[0].atomicMass = 1.0079;
elements[0].category = "nonmetal";
elements[0].group = 1;
elements[0].block = "s";
elements[0].period = 1;
elements[0].electronConfig = "1";
elements[0].valenceCount = 1;

// Physical Properties
elements[0].color = "colorless";
elements[0].phase = "gas";
elements[0].meltingPoint = 13.99;
elements[0].boilingPoint = 20.271;
}


There is alot of other code involded, but it's mostly just repetition for other buttons. Thanks again.



asked 41 secs ago







display a c++ created object in a qt quick application