FAQ Database Discussion Community


Spring Boot JSR303 message code in annotation getting ignored

spring-boot,bean-validation
In my Spring Boot app I have a backing bean where I am using JSR303 validation. In the annotation, I have specified the message code: @NotBlank(message = "{firstname.isnull}") private String firstname; Then in my message.properties I have specified: firstname.isnull = Firstname cannot be empty or blank My JavaConfig for the...

Android send data from service with sendOrderedBroadcast

android
i'm trying to send data with sendOrderedBroadcast to BroadcastListener such as : public class ServiceReceiveSubjects extends IntentService { public static String RECEIVE_SERVER_DATA = "ServiceReceiveNewSubject"; public ServiceReceiveSubjects() { super("ServiceReceiveSubject"); } @Override protected void onHandleIntent(Intent intent) { receive(); } private void receive() { String jsonStr = "DATA"; NotifyMsg( jsonStr ); } private...

Change file to read-only mode in Python

python,file-io
I am writing a data processing code, in which I create a new file, write processed data in to this file and close. But the file has to be closed in read-only mode, so that it would not be accidentally modified. Can this be done in Python?

missing some folders in iPhone simulator?

ios,ios-simulator
I am developing an iOS project. There, I am having to upload images to to PHP server. So I choose some images from gallery in simulator for check up. Selected image is stored inside simulator. But I couldn't find that folder. So image is going empty to server. How to...

Binary Search Tree Haskell

haskell,functional-programming,binary-search-tree
I have an insert function for a Binary Search Tree in Haskel. My insert functions first two lines look like this insert :: (Ord a) => BST a -> a -> BST a insert Nil x = Node x Nil Nil I know the function works, I have tested it...

Read Web XML using Android Studio

android,xml,parsing,web
I'm developing an app to read XML file from the web and parse it into text. I have tried the following code and it works perfectly with a normal project on eclipse(made slight changes for Android Studio): package ali.androidtest; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.View; import android.view.Menu; import android.view.MenuItem; import...

How to test my own data Types using HUnit in Haskell?

haskell,hunit
Part of Queue.hs: module Queue ( Queue, emptyQueue, isEmptyQueue, enQueue, deQueue ) where data Queue a = EmptyQueue | Single a | Q a ( Queue a ) a deriving (Show, Eq) emptyQueue :: Queue a emptyQueue = EmptyQueue enQueue :: a -> Queue a -> Queue a enQueue x...

MidiSystem.getSequencer() giving error at compile time - symbol not found [closed]

java
import javax.sound.midi.*; public class MiniMiniMusicApp { public static void main(String[] args) { MiniMiniMusicApp mini = new MiniMiniMusicApp(); mini.play(); }//close main public void play() { try { Sequencer player = new MidiSystem.getSequencer(); player.open(); Sequence seq = new Sequence(Sequence.PPQ, 4); Track track = seq.createTrack(); ShortMessage a = new ShortMessage(); a.setMessage(144, 1, 44,...

openpyxl 'NoneType' object has no attribute 'font'

python,fonts,openpyxl,nonetype
I'm writing a function that puts values into a spreadsheet and colors the cell based on the value. Now for some reason I'm getting a weird 'NoneType' error that's completely stumping me: Traceback (most recent call last): File "vix.py", line 168, in <module> printexceldaily(1990, 2015, 'All_Lows', 10, 15, 18, 28)...

Recursive Binary Search for Spellcheck is missing some words

java,recursion,binary-search-tree,spell-checking
I have a dictionary file that contains a list of words, and I read that file into the array list sArray. I then have a book where I use a string parser to take every string from this book and send it to the binary search method, bSearch. bSearch will...

python urlencode multiple same variables

python,urlencode
I've read the other posts about python(v2) urlencode and didn't find this question. How can I utilize the urlencode (if that is the right tool to use) if I have multiple variables, but all having the same name? So say the URL is: http://path.com/a?var=earth&var=wind&var=fire If I define this: url =...

Can't figure out what is wrong with my rot-13 method

java,methods,rot13
I've been changing it around a lot. And, it just keeps getting worse. I can't figure out what I am doing wrong. From A-M, add 13. From M-Z, subtract 13. Before, at least I was receiving back letters. Now, they symbols. import javax.swing.JOptionPane; public class ExerciseE { public static String...

Deleting data in Symfony2

php,symfony2
I have delete options for each row like this. I successfully deleted the data using GET method but How to delete in POST/DELETE method using the same layout? Is GET method the safe way to delete?...

Using “seed” based math to recreate application instances

string,algorithm,math,hash,seed
Okay so I was thinking today about Minecraft a game which so many of you are so familiar with, I'm sure and while my question isn't directly related to the game I find it much simply to describe my question using the game as an example. My question is, is...

How can I get the size of a resource without actually downloading it?

http,curl,network-programming
So I'm on very constrained bandwidth where I am right now and I clicked a link to a pdf tutorial for something and Chrome began to download it and I was watching the size spiral upward from 20Kb past 5Mb and decided to stop it. How do I know it's...

Android - Click Toolbar that is overlayed by a view

android
Here's my current situation: I can't click on the toolbar because there is a view that is overlapping it intercepting the touch responses. I'll expand: I'm making a music app. In the music app, there is a list of songs that is beneath the toolbar. However, once you click on...

How to fetch data using inner queries using parse in Android?

android,mysql,parse.com
I have 3 classes in Parse. 1)Post (post_id,post_text,user_pointer) 2)Votes (vote_type,post_pointer,user_pointer) 3)Comments (comment_id,post_pointer,user_pointer) I Need to fetch list of post texts, total count of votes & comments for a particular post and check whether the current user has voted. If voted, return the vote_type(upvote, downvote) as well. I tried this. ParseQuery<ParseObject>...

Disable child viewPager swipe inside parent viewPager

android,android-viewpager,ontouchevent
I want to disable swipe of child viewpager which is in a parent viewpager. I currently use this custom child viewpager public class CustomViewPager extends ViewPager { public CustomViewPager(Context context) { super(context); } public CustomViewPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onInterceptTouchEvent(MotionEvent event) { // Never...

View is not display proper in iOS

ios,iphone,xcode,storyboard,autolayout
I make a view in storyboard with one view only. It looks good in Xcode but when I am trying to run the app in the device then it does not look good. see below image in iPhone5C: Help me to solve this Thanks...

Create video of selected images from sdcard in android

android
Hello very good morning to all of you. Actually what i want to do is, I want to open gallery select some of what images and after selection of images i want to create video of that selected images. So please help me to do this task. Thanks in advance.

How to avoid Deadlock in this scenario?

mysql,database,database-deadlocks
I have a innoDB table, in which, multiple connections might insert data, and a single MySql Event that runs every 10 secs deletes some previously inserted records. But i am getting Deadlocks. How can i avoid them? This code is responsible for Inserting the records into the table row-by-row. sql...

awk search then transpose rows to columns

search,awk
quite new to awk and data manipulation but have got stuck and was looking for some help. have a file: Ntab.txt which is a sample file of two hosts, there is numerous hosts in the real file one after each other. Each host has multiple "displayName"s (addresses) with corresponding figures...

Laravel 5 Query Builder Recordset Array

php,arrays,laravel-5
I have created a query with query builder that returns multiple rows and when I try to print the records using foreach loop, getting this error: "Trying to get property of non-object" Controller: $productPhotos = DB::table('productsphotos')->where('ProductId', $id); View: @foreach ($productPhotos as $item) <li><img src="{{ $item->PhotoThumb }}" /></li> @endforeach ...

why cmd can not run “python a.py”,but “python E:\python\python2.79\a.py”is ok…“python a.py”is taught by a python book

python
Just like I ask in the title I try to run "python a.py" in cmd but it says no such file or directory "python E:\python\python2.79\a.py" can run.. ..I am a newbie in python...I will appeciate for your answers

Signalr with android client

android,signalr,signalr.client
Hi I'm new to Signalr and I want to develop android native client application for communicate with signalr server. So I follow "whathecode" article and still i'm not able to connect to server. Anyone can give me some sample project or example.Its big help for me. Thank you. public void...

how to implement validations by using javascript? [closed]

javascript,html,jsp
I implemented the validation for email,new and confirm password in js,the validations which i wrote are not working.could any one please help me to solve the problem.

Trying to find Magnitude of Mat image

c++,opencv,matrix,opencv3.0,magnitude
I'm trying to learn OpenCV (Using version 3.0.0). Right now I'm trying to see what the point operatioins do to various images, everything is going fine until I tried to do the magnitude operation, which requires inputs be in the form of magnitude(InputArray x, InputArray y, OutputArray magnitude) It also...

Make a list with Name and number, swift xcode

xcode,swift
In the ThirdArray under //Seattle I want make a list of names and numbers. What should I do? and how would I highlight the phone number so when the user touches it, it calls the number? thank you, This is my first language import UIKit class FirstTableViewController: UITableViewController{ var FirstTableArray...

How to do Selenium test on Bamboo

selenium-webdriver,maven-3,bamboo
We are trying to run some Selenium tests using Selenium CI . We are using maven to build the project and using Selenium web driver. I followed an Blog post in the link. http://www.3pillarglobal.com/insights/how-to-use-selenium-in-continuous-integration-testing#comment-38432 as a reference When I run the maven project locally(without Bamboo) it worked fine. But when...

Changing a JLabel while GUI is running

java,user-interface,jframe,jlabel
The code as I have it now does work in changing the JLabel, but the issue is that after the first change, it only adds onto the label, rather than changing it like I intended. The code is as follows. public static void changeJLabel(JPanel panelName, JLabel JLabel, String newText) {...

Expected unqualified-id before '[' token

c++,g++
I know this error is generally for syntax errors, but I can't seem to find anything wrong with this code. Can anyone help me point it out? Here are the errors I'm getting: deli.cc:10:7: error: expected unqualified-id before ‘[’ token int [] myCashierNums; ^ deli.cc:11:7: error: expected unqualified-id before ‘[’...

How to set Style on only Selected button from Group of Buttons

c#,wpf
I have two buttons Which is menioned in image I have set the styles on it like <Window.Resources> <Style x:Key="LinkButton" TargetType="Button"> <Setter Property="Foreground" Value="Blue" /> <Setter Property="Cursor" Value="Hand" /> <Style.Triggers> <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="True"> <Setter Property="TextElement.Foreground" Value="White"/> </DataTrigger> <EventTrigger RoutedEvent="Click">...

Blank Page on mysqli_query();? [duplicate]

php,mysql,sql,mysqli
This question already has an answer here: Parse errors are not displayed 8 answers I am making a basic song recommendation site, and I have a form set up that leads to a page with this exact code on it: <?php ini_set('display_errors',1); ob_start(); session_start(); $host = "localhost"; $user =...

jQuery Sortable Horizontal Using Different HTML Tags

jquery,html,css,twitter-bootstrap,jquery-ui
This is what I currently have http://www.bootply.com/sfLr2AJ7EU My issue is that I cant move my image (id) boxes horizontally. I have managed to get it working vertically but when I try to get it working horizontally, it wont work. You can move the image but you cant drop it in...

Illegal string offset Undefined offset: 2

php,mysql
I'm new to php\mysql and I'm having issuing querying my database and formulating a top 10 list of users arranged by the column 'points'. The error: Illegal string offset 'username' Illegal string offset 'points' Illegal string offset 'username' Illegal string offset 'points' Undefined offset: 2 Undefined offset: 2 Undefined offset:...

Tkinter Frame Doesn't Fill Remaining Space

python,tkinter,tk
This is my first encounter with Tkinter, and I'm beating my head against a wall over this. Ultimately, I am wanting a layout that uses a Frame along the left edge that contains a stack of buttons (navigation). This should be hard-wired to 100 px wide and take up all...

SELECT records based on criteria

sql,sql-server,tsql
I'm looking to find a way to select an ID (PersonID) based on criteria. Should this personID not meet the criteria, I need to select another one. To make it visual I have two tables: 1. ID Company LatestOrder 50593 TEST 1 10955 TEST 2 2. ID Criteria_A Criteria_B 50593...

Comparing two virtually identical BigDecimal numbers in Ruby on Rails

ruby,precision,equality,bigdecimal
I got a little problem that I really would like to understand. I am using assert_equal to compare two BigDecimal numbers that are supposed to be identical. They actually are except a very little tiny fraction, see below: -#<BigDecimal:7f4b40e8de78,'0.4021666666 6666666666 666666667E2',36(45)> +#<BigDecimal:7f4b40e85db8,'0.4021666666 6666666666 6666668E2',36(63)> I use assert_in_delta in order to...

“push” is deprecated in iOS 8.0 and later

ios,storyboard
'push' is deprecated in iOS 8.0 and later. This is the problem I faced... How to connect the ViewController ?...

MYSQL Select Count if greater than 0

java,mysql
Is there a way i can count all the greater than 0 in late? Select *, timestampdiff(minute, t1.startTime, t.IOTime) as late from tbl_time GROUP BY name if the late returns higher than 0 then it should count. Select *, COUNT(timestampdiff(minute, t1.startTime, t.IOTime)) as late from tbl_time but I don't know...

How to block javascript in c#?

javascript,asp.net,c#-4.0
I have written javascript in aspx file like below function Validate() { try { } } Now in .aspx.cs file like ClientScriptManager clientManager = Page.ClientScript; clientManager.RegisterClientScriptBlock(this.GetType(), "Validate()","Validate()", true); It's not working please help...

C# Type Inference fails with methods that contain default parameters

c#,type-inference
Say I have the following method: static int MethodWithDefaultParameters(int a, int b=0, int c=1) { return a + b + c; } And then I use this method in a LINQ query like so: Enumerable.Range(1,10).Select(MethodWithDefaultParameters); This fails with: Error 1 The type arguments for method 'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred...

Calling Global Variable from Controller to HTML View AngularJS

javascript,jquery,angularjs,angularjs-directive,angularjs-scope
I have the following code in Plunkr. http://plnkr.co/edit/8sBafktFzFa8fCLLJgMF this is my js file angular.module('ui.bootstrap.demo', ['ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function ($scope, $modal, $log) { $scope.open = function (size) { var modalInstance = $modal.open({ templateUrl: 'myModalContent.html', controller: 'ModalDemoCtrl', size: size }); var applicantID = 12; }; $scope.submit_info = function (size) { var modalInstance =...

add a virtual column to a reflected table

python,oracle,sqlalchemy
I have a class class TableA(Base): __table__ = table_a __mapper_args__ = { 'primary_key':[table_a.pk,], } and want to add a transform as a column that will be seen when querying (I only have read access, so no writing is necessary) new_col = func.regexp_substr(table_a.original, r'[^-]*').label("new_col") Is there a simple way of doing...

Get key value for selected option in select using jquery

jquery,json,select,key-value
I have a JSON like quarterJson = [{"quarter_id":1, "quarter":"Quarter 1", "end_date":'31.03.'}, {"quarter_id":2, "quarter":"Quarter 2", "end_date":'30.06.'}, {"quarter_id":3, "quarter":"Quarter 3", "end_date":'31.09.'}, {"quarter_id":4, "quarter":"Quarter 4", "end_date":'31.12.'}]; and using it populate options of a select box $('#quarterSel').empty(); $('#quarterSel').append('<option value="0">--Select--</option>'); $.each(quarterJson ,function(idx,ob){ $('#quarterSel').append ('<option...

How can I create a callable prototype method within another prototype

javascript,prototype
I'm working on trying to build a small library of functions within an object prototype. I'd perviously just been throwing my helper functions as global functions, however i'm trying to migrate to something more self contained. Anyway my proto wrapper looks like this; Q.fn = jHelper.prototype = { // helper...

BLE-Takes too much time while sending data from ios 7.1 to ios 8 - Transfer speed

ios8,bluetooth-lowenergy,core-bluetooth,ios7.1,ios-bluetooth
I Have a strange issue. I am developing an app in which i am sending Chunks in 20-20 bytes.. Everything is working fine. When i am sending Bytes data from iOS 8 to iOS 8 device it take around 4-5 second to transfer from one device to another, but my...

Open link in new tab using JQuery

jquery
I have a div and some links within it. I want to open these links in new tabs so am using the following code: $(".classname").find("a").target = "_blank"; However it is not working. Am I missing anything?...

HOW TO GET THE Postion in the type of int in list view

android,android-layout,android-activity
i am using a listview in my application and want the postion of the item clicked in the listview here i have this code in my main.java lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // selected item //here i want to get the...

wp_insert_post two values into the post_title

php,wordpress
I'm currently working on inserting some data into my posts, I'm trying to insert two sets of data into the post title and I'm kinda stuck. $my_post = array( 'post_title' => $data['title'], This works fine, but I need to add another one to the title, how can I do that?...

Force AJAX Header Change

javascript,android,jquery,ajax,cordova
So I am developing a Apache Cordova app for Android, and I'd like to be able to set the headers for the AJAX requests I am sending, including the Host, Origin, and Referer fields. Because these are being executed in a separate WebView, I can't access the user's original cookies...

Can't use list from another file in Python

python
I have a script that imports a list from another file. The list contains an almost-dictionary, so I ran a loop through it to turn it into a dictionary, but I'm getting the following error: Redefinition of unused productOrdersListPulled What am I doing wrong? My code is: import ast import...

how to convert 10:09:00 GMT+0000 to IST in javascript?

javascript,jquery
I'm Developing web app, In that We are using CK Editor Calendar. In which I'm execute below code for get Date & Time .. Code: var strDate = new Date(event.start); var endDate = new Date(event.end); var title='Event :'+event.title+' From :'+ event.start.toLocaleString() +'To:'+event.end.toLocaleString()+' By :'; Output: Fri Feb 13 2015 10:37:00...

setting the start position of the edge from node in cytoscape.js

cytoscape.js
How do I set the position of the edge from the node i.e. the edge should origin only from that location from the node(e.g. top,center,bottom,etc).Sometimes node labels and the edges of some nodes are overlaping each other. If it is possible to set the edge origin, able to set the...

Save itext pdf as blob without physical existence.

java,pdf,itext
I am using this code to generate PDF using iText. First it creates HTML to PDF after that it converts that PDF in byte array or in BLOB or in byte array. I dont want to create any physical stores of pdf on my server. First i want to convert...

jQuery multiple hover events- mouseleave not firing

jquery,hover,fadeout,mouseleave
Action: hover across multiple "h2" elements in one sweep of the mouse. Expected behavior: fadeIn and fadeOut corresponding "article" elements, one by one. Only one article should be visible at a time, and no article elements should be visible after mouseleave all h2 elements. Actual behavior: one or more articles...

How to decode list of urls in file

python,perl,file
I have file which contain urls. Each urls is separated by new line. The contents of url is encoded format. I need to use vi command line to decode the content of each line. List of urls is as follow: http://www.example.com/programm_detail.aspx?bu=%2fhome%2fprogramm_AbisZ.aspx%3fLang%3dde&amp;FilmId=22659&amp;Lang=de&amp;Search= http://www.example.com/programm_detail.aspx?bu=%2fhome%2fprogramm_AbisZ.aspx%3fLang%3dde&amp;FilmId=22104&amp;Lang=de&amp;Search=...

Nginx config rewrite rule combination

.htaccess,url,nginx,rewrite,config
So I have these 2 rules for url rewrites. location ~ /details { rewrite ^/details/(.*)/(.*)/(.*)/(.*)_(.*).html$ /site/$4.$5.html permanent; rewrite ^/details/(.*)/(.*)/(.*)/(.*)_(.*)_(.*).html$ /site/$4.$5.$6.html permanent; } But for some reason the first one on its own works just fine but the second one will not pick up. Is there a way I could combine...

numpy.savetxt() stop newline on final line

python,numpy
numpy.savetxt() seems to always put a new line on the end of files. Is there a nice way to avoid this behaviour? Substituting the new line character to something else doesn't help. I don't think this is particular to my code, but the writing is being done like this (model...

I cant add text to textProperty

python,google-app-engine,datastore
I need to store a large text(70k char) to datastore. what I did is working fine on localhost. But When I upload it to gae it doesnt store anything. it just shows "{}" if I rename textProperty to StringProperty and change the text, it works. where did I do the...

File type as seen in file's Get Info

osx,cocoa,file-management,fileinfo
I want to get the kind of a file at a certain path -- the same wording that you get from the file's Get Info window. Then I can know whether it is a document, script, binary, or a folder. How can I do this? NSString *path = [@"/Downloads/test.txt"]; NSDictionary...

imagecopyresampled not working not sure why

php,css,image,jpeg,php-gd
So I'm attempting to use imagecopyresampled to crop out a section of a photo so that I don't have to worry about my users uploading photos larger than intended to my website. Unfortunately I have yet to figure out why imagecopyresampled is basically behaving as though I simply resized the...

How to generate url redirects similar to stackoverflow using .htaccess and php?

php,.htaccess,redirect
Background As one would notice in stackoverflow's url structure, every question has an id followed by the question title. For example: http://stackoverflow.com/questions/1039725/how-to-do-url-re-writing-in-php The url above has the question id: 1039725 The question title is: how-to-do-url-re-writing-in-php Just to play around with this url, even if one were to enter some junk...

display thumbnails of video in tableviewcell

ios,uitableview,mpmovieplayercontroller
This is my code which is working perfectly . Here i m accessing array of videos in my tableview..... This is my array of videos and videos are in my bundle... - (void)viewDidLoad { [super viewDidLoad]; videos = [[NSMutableArray alloc] initWithObjects: @"video 1", @"video 2", nil]; } Accessing videos in...

IBM Worklight Mobile First Server [closed]

server,mobilefirst-server
I Done Hybrid application using IBM Worklight.I created apk file using eclipse and installed in android device.if my Mobile first Server is Stopped my app in android Mobile not working. if my Mobile first Server is Started then My app working can u tell me what is happing?

what is worng in ajaxSubmit calling?

jquery,ajaxsubmit
$scope.submitTheForm = function(htmlcode){ var idOfForm = "formOfCalCPDF"; var dataPassed = $.param({'htmlcode':htmlcode,'mode':'getpdf'}); alert("coming here"); $(idOfForm).ajaxSubmit({ url: 'ggs.erm.payrollJava.Taxsummary', type: "POST", data: dataPassed, error:function (){}, success: function (data){} }); }; When ever I call this function , although alert is executing,but not POST request, do you see any kind of problem with it?...

Create options menu on bottom of screen, no action bar

android,android-optionsmenu
I've seen similar questions, but most solutions revolve around a split actionbar. I don't think this is possible in my app, as my theme is Theme.Material.Light.NoActionBar. Here is an example of what I would like to do. The overflow menu is located on the bottom-right, and when clicked, a ListView...

How to separate lines depending on the value in column 1

shell
I have a text file that contains the following (a b c d etc... contains some random values): 1 a 1 b 2 c 2 d 2 e 2 f 6 g 6 h 6 i 12 j 12 k Is there a way to separate lines with some characters...

Accessing nested values in JSON data from Twitch API

python,dictionary,twitch
I am using the code: getSource = requests.get("https://api.twitch.tv/kraken/streams") text = json.loads(getSource.text) print text["streams"]["_links"]["_self"] text is a dictionary that I get by calling json.loads. I then try to get the nested values, eventually trying to get the url but this error shows up: Traceback (most recent call last): File "Twitch Strim.py",...

Webservice getting called multiple times

ios,xcode6
I am making 2 separate webservice calls asynchronusly, after 1st webservice response is received, I am making 2nd webservice call which leads to multiple threads being spawned of even though method is called once.. ...

how to find the total distance traveled, based on geo points stored in database

php,google-maps,google-direction
Using an android app I am sending latitude and longitude values to database. This is my database Now in webpage I need to show the total distance traveled by K.Prathibha.N I've used Google Maps Direction API to find the distance but it is accepting 'id=2' as origin and 'id=5' as...

Google play store like interface using recycler view

android,recyclerview
My assignment is to create an interface much same like Google Play Store.There will a Category name followed by 3 or 4 cards (horizontal) followed by More button. Then again next category. I already had implemented this using nesting the horizontal listview inside Vertical listview. I know, I can achieve...

How to align a child DIV to center (not middle)?

html,css3,alignment
i spend a day searching for a way to align my child DIV from its parent but all my research show same results. This is my first time creating a webpage. !http://i.imgur.com/xpUsMzU.png <== result https://jsfiddle.net/backspaced/6uy56hw4/ <== Code ._header0 { position: relative ; white-space: nowrap ; overflow: hidden ; text-align: center...

formatted output using php and mysql

php,mysql,sql
My problem details: logs table userid offername amount uamount offertitle date offername are like this xxx yyyy zzzz My query: $sqloffers=mysql_query("SELECT user.username, logs.* FROM logs INNER JOIN user ON user.userid = logs.userid ORDER BY logs.offername DESC "); to display results <?php while($row = mysql_fetch_array($sqloffers)) { echo "<tr> "; echo "<td>"...

Unknown Swift syntax

swift
I was just going through this blog from Mikeash and found the following declaration: private let f: AnyObject -> Parameters -> Void I am not clear what this syntax means. I tried looking into Swift Programming Guide but was not able to find any answer. Can someone please put some...

Split the first space and the last space in a string and limit the size of output in 3

php,regex,preg-split
Suppose I have a string: ABC DEF SASF 123 (35) And my expected output like: Array ( [0] => ABC [1] => DEF SASF 123 [2] => (35) ) I am trying to do this with $str = preg_split("/(^\S+\s+)|\s+(?=\S+$)/",$str, 3); But the current problem is this RegEx will replace the...

select values in a form not getting submitted

ruby-on-rails,forms,html-select,form-submit
I'm not exactly sure what I'm missing, when I use the dev tools the form shows up properly in the html but the only value that is not being submitted it the one in the drop down. I looked at my database and it's not submitting any value at all...

Error returned when calling Application.cfc method via Ajax (CF11)

ajax,coldfusion,application.cfc
I'm trying to test calling methods in a ColdFusion Application.cfc file using Ajax. As far as I can tell the following should work but I keep getting the following error returned: "Invalid request of Application.cfm, Application.cfc, or OnRequestEnd.cfm file". I am using ColdFusion 11. The following is my Ajax call...

How to cut broadcast ip address into another variable

linux,bash,ip
How can i get the string of the ip address. for example i enter 192.168.2.1, is there some method to cut the 2 and 1 into other string. IF not my for loop will have problem. echo -n "Please enter bmc start ip to ping 192.168." read bmcipStartaddress echo -n...

Setting QtreeWidget Height

qt,qtreewidget,qlabel
I am new to qt So I don't have much knowledge of sizepolicy and streches of widgets. I have a vertical box layout in which I have first added a Qlabel and then a QTreeWidget and then again a Qlabel. Now the problem is QTreeWidget is taking full space in...

Link in Rails doesn't work

ruby-on-rails,ruby-on-rails-3,authentication,ruby-on-rails-4,devise
I'm using Rails 4 and Devise 3.4.1 I have two pages. One of these two pages should not be accessed by unauthenticated users. I have a nav bar in the home page in which a link to that dashboard page is listed. This is the link <li><a href="/pages/dashboard/">Dashboard</a></li> In order...

Precision of repr(f), str(f), print(f) when f is float

python,floating-point-precision
If I run: >>> import math >>> print(math.pi) 3.141592653589793 Then pi is printed with 16 digits, However, according to: >>> import sys >>> sys.float_info.dig 15 My precision is 15 digits. So, should I rely on the last digit of that value (i.e. that the value of π indeed is 3.141592653589793nnnnnn)....

Why is my Android phone sending data through an unknown server?

android,security,networking,dns,wifi
I've been creating an app to learn how Android works and just playing around with various features like the sensors, SMS listeners, phone listeners, wifi listeners, etc. I recently added a bit of code from the Android Volley library to send a request to my website every time it connects...

How to Retrieve Data from Two Different MySQL Database using JDBC?

java,mysql,jdbc
How to retrieve data from two different MySQL database in a single query using jdbc? SELECT a.`driver_id`, a.`state`, a.`lat`, a.`long`, MAX(a.`time_stamp`) AS timestamp, b.vehicle_type FROM `rl_driv_location` AS a, `rl_driver_info` AS b WHERE a.`state` = 1 AND a.`driver_id` = b.`user_id` AND b.`vehicle_type` = '"+ cartype +"' GROUP BY driver_id location database...

How can I clip large shapefiles in program R without the computer crashing?

r,gis,ram,raster,shapefile
I am wanting to clip a large shapefile (67MB) in program R and derive a much smaller raster from around ~5% of it. Once loaded the shapefile has 221388 features and 5 fields - and explodes to 746 MB. My difficulty comes when trying to clip the file to a...

Get instance variable by name in Swift

ios,swift
I am trying to replicate this functionality in swift: http://stackoverflow.com/a/11774276/4102858. I was able to successfully recreate allPropertyNames() in Swift. However, I'm having trouble doing the same with the method pointerOfIvarForPropertyNamed(). The main reason is that the Objc solution uses the function object_getInstanceVariable(), which isn't available in Swift. TLDL: Im trying...

Java Builder Design Pattern Redundant Field Declaration in Class and its Builder

java,builder-pattern
The classic Builder Pattern requires fields to be declared in the class-to-be-built and the exact same fields to be declared in the builder class. This can lead to problems when there are many fields and, during refactoring, the field types are not kept in sync. Here's an example of what...

Laravel 5 Function () not found

php,laravel,middleware,laravel-routing,laravel-5
I'm putting together a site which has a protected section where users must be logged in to access. I've done this in Laravel 4 without too much incident. However, for the life of me I cannot figure out why I can't get it to work in Laravel 5(L5). In L5...

VBA: get the column number of a selection

vba
I want to get the column number of a selection after using the Application InputBox but it always has bugs. Here is what I have so far: Dim cln1 as Integer selection1 = Application.InputBox(prompt:="Please select the fist column.", Title:="First Column") cln1 = selection1.Cells(1, 1).Column debug.print(cln1) I am not sure why...

Name rows by serial number

hive
I have TableA - NRow ---- 1 2 ... 1000000 And TableB - RowCount Name -------------- 100 A 10 B 200 C ... ... I want to add a tag to TableA, which will take value "A" for first 100 rows, "B" for next 10 rows, "C" for next 200...

Prerequisite on types?

haskell
I have a type Foo a and want a type EnumFoo a that requires instance Enum (Foo a). How do you declare this type? Let's say we declare Foo like this: type Foo a = Maybe a There can be Foo Int, Foo String and anything. Now I declare an...

Java: Manipulating non-static variable from thread?

java,string,multithreading,variables,static
The relevant summary of my code is this: public class A { String aString; public static void main(String[] args) { B b = new B(); new Thread(b).start(); } public static class B implements Runnable { public void run() { aString = "foo"; } } } I have had a few...

Back Button Handling in SlidingDrawer for mulitple fragment?

android,android-fragments,slidingdrawer
I have searched for this solution many times but couldn't find what i want.I have a slidingdrawer in my app.Now the options in the drawer is: 1.Home 2.Friends 3.Groups and many more Now for every option i have many fragments.Like for Home and Friends option the fragments goes like Home->fragment1->fragment2->fragment3...

What is significance of systemui APK in android?

android,android-ui,android-applicationinfo
Sorry for very basic question but could not find the exact answer for it. Using one application called AppXplore I am able to see one application systemui.apk (com.android.systemui) on my Nexus5. I want to know what is the use of this APK? What does this apk actually do? Thanks in...

SAPUI5 Component Metadata rootView Parameter for JSONView

json,components,sapui5,rootview,openui5
Has anyone been able to specify a JSON view in the rootView parameter in the metadata of SAPUI5(or OPENUI5) component. My ultimate goal is to implement something similiar to this "Best Practices" demo app using JSON views. In the "Application Best Practices" UI5 demo app, the component.js file contains a...

opencart show a blankpage when a customer login

opencart
i,m using Opencart 1.5.6.1 for my store everything is good, but when a customer register and then click the submit button OR when a customer want to login to own profile the page show blank when the page is blank my URL is : www.mysite.com/index.php?route=account/login Note: when blank page is...

cost of keys in JSON document database (mongodb, elasticsearch)

json,database,mongodb,elasticsearch,bigdata
I would like if someone had any experience with speed or optimization effects on the size of JSON keys in a document store database like mongodb or elasticsearch. So for example: I have 2 documents doc1: { keeeeeey1: 'abc', keeeeeeey2: 'xyz') doc2: { k1: 'abc', k2: 'xyz') Lets say I...

Importing excel file with all the conditional formatting rules to epplus

c#,epplus,epplus-4
I have an excel file which contains lots of data along with icon sets and data bars based on the values in the cell. It looks like this: I want to import this excel sheet along with the conditional formatting. Is there any library for this?? I went through this...

How to apply a regex to a folder full of .txt files?

python,regex,python-2.7,parsing,io
I have this regex: regex_ = r'(\w+\s+RN).*?(\w+\s+VA\w+).*?(\w+\s+VMP\w+)' I would like to apply it to a folder full of txt files and return every document as a list with and a new line. something like this: [pattern of the regex 1] [pattern of the regex 2] ... [pattern of the regex...

implementing XOR between two collections in clojure

recursion,clojure,functional-programming
i am trying to learn Clojure--and am very green. i am trying to implement a recursive version of set difference between two collections. what i was trying to do is first combine both lists, convert the combination to a set to remove the duplicates, then pass the mess back to...