FAQ Database Discussion Community


TypeFace doesn't work and give some exception

java,android
when i running my code it makes some exceptions because of the TypeFace i have a spinner and i want it to change the font family when i click any of them but it doesn't work . here is my .java code public class Graduation extends ActionBarActivity { ImageView imageView...

How to get the current bar width of Flot Chart?

javascript,jquery,charts,flot
I am using Flot Chart for my Bar Chart... and I am using chart value indicator at the top like this... var p1 = $.plot($("#received-against-assigned"), data1, { xaxis: { ticks : ticks, axisLabel: "Accounts", axisLabelUseCanvas: true, axisLabelFontSizePixels: 12, axisLabelFontFamily: "Verdana, Arial, Helvetica, Tahoma, sans-serif", axisLabelPadding: 10 }, yaxis: { axisLabel:...

Javascript object versus array performance

javascript,arrays
I want to save data and have quick access to it. All of my data has a unique ID. I can think of two possibilities. object: myObject[id] = myDataObject; array: myArray.push(myDataObject); In the case of an array the ID would be inherited inside the myDataObject. If I want to search...

Getting access to globals in DialogFragment static class

android,android-dialogfragment
I've followed Google docs and created an inner class to popup a dialog in my android app. I've been running it fine in eclipse for a while, unbeknownst to me there was an error that came up when I imported the app into android studio to start using the stable...

how to add opening html tag using jquery?

javascript,jquery,html
I need your help. I want to add an opening html tag before an element and it's closing tag after that element . this is my script $("#searchresult").append("<span class='addRemoveTag'>"); $("#searchresult").append(checkBoxes[index]); $("#searchresult").append($(element)); $("#searchresult").append("</span>"); but unfortunately after I add the opening tag the browser close it immediately. so please could you help...

Jersey RESTful Web Service Connection Refused

java,rest,maven,jersey,connection-refused
I am trying to run a Jersey server on my local OS X machine. So far, I have executed these three commands as per the Jersey website instruction: mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-grizzly2 \ -DarchetypeGroupId=org.glassfish.jersey.archetypes -DinteractiveMode=false \ -DgroupId=com.example -DartifactId=simple-service -Dpackage=com.example \ -DarchetypeVersion=2.14 mvn clean test mvn exec:java It appears to be working...

Merging objects in array based on sub-value

javascript,jquery,arrays,object,merge
I have an array populated with objects. How do I go about merging objects inside this array when they have a matching specific sub value? My array looks like this: var data = [ { prod_name:"test1", type:"1", color:"white", product_id:"5" }, { prod_name:"test2", type:"1", color:"green", product_id:"7" }, { prod_name:"test2", type:"2", color:"green",...

How to implement INotifyPropertyChanged for WPF ProgressBar

wpf,progress-bar,inotifypropertychanged
I am going through the tutorials on how to implement INotifyPropertyChanged for a progressbar and I think i am a bit confused. This is my XAML code snippet: <ProgressBar Name="progressBar" Height="24" IsIndeterminate="{Binding IsIndeterminate}" Minimum="{Binding Minimum}" Maximum="{Binding Maximum}" Value="{Binding ProgressValue}"/> and this is my code-behind snippet: public partial class MainWindow :...

Uploading a file with AJAX, Python, and CGI

python,ajax,python-3.x,file-upload,cgi
I'm having a very odd problem uploading an image with Python and AJAX. If I don't use AJAX, it works perfectly, but if I don't, I get a: ValueError: Invalid boundary in multipart form: b'' Note that I would like to do this without an iFrame, which according to this...

VisualStudio running two different sets of tests

c#,unit-testing,visual-studio-2013
Currently I have a (hobby) project containing about 3,800 tests. From these tests, about 3,000 take quite some time (in total 5 minutes). Since I'm going to refactor a lot in the next months, I need to run it very often, and it would be nice to have them split...

How to convert Date value coming from Web Service to date string in PHP? [duplicate]

php,sql-server,json,web-services,date
This question already has an answer here: Datetime in PHP Script 3 answers I am querying some data from MSSQL server using a web service which I have written. I get the values in JSON format. In order to convert data table to json string I use System.Web.Script.Serialization.JavaScriptSerializer class....

Junit test that will fail if singleton getInstance() method is not synchronized

java,multithreading,junit,synchronization,thread-safety
I have this singelton Database that I've build, and this Junit test I've created: singleton package SingeltonDBVersion1; import GlobalSetting.User; /**************************************************************************** * This is the SingeltonDB. it warps the object DBconn according to the * Singleton pattern. it receive name and password (i.e. DBConn parameters) and * if it is the...

When is it worth to set in Xcode > General > Team and is it worth to leave empty?

ios,xcode,provisioning-profile
I am curious, when do I need to set / change Team setting in my project. Is it Project based setting or relating all the projects opened in Xcode? ...

Update variable inside ng-include template once a promise is kept

angularjs,angular-promise,angularjs-ng-include,angular-http
I'm in an interesting conundrum. In my app, I am using a recursive <script> which is referred to in my main page via an ng-include: <div ng-include="'theTemplate.html'" onload="one=features.items.one"></div> The data for features.items.one is loaded via external api using $http and is set when the $http promise is kept. The problem...

Regex on korean characters

c#,regex
I need to extract korean letters before '로' and before '길'in that WORD using regex. 장안로458번길 138 ->extract "장안" and "번" 충서로 1600 ->extract "충서" I have [^\x00-\x7F]+(?=로) [^\x00-\x7F]+(?=길). but this is not working for all...

How to paste previously prepared code snippets in Vim?

vim,paste
In Windows, using the AutoHotkey utility, it's possible to write simple scripts to expand some text in an editor of choice (e.g. Visual Studio's editor). For example, if in Visual Studio editor I type: d1 [TAB] (i.e. press the keys in sequence: d,1,Tab) the above "d1" text can be replaced...

How to implement gesture recognition in android wear

java,android,android-wear
Hello i'm looking for how to detect gestures in android wear, in android i use some code like this, but doesn't work in android wear.. is there a way to override the default gestures actions or just recognize them? I'm doing just like google developers: https://www.youtube.com/watch?v=naf_WbtFAlY http://youtu.be/sha_w3_5c2c?t=25m1s Is there something...

SQL Query to limit rows within a group

sql,hive,hiveql
Is it possible to write SQL query to get the first 5 rows for every date in the below table. I am trying to create a sample set for each data which will limit the data i am trying to process. Date Data 1-Jan abc 1-Jan bsd 1-Jan ejk 1-Jan...

PHP cURL returns error 52 if Content-Length is set

php,curl,content-length
I am trying to post a form in a remote website via php cURL. here is my cURL configuration (I added several explanations in the comments): $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $action); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); //without this line the request is being sent with GET method (I...

Casting an “alert” type in libtorrent, using Golang bindings

casting,go,bittorrent,libtorrent
I am developing a personal project in Golang, using libtorrent-go When I do receive an alert of type "save_resume_data_alert", I pick it up and have to CAST it as written in libtorrent documentation ... save_resume_data_alert const* rd = alert_cast<save_resume_data_alert>(a); ... But i really have not idea how to cast it...

How to get threshold from cumulative time series

r
In R, if I have a time series like so: datetime value 2014-12-01 00:00 100 2014-12-01 01:00 111 2014-12-01 02:00 98 2014-12-01 03:00 127 2014-12-01 04:00 114 2014-12-01 05:00 105 ... How can I get an interpolated datetime when the cumulative of this series reaches a certain value? Something like...

Avoiding loops in a complex calculation with arrays

php,arrays,loops
I have two arrays of numbers, one containing a lot of numbers, one only a few. There are no duplicates within or between arrays: $all = range(1, 50); $few = array(7, 11, 19, 27, 29, 36, 40, 43); $many = array_merge(array_diff($all, $few)); I now want to calculate the differences between...

Can I ask ui-router to update a specific resolve

angularjs,angular-ui-router
I have some resolves in a state and I want to update the data for one specific resolve. For example, I want to update only Resolve1 (in the following example) from within mainController or from a child state of main: $stateProvider .state('main', { url: '', abstract: true, templateUrl: ... controller:...

Print last occurrence of a tag in a log file using awk

regex,bash,awk
We need to do some monitoring of a large log file to find the last line that a tag (in this case a currency pair) appeared. Log looks like this: 20141217-10:34:48.411: 8=FIX.4.2^A35=X^A56=ABCD_MD^A55=AUD/USD^A15=USD^A279=2^A269=1.245 20141217-10:34:48.415: 8=FIX.4.2^A35=X^A56=ABCD_MD^A55=GBP/AUD^A15=GBP^A279=2^A269=1.245 20141217-10:34:48.465: 8=FIX.4.2^A35=X^A56=ABCD_MD^A55=AUD/NZD^A15=AUD^A279=2^A269=1.245 20141217-10:34:48.466: 8=FIX.4.2^A35=X^A56=ABCD_MD^A55=EUR/NZD^A15=EUR^A279=2^A269=1.245 20141217-10:34:48.466:...

Java Sandbox API - Denying access in a used class

java,security,classloader,sandbox,securitymanager
I struggle a little bit with the java-sandbox API. Consider the following code: Sandkiste.java: import java.util.List; import java.util.concurrent.TimeUnit; import net.datenwerke.sandbox.*; import net.datenwerke.sandbox.SandboxContext.AccessType; import net.datenwerke.sandbox.SandboxContext.RuntimeMode; import net.datenwerke.sandbox.handlers.BadThreadKillHandler; public class Sandkiste { public static void main(String[] args) { Sandkiste s = new Sandkiste(); s.run(); } public void run(){ SandboxService sandboxService =...

How to add node a structured xml at particular location from java

java,xml,parsing,sax
Need help on how to add an xml node at a desired position in the xml. For Example: Original xml <Errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="errors.xsd"> <Service Name="SYSTEM" Range="0-0299"> <Type Name="System"> <Error Name="ERROR1"> <Code>0001</Code> <Description>error1</Description> </Error> <Error Name="ERROR_OTHER"> <Code>0</Code> <Description>error error</Description> </Error> <Error...

How should I call external wcf web service?

c#,web-services,proxy,service-reference
there is external web service added to project with Service Reference. Is it necessary to do some extra manipulation with that, or methods and properties provided by web service is enough? Here is how it's look like: //Classes from web service HHserviceClient h = new HHserviceClient(); HHPostPropertyRequest r = new...

Date Format Issue, ORACLE

sql,oracle,date
I am writing this query, to find data between two dates. The time format I have is exactly like the one I am using in the query select TO_CHAR(REC_NO),(FIRSTNAME ||' '|| LASTNAME) as NAME, LOC_NAME,TO_CHAR(START_TIME,'yyyy/mm/dd/HH:MI:SS'), TO_CHAR(END_TIME,'yyyy/mm/dd/HH:MI:SS'), TT_NO,CUST_ID,CUST_MOB,MAC_ADDR,EMAIL_ID,s.STATUS from vw_rtb_visit_assn v left join [email protected] s on v.TT_NO = s.TICKETNUMBER and TT_NO...

expected unqualified-id before numeric constant for defining a number

c++,syntax,define
I'm new to C++, so I don't know what they mean with this error in a phidget-code example: Main.cpp:8:16: error: expected unqualified-id before numeric constant //verander de volgende informatie naar de informatie voor jouw database #define dserver "oege.ie.hva.nl" #define duser "username" #define dpassword "password" #define ddatabase "databasename" #define homeid 1234...

FindElements not found causes WebDriverException

c#,firefox,selenium,selenium-webdriver
While trying to run the following FindElements method on a page: var match = Driver.Instance.FindElements(By.LinkText("Click here")); I'm receiving the error: An exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll but was not handled in user code. OpenQA.Selenium.WebDriverException was unhandled by user code HResult=-2146233088 Message=The HTTP request to the remote WebDriver server...

PHP: Skipping code when file isn't upload to email via contact form

php,email,contact-form
I'm trying to get the form to skip the code for file vailidates and checks I was told to use: iF($_FILES["fileToUpload"] == UPLOAD_ERR_NO_FILE) { I have tryed to implement this in to my code but I am new to php, I think I may have messed up the headers. Now...

PHP shmom - can write, can't read

php,memory
I am exploring using sh_mop to exchange short messages between an error logger and another script that is periodically checked by another server. sh_mop seems incredibly simple so I wrote a spot of test code The Logger $str = time()."\0"; $shmid = shmop_open(1091,'c',0666,strlen($str)); echo "$shmid\n"; $writes = shmop_write($shmid,$str,0); echo "$writes\n";...

weird bug in visual studio 2012

c++,visual-studio,templates,visual-studio-2012
why does this code compiles and run on visual studio 2012? is this just a bug or i missing something namespace SSSS { namespace SSS { template <class T> class SS { public: typedef T ValueType; SS(){std::cout<<T();} SS(T t) { std::cout<<t;} }; typedef SS<double> DD; } } int main() {...

How abstract states work in Ionic?

javascript,angularjs,cordova,ionic-framework
How abstract states work? What is the purpose of the abstract tabs? What is the purpose of the template included in abstract tab? Can I have more than one abstract states? Can I switch from one state to another which are in different abstract states? I modified the app.js to...

Shared element transition among fragments that belong to different activities in Android lollipop

android,animation,android-fragments,android-animation,android-5.0-lollipop
I have a shared element in a fragment that belongs to one Activity. I want to make a shared element transition in Android Lollipop with an element that is part of a fragment that belongs to another activity. Is it possible? How can I achieve that?...

when click on empty asp:textbox I want to set the visibility of a asp:label to false immediately

c#,asp.net,textbox,textchanged
when click on empty asp:textbox I want to set the visibility of a asp:label to false immediately i set some label's to validation check when the textbox is empty , the label become visible but when text changed or clicked on textbox to edit it is not invisibled please help...

Create a New Table Oder by Column Name

sql,sql-server
I have the table in below format, UserName SessionID A.MCGREGOR SFNeBNnG7300 AB17 SFkPeL9INTER AB17 SFqXMAyINTER AB17 SFWoXtgINTER ABruce SFBTNvYBJ300 Accounts SF7ctc9F3700 Accounts SFjLXZwF3701 I need this information in another table group by UserName. I need UId generated based on the unique username as follows, UId UserName SessionID 1 A.MCGREGOR SFNeBNnG7300...

Issue in generating calendar event using zxing

android,calendar,barcode,qr-code,zxing
I tried to generate calendar event qr code using Google ZXing API but the image generated by it is not recognisable as an event. I used the same data format specified at different websites but it only creates qr code but not as a recognizable event. BEGIN:VEVENT SUMMARY:Concert DTSTART:20110912 DTEND:20110912...

How to add dimensions file only for HDPI devices and less(mdpi…)

android
I want to have separate file with dimensions(dimen.xml) only for phone with hdpi and less density. Unfortunately when I add folder "values-hdpi" with dimen.xml, the devices with xhdpi and tablets also use it....

Asynchronous Loading Google Maps API

javascript,jquery,asynchronous
I'd like to load an external JavaScript file, using jQuery, asynchronously, and then be able to call functions loaded from the external JavaScript. I'm including my JS file at the bottom of my html, just before </html>. The jQuery code is just before my code. I'm trying this: (function(){ $(document).ready(function()...

In GXT, after changing the color of ContentPanel header color ,the vertical alignment of heading text goes to top. How to make it middle?

css,gwt,gxt
In GXT, after changing the color of ContentPanel header and size,the vertical alignment of heading text goes to top. How to make it middle ?

pandas data frame indexing using loc

python,pandas,indexing
I have a sort of FIZZ-BUZZ problem. I have a calendar with weekdays. In the next column I put 'FIZZ' at certain rows. If there is an empty gap between two 'FIZZ' I put 'BUZZ' in between except if the weekday is 'SUN'. See the code below (I use 0.15.2...

Ordering in Typo3 Neos template

typo3-neos,typoscript2
I created a site template for a website in Typo3 Neos. However, in the template I need to define the ordering of the javascript because the CSS files have to be included before the javascript files. I now have these files: Default.html: {namespace neos=TYPO3\Neos\ViewHelpers} {namespace ts=TYPO3\TypoScript\ViewHelpers} <!DOCTYPE html> <html lang="en">...

Two DispatcherServlets share same ApplicationContext

spring,spring-mvc,servlets
I've got two DispatcherServlets. One is configured in web.xml, the other is configured with my implementation of org.springframework.web.WebApplicationInitializer. As I understand by doing this I create two ApplicationContexts. The problem is that they have to share same ApplicationContext. Initialization looks like this if it helps to understand my question. Web.xml:...

What is the sampling frequency of the accelerometers embedded in Android smartphone?

android,accelerometer,frequency,smartphone,sampling
I'm looking to know the sample frequency of smartphone, and - more important - if this parameter is equal for the most types of Android smartphone. I know that there are two mode of sampling: low at 20 Hz and standard at 100 Hz. But yesterday I've done some experiment...

Insert in SQL table using select with column values from another select

sql,sql-server,insert
I have an insert statement in MSSQL as follows: INSERT INTO A(KeyId, KeyName, Name) SELECT ('?','?',BName)FROM B The value of KeyId and KeyName are retreived from another table D Table B- Table C mapping is BName= XName Table C- Table D mapping is Xname = XName There are like 1000...

Spring Batch writer depending on processed item

spring,batch-processing,spring-batch
How to change or choose a specific writer depending on item property ? For example, I need to write to different SQL table (Table A and B). if(item.myBoolean==true) { Write to A and B } else { Write only on A } How to choose wich JdbcBatchItemWriter to use ?...

How to add div tag into while loop using asp.net c#

c#,asp.net,while-loop
I created a webpage called profile.aspx like that. <div id="div1"> <asp:Label ID="Label1" runat="server" > //Name </asp:Label> <asp:Label ID="Label2" runat="server"> //Satutes </asp:Label> </div> And this is the profile.aspx.cs file for this file This select query cmd.CommandText = "SELECT Name,Status FROM [ProfileStatusPhoto] WHERE Email = '" + Session["Email"].ToString() + "'"; This is...

Problems saving plot remotely

python,matplotlib
I connect remotely using: ssh -X then I have a code that has: #! /usr/bin/env python import matplotlib matplotlib.use('Agg') ... fig = plt.figure(figsize=(8.5,9.)) ... fig.savefig(plotfile) The code works until saving the plot. Then I get the following: Traceback (most recent call last): File "./lf_compared.py", line 171, in <module> fig.savefig(plotfile) File...

Sorting wordpress posts by date published

php,arrays,wordpress,sorting
im using the following code to display my posts on a page in wordpress that use a featured image: $mypages = get_pages( array() ); if ( !empty( $mypages ) ) { echo '<ul>'; foreach ( $mypages as $mypage ) { if ( get_the_post_thumbnail( $mypage->ID ) ) { echo '<div class="featured-container">';...

Javascript: form won't clear when submitted

javascript,jquery,ajax,reset
I'm trying to get a form to clear after it is submitted, but none of the methods I've found are working. html <div id ="newcomment"> <%= form_for([@thing, @good_comment], remote: true) do |f| %> <br> <%= f.text_area :text, :placeholder => "leave a comment...", class: "newcommentform" %> <div id="btn"><%= f.submit "Post", class:...

Is it possible to commit transaction in BeforeTransportMessage event

rebus
As in title I wanted to ask is it possible to commit transaction in BeforeTransportMessage event so for example if specific headers occur in TransportMessage I could wrap it in another message and send somewhere else and stop Rebus from futher processing. I didn't find any real life example of...

Distance calculation with square root on end result gives different result

java,math,processing
I can't wrap my head around this. Why is the part where I square such significant smaller? I know if I use l += l then I get the correct amount but it should not be that way I believe. If we look at processings dist method: static public final...

Jquery tooltip creates tooltip for Child elements

jquery-ui,jquery-ui-tooltip
I have an LI with A tag in it. <li title="LI TEXT" id="test"> ELEMENT WITH HREF <a href="#" title="HREF TEXT">HREF</a> </li> I want to create jquery tooltip for the LI and default tooltip for its child elements. But this does it both for the jquery elements for LI and its...

Is there any alternative to FPDF that can import HTML and CSS? [duplicate]

php,html,pdf
This question already has an answer here: Convert HTML + CSS to PDF with PHP? 33 answers I'm currently creating an invoice using FPDF. However, with FPDF there is a lot of calculating and trying before you finally get a decent looking pdf. My question is if any of...

Spring Java Config for LDAPTemplate.ignorePartialResultException

active-directory,spring-ldap,spring-java-config,spring-security-ldap
Appologies for the long question, but I in short I'm wondering how do I set the org.springframework.ldap.core.LdapTemplate#ignorePartialResultException flag using Spring Java Config. The long winded question is... I want to use our companies Active Directory for authentication (by this I mean user/password checking) to start off with, and then after...

Sending emails with Google Markup in a Rails application

ruby-on-rails,ruby-on-rails-4,gmail,actionmailer,google-schemas
I'm trying to setup Gmail's Email Markup but I'm not able to test it in my Rails application. To test it, I have changed my ActionMailer SMTP settings to be as follows: # config/environments/development.rb config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => 'gmail.com', :user_name => '[email protected]', :password...

How do I execute a console Javascript on page load?

javascript,console
I have a Javascript which can be ran from Google Chrome console. All it does is to automatically invite all of your Facebook friends to like a page you manage. Is there any way to automate this process so that people won't need to copy and paste the script into...

How to make Gtk.ToggleToolButton behave like radiobuttons?

radio-button,gtk,vala
I am writing a Vala application and I'm using Gtk.ToggleToolButtons' in it. And I want them to behave like radiobuttons, e.g. when clicking one of the buttons, others should be set unactive. The problem is, I don't know how to do it. I tried to do this: public void uncheckButtonsExcept(string...

Error in conversion of dates in java

java,android
String date = jsonobject.getString("needbydate"); DateFormat df = new SimpleDateFormat("MMM/dd/yyyy"); DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ"); Date startDate = sdf.parse(date); String needbydate = df.format(startDate).toString()+""; What is happening:: At the start date=2014-12-17T21:37:00+00:00 At the end needbydate= Dec/18/2014 17 is changed to 18 .... What wrong am i doing in conversion EDIT: String date=jsonobject.getString("needbydate");...

I want to use specific css code (that over rides master css) on buttons

css
I am working on a website and I am adding a few buttons, problem is it takes the master css and ruins the look of my buttons. the code in the page (for the buttons) is : <ul class="tabs"> <li><a href="../frequently-asked-questions#tab1">Placing an Order</a></li> <li><a href="../frequently-asked-questions#tab2">Delivery</a></li> <li><a href="../frequently-asked-questions#tab3">Returns</a></li> <li><a...

Need help a regarding javascript routine

javascript
i have two routine one return dropdown value as array and other one return highest close value from array based on given input. the problem is function closest() is not working and i also not being able to understand. here is full code $(document).ready(function () { //var array = [00,...

Handle enter key press event inside jQuery UI autocomplete

javascript,jquery,jquery-ui,jquery-ui-autocomplete
Is there a way how to handle event on pressing enter key in jquery autocomplete function? If I click on item of dropdown result I go to following url window.location.href = '/user?userId=' + ui.item.userId; And it works fine in select section of function. But what if i need to change...

what are the jquery ui selectmenu widget minimum css and js requirements?

javascript,css,jquery-ui,select-menu,jquery-ui-selectmenu
I'm about to use the jquery ui selectmenu widget and it will be the only one ui I'll use in my project. So I'd like to use the minimum js and css possible. I read the docs and took a look to the repo but I can't fully understand what...

Perl: Not a GLOB reference

perl
I get this error for the line: while($line =<$fh>) What does it mean and how can I resolve it? The entire code is: use strict; use warnings; use v5.14; use Compress::Zlib; my $filename= "example.gz"; my $fh= gzopen($filename, "rb"); my $line=0; my $counter=1; my @array=(); while($line = <$fh>) { # <--...

php function not returning any value

php
I'm trying a simple binary search. I expect this function to return 'false' or 'true', but it does not seem to return anything. I tried returning integers or strings, just to see if it would return another datatype, but it did not seem to do so. What am I doing...

How to enable Module uploaded in different directory Drupal 7

drupal
I upload my .info and .module file in sites/all/new/mymodule/ how can I enable this file on the admin page is it possible to enable it even though it's not uploaded in sites/all/modules/mymodule/ ? Im new in drupal thanks in advance !

get values from the nested json in android and pass it to listview [closed]

android,json
i want to get the values from the below nested json string and pass it to listview, i'm confused about it. could somebody help it out from this problem.Thanks in advance JSON DATA : { "errstr": "Apps list", "success": 1, "data": { "topFree": [ { "AppID": "3", "Title": "rgrger", "Price":...

Executing pwd command in csh script

csh
I'm trying to print the location in which I'm running my script from. I tried to use the following: #! /bin/csh -f var=$(pwd) echo $var i get the following output: Illegal variable name ...

Get child control content from sender

c#,wpf,canvas,children
How do I get a value from the sender's children? MouseUp on a Canvas creates a Grid. private void ScrollViewer_MouseUp(object sender, MouseButtonEventArgs e) { Grid grid = new Grid(); Label timeLabel = new Label(); timeLabel.Content = "06:00"; //this could be anything timeLabel.Name = "TimeStart" grid.Children.Add(timeLabel); canvas.Children.Add(grid); grid.MouseDown += new MouseButtonEventHandler(ClickEvent);...

Update and remove cached image using Liipimaginebundle

php,symfony2,liipimaginebundle
I'm using liipimaginebundle and everything work fine except for deletion and update cached images when I update the original image. I would to know How can I do this config.yml liip_imagine: resolvers: default: web_path: ~ filter_sets: cache: ~ travel_75_55: quality: 80 filters: thumbnail: { size: [75, 55], mode: outbound }...

unity facebook sdk get profile picture using www not working

facebook,unity3d,unityscript,facebook-unity-sdk
i am trying to get facebook profile photo by using facebook sdk when I used this code it was working fine but suddenly second day url was not downloading. url download completed is not printing, and it is showing no error. private IEnumerator getProfilePicture() { Debug.Log("Here to get profile picture");...

how to extract string list values in ajax success

javascript,jquery,ajax,json,jsp
In controller List<String> currectTime = userService1.getUserCurrectTime(time,hash); I need to extract each value from the ajax success responce. $( ".dropdownlist" ).change(function() { var time=$('#dropdownlist').val(); var hash=$('#hash').val(); alert(time+hash); var savedata = { time:time, hash:hash }; $.ajax({ type:'POST', url:'../test', data:savedata, error:function(){ alert("error"); }, success:function(data){ alert(data); var obj = JSON.parse(data); }); } }); });...

Save image to dropbox with data from canvas

javascript,html5,canvas,dropbox,dropbox-api
I'm trying to write canvas data as an image (png) to my dropbox. I manage to get the data from canvas and to save a file to dropbox, but the file is not an image file it seams. According to the documentation the image data should be converted to a...

FormControlName in ax 2012

forms,axapta,microsoft-dynamics
is it possible to find the control name for control which is an edit method in ax 2012 form. i.e how to find control name for edit method control. I tried but could not find the correct name ....

Client side validation gem for simple form not working

ruby-on-rails,ruby,simple-form,client-side-validation
<%= simple_form_for (@category), :validate => true do |f| %> <%= f.error_messages %> <ol class="formList"> <%= f.hidden_field :user_id, :value => current_user.id %> <%= f.input :category, :size =>20, :title => "Enter Category Name" %> <%= f.submit %><div class="load_preview_customer"><%= f.submit "preview", :style => 'width:100px;', data: {:disable_with=>"loading preview..."} %></div> </ol> <% end %> the...

When to use Hash partitions in Oracle

oracle11g
In my project ,table data does not easily lend itself to range partitioning, but i would like to partition for performance and manageability reasons. Table contains info about users for a retail domain like user id,username,email,address etc. so can i go ahead and create hash partitions like some 4 or...

Maximum Date Per Group in pandas DataFrame

python,pandas
I have found similar questions to this but nothing working with dates in DataFrames grouped by multiple columns. I have a pandas DataFrame that looks like this: person_ref post_start post_number post_title change_date 0 123 2010-08-08 000492 Doorman 2014-04-17 1 123 2010-08-08 000492 Doorman/Porter 2014-01-14 2 123 2010-08-08 000492 Uniformed Security...

window.open image resize jquery

javascript,jquery,html,window.open
hi i am trying to create html popup of an image of perfect size but it only works second time. for example, when you click an image, it will open without perfect size and if you close it and open it again, it works! please debug my code: $(function() {...

UIAccessibilityContainer in child view controllers?

ios,uiviewcontroller,accessibility,voiceover,uiaccessibility
I have a parent UIViewController to which I add four child view controllers. I’m trying to manage accessibility throughout those controllers. I have a status enum which keeps track of which of those children are visible on-screen, so when that changes, I’m updating the accessibilityElementsHidden of the children as appropriate,...

How do I assign a number to a set of results but re-start the numbering at the start of a new unique ID?

sql,teradata
I am trying to (within a query) assign a row number to a date grouped by a customer ID. I realise that that makes little or no sense as a description so I have included an examples below (I don't have the reputation to post images yet and HTML tables...

Get definite City name in Google maps reverse geocoding

javascript,google-maps,google-maps-api-3
Using the Google Maps Geocoding API, i'm able to get the formatted address for a particular coordinate. To get the exact city name, I'm doing the following: $.ajax({ url: 'http://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+long+'&sensor=false', success: function(data){ var formatted = data.results; var address_array = formatted[6].formatted_address.split(','); var city = address_array[0]; } }); where lat and long...

Possibilities of Climbing n stairs with a constraint on the 20th floor

c,recursion,fibonacci
Im solving a recursion problem in which the function int stairs(int n) returns the number of possibilities in climbing the stairs up to n, with the conditions of either taking 1 step or 2 steps. The following code solves this: int stairs(int n) { if (n<0) return 0; if (n==0)...

Accessing an Arraylist from Mainclass in other classes

java
Am developing a timer application and on process am stuck with a step. I have stored some values in an ArrayList and it resides in my main function . I have a separate timer class which triggers the timer for the event. Now I have to integrate the Arraylist with...

in a single column i have three values …how to get them seperately [closed]

php,mysql,arrays
<table> <tr><td>Pam Date:23-11-2014 Time: 02:18:00 </td></tr> <tr><td>Sam Date:24-11-2014 Time: 04:00:00 </td></tr> <tr><td>Julie Date:26-11-2014 Time: 06:10:00 </td></tr> <tr><td>Remo Date:27-11-2014 Time: 04:25:00 </td></tr> <tr><td>Woods Date:27-11-2014 Time: 03:40:00 </td></tr> </table> All these values are in the same column,i need the date value alone. Any suggestions to get the date value alone?...

LoadIcon()/LoadImage() fails with error code 0x00000715

c++,winapi,visual-c++
I am trying to load an icon in my Windows taskbar DeskBand but it always fails with error code 0x00000715(The specified resource type cannot be found in the image file). I have already included the resource.h file and it contains the id for the ICON. Here is the code i...

Lock with Python is not locking

python,locking,raspberry-pi
In order to understand how threading.Lock works I have create the following scripts: script1.py: import camera import threading import time t1 = threading.Thread(target=camera.action, args=(1, 10, 1)) t2 = threading.Thread(target=camera.action, args=(1, 10, 2)) t1.start() time.sleep(2) t2.start() camera.py from time import sleep from threading import Lock import picamera from sys import exc_info...

Going back and forth in django relations

python,django,foreign-key-relationship
I have following relations in between django models class Customer(models.Model): #fields class Tooth(models.Model): #fields customer = models.ForeignKey(Customer) class Peri(models.Model): #fields customer = models.ForeignKey(Customer) class PeriTask(models.Model): #fields tooth = models.ForeignKey(Tooth, related_name="peritasks") peri = models.ForeignKey(Peri, related_name="peritasks") I can't seem to be able to grasp the inverse relations. I mean I can get...

Does a lambda expression create an object on the heap every time it's executed?

java,lambda,java-8
When I iterate over a collection using the new syntactic sugar of Java8, such as myStream.forEach(Item -> { // do something useful }); Isn't this equivalent to the 'old syntax' snippet below? myStream.forEach(new Consumer<Item>() { @Override public void accept(Item item) { // do something useful } }); Does this mean...

How to store extra attributes using single table inheritance?

mysql,ruby-on-rails,ruby,database,activerecord
I'm building an application in Ruby on Rails, Rails 4. Let's say I have a table Users and I want to specify two types of users User_1 and User_2 User_1 will use all of the columns from the parent table Users, but User_2 will use all of the columns from...

WebGL - Texture is not showing correctly

javascript,textures,webgl
Following webglacademy 5th tutorial at creating textures (http://www.webglacademy.com/#5), the point is to load the texture on the cube object which works, kinda. Look at the result - Can anyone tell me why the texture looks like this while it should be fit perfectly on cube side? Demo here - http://kgpk.esy.es/WebGL/...

Android onTouchListener with ImageView and PDFRenderer

android,listener,pdfrenderer
Can some body help me with some understanding about onTouchListners?? I am new to android...and doing something more complex I guess.. 1. I have a main Activity class which renders a list of 7 pdf files 2. there exists a PDF class which renders the selected item as a new...

How to clone a javascript Error into a standard object

javascript,logging,properties,runtime-error,clone
Specifically, I'd like to convert a Javascript error to an object whose properties can be listed, and hence console.logged. try { throw new Error('418 : Blue Teapot of Death'); } catch (error) { for (var k in arg) { console.log('Key found: ' + k); } // Outputs nothing } EDIT:...

When does HttpContext.AllErrors contain more than one exception?

asp.net,error-handling,httpcontext
In an ASP.NET application typical error handling code involves some variation of GetLastError(), however there's also HttpContext.AllErrors collection of which the GetLastError() method only retrieves the first one. What are the scenarios where the AllErrors collection might contain more than 1 exception? I cannot think of anything, but obviously it's...

Has anyone worked with alddeed:tabular package in meteor?

mongodb,meteor,tabular
I am trying aldded:tabular package in meteor from here. Here is my code client side: TabularTables = {}; Books= new Mongo.Collection('books'); Meteor.isClient && Template.registerHelper('TabularTables', TabularTables); TabularTables.Books = new Tabular.Table({ name: "BookList", collection: Books, columns: [ {data: "title", title: "Title"}, {data: "author", title: "Author"}, {data: "copies", title: "Copies Available"}, ] });...

Object's Hash Code Array [duplicate]

java,arrays,hashcode
This question already has an answer here: What's the simplest way to print a Java array? 17 answers I wanna convert the linked list to array. But when I print it it gives me the objects' hash code. How can I fix this? I create an array and then...

List of data.frame's to individual excel worksheets - R

r,excel,xlsx
I have a list of data.frame's that I would like to output to their own worksheets in excel. I can easily save a single data frame to it's own excel file but I'm not sure how to save multiple data frames to the their own worksheet within the same excel...

Download and View PDF inside android application from Webservice

android,web-services,pdf,bufferedreader,filereader
I am trying to download and open a PDF file inside android application i.e. without using any other application(pdf viewer,etc) installed on phone. Please tell me is it possible?? So far What I have done is : PdfViewerActivity.java public class PDFViewerActivity extends Activity { private Button mDownLoadPdf; @Override protected void...

PhpMyAdmin throws Fatal Error isUserType() on a non-object at start. Blank Page displayed

phpmyadmin
I can use PhpMyAdmin normally when I set $cfg['ServerDefault'] to 1, my localhost. But I need the user to be presented with a list of possible servers. When I switch $cfg['ServerDefault'] to 0 though PhpMyadmin doesn't load anymore. Blank page is displayed and error log shows following message: [error] [client...

SQL combine AVG and RANK

tsql,sql-server-2008-r2
I have a query VariableWastage AS ( SELECT ID , SCRAPVAR , COUNT(RECCODE) AS [COUNT] , RANK() OVER ( PARTITION BY ID ORDER BY COUNT(RECCODE) DESC ) AS [RANK] FROM RECIPE WHERE ITEMTYPE != 2 AND CAST(CAST(SCRAPVAR AS FLOAT) AS INT) != 0 -- excluding SCRAPVAR 0 GROUP BY ID...