FAQ Database Discussion Community


Echo Image from get PHP [closed]

php,echo
I know it may sound stupid, but im trying to echo an image that i get his name from the url, i dont get anything only the alt text of the image. This is my code <?php $url = $_GET["userpic"]; $DisplayImg = "./Imagenes/".$url.".jpg"; ?> <html> <body> <img src="<?php echo $DisplayImg;...

Invalid use of Me keyword

ms-access,access-vba,ms-access-2010
This code is a function and not a private subroutine. I'm suddenly getting this error with the Me.[field name here]. I'm not getting that error in my other code, just in this one. Here's my full code without the boring end part, but I'm getting the error starting from the...

How can I get the current state of my div animation?

html,css,safari,styling
I am using Safari, thus to make it easier to answer my question I will just use the -webkit- prefix on my animations. I am making a menu that is in the corner. When the user hovers, it spans the entire website until the user leaves the menu, then it...

How to use django_auth_ldap for django project?

django,ldap,django-auth-ldap
The following is the snippet of the setting for our project.The problem is that it did not seem like it is connecting to the LDAP server. I added a couple print statement in the django_auth_ldap module and none of them is printed out when I run the server and try...

undefined local variable or method `accounts' for #

ruby-on-rails,ruby,ruby-on-rails-4
I'm trying to associate "Notes" with "Account one the same page (show.html.erb) once the note is created. However, once I create the note for the associated account I get undefined local variable or method `accounts' for NotesController:0x0000000545e1d8" Notes were being created fine up until the point of association. with @account...

“Page not found” all over the place with i18n on Drupal?

drupal-7,internationalization,multilingual
I am clearly missing the picture here as just about everything I try is just failing miserably. I have languages as follows: gb-en - UK English (path = /gb/en/about ) us-en - US English (path = /us/en/about ) us-es - US Spanish (path = /us/es/about ) I have an about...

How to set a Tag to a Fragment in Android

android,android-fragments,fragmentmanager
I've looked at all the questions on Stackoverflow but could not find a single definitive answer to this question. How do you set a Tag to a Fragment so that you can retrieve it via getFragmentManager().findFragmentByTag()? Could someone give a simple code example of how to create a tag to...

Centering the camera on the character

ios,swift,camera
I am a beginner and I have started my first project. It should be a little game where you can run to the left and to the right. But I don't know how to set the camera settings. I'd be very thankful if you could help me, tell me how...

1064 error with CodeIgniter in ci_sessions table

php,mysql,sql,codeigniter
// Run the update query $this->CI->db->where('session_id', $this->userdata['session_id']); $this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata)); I have a problem using sessions in CodeIgniter. I downloaded de las CI version and I have to modify many things to make it works, but, when I'm trying to login in my web, I have...

What is the decoded form of an instruction?

assembly,x86,x86-64,intel
I am reading through "What every computer scientist should know about memory" by Ulrich Drepper. In section 6.2.2, it reads: [...] instructions have to be decoded before they can be executed and, to speed this up (important on x86 and x86-64), instructions are actually cached in the decoded form, not...

Apply function with pandas dataframe - POS tagger computation time

pandas,dataframes,pos-tagging
I'm very confused on the apply function for pandas. I have a big dataframe where one column is a column of strings. I'm then using a function to count part-of-speech occurrences. I'm just not sure the way of setting up my apply statement or my function. def noun_count(row): x =...

Primitive type and reference type objects

c#,static,primitive-types,reference-type
I have an exam question from a past paper that I'm trying to answer: Discuss variables of type primitive, reference and static in the context of a programming language. Give suitable examples [8]. The answer I have so far is: A primitive type is an object which the language has...

Condense multiple lines of var = false code to less lines?

javascript,jquery
I have ten buttons. When one is clicked I want the corresponding div to fade in and when another button is clicked I want the div to fade out and the new div to fade in. My method is not working correctly because my knowledge of JS is limited. I...

Error in SQL script file

sql,sql-server
I am working on a database and we are trying to make a script file that will give us the total number of orders in july. How exactly would I say july because I know syntax is wrong and I would be using sum instead of count right? Please help,...

Parsing JSON using Python and if statement

python,json
Here is the JSON data I have: { "response": { "status": { "version": "4.2", "code": 0, "message": "Success" }, "artists": [ { "name": "Taylor Swift", "foreign_ids": [ { "catalog": "facebook", "foreign_id": "facebook:artist:19614945368" } ], "hotttnesss": 0.99956, "id": "ARS54I31187FB46721" }, { "name": "Ed Sheeran", "foreign_ids": [ { "catalog": "facebook", "foreign_id": "facebook:artist:9189674485"...

bash send string argument as multiple arguments

bash
So I have a bash script that is generating a string of commands that I want to be run. The output looks something like $ program "command1 command2 ... commandN" But the program is interpreting (as it should) "command1 command2 ... commandN" as one argument. Is there away to turn...

Log4j2 : How to configure multiple Appender with same type in Yaml configuration

yaml,log4j2,rollingfileappender
I'm trying to have 2 RollingRandomAccessFile in the same YAML configuration. I'm able to do it in XML but not in YAML. As a result, I want two files "application.log" and "payload.log". Here's my working XML configuration : <?xml version="1.0" encoding="UTF-8"?> <Configuration status="debug"> <Appenders> <Console name="CONSOLE" target="SYSTEM_OUT"> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t]...

Test Harness asks for input rather than using what is written(homework)

c++
I'm supposed to use a test harness for homework to check if a module works. I've only done 2 tests so far, but when I debug the program, it asks me for an input rather than using what I've provided in the code. What did I do wrong? void retirement_eligibility(bool...

How to change an attribute of a javascript prototype object

javascript,object,attributes,prototype
html base <html> <head> </head> <body> <input type="text" class="abc"/> </body> </html> So I have my prototype object function AnArray(){ this.anArray=[]; } AnArray.prototype.getAnArray=function(val){ return this.anArray[val]; } AnArray.prototype.setData=function(index,val){ this.anArray[index].data=val; } var objAnArray=new AnArray(); the object ends up looking like this id: 1, pid: "questions-worth-asking", num: 1, data: null and I'm trying to...

Dropdown selected value from JSON in AngularJS

angularjs
Angular newbie question I have a dropdown showing days from week something like this <select class="form-control" id="selectedDayofWeek" ng-model="selectedDayofWeek" ng-selected="sdw"> <option value="">Select</option> <option value="Monday">Monday</option> <option value="Tuesday">Tuesday</option> <option value="Wednesday">Wednesday</option> <option value="Thursday">Thursday</option> <option value="Friday">Friday</option> <option...

How to add a remote repository to my own git repository

git,github,phalcon
I have have my own git repository with some subfolders which all belong to my git repository. Now I want to add another subfolder vendor that I cloned from a remote github url. However, When I try to commit the new folder vendor and its contents,(subfolders, files, etc), git tells...

List of a subclass within its class

java,oop
The context here is a school project for a Library system, the library has both magazines and books. We have an abstract class Register which is extended by Book and Magazine. Now there's need to implement a Copy class , that can be used for both books and magazines, which...

'redirect url' for an oAuth2.0 client

android,rest,oauth-2.0,client
I am extremely new to the OAuth framework and am currently working on writing a client on the android platform. When trying to register my application with the api provider, it asks for a redirect url. I searched around bit and found some literature that says that it is a...

Debug the following code

javascript,jquery,html,css
I want to make multilevel responsive drop down menu. the problem is that on clicking on Purchase, Sale and New menu the drop down menus are appearing but they remain open on again click. i want to show/ hide it on click like the #handle. it means that when i...

How can I keep jointjs cells from overflowing the paper?

javascript,jquery,javascript-framework,jointjs
I'm using jointjs to make diagrams which will be user-editable. The user may drag them around and relocate each cell. However, when a cell is dragged to the edge, it overflows and becomes cut off. I want to prevent this from happening, instead the cell to stop before it gets...

Stuck with Go concurrency

go,channel,goroutine
I can't seem to figure out what to do next. My goal is to create an array of all the sub images from the original image using the SubImage function from the image package. I am able to partition an image in the imageSplit() function and pass to imageReceiver() function...

Trying to convert total minutes from a datediff to days, remaining hours, & minutes in Crystal Reports

crystal-reports,datediff
I am using Crystal Reports 2013 SP5 on Windows 7 Pro pulling from an Oracle db. I am trying to write a formula(s) in crystal reports that returns the total number of days the remaining hours if less than 24, and the remaining minutes if less than 60 from a...

Quicksort: wikipedia-implementation not working out

java,algorithm,sorting,quicksort
I just tried to implement the quicksort algorithm from wikipedia (https://en.wikipedia.org/wiki/Quicksort) but something is missing. Here's my code: public static void quicksort(int[] a, int lo, int hi) { if(lo < hi) { int p = partition(a, lo, hi); quicksort(a, lo, p - 1); quicksort(a, p + 1, hi); } }...

Unable to retrieve data from SQLite database because of table's name.(Hibernate)

database,hibernate,sqlite
I have a tabe in my database with name "Group". This is my model code: @Entity @Table(name="Group") public class Group { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="group_id") private int id; @Column(name="name") private String name; @Column(name="color") private String color; public Group(){ this(null,null); } public Group(String name, String color){ this.name=name; this.color=color; } public...

Is it a good idea to iterate through several browsers in one test using Selenium WebDriver?

loops,testing,selenium,webdriver
I am trying to run a simple test on multiple browsers, here is a mock up of the code I've got: String url = "http://www.anyURL.com"; WebDriver[] drivers = { new FireFoxDriver(), new InternetExplorerDriver, newChromDriver() }; @Test public void testTitle() { for (int i = 0; i < drivers.length; i++) {...

Coloring dendrogram’s end branches (or leaves) based on column number of data frame in R

r,colors,data.frame,dendrogram
From a dataframe data.main, I am able to generate a hclust dendrogram as, aa1<- c(2,4,6,8) bb1<- c(1,3,7,11) aa2<-c(3,6,9,12) bb2<-c(3,5,7,9) data.main<- data.frame(aa1,bb1,aa2,bb2) d1<-dist(t(data.main)) hcl1<- hclust(d1) plot(hcl1) Further, I know there are ways to use a tree cutoff to color the branches or leaves. However, is it possible to color them based...

Xquery Assertion for SoapUI multiple modes

xml,automation,xquery,soapui
I'm trying to create an assertion for a Response that needs to looks like this: <Names> <NameList PropertyName="Record"> <Names> <SimpleValue Value="Date :xx"/> <SimpleValue Value="Name :xx"/> </Names> </NameList> <NameList PropertyName="Record"> <Names> <SimpleValue Value="Date :xx"/> <SimpleValue Value="Name :xx"/> </Names> </NameList> </Names> The assertion should be an exact match. I have come up...

Exporting attributes of multiple shapefiles to a text file

python,text,arcgis,arcpy
I'm trying to export the attributes of multiple shapefiles all contained in one folder to a text file. I wrote the code below to do so but it is only exporting the file names to a text file. Any ideas on what I may be doing wrong? I've been troubleshooting...

unable to resolve method using strict-mode

drools,strict-mode
I'm newbie with java and drools and I have to build a java RESTful Web Services / rules engine. We already have Genesys Rule Authoring (GRAT) and Genesys Rule Engine (GRE) (version 8.1.2) who run drools version 5.2. We have the need to take the source of GRAT packages and...

Symfony2: Unable to write test for this form with multi checkboxes

symfony2
I have a checkbox form element like this: ... ->add( 'race', 'choice', array( 'label' => 'Racial Identity', 'choices' => array( 'American Indian or Alaskan Native' => 'American Indian or Alaskan Native', 'Asian' => 'Asian', 'Black or African American' => 'Black or African American', 'Native Hawaiian or Other Pacific Islander' =>...

convert query results to nested objects

c#,linq
I have the following class to represent my DB relationship: public class Faclility{public List<Room> {get;set;}} and the following is the EE query: dbContext.Facilities.join(db.Room,f=>f.fUnitID,r=>r.fUnitID,(f,r)=> new ???) How can I stuff all the Room object into the list of Facility object?...

xPath - from the bottom to top

php,xpath
Normally, I would use xpath to get a table like so: foreach($xpath->query('//*[@id="financial"]/div[4]/table/tr') as $row) { echo '<tr>'; foreach($xpath->query('td[position() > 0]', $row) as $col) { echo '<td>'.trim($col->textContent).'</td>'."\n"; } echo '</tr>'; etc. The results would display the same as they are in the current table. However, I would like to display the...

Java generate random double

java,random,double
How can I generate a random double in Java? All tutorials only show how to generate in a certain range, but I want all doubles possible. Is there something which just shuffles all bits and gives me the number?...

Add a custom content block within an existing content block of Magento Core

php,magento
I'm trying to add a custom order attribute, that the user can define on the checkout page just after the list of the payment methods and before the button continue. I want to do things as clean as possible, so I created my own module. Im struggling with something I...

JavaFx - Open window next to main windows

java,javafx,java-8
I am using JavaFx and I want open a new window next to the first window like in the picture. I can open a new window but its always on the first. How can i do that? Parent detailsPanel = FXMLLoader.load(getClass().getResource("/fxml/DetailsPanel.fxml")); Stage stage = new Stage(); stage.setTitle("Details"); stage.setScene(new Scene(detailsPanel)); stage.setResizable(false);...

Date Filters in DC.js

d3.js,dc.js,crossfilter
I am working with DC.js and I am trying to add preset date filters to this jsfiddler. <div id="header" class='row logoSize'> <img src="logo-main2.png" /> <div class="buttons-container"></div> <div class="startEnd" id="start">2015-02-12</div> <div class="startEnd" id="end">2015-02-17</div> <div class="startEnd" id="brushYears">gggg</div> </div> <div class='row '> <div class="dc-data-count"> <h2> Card Activity Report <span> <span...

Node JS MySQL query function not returning result

javascript,mysql,node.js,function
I am running a MySQL query inside a .js file running on Node JS. I have the connection setup ok and the query works but when I try returning the result back to the original call it doesn't seem to work. function sqlQuery(query){ console.log("Running query"); var conn = connection(); var...

Return value from 2D array in Python class

python,arrays
I'll frame this in the fact that I'm kind of a newbie to Python and I'm taking my first stab at writing a class. What I'd like to achieve is for the class to open a text file and return a value from the file based on user input. The...

ora-30926 when using two primary keys

plsql,oracle-sqldeveloper
I'm getting the following error ORA-30926: unable to get a stable set of rows in the source tables when attempting to execute the following statement: MERGE INTO new_table nt USING ( select c.id, cd.evaluation_date, cd.population_total_count, cd.population_urban_count, cd.population_birth_rate_per1k, cf.gdp_total_dollars, cf.gdp_per_capita_dollars from countries c, country_demographics cd, country_financials cf where c.id = cd.country_id...

Child doesn't inherit dependency property value and takes default value

c#,wpf
I have a dependency property that should inherit its value from an attached property, but it never does. It seems to always take its default value, instead. My Setup I have a custom grid that inherits from Microsoft's DataGrid and a CustomColumn that inherits from Microsoft's DataGridTextColumn. My CustomGrid has...

Why isn't Scala picking the most specific instance in this this type class?

scala,type-inference,typeclass
I am struggling to build this computation pipeline builder in Scala. I want a class that has two methods, map and reduce, that receive anonymous functions in a "fluent interface". These functions will be composed, so I want to type-check all of them, also having their input type inferred from...

recursive grep and sed [duplicate]

bash,awk,sed,grep
This question already has an answer here: sed replace string with condition 2 answers file1: some line1 some line2 text1 text2 text3 some line3 text1 text2 text4 some line3 I want to replace text1 with say NEW only in line which has text3 final output should be some line1...

Is it better to use an array of pointers to members or a switch?

c++,optimization,switch-statement,function-pointers
In my school we're highly encouraged to use arrays of pointers to members instead of switch (or multiple else if) in C++ (and C). As I don't see any point of using such arrays (I actually use maps of pointers to members) instead of a switch statement, I'd like to...

How can I loop through a nested UL to do an attribute comparison?

jquery,html,custom-data-attribute
On my HTML page, I have a nested unordered list, where each list item may or may not have an attribute called data-roles. If I have a comparison variable, read from an input element (lets call it the strComparison variable to keep it simple), then how can I use jQuery...

Java Input & Output Array

java
Working on a java program that reads a txt file with a bunch of account numbers. User enters account number if it matches the programs responds saying its a valid account number if its not it responds invalid. Here is my class that opens the file and checks to see...

Why is my angular directive not getting Parent controller scope inside isolated scope?

angularjs,angularjs-directive,isolate-scope
I've followed Angular docs precisely to get a directive working with an isolated scope containing a couple of vars from the parent Controller's scope object. app.controller('MainCtrl', function($scope) { $scope.name = 'Parent Name'; $scope.pokie = { whyIs: "thisUndefined?" }; }); app.directive('parseObject', function() { var preLink = function($scope, el, att, controller) {...

Facebook SDK - Getting all users that use the application

android,facebook,facebook-graph-api
I don't know what you guys think, but I believe that the Facebook SDK documentation is very limited and doesn't explain very much; Luckily throughout the use of some videos I was able to set up most of the integration that I needed. However my application doesn't interact with just...

Get error : [$injector:unpr] Unknown provider: socketProvider <- socket <- LogCtrl

angularjs,node.js,socket.io
I am new to AngularJs and nodejs and I have a simple chat app with angular as client and socketio as server side. I got an error when loading angular page Error: [$injector:unpr] Unknown provider: socketProvider <- socket <- LogCtrl My client side <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.min.js"></script> <script src="http://localhost:1337/socket.io/socket.io.js"></script>...

How to loop through $firebaseArray

angularjs,firebase,angularfire
I created an array of users like so - var ref = new Firebase(FIREBASE_URL + '/users'); var users = $firebaseArray(ref); I have added objects to this and I want to loop through each of the users in this array. I know this is possible in the view using ng-repeat, but...

how to append associative arrays into another array inside loop - php

php,arrays
I really hope you help me with this problem, I hope this make sence for you - I have this pseudo example of foreach loop: foreach_loop { $k1 = GetKey1(); $v1 = GetValue1(); $k2 = GetKey2(); $v2 = GetValue2(); $k3 = GetKey3(); $v2 = GetValue3(); // now I put those...

Select random object from JSON [duplicate]

javascript,jquery,json,random
This question already has an answer here: Pick random property from a Javascript object 4 answers I have the following code: $.getJSON('js/questions1.json').done(function(data){ window.questionnaire = data; console.log(window.questionnaire); startGame(); }); This brings a json from the server and logs it into a variable. Now after this, I want to select a...

Prevent circumventing ASP.NET minification

javascript,asp.net,asp.net-mvc,minify,bundling-and-minification
I've got some ASP.NET that I'm deploying as an Azure cloud service. The javascript files have comments in them that I'd like not to be visible to anyone consuming the JS. I'm taking advantage of ASP.NET bundling and minification: http://www.asp.net/mvc/overview/performance/bundling-and-minification This seems to be a nice solution in that it...

Calculating Breakpoints of `background-size` Property

html,css,responsive-design
I have a centered viewport who has a large image as its background. Due to other elements on the page, we elected to have some breakpoints depending on the sizes of of these other elements. So far so good, my layout works fine. The one gotcha is that since the...

How to initialize a 3d array in C - Array of arrays of pointers

c,arrays,pointers,malloc
I am programming a game which generates the next possible moves. I need to generate the next moves in order to perform the search. However I have no idea about how to do it in C. The code to generate the board is: #include <stdio.h> //prints #include <stdbool.h> //bool #include...

Intercept Mouse Click

c#,windows,mousekeyhook
I'm currently writing a program that holds down a mouse button when initially clicked, and continues to hold it until the user presses the mouse button for a second time. The program works by detecting input globally using a MouseHookListener and then uses an input simulator to hold down the...

What is the best practice in Android about Upload a Photo with a loading message?

android,image-uploading
I need upload a photo to server and show a loading message. I tried with this code but the ProcessDialog works unsteadily... new UploadTask(MainActivity.this).execute(bitmap); .... private class UploadTask extends AsyncTask<Bitmap, Void, Long> { private ProgressDialog dialog = null; private Context context; public UploadTask(Context context){ this.context = context; } protected void...

Two RecyclerViews under each other in one layout

android,recyclerview
How can I get two RecyclerViews under each other in one layout? I don't want to have a single RecyclerView for all items. My code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="@color/main__item_background" android:layout_height="match_parent" android:layout_width="match_parent"> <TextView android:text="@string/find_friends__already_playing" android:background="@color/header" android:gravity="center" android:layout_width="match_parent"...

Write a query that select all events ordered by a particular customer in SQL [closed]

sql,database,database-schema
In SQL how we will write a query that selects all events ordered by a particular customer. Kindly help me there. Thanks...

Nesting Foreach loop inside Foreach loop using short_open_tags

php,wordpress,foreach,custom-fields,short-open-tags
I have the following foreach loop: <?php $fields = CFS()->get('list-item-field'); ?> <? foreach ($fields as $field) : ?> <?= $field['list-item-title'] ?> <? endforeach ?> And I would like to add another foreach inside the loop, like so: <?php $fields = CFS()->get('item-field'); ?> <? foreach ($fields as $field) : ?> <?=...

Determining return type via bitwise operation

java,generics
I was wandering throught java docs and suddenly found this code: public static <T, U extends Comparable<? super U>> Comparator<T> comparing( Function<? super T, ? extends U> keyExtractor) { Objects.requireNonNull(keyExtractor); return (Comparator<T> & Serializable) (c1, c2) -> keyExtractor.apply(c1).compareTo(keyExtractor.apply(c2)); } Can anyone explain what kind of magic is going on after...

incompatibility when running dart rpc and shelf (with shelf_rpc) related to headers which are lists (and not Strings)

dart,dart-shelf
incompatibility when running dart rpc and shelf (with shelf_rpc) related to headers which are lists (and not Strings). It seems that there is an incompatibility when running dart rpc and shelf (with shelf_rpc) related to headers which are lists (and not Strings). Error thrown is ( for shelf[0.5.7], shelf_rpc[0.0.3], rpc[0.4.2]:...

Web services, architectural design advice for central logging

web-services,logging,architecture
We have a certain number of SOAP and REST Web Services, which provide legal information for clients. Management demands to log all the information which is requested by this services. Using logs they want to collect statistics and bill clients. My colleague offered to use central relational database for logging....

python pandas min() not picking up minimum

python,pandas
I've encountered a strange problem. I'm sure there is a logical reason behind this. I have a dataframe called alloptions that has 4 columns, minage1, minage2, minage3, and minage4, which are all float64. the number of missing values increases from minage1 to minage4. I create a fifth column that takes...

Getting value of toggled select fields in jquery

jquery,onchange,value
Im trying to get the value of a selection based upon a previous on change selection. This is the initial html that shows or hides the next select: <div class="selectOptionCat"> <select class="categoryName1 changeFields" name="option"> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> </div> Depending on the above selection another selection hides...

Find the position of the first occurrence of a character in a string after a specific position

php
I would like to find the position of the first point after the @ character: blabla [email protected] blabla.bla bla I know that the @ is at position 54, so the result would be 60....

When having image in div change on hover, the image is cut off

html,css
I'm trying to make an image change when a user hovers over it, but the method I used seems to cut off the image, not showing all of it. How can I have it scale the image to the size I specify, rather than just making the div that size...

How to Overload operator[] for a Two-Dimmensional Array in C++

c++,vector
I have a class Map that uses a vector<Cell> to store a two dimensional array of Cells. I overloaded operator[] to access the data inside Map using map[i][j]. My problem is that it only works for the first row of data. As soon as i = 1 I get a...

Why is Element not Found, Except in jsfiddle?

javascript,jquery,html
Why can't this JavaScript find the input element with id="filesToUpload" in the HTML below it, except in jsfiddle? In jsfiddle, this code provides the functionality to select multiple image files, and lists the image files selected. It fails in IE, FF, and Chrome, unless run in jsfiddle. function fileSelect(evt) {...

Android - Pass data from parent fragment to child fragment

java,android,android-fragments
In my application I want to pass an search query from an edittext to my adapter which is located in one of the child fragment. In the childfragment I want to filter the adapter based on the text I have entered in the edittext which is located in the parent...

Drawing on multiple surfaces by using only EGLSurface?

opengl,opengl-es,opengl-es-2.0,egl
Is it possible to draw from the same application on multiple surfaces, one by one, by using only the handler returned by eglCreateWindowSurface ? What i want to achieve is to create two or more surfaces and pass them to a client who will draw on them, and then, when...

jsTree 3: use a drag handle to restrict initiating dragging

javascript,drag-and-drop,jstree,jquery-ui-draggable,jstree-dnd
Using jsTree 3.0.8 I want to allow nodes to be dragged and dropped within the tree, but it should only allow that action if it was initiated by a drag on a specific button or "drag handle", instead of the default behavior of allowing dragging anywhere on the row. I...

Why is Jackson mapping these values twice, in differing case?

java,json,jackson
I'm mapping a Java object to JSON using Jackson, the object is a pretty simple pojo class that looks like this: import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonProperty; @JsonAutoDetect public class Area { @JsonProperty("Id") public int Id; @JsonProperty("Name") public String Name; public Area() { Name = ""; } public int getId() { return...

delay, setTimeout - how to do 2 things delayed on click?

click,delay,settimeout
it should be so easy but i'm blind ;( What i want to do is: I click on a button. I do some clickstuff, but i also want a blur-transition-css-effekt on another element. so I add a class und then with delay (because this is a nice effect) another class...

“getaddr info failed” Error When Attempting POST

python,python-2.7,ssl,urllib,httplib
I am using urllib and httplib to do an HTTPS POST to a web page, using a PEM cert file (P:\Bailey\certs\usercert.pem) and key file (P:\Bailey\certs\userkey.pem). When I ran it I got the following error: "I/O error (10109): getaddrinfo failed" Here is the Python code: from httplib import * from urllib...

SlimPHP: How to pass array of flash messages to twig template

php,twig,slim
I would like to send an array of flash messages to a twig template. The code would go like this: $errors = $validation->errors(); $app->flash('error', $errors); $app->response->redirect($app->urlFor('register'), 303); This is what I've tried in the twig template, but it doesn't render the messages: {% for error in flash.error %} {{ error...

I am trying to insert values from a one dimension array to a 2d matrix in php, getting Notice: Array to string conversion

php,arrays,string,matrix
I have an array $re_arr=array("ask","bat","cod","dig","egg","fur","gap","hay","ice","jar","kin","lee","mux","nod","odd","pro","qat","raw","sad","tax","ups","vet","wed","xis","yak"); it has 25 elements, i want to transfer its elements one by one into a 2d matrix. i am trying using: echo"<table border=”1px” width=30% height=50% align=center>"; for($i=0;$i<5;$i++) { echo"<tr>"; for($j=0;$j<5;$j++) { for($k=0;$k<25;$k++) $mat[$i][$j]=$re_arr[$k]; echo "<td>$mat[$i][$j]</td>"; } echo"</tr>"; } } $i and...

How to extract a complex version number using sed?

regex,bash,sed,centos
I use sed in CentOs to extract version number and it's work fine: echo "var/opt/test/war/test-webapp-4.1.56.war" | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' But my problem is that i am not able to extract when the version is shown like this: var/opt/test/war/test-webapp-4.1.56-RC1.war I want to extract the 4.1.56-RC1 if it is present. Any ideas...

How do I ring a bell sound within an ssh session?

python,audio
I'd like to generate a bell ring, or any kind of audio sound with Python. In particular, I am assuming I have an open ssh session into another computer, but I want the audio to be heard locally. Is that even possible? I tried print '\a' and that does not...

Compojure with configurable base route

clojure,ring,compojure
I am working with Clojure, Ring and Compojure for some time now, but I am still fairly new. What I need to know is how to make a configurable base route, for example: /:base-route /:base-route/user /:base-route/settings /:base-route can be different (api, company, stuff...) and will depend on an internal check....

Braced initialisation of std::map member compiler error

c++,c++11,stdmap,brace-initialization
The following code does not compile using Visual Studio 2013. It does compile using Xcode 6.1 (Clang 3.5). std::string s1("one"); std::string s2("two"); std::string s3("three"); std::string s4("four"); class X { typedef std::map<std::string, std::string> MyMapType; MyMapType map1 = { { s1, s2 }, { s3, s4 } }; MyMapType map2 = {...

How to define a function which requires one of two parameters?

powershell
For the following function, it must have a parameter of Group of type int or a parameter of Items of type int array. How to define the function? It must have one of these parameters but cannot have both. Start-Execute -Group 1 Start-Execute -Items 100,200,300 ...

bash programming - best practice setting up variables within a loop or not

bash,shell,unix
I have the following logic in my bash/shell script. Where essentially, I'm trying to pass one argument manually and then passing in other values from a hidden file, like so: if [[ $# != 1 ]]; then echo "./tstscript.sh <IDNUM>" 2>&1 exit 1 fi MYKEY=/dev/scripts/.mykey if [ -f "$MYKEY" ]...

Getting NullPointer exception with File.listfiles()

java,android,nullpointerexception
So I have 3 folders in my Android Gallery. I am trying to read the files of these folders into File arrays and then, from there, translate the image source into actual ImageViews. My problem is that I'm getting NullPointerException when referencing my File array. Here is some code: //...

Bingo game, trouble subtracting, resetting counter tracking squares clicked

javascript,jquery
Problem Currently, if you select a square in a row, but then unselect it and then click the remaining 4 squares in that row, you still receive a "Bingo!" because the counter is just counting the squares clicked. So, I'm wondering how to change it so that unselecting a square...

How to change/prepopulate SelectedIndex for each individual Combobox in DataGridTemplate?

c#,wpf,xaml,datagrid,combobox
I currently have a DataGrid that has 2 columns, one of which is a DataGridTextColumn that will display items in an ObservableCollection of strings, and the second one being a DataGridTemplateColumn that holds the DataGridCellTemplate which contains the DataTemplate that displays the Combobox. The combobox also binds to an ObservableCollection...

Grab only one out of several node labels

neo4j,cypher
if I have a node with more than one label - how can I receive a selected label of that collection, lets say only the 2nd or 3rd? The node schema is (g:Group:Group1:Group2) I can grab the first maybe with MATCH (g:Group) WHERE LENGTH(LABELS(g)) = 1 return labels(g); When I...

How do I add a reset option to this game?

java,eclipse
I want players to be able to press "r" after dying and be able to restart. I think I'm supposed to put my entire code into a reset method, but I am only a beginner, and I'm not quite there yet. import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.KeyEvent; import...

I can't build 64x project in Visual Studio

visual-studio-2010,64bit,badimageformatexception
I created a extremely simple solution in visual studio 2010, this solution has: A class library...and a class named "HelloWord" ASP.NET web site project...and one page inside it named "Home.aspx" Home.aspx calls "HelloWord" class Problem: I have a Win7/64x machine and i want this project to compile as 64x (not...

Using variables from one Octave function file in another

scope,octave
Say I have two Octave function files in the same load path: file1.m and file2.m. file1: function [variable] = file1() variable = 1; endfunction file2: function file2() variable2 = variable*2; endfunction How can I make it so that I can use variable in file2? I have tried many things, such...

perl threads: is exit needed?

multithreading,perl
# Check thread's state if ($thr->is_running()) { sleep(1); } if ($thr->is_joinable()) { $thr->join(); } # Send a signal to a thread $thr->kill('SIGUSR1'); # Exit a thread threads->exit(); I'm unclear on the documentation on perldoc threads. Is threads->exit() needed if a thread is already joined or detached? If it's not...

Creating a “normal” line chart in amcharts.js with arrays? [closed]

javascript,python,json,flask,amcharts
I'm growing desperate with amCharts doing the simplest task. Well, at least what I think is simple. I want to create a normal line chart with "normal" data. What do I mean with normal? Well, having an array with my y values, and maybe also one for x: x =...

Only one dot “.” regex

javascript,regex,angularjs
I need to be able to set an input in order to put only numbers and one dot, like 111.111 and not 111..110....11 or 11.11.11.11. This is because I am doing a calculation, and if the user enters more than one dot in the same input, then the calculation stops,...

Horizontal scroll using Swift

ios,swift
How can I find a tutorial or something to help me to create something like this scrollable area which is marked in the image below using Swift? Thanks. ...

Getting no errors using mail() in PHP

php,email
When in PHP I am using the mail() function incorrectly I do not get an error as return value: ini_set("display_errors", "1"); error_reporting(E_ALL); if(mail(1,2,3)) echo 'true'; else echo 'false'; The above delivers no PHP error and the echo is true. So it seems the "mail" with the obviously wrong parameters has...

Combining multiple lists of variable names in data.table?

r,data.table
I'm trying to pass two separate lists of variable names into a data.table (v1.9.4). It returns the correct columns, but it strips the variable names. This works as expected: dt <- data.table(a=1:3, b=4:6, c=7:9, d=10:12) dt a b c d 1: 1 4 7 10 2: 2 5 8 11...