back soft

مطالب مرتبط با «class with dynamic array c» در back soft | نویسنده: استخدام کار

Why does dynamically created element with Dragstart event returns undefined?

Vote count: 0 The following code creates new elements and ascribes an dragstart event to it. However it results in an "undefined". What am I doing wrong? for (var S = 0; S < arrInbound[i][3].length; S++){ var namesDiv = document.createElement('div'); namesDiv.id = S; namesDiv.draggable = 'true'; namesDiv.contenteditable = 'true'; namesDiv.className = "crewNames"; namesDiv.ondragstart = function(){dragStart(event) if(event.target.type=="range")event.preventDefault(); event.dataTransfer.setData("T...

ادامه مطلب

ld fails to link a static library to a dynamic library even when all files are compiled with fPIC

Vote count: 0 Summary: On a CentOS 7 x64 system, I've build the latest Boost 1.61.0 with -fPIC enabled. I'm trying to link libboost_log.a to the dynamic library I'm building so that the user of my library doesn't have to have Boost installed. That succeeded using the stock GCC 4.8.5 shipped with CentOS 7, but failed when I'm using GCC 5.2.1 from devtoolset-4. Error: /opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.2.1/ld: /opt/boost/lib/libboost_log.a(attribute_name.o): relocation...

ادامه مطلب

What's wrong with my java class inheritance?

Vote count: 0 Help, I can't seem to get an output from my inherited shape, whats is wrong with my code? Anyone? I have shortened the code to exclude all the extra constructors and getters and setters, but I hope this provides enough context. public class Shape { public String color; public Boolean filled; public Shape(String color, Boolean filled) { this.color = color; this.filled = filled; } public String toString() { retu "Shape[color = " + color + "filled = " + filled; } ---------------------...

ادامه مطلب

Express JS Dynamic Routing with Typescript

Vote count: 0 I want to migrate my routing logic from plain javascript to typescript. In javascript I would use below logic. How can I achieve the same the below in typescript to implement a route by implementing the IRoute interface.The idea is to use a class which handles routing. route.ts: var express = require('express'); var myRouter = express.Router(); myRouter.route('/') .all(function(req,res,next) { res.writeHead(200, { 'Content-Type': 'text/plain' }); next(); }) .get(function(req,res,ne...

ادامه مطلب

Surefire plugin with forkcount set 0 causes issues with File class

Vote count: 0 When ruing testng tests with Surefire 2.19.1, I am ruing with setting 0. When I add this setting, some of my tests fail where the File class is being used. Tests that normally succeed now fail with errors around not being able to find the file. The files exist in the same location as before, it seems that the classpath is being changed when not using forks. If I use the following code, the File issue goes away, however I can't do this for all problems. f.exists() -- This fails f = ...

ادامه مطلب

How to replace a value in an ArrayList (with multiple columns) with a new value, in JAVA

Vote count: 0 I have read many posts about updating a certain value in an ArrayList, when the ArrayList is single column. In my case, I have a multi-column ArrayList which is done by using the following JAVA code. Class A{ private List ArrayList; double[] _array = {0.0, 1.0}; ArrayList.add(_array); _array = {2.0, 5.0}; ArrayList.add(_array); _array = {3.0, 8.0}; ArrayList.add(_array); } Then my ArrayList looks like, {0.0, 1.0} {2.0, 5.0} {3.0, 8.0} My problem is: I tried to replace the number 8....

ادامه مطلب

How to add items to an array dynamically in javascript?

Vote count: 0 I want to add dynamic data into this JavaScript. So how to do this? Please help me... Thanx in Advance $(document).ready(function(){ new jPlayerPlaylist({ jPlayer: "#jquery_jplayer_2", cssSelectorAncestor: "#jp_container_2" }, [ { title:"Do Pag Mar aur Bhul Ja", mp3:"http://download.apunkabollywood.us/songs/Audio/indian/movies/One Night Stand (2016)/01 - Do Peg Maar - Neha Kakkar @ fmw11.com.mp3", }, { title:"Your Face", mp3:"http://www.jplayer.org/audio/mp3/TSP-05-Your_face.mp3", ...

ادامه مطلب

how to get the nested array count with key values seperated in php

Vote count: 0 This is my array Array ( [2] => Array ( [0] => Array ( [id] => 2 [res_id] => 1 [grand_total] => 303.42 [time] => 2016-07-28 11:04:38 AM [status] => 0 ) [1] => Array ( [id] => 2 [res_id] => 1 [grand_total] => 303.42 [time] => 2016-07-28 11:04:38 AM [status] => 0 ) ) [1] => Array ( [0] => Array ( [id] => 1 [res_id] => 1 [grand_total] => 303.42 [time] => 2016-07-28 11:04:17 AM [status] => 0 ) [1] => Array ( [id] => 1 [res_id] => 1 [grand_total] => 303.42 [time] => 2016-07-28 11:04:17 ...

ادامه مطلب

Shape of numpy array comparison with empty list

Vote count: 0 I have some problems understanding how python/numpy is casting array shapes when comparing to an empty list - which as far as I understand - is an implicit (element wise) comparison with False. In the following example the shape decreases by one in the last dimension, if it is not greater than 1. z = N.zeros((2,2,1)) z == [] >> array([], shape=(2, 2, 0), dtype=bool) z2 = N.zeros((2,2,2)) z2 ==[] >> False If, however, I compare with False directly, I get the expected output. z = N.z...

ادامه مطلب

ElasticSearch create an index with dynamic properties

Vote count: 0 Is it possible to create an index, restricting indexing a parent property? For example, $ curl -XPOST 'http://localhost:9200/actions/action/' -d '{ "user": "kimchy", "message": "trying out Elasticsearch", "actionHistory": [ { "timestamp": 123456789, "action": "foo" }, { "timestamp": 123456790, "action": "bar" }, { "timestamp": 123456791, "action": "buz" }, ... ] }' I don't want actionHistory to be indexed at all. How can this be done? For the above document, I believe the index wou...

ادامه مطلب

How to make Pagination with Object array in Cakephp?

Vote count: 0 $this->paginate = array( 'paramType' => 'querystring', 'limit' => $limit, 'maxLimit' => 100, 'order' => array('id' => 'desc'), ); $conditions = array(); foreach ($arr as $key => $value) { // debug($value); $conditions[] = array( 'conditions' => array( 'Content.id' => $value )); asked 1 min agoKo Phyo Htet Let's block ads!...

ادامه مطلب

Suggestion on logging with static class

Vote count: 0 I am currently facing an issue related to logging messages in my WPF application. I am keeping a static class for logging messages throughout my application which contains a function private SomeService service = new SomeService(); private void LogMessage(string message) { service.Log(message); } My issue is in my screens where I require logging, I append strings from different places in the screen and pass it to the LogMessage function. I have very large data to be logged from dif...

ادامه مطلب

Array counter doesn't work with java

Vote count: 0 Good day, this is my first question here in stackoverflow and I hope I could get along with fellow coders here. I'm making a Java Program that uses JOptionPane about days. I'm not talking about date (10/14/2016 etc.) I'm talking about Sunday, Monday etc. Here's what I plan to do, when you run the program, a panel appears that asks the user to input a number and the program runs a task depending on the function wanted by the user (1 for setting a day, 2 for printing the day, 3 for p...

ادامه مطلب

Crash after QGraphicsScene::removeItem() with custom item class

Vote count: 0 I am populating a QGraphicsScene with instances of a custom item class (inherting QGraphicsPathItem). At some point during runtime, I try to remove an item (plus its children) from the scene by calling: delete pItem; This automatically calls QGraphicsScene::removeItem(), however it also leads to a crash in the class QGraphicsSceneFindItemBspTreeVisitor during the next repaint. asked 24 secs agoPhilip Allgaier 1 Answer Vote count: 0 TL;DR: The solution is to ensure that QGraphicsIte...

ادامه مطلب

How to combine two same lengths array into one same length array with element joined by a separator

Vote count: -1 Given a=["a", "b", "c"]; x=["x", "y", "z"]; combine/join the two list: the expected result: ax=["a:x", "b:y", "c:z"]; How? Thanks asked 1 min agomilesma 1 Answer Vote count: 1 var ax = []; for (var i = 0; i < a.length; i++) { ax.push(a[i] + ":" + x[i]); } answered 22 secs agosmarx Let's block ads!...

ادامه مطلب

Object assign with dynamic variable in Javascript

Vote count: 0 I have this initialState in my Redux store const initialState = { isFetching : false, active : {} } Where active is an object. Now I have an action that should append or add a property to active's data property like so: [DASHBOARD_TEMPLATE_DATA_RECEIVE]: (state, action) => { retu Object.assign({}, state, { isFetching : false, active : Object.assign({}, active, {data[action.key]: action.data}) }) } As you can see data[action.key] is not permitted, how do I do it? asked 35 secs agoJo...

ادامه مطلب

PHP how to make a class stored data to a variable an callback with method?

Vote count: 0 like php code below : how to make a class an method an stored to a variable, and call again by method? like $mysqli and $query above? asked 43 secs agoBar O Kuiawan This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.Recommended article from FiveFilters.org: Most Labour MPs in the UK Are Revolting....

ادامه مطلب

How to execute dynamic query with sql""select c from T""".as[T] interpolation in slick

Vote count: 0 I am trying to implement a function with Slick3 to retu a tuple. def executeQueryConfig2[T](sql: String, f : Option[T] => Unit): Future[T] = { val action2 = sql"""$sql""".as[T].headOption getDatabase(config).run(action2).mapTo[T].map(f(_)).recover{ case e: SQLException => println(e.getMessage) } ....... } The compiler shows the error: Error:(66, 35) could not find implicit value for parameter rconv: slick.jdbc.GetResult[T] val action2 = sql"""$sql""".as[T].headOption ^ If T is the ...

ادامه مطلب

Create dynamic Variables from an Array

Vote count: 0 Ok, so i want to create dynamic Variables as Integer using the names from an Array. This is what I've tried so far: Dim subjects as Array {"Math", "English", "German"} 'Three example names Dim subjectsInt as New Dictionary(Of Integer) 'Throws error: Not enough arguments Dim i as Integer For i = 0 to 2 subjectsInt(subjects(i)) = 0 ' Trying to create a variable with the name of entry number i of the Array & and the starting value 0 Do Console.WriteLine(subjects(1) & ": ") Dim input A...

ادامه مطلب

Swift 3 Array remove object at: ? String may not be indexed with 'Int', it has variable size elements error

Vote count: 0 Hello i want to remove object from array in swift 3 gives me error String may not be indexed with 'Int', it has variable size elements error My codes here var itemListcomming = String() itemListcomming = itemListcomming.remove(at: 16) any idea ? Thanks asked 1 min agoSwiftDeveloper Let's block ads!...

ادامه مطلب