FAQ Database Discussion Community


SQL move part of table data and replace by key of row in new table

mysql,sql
Example with 2 tables: Table A: `id`, `a`, `b`, `c`, `X`, `Y`, `Z` Table B: `id`, `h`, `i`, `j`, `X`, `Y`, `Z` I'm making a Table C that contains the X, Y, Z columns of either A and B, and use a key to link the data i.e.: A `id`,...

What is the best way to set the default instance for a final private field with optional parameter?

dart
Given a class with final private field _bar: class Foo() { final Bar _bar; Foo({Bar bar}) : _bar = bar { //error: list cannot be used as setter, it is final _bar = new Bar(); } } Attempting to set it in the parameter list results in this error //error:...

Catch SQL RaiseError in jsp

java,sql,sql-server,jsp
I am developing a database and some JSP Pages to perform CRUD operations on it. I cannot catch exceptions related to my SQL Code in my JSP Code. For Example: I have this part of code where I raise an error in T-SQL: IF @existing > 0 BEGIN RAISERROR ('ID...

Specify column separator for BCP

bcp
How do I specify column separator with "," for bcp or this code below bcp [wwtest].[accesscontrol].[Roles] out C:\test\bcp_outputTable.csv -SPC01 -T -c ...

SQL - find all the rows where the values are the same, or next biggest

mysql,sql,symfony2
I have a table where in one column I have lot of Int -values from x to y and it kinda loops. The values go from lowest to highest, but start again after awhile. Values look like this: TableRow: 2 5 10 15 .. 30 40 50 // And here...

MySQL: ERROR 1064 (42000) on trigger

mysql,mariadb
Could someone help me with this trigger please to find out what I am doing wrong. BTW sometime I didn't have this error... CREATE DEFINER = CURRENT_USER TRIGGER `domitik_db`.`disp_hdw_BEFORE_INSERT` BEFORE INSERT ON `disp_hdw` FOR EACH ROW BEGIN declare boxId int UNSIGNED; declare unitId VARCHAR; SET unitId=(SELECT homeunit FROM t_cpl WHERE...

Meteor observe changes added callback

meteor
@DavidWeldon I tried your code (Meteor observe changes added callback on server fires on all item) and it's very good thank you ! However I would like to have your advise : I use it for desktop notifications : when i get one notification, there is one console log (ok),...

Base64 decode for image/jpeg;base64 in android

android,base64,bitmapfactory
I am trying to decode base64 encoded string into bitmap in android. The encoded string will start with "image/jpeg;base64," I use the following method: public static Bitmap decodeBase64(String input) { byte[] decodedByte = Base64.decode(input, Base64.DEFAULT); // also tried using Base64.URL_SAFE , Base64.NO_PADDING return BitmapFactory.decodeByteArray(decodedByte, 0, decodedByte.length); } Assume that I...

Python searching list thats inputted by user

python
Hi im trying to write a program which uses a repetition statement to allow users to enter 5 numbers and stores them in a list.Then allow the user to search the list for a number entered by the user and indicate whether the number has been found or not. Im...

How to get all aliases for a cmdlet in power shell?

powershell
How can get all aliases for a cmdlet . For example Get-Help cmdlet has "gcm" and "man". So my question is how to get all aliases for a cmdlet , I tried Get-Alias but it gives unwanted answers . My requirement is to get all the aliases for a particular...

How to extact all columns when using data.table in R?

r,data.table
library(data.table) I am trying to do temporal matching between two datasets. wd <- structure(list(Year = c(2006L, 2006L, 2006L), day = c(361L, 361L, 360L), hour = c(14L, 8L, 8L), mint = c(30L, 0L, 30L), valu1 = c(0.5, 0.3, 0.4), Date = structure(c(1167229800, 1167206400, 1167121800 ), class = c("POSIXct", "POSIXt"), tzone =...

jqPivot is grouping column headers that do not belong to the group

jquery,jqgrid,free-jqgrid,jqpivot
I am trying to utilize the column header group functionality of jqgrid's jqpivot to have two column headers (A header for day of the week, and another header for the actually date). var crewAttendance = { "total": 1, "page": 0, "records": 7, "rows": [ { "ID": "1", "UserID": "10", "AttendanceTypeID":...

wordpress the_date('d F y') not working in query_posts

php,wordpress,date
in my template I want to show and specific category posts in side bar (cat = 17) so I use this code : <?php $cat=17; ?> <?php $pp = query_posts("cat=$cat&showposts=3"); ?> <?php if( $pp ) { ?> <section class="sidebar_boxes_container"> <div class="sidebar_headers" > اطلاعیه ها &nbsp<img src="<?php bloginfo( 'template_url'); ?>/img/notification.png"></div> <?php...

MySQL sort values that contain two numbers separated by “x”

mysql,sql,sorting
I have some values consisting of decimal numbers and alphabets: 2mm 3x4mm 2.5x5mm 1.7x6mm 1.7x9mm 1.6x5mm 3mm 5mm 3.5x5mm 3.5x8mm 10x7mm Note: x - means alphabet x. I want to sort them ascending so that the result looks like: 1.6x5mm 1.7x6mm 1.7x9mm 2mm 2.5x5mm 3mm 3x4mm 3.5x5mm 3.5x8mm 5mm 10x7mm...

KeyEvent on focus JavaFX FXML

java,javafx,javafx-2,javafx-8,fxml
I am currently working on an instant messaging program and have created a text for the user to enter a message in the FXML. How do I add a KeyEvent for when enter is pressed while the text field has focus. Update - Tried, but doesn't work <TextArea fx:id="area_chatInput" editable="true"...

Libgdx - How to get a specific item from an array?

arrays,libgdx
I have a Player class which has int number; In main, I store them in Array. Array<Player> players; How can I get a player which has for example number=2?...

jQuery .on() running before value given

javascript,jquery
Why does .on() not get the value of the form input field (#forgot) before the keypress has happened. $(document).ready(function() { $(document).on('keypress', '#pass', function() { var value = $.trim($('#pass').val()); alert(value); if (!value.length) { alert("Show"); $('#forgot').show(); } else { alert("Hide"); $('#forgot').hide(); } }); }); When I type in the first character the...

How to protect source code in electron project

copy-protection,electron
I build my first electron app but now I wonder how to protect the source code to be view by other developers. The official doc says : To protect your app's resources and source code from the users, you can choose to package your app into an asar archive with...

How to fire a Trigger when a variable surpasses/exceed a specific Date

sql,database,oracle,triggers,oracle-sqldeveloper
I have a table with an atributte of type "DATE" and I want to fire a Trigger when the atributte achieve a specific date. For example: Table A: a int primary key; d Date; A(1, '15-05-2015'); When this date arrives I want to fire a specific trigger. Thanks....

Calling the mixpanel API never returns a response

python,python-requests,mixpanel
When I use the following Python code to call the Mixpanel API, I never get a response. import requests requests.get("https://data.mixpanel.com/") But when I try in the browser it works fine. (I get the following response: {error: "Not Found"} which is expected.) Why is this? Or what can I do to...

Returning Function in VB.net

vb.net,function
I have a problem in this code because I am not returning any thing! It works Just as I want it without returning but when I return it crashes. Can you please help? Public Function Clear() As Boolean 'resetting the variuabels to be ready for next Order ZYZZ = "0"...

How to get a Column from a Frame as a double array type in Deedle C#?

c#,functional-programming,deedle
I wish to extract a column from a frame as a new double array in C#. For example: double[] values = myFrame.GetColumn<double>("myColumnName"); ...

Priority in DB2

group-by,db2,priority
This is my Parent_Child Table. PARENT CHILD TOT_BAL_AMT EFF_DT END_DT REFN_ID 22716 2528 5632 3/2/2015 3/5/2015 4112 22716 5698 5632 3/2/2015 5/9/2014 2563 22716 3256 5896 5/6/2014 5/6/2013 4555 37091 7412 4563 5/6/2015 1/1/2015 5666 37091 9632 4563 3/25/2015 2/5/2015 7896 425696 25 9000 3/8/2014 1/1/2015 45174 425696 30 8000...

Rename resource file does not change editor part title

eclipse,user-interface,eclipse-plugin,eclipse-rcp
In my plugin project, I have a project explorer view where I can rename a config file which in shown in another editor part. The file can be renamed in the explorer with the rename resource dialog but the corresponding the editor tab title does not change. The same problem...

java/selenium - how can I click on an element from a form that pops up on top of the main page?

java,selenium,xpath
At a certain point in my automation project, I have to click on an element that is part of a form that pops up on top of the main page (it doesn't go away like those menus that show up when hovering over a certain element and then disappear) after...

Convert date into “17. December 2015” Format [closed]

android,date,simpledateformat,android-date,android-dateutils
I am getting date in form of "20150119" and I want to convert it into the format like: "19. January 2015" . How can I convert date in such format. I tried below code: private void convertDate() { String m_date = "20150119"; SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy.MM.dd"); try { Date...

i am trying to make a pong game in android but i am stuck ,i dont know why ball isnt moving

java,android,surfaceview,thread-sleep,pong
here is the class which extends surface view , in its run method i've called the method to animate ball but the ball isnt animating public class OurView extends SurfaceView implements Runnable { Canvas c; Thread t = null; SurfaceHolder holder; boolean isItOk = false; Rect racketTop,racketBottom; int TopLeft ;...

String variable is not accepting “?” sign

javascript,string,variables,protractor,sign
I made code with: element(by.className('charge')).getText() .then(function(text){ var blabla = "Is this my string?"; expect(text.match(blabla)).toBe(true); console.log(text); }); And even is output of my console equal to my blabla variable, I'm getting result: Expected [ 'Is this my string' ] to be true. without any "?" sign. How is it possible?...

Not getting JSON data when using AJAX, Slim and PHP

php,api,slim
I am learning to create Rest API using Slim, but got stuck in here. I tried many things mentioned on internet but its still not getting value. My Ajax: $.ajax({ type: 'POST', url: 'pages/search', dataType: "json", data: {'val1':value1,'val2':value2}, success: function(data){ alert(data.val1); } }); My PHP using Slim: <?php require 'Slim/Slim.php';...

Carousel not working when window is resized

javascript,jquery,html,css
I have a series of 3 divs floating to the left in a straight line. Each div is the width of the page. Here's the HTML structure; <div class="Horizontal-Wrapper"> <div class="Horizontal-Section"> <div class="Project-Wrapper"> <div class="Project-Box" id="PJB1"><div class="Project-Box-Overlay"><h2>Splash</h2><p>Industries define the ideal selection for both wholesale and retail quantities of high quality</p></div></div>...

How do I remove an array inside an array in mongoDB?

arrays,mongodb
I need to remove an array that is inside another, found only query's to delete an array element (without him being inside another). How do I delete a specific element (the ID) of the array what's inside this array? What's wrong with my query I get error? There is a...

Creating a WPF divided diagram

wpf,canvas,diagram
So there's this tutorial about creating a diagram in WPF. http://www.codeproject.com/Articles/24681/WPF-Diagram-Designer-Part I've read it, and still studying it to understand it completely. At the end of this tutorial, you can basically add shapes, move/rotate/scale them, and since they are created in a vector form, they are keeping their resolutions, there...

Project Tango Point Cloud strange crash, and dense depth map

android-ndk,google-project-tango
I am trying to use Project Tango C API, but the application crashed with no error if number of point cloud are more than ~6.5k (after some testing) with the following code int width = mImageSource->getDepthImageSize().x; int height = mImageSource->getDepthImageSize().y; double fx = mImageSource->calib.intrinsics_d.projectionParamsSimple.fx; double fy = mImageSource->calib.intrinsics_d.projectionParamsSimple.fy; double cx...

SetFetchMode Lazy doesn't overwrite ClassMap settings

c#,nhibernate,fluent-nhibernate,lazy-loading
In Criteria I do SetFetchMode as Lazy but still fetching all items, how can I fix this? public class MenuItem : BaseClass<MenuItem> { public virtual int MenuItemId { get; set; } public virtual string Text { get; set; } public virtual IList<MenuItem> Children { get; set; } public virtual MenuItem...

PHPExcel setActiveSheetIndex not working properly

indexing,default,phpexcel,sheet,first-time
I'm using PHPExcel to make export xls with 2 worksheets. When I open the generated xls file , it open directly the second worksheet, even that I've declared on the code that generates the first worksheet : $objPHPExcel->setActiveSheetIndex(0) This happened after I've added the following lines in the code that...

How to check if checkbox is checked in Angular JS?

angularjs
I have HTML form with fields: input, textarea. All fields have attribute required and submit button have: <div ng-click="Share()" ng-disabled="shareForm.$invalid"</div> How I can check if checkbox is checked or not and disable button?...

jQuery get index from different element group

jquery,indexing,group
I have list of li that contains 2 group of data, data-type='a'/data-type='b', and order of a/b is random. How do I get index when user clicks on li only based one of the groups, for example, 3rd li clicked, would return index 1 with html below. <li> <div class='img' data-type='a'>...

How to determine static lib path for boost?

c++,linux,boost,cmake
I use this for static-compiling with libboost-system and libboost-filesystem: add_library(boost_system STATIC IMPORTED) SET_TARGET_PROPERTIES(boost_system PROPERTIES IMPORTED_LOCATION /usr/lib/libboost_system.a) add_library(boost_filesystem STATIC IMPORTED) SET_TARGET_PROPERTIES(boost_filesystem PROPERTIES IMPORTED_LOCATION /usr/lib/libboost_filesystem.a) target_link_libraries(mysuperprogram ${LIBS} boost_system boost_filesystem) Problem is that on my development machine (Linux Mint 17.1) libboost_*.a files installed in...

A 'merge into' statement without using an alias?

sql,oracle
When I try to run a simple merge query, I've found that it fails if I don't set an aliases for the tables in the using statement: e.g. create table table1test (col1 int not null, col2 varchar2(255), primary key(col1)); INSERT ALL INTO table1test (col1, col2) VALUES (1, '10') INTO table1test...

How to serialize/deserialize “splashed” complex type?

java,xml,jackson
I'm connecting to external XML API and I'm trying to parse it to POJOs using Jackson XmlMapper class. Part of the XML looks like this: <invoice> <some>element</some> <some_other>element</some_other> <currency>USD</currency> <cost>10.42</cost> <breakdown> <item id="1"> <description>blah blah</description> <cost>4.21</cost> </item> </breakdown> </invoice> And I want to parse the currency and cost elements in...

How can I make Prolog speak?

prolog,text-to-speech
I have a list which holds some string values. A = [John, goes, to, party]. How can I pass this text to speech? Can any one tell me how to do text to speech conversion in prolog?...

Jmeter select random product from sql server db

jmeter
I have a CompanyID value being read into my Jmeter script, is it possible to then get it to do a sql query and select a random product from the results

Map XInput2 devices to sysfs nodes

linux,sysfs,xinput,evdev
How can I turn an XInput2 device, e.g. as reported by XIQueryDevice, into an appropriate sysfs node? The device is a generic HID device, handled by the evdev input driver. I know I can get the name of the device. I might be able to look at the Xorg.0.log and...

RelativeLayout background drawable overlap content

android,android-layout,android-background
I have a 9-patch drawable(date_time). And i want to place this drawable behind Relative Layout content, so all child views should be drawn on top of this image. Here is xml Layout: <RelativeLayout android:layout_width="wrap_content" android:layout_height="23dp" android:layout_below="@id/tv_map_address" android:layout_marginTop="11dp" android:layout_marginBottom="12dp" android:background="@drawable/date_time"> <ImageView android:id="@+id/iv_map_distance" android:layout_width="wrap_content" android:layout_height="wrap_content"...

VBA - on click - generate a prompt to confirm which workbook / spreadsheet to look at

excel,vba,onclick,copy,prompt
I am fairly certain I know how to select data from a different workbook / sheet but I'm a little clueless as to how I would go about generating a VBA question box that would prompt the user on click to input the relevant workbook / sheet. For example: Workbook...

OVH API Authentication with powershell

powershell,oauth,ovh
I'm trying to get a list of dedicated servers hosted at OVH using powershell, via their new spangly API. But I'm a bit stuck at generating the authentication signature. I think I followed the steps here: https://api.ovh.com/g934.first_step_with_api but I guess I messed something up. My script so far looks like...

Load JSON into Angular

javascript,json,angularjs,single-page-application
I am new with Angular.js. I try to get json from my local url http://85.96.243.31/admin.productss/searchwithjson. JSON content is: [ { "fullsizeurl": "/uploads/incubout_denemeshop/1/product/3-kdd4eesv-erer-1-cent-1.png", "productid": "3", "price": "0.01", "isactive": 1, "brandid": "1", "subcategoryid": "1", "model": "1 Cent", "isbundle": 0, "subcategory": "Cat2", "taxincluded": 0, "brand": "erer", "thumbnailsizeurl": "/uploads/incubout_denemeshop/1/product/3-kdd4eesv-erer-1-cent-1_thumb.png" }, { "productid": "1", "isactive":...

PL/SQL Adding hours to timestamp parameter

plsql,oracle-sqldeveloper
I got parameter :dateFrom which gonna be used as an argument in a function as a TIMESTAMP. I need to add to :dateFrom + 7 hours, how can I do that?...

Spring MVC return modelandView class

java,spring
return new ModelAndView( ? , "listBooks", listBooks); at place ? I want to return a class=> net.codejava.spring.PDFBuilder. Is it possible if yes then how?...

Checking if user has unsaved data in JQuery?

javascript,jquery,exit,prompt
I have the following code... var leave_page_confirm=false; if ($(':input.common_class').val().length !== 0) { var leave_page_confirm=true; } window.onbeforeunload = save_data_check; function save_data_check() { if (leave_page_confirm) { return "You have unsaved information on the page."; } } I'm trying to see if any inputs on the page have value. If they don't then...

Hide an element after 5 seconds only CSS does not work on Firefox

css3,css-transitions,css-animations
For hiding an element after 5 seconds, I have used below code. But it does not work in Firefox. .classname { -webkit-animation: cssAnimation 0s ease-in 5s forwards; -moz-animation: cssAnimation 0s ease-in 5s forwards; -o-animation: cssAnimation 0s ease-in 5s forwards; animation: cssAnimation 0s ease-in 5s forwards; -webkit-animation-fill-mode: forwards; animation-fill-mode: forwards; }...

Can't install RadRails on Eclipse Luna 4.4.2

eclipse,aptana,radrails
I am trying to install the RadRails plug-in on a fresh Eclipse Luna instance (4.4.2), using the following update site: http://download.aptana.com/tools/radrails/plugin/install/radrails-bundle But it always fails with the error below: Cannot complete the install because one or more required items could not be found. Software being installed: Aptana RadRails 2.0.5.1278709071-79-7D7BFZcLCUQRF2NWAQhRBC1qP (com.aptana.radrails.feature.feature.group...

Octave and Java: libjvm.so not found

java,debian,octave
I am trying to use WFDB toolbox for Matlab from Physionet in GNU Octave. One prerequisite is having GNU Octave 3.8.1 or later with the Java package, so I have compiled it for my Debian 7.8 and then installed Java package from within Octave. I am not sure to have...

Pygame FPS faster than what I want

python,pygame
I am trying to run a game at 80 fps but I am getting 83 fps?! What's going on? while 1: start = time() clock.tick_busy_loop(80) self.update() fps=int(1./(time()-start)) print fps, 'fps' >> 83 fps ...

Checkstyle validation fail when needs multiple lines

regex,eclipse,checkstyle
I need to perform a validation rule on eclipse checkstyle, after a key { of method and before end key } should have a empty line, example: public void wrongMethod() { System.out.println("wrong method"); } correct public void correctMethod() { System.out.println("correct method"); } I try to use a RegexpMultiline in checkstyle...

Chumper Datatable in laravel 5

php,laravel,datatable
I am trying to make use of chumper in laravel 5 but have encountered the following problem FatalErrorException in HomeController.php line 11: Class 'App\Http\Controllers\Datatable' not found I have installed the develop branch via composer and updated providers and aliases as per the instructions any ideas ?...

How to rename file forth and back in java

java,file,zip,rename,document
I want to rename a file name xxx.docx to xxx.docx.zip then rename it back to xxx.docx in Java. Here is my code. File file = new File(path); File file2 = new File(path+".zip"); file.renameTo(file2); File file3 = new File(file.getPath()); file2.renameTo(file3); It won't work. Thank you. Edit : The problem is I...

Google calendar feed link does not respect the parameters

api,rss,google-calendar,feed
I try to use this link to show the upcoming events but there is not respect my params form link have anyone any idea how to fix this? It is showing the whole events. Even the past ones https://www.google.com/calendar/feeds/mariushincu0%40gmail.com/public/basic?singleEvents=true&orderBy=startTime&timeMin=2015-04-25T00:00:00Z...

MongoDB .Net driver 2.0 Builders Filter (field to array comparison)

mongodb,mongodb-query,mongodb-csharp,mongodb-csharp-2.0
I need to get all usernames from "followingList.username" and compare with posts' usernames, if there any match need to add that one to an array. Person Model { "_id" : ObjectId("554f20f5c90d3c7ed42303e1"), "username" : "fatihyildizhan", "followingList" : [ { "_id" : ObjectId("55505b6ca515860cbcf7901d"), "username" : "gumusluk", "avatar" : "avatar.png" }, { "_id"...

Convert curl command to pycurl

python,curl,pycurl
im trying to convert the following curl call into pycurl , can someone help me out with that . curl --request 'POST' 'https://api.twitter.com/1.1/mutes/users/create.json' --data 'screen_name=fails' --header 'Authorization: OAuth oauth_consumer_key="mZRm27WsyGa8PRxcDC", oauth_nonce="5d10f384e1a8f176ca0a74b3dd2", oauth_signature="vYY%2BbHfXv1PTfc0MbY9jcLU%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1431346223", oauth_token="17718839-bewY3FfcV7vBPSd3pBOzscoxGmFeU", oauth_version="1.0"' ...

No results when in the mapping, the field _all has specified an index_analyzer

search,elasticsearch
With Elasticsearch I have created an index using a custom mapping and custom set of analszers, however I'm not able to do query search on the _all field. I'm using these analyzers: { "analysis": { "analyzer": { "case_insensitive": { "type": "custom", "tokenizer": "keyword", "filter": [ "lowercase", "asciifolding" ], "char_filter": "punctuation"...

Populating C# ListView With Mysql Table

c#,mysql,listview
I don't understand why the listview is empty. Refresh button = Button2, and this is my code : private void button2_Click(object sender, EventArgs e) { MySqlDataAdapter ada = new MySqlDataAdapter("select * from Teams", _dbConnect.getConnection()); DataTable dt = new DataTable(); ada.Fill(dt); for (int i = 0; i < dt.Rows.Count; i++) {...

how to init an instance in a java generic method

java,generics,constructor
I have this code: public <V> V getPropertiesByObject(V sample) throws TimeoutException { //settings fields using reflaction return sample; } which I call like this: MyClass a = getPropertiesByObject(new MyClass()); only because I don't know how to construct an instance otherwise. I would prefer: public <V> V getPropertiesByObject(Class<V> sample) throws TimeoutException...

What is tag in layout xml used for?

android,android-layout
I notice that there is a tag <view>(not <View>) which can be used in Android layout xml. When I add such a tag in a layout xml, the app can be successfully compiled but crashes when running. So what is this <view> used for?

Auto-increment - automatic reset for each year

mysql,innodb,auto-increment
MySQL/InnoDB In my case my receipts should be counted on yearly basis; 1/2015, 2/2015 ... 556/2015 and so on. When next year comes, the counter should start from 1 again and receipts should be counted as 1/2016, 2/2016 ... How to define auto_increment field which will reset itself on yearly...

Javascript:window.print(); not working

javascript,html
I created a simple link to print a page I created. I'm using Google Chrome. But that link is not working. When I checked my console log, I'm getting this message when I click the link: Maximum call stack size exceeded Here's the HTML I'm using to create the print:...

Reactive Extensions (Rx) - sample with last known value when no value is present in interval

c#,.net,system.reactive,reactive-programming
I have an observable stream that produces values at inconsistent intervals like this: ------1---2------3----------------4--------------5--- And I would like to sample this but without any empty samples once the a value has been produced: ------1---2------3----------------4--------------5----- ----_----1----2----3----3----3----4----4----4----5----5 I obviously thought Replay().RefCount() could be used here to provide the last known value to...

Object push to bluetooth without pairing

bluetooth
Is it possible to send some notification messages to the nearby Bluetooth devices without pairing.I have found some protocol for these - OBEX Oject Push. But am not clear whether is is feasible without pairing request .Any demo apps for reference?

Leakage out of `overflow:hidden` parent with rounded border in Chrome

html,css,css3,google-chrome
Cropped by rounded parent child's hidden part still persists and active in Chrome: The same behavior in IE could be cured by adding z-index property to parent. Still found no cure for Chrome. #container { width: 200px; height: 200px; border-radius: 50%; background-color: orange; position: fixed; overflow: hidden; /*z-index: 1;*/ }...

Add element during arrayList iteraction (add to final of the list)

java,arrays,arraylist,java-8
I want to add some elements to an arrayList during iteraction, but I want to add in the final of the list, I have tried with ListIterator but only adds after the actual element on interaction... Example: ArrayList<Integer> arr = new ArrayList<>(Arrays.asList(new Integer[]{1,2,3,4,5})); for (ListIterator<Integer> i = arr.listIterator(); i.hasNext();) {...

Java regex expression trouble in split function call

java,regex,string,split,regex-greedy
I am having some trouble with creating a regular expression in java, where I want it to match all parts of a string that have a single ; and none are a ;; in the string. Such as in the string today;i;;drank water the ; after today would be a...

Convert a numpy.ndarray to string(or bytes) and convert it back to numpy.ndarray

python,numpy,multidimensional-array
I'm having a little trouble here, I'm trying to convert a numpy.ndarray to string, I've already done that like this: randomArray.tostring() It works, but I'm wondering if I can transform it back to a numpy.ndarray. What's the best way to do this? I'm using numpy 1.8.1 Context: The objective is...

Thread Safety in Jax-WS Request-Response Payload Logging

web-services,soap,thread-safety,jax-ws,soaphandler
I am working on a SoapHandler implementation. Basically my aim is to get both request and response payloads and insert them to the database. Although I can get the request and response payloads, I couldn't make sure if my code is working thread-safe. In other words, I am not sure...

Idiom to get just the “own object” and not the prototype chain

javascript
Is there a recognised idiom to get just the own-object in JavaScript? i.e. I would like to chop off the prototype chain for an object, in IE10 and above. function O() { this.foo = 'foo'; } O.prototype = { bar: 'bar' } var o = new O(); for(var v in...

How to launch a jar file on windows startup from the registry?

java,windows,jar,registry
I am trying to launch a jar file on Windows Server 2008 R2 startup. I tried to add a key\value to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run I tried as a value several alternatives: java -jar c:\jcm\jcm.jar "java -jar c:\jcm\jcm.jar" c:\program files(x86)\java\jre1.8.31\bin\java.exe -jar c:\jcm\jcm.jar "c:\program files(x86)\java\jre1.8.31\bin\java.exe -jar c:\jcm\jcm.jar" "c:\program files(x86)\java\jre1.8.31\bin\java.exe" -jar c:\jcm\jcm.jar But none of...

Why do I need to pass an object to this class to make it work?

python,class,object,self
So I've been working to replace PHP with Python in my career for a bit. So I'm using WebPy with WSGI in apache, and all is working well, but I'm still learning the language, and can't find a simple explanation for this. So, while messing around, trying to get other...

Why does GCC emit a warning when using trigraphs, but not when using digraphs?

c,gcc,compiler-warnings,digraphs,trigraphs
Code: #include <stdio.h> int main(void) { ??< puts("Hello Folks!"); ??> } The above program, when compiled with GCC 4.8.1 with -Wall and -std=c11, gives the following warning: source_file.c: In function ‘main’: source_file.c:8:5: warning: trigraph ??< converted to { [-Wtrigraphs] ??< puts("Hello Folks!"); ??> ^ source_file.c:8:30: warning: trigraph ??> converted to...

Image height in safari

html,css,safari
I have a problem with some image in safari. It is working everywhere but not in safari. I've some images on my site but on safari the image's are going way to high. The website is development.mar-bakker.nl <div class="col-xs-12 col-sm-4 col-md-4"> <div class="grid wow zoomIn"> <figure class="effect-bubba"> <img src="assets/images/item-2.jpg" class="img-responsive"...

How in Java I can create a field that can accept only digits and once dot?

java,regex,swing,jtextfield,documentfilter
I look all over the net and all the things I tried didn't work.... I found that I can use some JTextFormatterField but it didn't work. Then I found that I can use DocumentFilter with regex and that what I did: JTextField jFormattedTextFieldMoneyToConvert = new JTextField(); ((AbstractDocument) jFormattedTextFieldMoneyToConvert.getDocument()).setDocumentFilter(new DocumentFilter(){ Pattern...

ViewRendererServlet vs Dispatcherservlet Difference

spring,spring-mvc
What are the applications of DispatcherServlet versus ViewRendererServlet in Spring MVC? Are they related in any way?

How to Custom Heads-up notification layout? Thank you

android,notifications
In my project, need change heads-up notification layout. I have custom two remoteView, one for Notification.contentView, one for Notification.bigContentView and its succeed. When I want to use Notification.Builder.addAction to add click button, it will use system layout not mine. I changed another way, I custom layout & click button in...

how can i get pictures from instagram using specific tags and locations

api,instagram
So, I am trying to get a bunch of pictures from Instagram using their API. How can I specify the pictures I want to get, using both tags and location, not just one of them. I tried to go to the endpoints listed on Instagram page, but it does not...

Is following scenario a memory-leak in java?

java,android,memory-leaks
Here are 2 diffrent ways of doing the same thing (i.e Fetching messages from Database) Scenerio 1 Calling Class: ArrayList<String> messages = new ArrayList<String>(); messages = Db.getAllMessage(messages); Database Class: public ArrayList<String> getAllMessage(ArrayList<String> m) { m= /* get messages from DB */ return m; } Scenerio 2 Calling Class: ArrayList<String> messages...

Keyword var performance for compilation

c#,visual-studio,compilation,resharper,var
Refactoring a big project (in term of code lines) I got to know ReSharper and the topic using var instead of the type which will only affect in compilation time. Does it makes a big impact in the compilation time? I would like to define a code style for it...

ActionScript 3.0 End Game Countdown Timer

actionscript-3
I'm making a game in actionscript 3.0. I currently have a countdown timer (counts down from 30 seconds). Once the 30 seconds is up I want the frame to move from frame 2 to frame 3. I have put gotoAndStop(3) in the code under the timer but when the timer...

Autolayout, async load image into uiimageview (Swift, xCode6)

ios,swift,uiimageview,autolayout
Good day! I have 2 problems and I hope you will help me. 1) I have news feed in my application, that contains images. I am using Autolayout for dynamic cells: and I want the image to keep its ratio and to completely fill the width of the cell (with...

How to show all data elements using D3 and Bootstrap?

d3.js,twitter-bootstrap-3
Just started with D3 and my HTML below is supposed to show vertical bars as per array (5 bars) but instead it only shows 3 bars. <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> <link rel="stylesheet" href="css/bootstrap.min.css"/> <style type="text/css"> div.bar { display: inline-block; width: 20px; height:...

What is the correct way of setting state variables in Reactjs and what is the difference between these approaches?

reactjs
I was working with React JS and I was wondering the difference between calling setState() twice to set two different state variables like this: this.setState({fruit1: “apple”}); this.setState({fruit2: “mango”}); AND calling setState() once and passing both state variables as JSON like this: this.setState({fruit1: “apple”, fruit2: “mango”}); Also what is the better...

Issue with XSL Template for Dates from Filemake Exported Data

xslt,export,filemaker
OK, so I've asked about this before but now am further along in what I'm trying to achieve, so can (hopefully) explain better. I am supporting a FileMaker application which has been updated to allow users to export data in specific formats, five reports in total, and each one is...

Windows phone 8.1 universal app DataTransferManager UI not showing

c#,windows-phone-8.1,win-universal-app
In my windows phone 8.1 universal app project I am trying to make a share option. But when I click on the button (ShareCommand) the Share UI is not showing up, I have tried this in the emulator and on a device. The event is correctly wired up since the...

Imputation for bounding NA observations using a linear approximation

r,missing-data,extrapolation
I would like to impute values for NA observations at the beginning of the array, using a linear approximation of the following two non-NA observations to extrapolate the missing value. Then do the same for the NA observations at the end of the array, using the preceding two non-NA observations....

Cancel an async operation after the form has loaded?

c#,winforms,asynchronous,task-parallel-library
I have different classes (implementing an interface) where one method is to perform an async databases search: public async void SearchAsync(CancellationToken ct) { await Task.Run(() => {Find(); }, ct); } private void Find() { //do db search here... } When forms are opened, a background async search is performed to...

Is there anyway making ADO.NET work on .NET Core?

ado.net,odp.net,.net-core
I need ODP.NET (Oracle Data Providers for .NET) on .NET Core but can't find anyway to make it work. When I reference OracleConnection or OracleCommand classes, the project needs System.Data assembly which I can't find in .NET Core. So isn't there any solution to use ADO.NET on .NET Core?...

Android - Get URI from Picture that i just have taken (without save the image again)

android
I've found a lot of answers for questions like mine but they doesn't make sense for me. Let me explain. I have a ImageButton that let the user take a picture and display it on interface. When i try to get image URI, it returns null: Uri uri = data.getData();...

Common way to use System.in several times without closing

java,bufferedreader,system.in
I have a console menu that has to read inputs a few times in different methods. I use a new BufferedReader(new InputStreamReader(System.in)) to do that. But if this reader is closed in a method it's not useable/openable again because of System.in. To solve this problem one possibility is to static...

how to set the decimal separator for printing to file different from the system setting

excel,vba,excel-vba,excel-2010
Using VBA in Excel 2010 I want to print the contents of a cell in a worksheet which is a decimal number to a file. I am using the ´Print #´ statement for this. I am working in an environment where the comma ´,´ is the system wide decimal separator....

how to decode youtube api v3 json response

php,json,video,youtube,youtube-data-api
here is my youtube json response query results:Array ( [kind] => youtube#searchListResponse [etag] => "tbWC5XrSXxe1WOAx6MK9z4hHSU8/_RyGfO1dwDRqY9aMf412I8xvZgw" [nextPageToken] => CAoQAA [pageInfo] => Array ( [totalResults] => 1000000 [resultsPerPage] => 10 ) [items] => Array ( [0] => Array ( [kind] => youtube#searchResult [etag] => "tbWC5XrSXxe1WOAx6MK9z4hHSU8/vJBGevzCpIbHOcHu7AAc4WsQ92E" [id] => Array ( [kind] => youtube#video...

How to escape/ translate Encoding/chars via Regex and XSLT?

regex,xml,powershell,xslt,ansi
I need some help on how to actually fix these encoding being outputted as special characters in an xml.I'm trying to execute a powershell script to create a certificate using a platform via an SSH connection on a server and the expected response from it is a clean xml form...

Bootstrap Input Group pushes control little to left

css,twitter-bootstrap-3
I am trying to layout a form using bootstrap 3 but for some reason the input is pushed to left. My markup looks like this <div class="jumbotron"> <form name="invoiceForm" class="form-horizontal" role="form" data-toggle="validator"> <div class="form-group"> <label class="control-label col-sm-3" for="txt_job_date" >Date work performed</label> <p class="input-group col-sm-3"> <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened"...

Matplotlib/Pyplot shared axis for odd number of subplots

python,matplotlib,axis-labels,subplot
I am using the following code to produce an odd number of plots that I want 'butted' together and sharing axes. import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(4,2,1) ax1.set_yscale('log') ax1.set_xscale('log') plt.subplot(4,2,2, sharex=ax1, sharey=ax1) plt.subplot(4,2,3, sharex=ax1, sharey=ax1) plt.subplot(4,2,4, sharex=ax1, sharey=ax1) plt.subplot(4,2,5, sharex=ax1, sharey=ax1) plt.subplot(4,2,6, sharex=ax1, sharey=ax1) plt.subplot(4,2,7, sharex=ax1,...