demo demo

0

votes
0

answer
5

views

How to make MIDI file from notes with Flute instrument in Python (music21 library)

I have some notes and what I want is create the MIDI file with Flute instrument. But what happens is that the output MIDI file plays Piano, instead of Flute. I tried other instruments, but it's always the same, Piano. What is going on? (...) new_note = note.Note(pattern) new_note.offset = offset new...
demo
1

votes
3

answer
1k

views

UserControl with custom ItemsSource doesn't detect changes

I have simple UserControl where is defined property ItemsSource public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register('ItemsSource', typeof(Dictionary), typeof(UserControl1), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(UserControl1.OnItemsSou...
demo
1

votes
1

answer
315

views

Jquery carousel in WPF

I want to create carousel in WPF like here. (left and right buttons not counted, just bullets) I've found many solutions how to create carousel in WPF, but it isn't exactly what i need. I have listBox of images: and slider bullets: I don't know how to create 'relation' between them - when I click o...
demo
1

votes
1

answer
33

views

Splitting and ordering the class c#

I have a class like Class Foo { public string info { get; set; }; public string name { get; set; } } Now, info is like : id=2&pid=6 id=2&pid=6&cid=7 id=2 Now, I want to sort it based on the count of parameters (after spliting by &) so, it should be id=2&pid=6&cid=7 id=2&pid=6 id=2 But, I have a lis...
demo stack
1

votes
1

answer
69

views

Ng-Repeat adds new items to the end

I have page with ng-repeat. Something like : ... Every minute there are new request to server for new collection of pendingRequests. When after 1 minute server return new collection of pendingRequests new item is added to the end of ng-repeat block even if this new item is first in collection that i...
demo
1

votes
1

answer
39

views

Read two optional seperated integers with scanf

I am completely new to C. I want to read two integers with the scanf function, that are seperated by whitespaces OR by one comma. If the formatstring says '%d%d' the whitespaces are automatically handled for me. But if I change it to scanf('%d,%d', &firstNum, &secondNum); I have to seperate both v...
DeMo
1

votes
1

answer
52

views

Make button disabled by changing object property

On button click I wan't to disable all buttons to prevent any other operation. For this I use request.isProcessing bool value. In the beginning function approve(request) I set request.isProcessing to true and In the end to false. But this doesn't work. (For request in ng-repeat request.isProcessing...
demo
1

votes
1

answer
48

views

SELECT name of table if table is empty

I have table with names of tables... I need to select only that tables that are empty. For this I've tried to write CURSOR. DECLARE @Footprint VARCHAR(200) DECLARE @query VARCHAR(200) DECLARE MY_CURSOR CURSOR LOCAL STATIC READ_ONLY FORWARD_ONLY FOR SELECT '[' + [SchemaName] + '].[FootprintBuildSta...
demo
1

votes
2

answer
129

views

How to use FrameLayout Properly?

I attached my xml code below...How to create one button on top of the LinearLayout.I tried i am not get output. My output below: Expected Output: Please give any reference or what i did mistake specify...Thanks in adavace
demo
1

votes
1

answer
84

views

What is wrong with my CNN? [closed]

I really don't understand what is wrong with my model. Sometimes it gives me excellent results, but in other cases results are just absurd. During training, from one moment to another it gives absurd results. I tried model with 3 dropout layers and without them, and get same strange results. Here's...
demo
1

votes
2

answer
256

views

Throttle method in C# [closed]

I have method that make request to some 3rd party API and return response from it. As this API allows only 50 calls per 1 minute, I want to throttle my requests to this API. Currently I'm thinking of using Polly and add something like wrapper to my code var policy = Policy.Handle() .WaitAndRetryFore...
demo
1

votes
1

answer
55

views

req.query is not working in Http.createserver in nodejs?

Hai Everyone I'm beginner in NodeJS I could not get the value whatever given the data in the get request.It shows the error 'Cannot read property 'user' of undefined'.This is the url which I given in the browser is http://localhost:8086/dopath?user=viki&pass=vino I attached the code.can anyone solv...
demo developers
1

votes
2

answer
97

views

How to rewrite this LINQ query with SQL syntax and <>?

The following query joins two tables on serverID and returns the ServerID's and components belonging to them as shown below LINQ var header = from a in this.db.Servers where a.ServerID.Contains(match) join b in this.db.Components on a.ServerID equals b.ServerID into g select new { a.ServerID,...
demo_user
1

votes
1

answer
1.7k

views

StackExchange.Redis string value is converted to set

I use StackExchange.Redis to work with cache. I have action which returns values from cache (if value exists) public ActionResult GetCalculatorSalaries() { var s = (string) _cache.StringGet('CalculatorSalaries'); if (String.IsNullOrEmpty(s)) { var salaries = _service.LoadCalculatorSalaries(); _cache...
demo
1

votes
5

answer
155

views

Add line to the sides of some text [duplicate]

This question already has an answer here: Add centered text to the middle of a -like line 26 answers How to add lines to the sides of text, create something like text separator but whithout background for text. Some text goes here In this post CSS challenge, can I do this without introducing more H...
demo
1

votes
1

answer
471

views

Difference in creating PXCMSenseManager with Intel RealSense

I found that i can create PXCMSenseManager in 2 different ways (as i think now) First one : Create session and then from it get senseManager var session = PXCMSession.CreateInstance(); var sm = session.CreateSenseManager(); Second way - just create instance from PXCMSenseManager class var pp = PXC...
demo
1

votes
2

answer
655

views

C fopen() - Possible issue with absolute path [duplicate]

This question already has an answer here: Returning a string from function 3 answers I'm currently using Code::Blocks 13.12 (compiler: GNU GCC) under Windows 10. I'm trying to open a file and load its content, but fopen gives me troubles. The 'input.txt' exists in the same directory as my executabl...
M. Demo
1

votes
2

answer
130

views

Getting XML data from the string

string xml = ' Yes | No | None Header Text Body Paragraph 1 Body Paragraph N true | false Long | Short '; Here, from the XML, I want to extract certain strings. First is the Header Text in the Header tags. When, I try XDocument doc = XDocument.Parse(xml); var a = doc.Descendants('Header').Sing...
demo stack
1

votes
1

answer
1.6k

views

Set Height of Grid according to content size

I have separate Window. It contains Grid. I need to set Height of this Grid according to content inside it. In general this Window is like Popup so I want to show all content in it. When Text of TextBlock is large - I want to make window also larger to show all text inside. But setting Height to Au...
demo
0

votes
0

answer
4

views

The interpretation of Chi-Square Independence Test

I'm working with UFO Sightings data set and my goal is to verify if the Shape of UFO ('circle', 'cone'...) depends on the Duration of Sight (in seconds). To do that, I decided to perform a Chi-Square Independence Test, where the H0: 'independant' and H1: 'dependant'. Code: tab
demo
1

votes
2

answer
511

views

Sum column in data frame based on another column in R

I have a data frame like this: Vehicle Driver Distance Fuel.Consumption W01 Alex 22.31 0.58 W01 Alex 93.21 2.48 W02 Brian 122.72 3.22 W02 Brian 22.25 0.5 ...... I want an output like this: Vehicle...
Demo
0

votes
1

answer
33

views

how can I place the script tag in div tag?

I'm beginner in Html and js.I want to place script tag inside div tag.My Aim is I want to display sweet alert tag Inside script.Thanks for advance.... function myFunction() { console.log('problem with student'); swal('You entered the regno more than once', ' Your team is not registered yet! Regist...
demo developers
4

votes
2

answer
1.6k

views

How do I track the location of a user throughout the day in Google Maps?

How would you track the location of a user for the entire day, like the timeline in Google maps? I have two ideas For example, if I have 200 LatLng values per day, how do I pass all of these LatLng values to Google map as points? I got one google doc reference in that I can track up to 10 locations...
demo
2

votes
0

answer
322

views

res.download function is not working in express.js

I want to download a file in node.js using express.js framework according to the get request url. I didn't get an error in this code, but the file is not downloaded, it shows success message. Kindly look at following code, can anyone solve this issue? var express=require('express'); var bodyparser=...
demo developers
0

votes
0

answer
5

views

Yelp Fusion API Migrated Business

I want to get details of one yelp business that has migrated id. string page = 'https://api.yelp.com/v3/businesses/5Ers-96nMItrZRCqtC7mDA'; using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( 'Bearer', 'SOME_TOKEN'); using (HttpR...
demo
2

votes
0

answer
58

views

Property from link scope is anonymous function

I write custom directive. In this peace of code I want to get property from scope return { restrict: 'A', scope: { user: '=', startDate: '=', daysInRow: '=' }, link: function (scope, element, attrs) { days = $rootScope.days[scope.user.id];
demo
1

votes
1

answer
198

views

Issue deserializing an array of javascript object in c#

I have a problem deserializing a javascript array to c# List class, have read other answers on SO but did not solve my issue. The Array of Objects '{\'Id\':\'87\',\'Name\':\'Product x\',\'Cost\':200000,\'Tag\':\'Product_x\'}, {\'Id\':\'88\',\'Name\':\'Product y\',\'Cost\':100000,\'Tag\':\'Product_y\...
demo.b
5

votes
5

answer
12.2k

views

Select all / Unselect all in Bootstrap Select plugin

All Ratings EC (Early Childhood) E (Everyone) E10+ (Everyone 10+) T (Teen) M (Mature) AO (Adults Only) In html above there are option with value All. I want to select all items if that option is selected and unselect all if i unselect this option. I think it will be simple to do, but i can't get w...
demo
4

votes
2

answer
2.9k

views

Cannot create an instance of “MainViewModel”

I am creating a simple WPFapplication for implementing Databinding a Datagrid to database using Observable collection (following MVVM pattern). App.xaml.cs class public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var mainWindow = new...
demo_user
2

votes
1

answer
1.8k

views

HttpContext becomes NULL in Tasks

I create extension method for HttpContext. This method generates pdf files. public static Task GeneratePdfTask(this HttpContext context, string path, int submissionId, string pdfName, Action postAction = null) { var local = context; return Task.Factory.StartNew(() => { HttpContext.Current = local; S...
demo
2

votes
2

answer
12.5k

views

How to convert Generic List<anonymous type > to Generic List <Classname>?

I have a database, where the CPU usage is inserted for every 'n' seconds and my task is to get the latest CPU entry from the database. I would like to display the latest CPU entry from the database tat belongs to the particular server , and I would like to save the result into a generic list. what I...
demo_user
6

votes
2

answer
8.6k

views

Get value of constant by name

I have a class with constants. I have some string, which can be same as name of one of that constants or not. So class with constants ConstClass has some public const like const1, const2, const3... public static class ConstClass { public const string Const1 = 'Const1'; public const string Const2 =...
demo
4

votes
1

answer
1.5k

views

How onInitialized works in Bootstrap-multiselect

Very simple example : https://jsfiddle.net/x6z6w0n8/8/ How can I set selected values on Initialization step without creating duplicate? Sample from off site works well. https://jsbin.com/yupinelefa/edit?html,js,console As I noticed, in off-example they don't initialize select, they just use event o...
demo
3

votes
1

answer
385

views

Make <li> tags editable

I need something like html list. It should contains bullets and something like textarea. textarea{ border : none; } .custom-txt-area{border-bottom : 1px dashed red;} This is very sample example. Problem here - I can't make textarea extend it height to the bottom if it contans more than 1 row.
demo
3

votes
2

answer
57

views

Find DISTINCT Missing SQL Dependencies

I have script which returns all invalid dependencies in database. But this script returns many duplicates. So I want to see only DISTINCT results. /* modified version of script from http://michaeljswart.com/2009/12/find-missing-sql-dependencies/ Added columns for object types & generated refresh mod...
demo
2

votes
1

answer
2.7k

views

A member with the name 'Id' already exists on `Model`. Use the JsonPropertyAttribute to specify another name

I have DTO with next structure : public class DTO { public int Id {get;set;} [JsonProperty('Id')] public int ServerId {get;set;} } From server I receive json from next model : public class ServerModel { public int Id {get;set;} } I want to Deserialize json from ServerModel into DTO with rule => Id f...
demo
2

votes
1

answer
3.4k

views

How to use Command Line Parser Library in case Error happend?

I use Command Line Parser Library to parse command lines parameters. I have declared class Options internal class Options { [Option('r', 'read', Required = true, HelpText = 'Input file to be processed.')] public string InputFile { get; set; } [Option('f', 'date from', Required = false, HelpText = 'D...
demo
3

votes
3

answer
1.2k

views

Convert factor into time in R

I have a data frame df like: ID time a 121:24:30 b 130:30:00 The time column is of factor after importing data. I want convert the values of time column into minutes. At first, I have tried: df$time
Demo
1

votes
5

answer
87

views

Function is undefined in JS object

I create object var myObj = new functon () {...}. In that object i add functions like : var myObj = new function () { this.func1 = function() { func2(); } this.func2 = function() { ... } } As you can see in func1 I try to call func2 but it is always undefined. Why? Cause everything is in one object...
demo
2

votes
1

answer
541

views

Update Datagrid when ItemsSource changes

I have gone through many forums to find a solution for my problem, but I didn't find the appropriate solution. I have a Datagrid that is bound to a Datasource (MS SQL Server 2008) following the MVVM pattern. I have bound the ItemsSource to an ObservableCollection and implemented the INotifyProperty...
demo_user

View additional