dearn44

1

votes
1

answer
468

views

No output coming from log4net

I am trying to use log4net by following a few tutorials and reading the plethora of posts about people having problems with it, since I can not make it work properly. I have this part right on top of my .config file I added this line on my AssemblyInfo file [assembly: log4net.Config.XmlConfigurator(...
dearn44
5

votes
1

answer
42

views

Create a group of streamers and publishers

I have a number of nodes that will use a secondary service to be informed about the address of each other. I want to be able to publish information so as all the other nodes can hear it. Using an XPUB socket is not an option I would want to go with here as I want this system to be distributed. What...
dearn44
1

votes
2

answer
157

views

Error with casting value returned by sql query

I have the following query string sql = 'IF NOT EXISTS(SELECT testId from TestData where [email protected]) ' + 'Insert INTO TestData (testId, jsonString) VALUES(@testId, @jsonstring) ' + 'else ' + 'UPDATE TestData SET [email protected] WHERE [email protected] ' + 'SELECT CAST(scope_identity() AS int...
dearn44
1

votes
2

answer
295

views

Cannot access closed stream error when trying to send data from my WCF service

On my service I am trying to create and return a MemoryStream like this: // Write data. MemoryStream memoryStream = new MemoryStream(); using (StreamWriter txtwriter = new StreamWriter(memoryStream, System.Text.Encoding.UTF8)) { string tempString = 'Test'; txtwriter.Write(tempString); txtwriter...
dearn44
1

votes
3

answer
50

views

Invalid CORS request for PUT with AngularJS

I have a mapping in my Spring application that looks like this: @PutMapping(path='/test/{id}') public @ResponseBody Shop putTest(@PathVariable('id') long id, @RequestBody User user { .... When trying to call this endpoint with Angular by doing: $http({ method: 'PUT', url: 'https://localhost:8000/api...
dearn44
1

votes
1

answer
66

views

Read a file and save to a list

I have a file of the form: 3 1 2 3 4 5 4 5 6 1 6 2 4 6 7 The first line identifies the lines that will follow. Those lines in turn are just a series of numbers. I need to save this into a list that might look like this: N = 3, Teams = [line(1, 2, 3, 4, 5), line(4, 5, 6), line(1, 6, 2, 4, 6, 7)]. Wha...
dearn44
1

votes
1

answer
41

views

Deal with negative values resulting from my nn model

I have a simple nn model that looks like this class TestRNN(nn.Module): def __init__(self, batch_size, n_steps, n_inputs, n_neurons, n_outputs): super(TestRNN, self).__init__() ... self.basic_rnn = nn.RNN(self.n_inputs, self.n_neurons) self.FC = nn.Linear(self.n_neurons, self.n_outputs) def forward(...
dearn44
2

votes
3

answer
18

views

Get values from a smaller DataFrame with a specified step

Supposing I have the two DataFrames shown below: dd = pd.DataFrame([1,0, 3, 0, 5]) 0 0 1 1 0 2 3 3 0 4 5 and df = pd.DataFrame([2,4]) 0 0 2 1 4 How can I broadcast the values of df into dd with step = 2 so I end up with 0 0 1 1 2 2 3 3 4 4 5
dearn44
0

votes
2

answer
16

views

Correctly converting a NumPy array to a PyTorch tensor running on the gpu

I have initialized my weights using torch.zeros(1, self.batch_size, self.n_neurons, dtype=torch.float32, device=device) where device is 'cuda:o'. I have also created a model that has a simple RNN basic_rnn = nn.RNN(self.n_inputs, self.n_neurons) out, hidden = basic_rnn(X, hidden) X is my input that...
dearn44
1

votes
2

answer
120

views

How to model user transactions for DB storage in a small chat app? [closed]

I am trying to develop my own simple chat app using Qt5. Some Context What I have until now is a simple server that will receive any messages from users (that are using the corresponding client) and store them in a database, together with a from, to and iseRead field. Then the clients regularly ask...
dearn44
1

votes
1

answer
851

views

How to rotate an element on both axes with different angle values

If you need to rotate an element in QML in order to achieve a sort of 3d flip effect then you can do transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 24 } How can I achieve the same thing but this time rotate both x and y with different angle values?
dearn44
1

votes
3

answer
4.6k

views

Allow only one radio button to be selected from multiple groups of checkboxes

I have a number of account items. I am displaying these in a list doing something like and for every such item i display three radio buttons in a group, holding values like admin user moderator Right now a user can select a value for each group of radio buttons, but what I want to do is have only...
dearn44
1

votes
1

answer
152

views

Angular wont update view even after $apply was used

I am including an html file using inside my main page using inside this script there is a list showing some documents. {{document.name | limitTo: 20 }}{{document.name.length > 20 ? '...' : ''}} {{document.name}} At some point using a button that is inside another template, is included in pretty muc...
dearn44
5

votes
3

answer
1.5k

views

Remove border outline that appears after I click an element on my page

Every time I click an item in my page a black line appears showing the items boundaries. Is there a way to not have this line shown at all? Edit after Solution What I called a border trail is actually an outline used for easier accessibility (for example when using Tab to move around) and should act...
dearn44
4

votes
2

answer
41

views

Read a file using Stream and keep track of the current index

I am reading a large file as such: try (Stream stream = Files.lines(Paths.get(fileName))) { stream.skip(1).forEach(Main::parseLine); } catch (IOException e) { e.printStackTrace(); } where parse line looks like this: private static void parseLine(String line) { System.out.println(line); } what I woul...
dearn44
5

votes
1

answer
80

views

Find viable combination from a list of preferences

I have an object that looks like this: a - ['A', 'B', 'C'] b - ['A', 'B', 'C'] c - ['A', 'B', 'C', 'D'] d - ['A', 'B', 'C', 'D'] each one of the keys has a number of available options as denoted by the list (e.g. a can choose between A, B, C and so on). I want to find a combination of pairs that wil...
dearn44
1

votes
2

answer
544

views

Iterate through all public methods of a class

Is it possible to iterate and print the names of all the functions that I have created in my application while using qt5? For example lets say that I have created my own class (myClass) that contains two public slots int add(int a, int b); int mul(int a, int b); What I want is later at some point to...
dearn44
1

votes
2

answer
1.9k

views

Is it possible to use ng-if with a service value?

I have the following service that holds some random data .service('dataSrvc', [function() { var accountData = { accounts: [ { 'id': 1, 'title': 'Account A', 'selected': true }, ... When displaying this data in a list, I want to add an icon if lets say the id for this item equals to 1. I tried using...
dearn44
1

votes
2

answer
88

views

Get custom object T in list List<T> based on key

I have a list of what I call Actions that looks like this public class Actions { public string Type { get; set; } public string Observations { get; set; } public Actions( string type, string observations) { Type = type; observations= type; } } That I later on use in a List like List data= new List()...
dearn44
1

votes
2

answer
144

views

Issue with what a function returns in my WFC service and Client

I am defining a number of functions in my client, as an example [OperationContract] List GetObject(string id); When trying to call this function from my interface if I try: List result = cvs.GetObject(5); I get an error, instead what I must do is CustomObject[] result = cvs.GetObject(5); One other e...
dearn44
3

votes
2

answer
3.1k

views

Radiobutton wont react to ng-change directive

This question is linked to this. While trying to experiment with the suggestions on these answers, I ran into some trouble. What I tried to do is do the same thing but using the official angular material example as can be seen below: Apple Banana Mango 'use strict'; angular .module('radioDemo1', ['...
dearn44
2

votes
1

answer
739

views

I would like to use the span slider from Qxt without having to install it. Is this possible?

I stumbled across a widget that provides you with a slider with two handles so you can select a range between an upper and lower limit. I would like to use it without having to install all of Qxt though, since I am pretty sure this is the only thing that I need. How can I deal with qxt_p() in order...
dearn44
2

votes
2

answer
28

views

Read a variable that is placed inside my models file, in another file

In my models file I have this class User(models.Model): USER_TYPE_CHOICES = ( ('USER', ( (TYPE1, 'type 1'), (TYPE2, 'type 2'), ) ), ... What I want to do is be able to access these values from my forms.py file, where I have type = forms.CharField(label='Type', widget=forms.Select(choices=USER_TYPE...
dearn44
2

votes
1

answer
41

views

Empty result while creating a csv file

I have an array with keys and values that I want to email as an attachment in csv form. What I am trying is this: ... $mail->addStringAttachment(create_csv($dataCSV), 'test.csv', $encoding = 'base64', $type = 'text/csv', $disposition = 'attachment'); ... and below that, I declare my create_csv funct...
dearn44
2

votes
2

answer
108

views

Drop-shadow is interrupted by invisible borders

I am making a simple button using the code below Item { id: menuButton width: 124 height: 124 Rectangle { id: menuButtonIcon x: parent.width - 75 y: parent.height - 80 color: '#C02A25' width: 60 height: 60 radius: width * 0.5 antialiasing: true } DropShadow { id: menuButtonIconShadow source: menuBut...
dearn44
3

votes
2

answer
127

views

Pair bad players with good players while retaining ballance

I have a number of players that are split into two groups, good players and bad players. Each player is defined by a an arithmetic value and a possible group could be this one: bad players A 13 B 6 C 9 D 2 good players X 25 Y 16 Z 17 K 10 Pairing a good player with a bad player will cause him to be...
dearn44
54

votes
12

answer
73.4k

views

Change format of md-datepicker in Angular Material

Angular material introduced a new date picker component found here. I want the date returned by this component to be in the format yyy-mm-dd but I am not sure how is this done. By searching I found that $mdDateLocaleProvider can be used, but I could not find an example of using it. Can someone show...
dearn44
4

votes
1

answer
238

views

Error 415 while testing my wcf service

I have a Restful service that has this OperationContract [OperationContract] [WebInvoke(Method = 'POST', ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = 'json')] Response JSONData(Request request); and is configured in this way The request object is fo...
dearn44
1

votes
2

answer
35

views

List of dictionaries similar to a Json string

I am reading a file that is of the form [name, age] So I am parsing each line in a loop and I want to save all the data for each line. My idea was to use a list of dictionaries var testData = new List(); So as in the end to have something similar to this {{Name: John; Age: 30},{Name: Doe; Age: 36}...
dearn44
5

votes
2

answer
2.2k

views

Qt shared library in windows, not generating .lib file

I have a simple class (the analog clock from the Qt examples) that I want as a test to compile into a shared library. So what I want in the end is to have a .dll file and a .lib file. What I did was simply create a new project, add the analog clock header and source file and then configure TEMPLATE...
dearn44
2

votes
2

answer
203

views

Find element by class and toggle it

I have inside my html code repeating elements like this: Link Text and I use the following command so I can toggle the class 'content-visible' that will make this element slide to reveal the contents of , in this case Text. What I am trying to do is before doing this in my code, find the previous el...
dearn44
2

votes
1

answer
427

views

Trying to make ngTable work with data coming from my API

I have a function that is inside a factory API.doRetrieveResults = function(name, id, values, row) { // alert(angular.toJson(values)); var getdata = { 'operation': 'RetrieveResults', 'name': name, 'ds_blockid': id, 'values': angular.toJson(values), 'row': row }; return $http({ method: 'GET', url: _m...
dearn44
3

votes
1

answer
3.4k

views

Converting a byte array to string and back

My python back end uses byte arrays like this '\x00k\x8bEg' as IDs. In order to correctly display them in my nodejs front end I use the operations seen bellow hex_data = binascii.hexlify('\x00k\x8bEg') text_string = hex_data.decode('utf-8') this might return back something that looks like this : 006...
dearn44
2

votes
3

answer
237

views

How should I bind values of an object inside an ng-repeat?

I have a complex object that I wish to display and edit in my page. More specifically for my actual case, I have an object that has a pair, where array is actually a collection of objects with various pairs. I try to iterate over this complex structure like this: {{key}} There seems to be no way...
dearn44
4

votes
2

answer
361

views

Qt move text following a circular path

I am making a simple analog clock using Qt5, and I had this idea of printing the current time, for example the current seconds above the seconds hand. So the text holding the seconds value would move following the clock. What I have until now is something like this painter.save(); painter.setPen(Qt:...
dearn44
2

votes
0

answer
54

views

Angular Material SpeedDial starts open on Firefox

Browsing through the ngMaterial issues I can spot a few mentions on SpeedDial, namely here, here, and here. What I am noticing though is that by adding ng-cloack I can get rid of the 'starting as open' issue on Chrome, but it still remains on Firefox. There is no mention of this Firefox specific iss...
dearn44
2

votes
3

answer
5.5k

views

Angular ngClass is not updating my classes even though my condition change as expected

I have something like this in a template I am creating The values app.layout.isNavbarFixed, etc are initialized with either zero or one, and for the first time the page loads the appropriate classes are inserted into my div. Any change after that though, by means of a button that sets those values,...
dearn44
3

votes
0

answer
185

views

Custom filter for an ng dynamic table

I have a dynamic ngTable for which I created a custom datetime filter like this: // Generate table columns. function generateColumns(sampleData) { var colNames = Object.getOwnPropertyNames(sampleData); var cols = colNames.map(function (name, idx) { if (name == 'date') { var filter = {}; filter[name]...
dearn44
3

votes
2

answer
1.1k

views

Odd behaviour on track bar mouse move event

I am trying to implement a feature similar to most media players where by moving your mouse above the media duration track bar it will display a small popup informing you on the time your mouse is currently above. I noticed an odd behaviour though while implementing the code given below. procedure T...
dearn44
2

votes
1

answer
106

views

Complex nested rows table using ngRepeat

I have an object that looks like this: { '10': {}, '12': { '20': { 'value': 1, 'id': 1, }, '100': { 'value': 12, 'id': 1, } }, '14': { '100': { 'value': 14, 'id': 2, } }, '16': {}, '18': {}, '20': { '100': { 'value': 23, 'id': 1, }, '150': { 'value': 56, 'id': 3, } }, '22': {}, '24': {}, '26': { '50...
dearn44

View additional